diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e4d7ef9..15162d5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: 3.19.0 + flutter-version: 3.24.x # Get flutter dependencies. - run: flutter pub get diff --git a/lib/presentation/coupons/components/coupon_banner.dart b/lib/presentation/coupons/components/coupon_banner.dart index eb9fad94..15f694da 100644 --- a/lib/presentation/coupons/components/coupon_banner.dart +++ b/lib/presentation/coupons/components/coupon_banner.dart @@ -14,7 +14,7 @@ class CouponBanner extends StatelessWidget { child: Row( children: [ IconButton( - onPressed: context.router.pop, + onPressed: context.router.maybePop, icon: const Icon( Icons.arrow_back, color: Colors.white, diff --git a/lib/presentation/feedback/components/feedback_banner.dart b/lib/presentation/feedback/components/feedback_banner.dart index a2ee48cb..72b53032 100644 --- a/lib/presentation/feedback/components/feedback_banner.dart +++ b/lib/presentation/feedback/components/feedback_banner.dart @@ -14,7 +14,7 @@ class FeedbackBanner extends StatelessWidget { child: Row( children: [ IconButton( - onPressed: context.router.pop, + onPressed: context.router.maybePop, icon: const Icon( Icons.arrow_back, color: Colors.white, diff --git a/lib/presentation/feedback/feedback_view.dart b/lib/presentation/feedback/feedback_view.dart index 778cfd48..f5d037f7 100644 --- a/lib/presentation/feedback/feedback_view.dart +++ b/lib/presentation/feedback/feedback_view.dart @@ -148,7 +148,7 @@ class FeedbackScreen extends StatelessWidget { textColor: Colors.white, backgroundColor: AppTheme.green, fontSize: 12.toAutoScaledFont); - context.router.pop(); + context.router.maybePop(); } if (state.error) { Fluttertoast.showToast( diff --git a/lib/presentation/hostel_change/components/hostel_change_banner.dart b/lib/presentation/hostel_change/components/hostel_change_banner.dart index c8347410..b35a006f 100644 --- a/lib/presentation/hostel_change/components/hostel_change_banner.dart +++ b/lib/presentation/hostel_change/components/hostel_change_banner.dart @@ -14,7 +14,7 @@ class HostelChangeBanner extends StatelessWidget { child: Row( children: [ IconButton( - onPressed: () => context.router.pop(), + onPressed: () => context.router.maybePop(), icon: const Icon( Icons.arrow_back, color: Colors.white, diff --git a/lib/presentation/login/components/oauth_webview.dart b/lib/presentation/login/components/oauth_webview.dart index 54c55580..5eedbfd4 100644 --- a/lib/presentation/login/components/oauth_webview.dart +++ b/lib/presentation/login/components/oauth_webview.dart @@ -34,7 +34,7 @@ class OAuthWebScreen extends StatelessWidget { onUpdateVisitedHistory: (_, uri, __) { if (uri != null) { if (uri.toString().contains('https://channeli.in/feed')) { - context.router.pop(); + context.router.maybePop(); //TODO: show dialog box // SnackBarUtils.showDark('Error', 'Permission Denied!'); } @@ -49,7 +49,7 @@ class OAuthWebScreen extends StatelessWidget { var params = url.split('?').last.split('&'); if (params.first.contains('code')) { var code = params.first.split('=').last; - context.router.pop(code); + context.router.maybePop(code); } return NavigationActionPolicy.CANCEL; diff --git a/lib/presentation/notifications/components/notification_banner.dart b/lib/presentation/notifications/components/notification_banner.dart index b9259326..e73d949e 100644 --- a/lib/presentation/notifications/components/notification_banner.dart +++ b/lib/presentation/notifications/components/notification_banner.dart @@ -14,7 +14,7 @@ class NotificationBanner extends StatelessWidget { child: Row( children: [ IconButton( - onPressed: context.router.pop, + onPressed: context.router.maybePop, icon: const Icon( Icons.arrow_back, color: Colors.white, diff --git a/lib/presentation/profile/profile_view.dart b/lib/presentation/profile/profile_view.dart index a36563d5..1a4d2a45 100644 --- a/lib/presentation/profile/profile_view.dart +++ b/lib/presentation/profile/profile_view.dart @@ -126,13 +126,13 @@ class ProfileScreen extends StatelessWidget { ProfilePageBloc>() .add( const DeleteHostelChangeRequest()); - ctx.router.pop(); + ctx.router.maybePop(); }, child: const Text('Delete'), ), TextButton( onPressed: () => - ctx.router.pop(), + ctx.router.maybePop(), child: const Text('Cancel'), ) ], diff --git a/lib/presentation/reset_password/components/reset_password_banner.dart b/lib/presentation/reset_password/components/reset_password_banner.dart index 01127950..4f91b443 100644 --- a/lib/presentation/reset_password/components/reset_password_banner.dart +++ b/lib/presentation/reset_password/components/reset_password_banner.dart @@ -14,7 +14,7 @@ class ResetPasswordBanner extends StatelessWidget { child: Row( children: [ IconButton( - onPressed: context.router.pop, + onPressed: context.router.maybePop, icon: const Icon( Icons.arrow_back, color: Colors.white, diff --git a/lib/presentation/reset_password/reset_password_view.dart b/lib/presentation/reset_password/reset_password_view.dart index 4f53848c..34c507cf 100644 --- a/lib/presentation/reset_password/reset_password_view.dart +++ b/lib/presentation/reset_password/reset_password_view.dart @@ -41,7 +41,7 @@ class ResetPasswordScreen extends StatelessWidget { content: Text('Password reset successfully!'), backgroundColor: Colors.green, )); - context.router.pop(); + context.router.maybePop(); } }, builder: (context, state) { diff --git a/lib/presentation/week_menu/components/DayMenu/menu_card.dart b/lib/presentation/week_menu/components/DayMenu/menu_card.dart index 71715f80..1e09262d 100644 --- a/lib/presentation/week_menu/components/DayMenu/menu_card.dart +++ b/lib/presentation/week_menu/components/DayMenu/menu_card.dart @@ -92,7 +92,7 @@ class CouponDialogBox extends StatelessWidget { Align( alignment: Alignment.topRight, child: GestureDetector( - onTap: context.router.pop, + onTap: context.router.maybePop, child: const Padding( padding: EdgeInsets.all(2.0), child: Icon(Icons.close),