Skip to content

Commit

Permalink
Fixing WillPopScope deprecated (#352)
Browse files Browse the repository at this point in the history
Co-authored-by: DonnieBLT <[email protected]>
  • Loading branch information
Dante291 and DonnieBLT authored Feb 24, 2024
1 parent 7f1b231 commit 27ac6a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/src/pages/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ class _HomeState extends ConsumerState<Home> {

@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
return PopScope(
canPop: false,
onPopInvoked: (_) async {
showGeneralDialog(
context: context,
barrierLabel: "Barrier",
Expand All @@ -223,7 +224,6 @@ class _HomeState extends ConsumerState<Home> {
return buildLogOUtDialog();
},
);
return false;
},
child: Scaffold(
appBar: buildAppBar(context: context),
Expand Down
5 changes: 2 additions & 3 deletions lib/src/pages/leaderboards/monthly_leaderboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,12 @@ class _MonthlyLeaderBoardPageState
Widget build(BuildContext context) {
final Size size = MediaQuery.of(context).size;
final monthlyLeadersState = ref.watch(monthlyLeaderBoardProvider);
return WillPopScope(
onWillPop: () async {
return PopScope(
onPopInvoked: (_) async {
ref
.watch(monthlyLeaderBoardProvider.notifier)
.refreshMonthlyLeaderList(
DateTime.now().year, DateTime.now().month);
return true;
},
child: Scaffold(
appBar: AppBar(
Expand Down

0 comments on commit 27ac6a4

Please sign in to comment.