Skip to content

Commit

Permalink
Change pending request button (#53)
Browse files Browse the repository at this point in the history
* improve pending request button

* edit screenshot
  • Loading branch information
BenjaminCanape authored Feb 29, 2024
1 parent 91d08d9 commit 616f642
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ActivityItemDetails extends StatelessWidget {
],
),
Padding(
padding: EdgeInsets.only(left: 0, bottom: displayUserName ? 30 : 0),
padding: EdgeInsets.only(left: 0, bottom: displayUserName ? 10 : 0),
child: buildActivityDetails(
context, appLocalizations, formattedDate, formattedTime),
),
Expand Down
126 changes: 64 additions & 62 deletions lib/presentation/community/screens/community_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,67 +52,6 @@ class CommunityScreen extends HookConsumerWidget {
},
),
body: Column(children: [
pendingRequestsStateProvider.when(
data: (total) {
return total > 0
? Container(
width: double.infinity,
padding: const EdgeInsets.symmetric(
horizontal: 16.0, vertical: 16.0),
child: ElevatedButton(
style: FormUtils.buttonStyle,
onPressed: () {
Navigator.push(
context,
PageRouteBuilder(
transitionDuration:
const Duration(milliseconds: 500),
pageBuilder:
(context, animation, secondaryAnimation) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation),
child: PendingRequestsScreen(),
),
),
);
},
child: Align(
alignment: Alignment.center,
child: Badge.count(
count: total,
textColor: ColorUtils.black,
backgroundColor: ColorUtils.white,
child: Padding(
padding: const EdgeInsets.fromLTRB(
0, 0, 16, 0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.people,
color: ColorUtils.white,
),
const SizedBox(width: 8),
Text(
AppLocalizations.of(context)!
.see_pending_requests,
style: FormUtils
.darkTextFormFieldStyle,
),
]))))),
)
: Container();
},
loading: () {
return Expanded(child: Center(child: UIUtils.loader));
},
error: (error, stackTrace) {
return Text('$error');
},
),
Expanded(
child: RefreshIndicator(
key: _refreshIndicatorKey,
Expand Down Expand Up @@ -142,6 +81,69 @@ class CommunityScreen extends HookConsumerWidget {
)
])),
),
]));
]),
floatingActionButton: pendingRequestsStateProvider.when(
data: (total) {
return total > 0
? FloatingActionButton(
backgroundColor: ColorUtils.main,
elevation: 4.0,
child: Badge.count(
count: total,
textColor: ColorUtils.black,
backgroundColor: ColorUtils.white,
child: Icon(
Icons.people,
color: ColorUtils.white,
),
),
onPressed: () {
Navigator.push(
context,
PageRouteBuilder(
transitionDuration: const Duration(milliseconds: 500),
pageBuilder:
(context, animation, secondaryAnimation) =>
SlideTransition(
position: Tween<Offset>(
begin: const Offset(1.0, 0.0),
end: Offset.zero,
).animate(animation),
child: PendingRequestsScreen(),
),
),
);
},
)
: Align(
alignment: Alignment.center,
child: Badge.count(
count: total,
textColor: ColorUtils.black,
backgroundColor: ColorUtils.white,
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 16, 0),
child:
Row(mainAxisSize: MainAxisSize.min, children: [
Icon(
Icons.people,
color: ColorUtils.white,
),
const SizedBox(width: 8),
Text(
AppLocalizations.of(context)!
.see_pending_requests,
style: FormUtils.darkTextFormFieldStyle,
),
]))));
},
loading: () {
return Container();
},
error: (error, stackTrace) {
return Container();
},
),
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat);
}
}
Binary file modified screenshots/community/all_activities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 616f642

Please sign in to comment.