@@ -22,91 +22,101 @@ class CollectionPane extends ConsumerWidget {
2222 child: CircularProgressIndicator (),
2323 );
2424 }
25- return Padding (
26- padding: kIsMacOS ? kP24CollectionPane : kP8CollectionPane,
27- child: Column (
28- crossAxisAlignment: CrossAxisAlignment .stretch,
29- children: [
30- Padding (
31- padding: kPe8,
32- child: Wrap (
33- alignment: WrapAlignment .spaceBetween,
34- children: [
35- TextButton .icon (
36- onPressed: (savingData || ! hasUnsavedChanges)
37- ? null
38- : () async {
39- overlayWidget.show (
40- widget:
41- const SavingOverlay (saveCompleted: false ));
25+ return Drawer (
26+ shape: const ContinuousRectangleBorder (),
27+ backgroundColor: Theme .of (context).colorScheme.surface,
28+ surfaceTintColor: kColorTransparent,
29+ child: Padding (
30+ padding: (! context.isMediumWindow && kIsMacOS
31+ ? kP24CollectionPane
32+ : kP8CollectionPane) +
33+ (context.isMediumWindow ? kPb70 : EdgeInsets .zero),
34+ child: Column (
35+ crossAxisAlignment: CrossAxisAlignment .stretch,
36+ children: [
37+ Padding (
38+ padding: kPe8,
39+ child: Wrap (
40+ alignment: WrapAlignment .spaceBetween,
41+ children: [
42+ TextButton .icon (
43+ onPressed: (savingData || ! hasUnsavedChanges)
44+ ? null
45+ : () async {
46+ overlayWidget.show (
47+ widget:
48+ const SavingOverlay (saveCompleted: false ));
4249
43- await ref
44- .read (collectionStateNotifierProvider.notifier)
45- .saveData ();
46- overlayWidget.hide ();
47- overlayWidget.show (
48- widget: const SavingOverlay (saveCompleted: true ));
49- await Future .delayed (const Duration (seconds: 1 ));
50- overlayWidget.hide ();
51- },
52- icon: const Icon (
53- Icons .save,
54- size: 20 ,
55- ),
56- label: const Text (
57- kLabelSave,
58- style: kTextStyleButton,
50+ await ref
51+ .read (collectionStateNotifierProvider.notifier)
52+ .saveData ();
53+ overlayWidget.hide ();
54+ overlayWidget.show (
55+ widget:
56+ const SavingOverlay (saveCompleted: true ));
57+ await Future .delayed (const Duration (seconds: 1 ));
58+ overlayWidget.hide ();
59+ },
60+ icon: const Icon (
61+ Icons .save,
62+ size: 20 ,
63+ ),
64+ label: const Text (
65+ kLabelSave,
66+ style: kTextStyleButton,
67+ ),
5968 ),
60- ),
61- //const Spacer(),
62- ElevatedButton (
63- onPressed : () {
64- ref. read (collectionStateNotifierProvider.notifier). add ();
65- },
66- child : const Text (
67- kLabelPlusNew ,
68- style : kTextStyleButton ,
69+ //const Spacer( ),
70+ ElevatedButton (
71+ onPressed : () {
72+ ref. read (collectionStateNotifierProvider.notifier). add ();
73+ },
74+ child : const Text (
75+ kLabelPlusNew,
76+ style : kTextStyleButton ,
77+ ) ,
6978 ),
70- ),
71- ],
72- ),
73- ),
74- kVSpacer10,
75- Container (
76- margin: const EdgeInsets .only (right: 8 ),
77- decoration: BoxDecoration (
78- borderRadius: kBorderRadius8,
79- border: Border .all (
80- color: Theme .of (context).colorScheme.surfaceVariant,
79+ ],
8180 ),
8281 ),
83- child : Row (
84- children : [
85- kHSpacer5 ,
86- Icon (
87- Icons .filter_alt ,
88- size : 18 ,
89- color: Theme .of (context).colorScheme.secondary ,
82+ kVSpacer10,
83+ Container (
84+ margin : const EdgeInsets . only (right : 8 ) ,
85+ decoration : BoxDecoration (
86+ borderRadius : kBorderRadius8 ,
87+ border : Border . all (
88+ color: Theme .of (context).colorScheme.surfaceVariant ,
9089 ),
91- kHSpacer5,
92- Expanded (
93- child: RawTextField (
94- style: Theme .of (context).textTheme.bodyMedium,
95- hintText: "Filter by name or URL" ,
96- onChanged: (value) {
97- ref.read (searchQueryProvider.notifier).state =
98- value.toLowerCase ();
99- },
90+ ),
91+ child: Row (
92+ children: [
93+ kHSpacer5,
94+ Icon (
95+ Icons .filter_alt,
96+ size: 18 ,
97+ color: Theme .of (context).colorScheme.secondary,
10098 ),
101- ),
102- ],
99+ kHSpacer5,
100+ Expanded (
101+ child: RawTextField (
102+ style: Theme .of (context).textTheme.bodyMedium,
103+ hintText: "Filter by name or URL" ,
104+ onChanged: (value) {
105+ ref.read (searchQueryProvider.notifier).state =
106+ value.toLowerCase ();
107+ },
108+ ),
109+ ),
110+ ],
111+ ),
112+ ),
113+ kVSpacer10,
114+ const Expanded (
115+ child: RequestList (),
103116 ),
104- ),
105- kVSpacer10,
106- const Expanded (
107- child: RequestList (),
108- ),
109- ],
117+ kVSpacer5
118+ ],
119+ ),
110120 ),
111121 );
112122 }
@@ -150,7 +160,7 @@ class _RequestListState extends ConsumerState<RequestList> {
150160 radius: const Radius .circular (12 ),
151161 child: filterQuery.isEmpty
152162 ? ReorderableListView .builder (
153- padding: context.isMobile
163+ padding: context.isMediumWindow
154164 ? EdgeInsets .only (
155165 bottom: MediaQuery .paddingOf (context).bottom,
156166 right: 8 ,
@@ -198,7 +208,7 @@ class _RequestListState extends ConsumerState<RequestList> {
198208 },
199209 )
200210 : ListView (
201- padding: kIsMobile
211+ padding: context.isMediumWindow
202212 ? EdgeInsets .only (
203213 bottom: MediaQuery .paddingOf (context).bottom,
204214 right: 8 ,
@@ -240,7 +250,6 @@ class RequestItem extends ConsumerWidget {
240250 Widget build (BuildContext context, WidgetRef ref) {
241251 final selectedId = ref.watch (selectedIdStateProvider);
242252 final editRequestId = ref.watch (selectedIdEditStateProvider);
243- final mobileDrawerKey = ref.watch (mobileDrawerKeyProvider);
244253
245254 return SidebarRequestCard (
246255 id: id,
@@ -250,7 +259,7 @@ class RequestItem extends ConsumerWidget {
250259 selectedId: selectedId,
251260 editRequestId: editRequestId,
252261 onTap: () {
253- mobileDrawerKey. currentState? .close ();
262+ ref. read (mobileScaffoldKeyStateProvider). currentState? .closeDrawer ();
254263 ref.read (selectedIdStateProvider.notifier).state = id;
255264 },
256265 // onDoubleTap: () {
0 commit comments