@@ -9,7 +9,7 @@ import 'package:mostro_mobile/shared/widgets/add_order_button.dart';
99import 'package:mostro_mobile/shared/widgets/bottom_nav_bar.dart' ;
1010import 'package:mostro_mobile/shared/widgets/mostro_app_bar.dart' ;
1111import 'package:mostro_mobile/shared/widgets/order_filter.dart' ;
12- import 'package:mostro_mobile/shared/widgets/mostro_app_drawer .dart' ;
12+ import 'package:mostro_mobile/shared/widgets/custom_drawer_overlay .dart' ;
1313
1414class HomeScreen extends ConsumerWidget {
1515 const HomeScreen ({super .key});
@@ -21,69 +21,95 @@ class HomeScreen extends ConsumerWidget {
2121 return Scaffold (
2222 backgroundColor: AppTheme .backgroundDark,
2323 appBar: MostroAppBar (),
24- drawer: const MostroAppDrawer (),
25- body: Stack (
26- children: [
27- RefreshIndicator (
28- onRefresh: () async {
29- return await ref.refresh (filteredOrdersProvider);
30- },
31- child: Column (
24+ body: CustomDrawerOverlay (
25+ child: Stack (
26+ children: [
27+ // Main content column with bottom navigation
28+ Column (
3229 children: [
33- _buildTabs (ref),
34- _buildFilterButton (context, ref),
30+ // Content area that expands to fill available space
3531 Expanded (
36- child: Container (
37- color: const Color (0xFF1D212C ),
38- child: filteredOrders.isEmpty
39- ? const Center (
40- child: Column (
41- mainAxisAlignment: MainAxisAlignment .center,
42- children: [
43- Icon (
44- Icons .search_off,
45- color: Colors .white30,
46- size: 48 ,
47- ),
48- SizedBox (height: 16 ),
49- Text (
50- 'No orders available' ,
51- style: TextStyle (
52- color: Colors .white60,
53- fontSize: 16 ,
54- ),
55- ),
56- Text (
57- 'Try changing filter settings or check back later' ,
58- style: TextStyle (
59- color: Colors .white38,
60- fontSize: 14 ,
61- ),
62- textAlign: TextAlign .center,
63- ),
64- ],
32+ child: RefreshIndicator (
33+ onRefresh: () async {
34+ return await ref.refresh (filteredOrdersProvider);
35+ },
36+ child: GestureDetector (
37+ onHorizontalDragEnd: (details) {
38+ if (details.primaryVelocity != null &&
39+ details.primaryVelocity! < 0 ) {
40+ ref.read (homeOrderTypeProvider.notifier).state =
41+ OrderType .buy;
42+ } else if (details.primaryVelocity != null &&
43+ details.primaryVelocity! > 0 ) {
44+ ref.read (homeOrderTypeProvider.notifier).state =
45+ OrderType .sell;
46+ }
47+ },
48+ child: Column (
49+ children: [
50+ _buildTabs (ref),
51+ _buildFilterButton (context, ref),
52+ Expanded (
53+ child: Container (
54+ color: const Color (0xFF1D212C ),
55+ child: filteredOrders.isEmpty
56+ ? const Center (
57+ child: Column (
58+ mainAxisAlignment:
59+ MainAxisAlignment .center,
60+ children: [
61+ Icon (
62+ Icons .search_off,
63+ color: Colors .white30,
64+ size: 48 ,
65+ ),
66+ SizedBox (height: 16 ),
67+ Text (
68+ 'No orders available' ,
69+ style: TextStyle (
70+ color: Colors .white60,
71+ fontSize: 16 ,
72+ ),
73+ ),
74+ Text (
75+ 'Try changing filter settings or check back later' ,
76+ style: TextStyle (
77+ color: Colors .white38,
78+ fontSize: 14 ,
79+ ),
80+ textAlign: TextAlign .center,
81+ ),
82+ ],
83+ ),
84+ )
85+ : ListView .builder (
86+ itemCount: filteredOrders.length,
87+ padding: const EdgeInsets .only (
88+ bottom: 100 , top: 6 ),
89+ itemBuilder: (context, index) {
90+ final order = filteredOrders[index];
91+ return OrderListItem (order: order);
92+ },
93+ ),
6594 ),
66- )
67- : ListView .builder (
68- itemCount: filteredOrders.length,
69- padding: const EdgeInsets .only (bottom: 155 , top: 6 ),
70- itemBuilder: (context, index) {
71- final order = filteredOrders[index];
72- return OrderListItem (order: order);
73- },
7495 ),
96+ ],
97+ ),
98+ ),
7599 ),
76100 ),
101+ // Bottom navigation bar fixed at the bottom
77102 const BottomNavBar (),
78103 ],
79104 ),
80- ),
81- Positioned (
82- bottom: 80 + MediaQuery .of (context).viewPadding.bottom + 16 ,
83- right: 16 ,
84- child: const AddOrderButton (),
85- ),
86- ],
105+ // Floating action button positioned above bottom nav bar
106+ Positioned (
107+ bottom: 80 + MediaQuery .of (context).viewPadding.bottom + 16 ,
108+ right: 16 ,
109+ child: const AddOrderButton (),
110+ ),
111+ ],
112+ ),
87113 ),
88114 );
89115 }
0 commit comments