Skip to content

Commit 2098d83

Browse files
authored
Merge pull request #121 from AndreaDiazCorreia/feat/issue-92
UI Consistency Improvements - Issue #92
2 parents b8a0e5e + 0103e66 commit 2098d83

File tree

8 files changed

+405
-267
lines changed

8 files changed

+405
-267
lines changed

lib/features/chat/screens/chat_rooms_list.dart

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:mostro_mobile/shared/providers/legible_handle_provider.dart';
1010
import 'package:mostro_mobile/shared/providers/session_notifier_provider.dart';
1111
import 'package:mostro_mobile/shared/widgets/bottom_nav_bar.dart';
1212
import 'package:mostro_mobile/shared/widgets/mostro_app_bar.dart';
13-
import 'package:mostro_mobile/shared/widgets/mostro_app_drawer.dart';
13+
import 'package:mostro_mobile/shared/widgets/custom_drawer_overlay.dart';
1414

1515
class ChatRoomsScreen extends ConsumerWidget {
1616
const ChatRoomsScreen({super.key});
@@ -22,27 +22,28 @@ class ChatRoomsScreen extends ConsumerWidget {
2222
return Scaffold(
2323
backgroundColor: AppTheme.dark1,
2424
appBar: const MostroAppBar(),
25-
drawer: const MostroAppDrawer(),
26-
body: Container(
27-
margin: const EdgeInsets.fromLTRB(16, 16, 16, 16),
28-
decoration: BoxDecoration(
29-
color: const Color(0xFF303544),
30-
borderRadius: BorderRadius.circular(20),
31-
),
32-
child: Column(
33-
children: [
34-
Padding(
35-
padding: const EdgeInsets.all(16.0),
36-
child: Text(
37-
'CHAT',
38-
style: TextStyle(color: AppTheme.mostroGreen),
25+
body: CustomDrawerOverlay(
26+
child: Container(
27+
margin: const EdgeInsets.fromLTRB(16, 16, 16, 16),
28+
decoration: BoxDecoration(
29+
color: const Color(0xFF303544),
30+
borderRadius: BorderRadius.circular(20),
31+
),
32+
child: Column(
33+
children: [
34+
Padding(
35+
padding: const EdgeInsets.all(16.0),
36+
child: Text(
37+
'CHAT',
38+
style: TextStyle(color: AppTheme.mostroGreen),
39+
),
3940
),
40-
),
41-
Expanded(
42-
child: _buildBody(chatListState),
43-
),
44-
const BottomNavBar(),
45-
],
41+
Expanded(
42+
child: _buildBody(chatListState),
43+
),
44+
const BottomNavBar(),
45+
],
46+
),
4647
),
4748
),
4849
);

lib/features/home/screens/home_screen.dart

Lines changed: 81 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'package:mostro_mobile/shared/widgets/add_order_button.dart';
99
import 'package:mostro_mobile/shared/widgets/bottom_nav_bar.dart';
1010
import 'package:mostro_mobile/shared/widgets/mostro_app_bar.dart';
1111
import '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

1414
class 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

Comments
 (0)