Skip to content

Commit 616f642

Browse files
Change pending request button (#53)
* improve pending request button * edit screenshot
1 parent 91d08d9 commit 616f642

3 files changed

Lines changed: 65 additions & 63 deletions

File tree

lib/presentation/common/activity/widgets/activity_item_details.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ActivityItemDetails extends StatelessWidget {
8080
],
8181
),
8282
Padding(
83-
padding: EdgeInsets.only(left: 0, bottom: displayUserName ? 30 : 0),
83+
padding: EdgeInsets.only(left: 0, bottom: displayUserName ? 10 : 0),
8484
child: buildActivityDetails(
8585
context, appLocalizations, formattedDate, formattedTime),
8686
),

lib/presentation/community/screens/community_screen.dart

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -52,67 +52,6 @@ class CommunityScreen extends HookConsumerWidget {
5252
},
5353
),
5454
body: Column(children: [
55-
pendingRequestsStateProvider.when(
56-
data: (total) {
57-
return total > 0
58-
? Container(
59-
width: double.infinity,
60-
padding: const EdgeInsets.symmetric(
61-
horizontal: 16.0, vertical: 16.0),
62-
child: ElevatedButton(
63-
style: FormUtils.buttonStyle,
64-
onPressed: () {
65-
Navigator.push(
66-
context,
67-
PageRouteBuilder(
68-
transitionDuration:
69-
const Duration(milliseconds: 500),
70-
pageBuilder:
71-
(context, animation, secondaryAnimation) =>
72-
SlideTransition(
73-
position: Tween<Offset>(
74-
begin: const Offset(1.0, 0.0),
75-
end: Offset.zero,
76-
).animate(animation),
77-
child: PendingRequestsScreen(),
78-
),
79-
),
80-
);
81-
},
82-
child: Align(
83-
alignment: Alignment.center,
84-
child: Badge.count(
85-
count: total,
86-
textColor: ColorUtils.black,
87-
backgroundColor: ColorUtils.white,
88-
child: Padding(
89-
padding: const EdgeInsets.fromLTRB(
90-
0, 0, 16, 0),
91-
child: Row(
92-
mainAxisSize: MainAxisSize.min,
93-
children: [
94-
Icon(
95-
Icons.people,
96-
color: ColorUtils.white,
97-
),
98-
const SizedBox(width: 8),
99-
Text(
100-
AppLocalizations.of(context)!
101-
.see_pending_requests,
102-
style: FormUtils
103-
.darkTextFormFieldStyle,
104-
),
105-
]))))),
106-
)
107-
: Container();
108-
},
109-
loading: () {
110-
return Expanded(child: Center(child: UIUtils.loader));
111-
},
112-
error: (error, stackTrace) {
113-
return Text('$error');
114-
},
115-
),
11655
Expanded(
11756
child: RefreshIndicator(
11857
key: _refreshIndicatorKey,
@@ -142,6 +81,69 @@ class CommunityScreen extends HookConsumerWidget {
14281
)
14382
])),
14483
),
145-
]));
84+
]),
85+
floatingActionButton: pendingRequestsStateProvider.when(
86+
data: (total) {
87+
return total > 0
88+
? FloatingActionButton(
89+
backgroundColor: ColorUtils.main,
90+
elevation: 4.0,
91+
child: Badge.count(
92+
count: total,
93+
textColor: ColorUtils.black,
94+
backgroundColor: ColorUtils.white,
95+
child: Icon(
96+
Icons.people,
97+
color: ColorUtils.white,
98+
),
99+
),
100+
onPressed: () {
101+
Navigator.push(
102+
context,
103+
PageRouteBuilder(
104+
transitionDuration: const Duration(milliseconds: 500),
105+
pageBuilder:
106+
(context, animation, secondaryAnimation) =>
107+
SlideTransition(
108+
position: Tween<Offset>(
109+
begin: const Offset(1.0, 0.0),
110+
end: Offset.zero,
111+
).animate(animation),
112+
child: PendingRequestsScreen(),
113+
),
114+
),
115+
);
116+
},
117+
)
118+
: Align(
119+
alignment: Alignment.center,
120+
child: Badge.count(
121+
count: total,
122+
textColor: ColorUtils.black,
123+
backgroundColor: ColorUtils.white,
124+
child: Padding(
125+
padding: const EdgeInsets.fromLTRB(0, 0, 16, 0),
126+
child:
127+
Row(mainAxisSize: MainAxisSize.min, children: [
128+
Icon(
129+
Icons.people,
130+
color: ColorUtils.white,
131+
),
132+
const SizedBox(width: 8),
133+
Text(
134+
AppLocalizations.of(context)!
135+
.see_pending_requests,
136+
style: FormUtils.darkTextFormFieldStyle,
137+
),
138+
]))));
139+
},
140+
loading: () {
141+
return Container();
142+
},
143+
error: (error, stackTrace) {
144+
return Container();
145+
},
146+
),
147+
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat);
146148
}
147149
}
14.2 KB
Loading

0 commit comments

Comments
 (0)