File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
screens/history/history_widgets Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -89,4 +89,11 @@ class HistoryMetaStateNotifier
89
89
await hiveHandler.setHistoryRequest (id, model.toJson ());
90
90
await loadHistoryRequest (id);
91
91
}
92
+
93
+ Future <void > clearAllHistory () async {
94
+ await hiveHandler.clearAllHistory ();
95
+ ref.read (selectedHistoryIdStateProvider.notifier).state = null ;
96
+ ref.read (selectedHistoryRequestModelProvider.notifier).state = null ;
97
+ loadHistoryMetas ();
98
+ }
92
99
}
Original file line number Diff line number Diff line change 1
- import 'package:apidash/services/services.dart' ;
2
- import 'package:apidash_design_system/apidash_design_system.dart' ;
3
1
import 'package:flutter/material.dart' ;
4
2
import 'package:hooks_riverpod/hooks_riverpod.dart' ;
3
+ import 'package:apidash_design_system/apidash_design_system.dart' ;
5
4
import 'package:apidash/providers/providers.dart' ;
6
5
import 'package:apidash/widgets/widgets.dart' ;
7
- import 'package:apidash /consts.dart' ;
6
+ import '../../.. /consts.dart' ;
8
7
9
8
class HistorySidebarHeader extends ConsumerWidget {
10
9
const HistorySidebarHeader ({super .key});
@@ -29,7 +28,11 @@ class HistorySidebarHeader extends ConsumerWidget {
29
28
color: Theme .of (context).brightness == Brightness .dark
30
29
? kColorDarkDanger
31
30
: kColorLightDanger,
32
- onPressed: () => hiveHandler.clearAllHistory (),
31
+ onPressed: () async {
32
+ await ref
33
+ .read (historyMetaStateNotifier.notifier)
34
+ .clearAllHistory ();
35
+ },
33
36
),
34
37
ADIconButton (
35
38
icon: Icons .manage_history_rounded,
You can’t perform that action at this time.
0 commit comments