Skip to content

Commit ea70d7c

Browse files
committed
added changes
Signed-off-by: Manas Malla <manasmalla.dev@gmail.com>
1 parent d951431 commit ea70d7c

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

lib/cart_page.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ class _CartPageState extends State<CartPage> {
354354
// Handle checkout action
355355
await Injector.cartRepository.checkout(
356356
context,
357+
Navigator.of(context),
357358
coupon: coupon,
358359
onLoading: (p0) {
359360
isLoading.value = p0;

lib/data/cart.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ class CartRepository {
156156
}
157157

158158
Future<void> checkout(
159-
BuildContext context, {
159+
BuildContext context,
160+
NavigatorState navigator, {
160161
Coupon? coupon,
161162
required Function(bool) onLoading,
162163
}) async {
@@ -290,22 +291,21 @@ class CartRepository {
290291
);
291292
}).then((semester) {
292293
SharedPreferences.getInstance().then((sharedPreferences) {
293-
Navigator.of(context).pop();
294-
if (context.mounted) {
295-
Navigator.of(context).pushReplacement(
296-
MaterialPageRoute(
297-
builder:
298-
(context) => MyHomePage(
299-
name:
300-
userCredential.user?.displayName?.split(
301-
" ",
302-
)[0] ??
303-
"User",
304-
semester: semester,
305-
),
306-
),
307-
);
308-
}
294+
navigator.pop();
295+
296+
navigator.pushReplacement(
297+
MaterialPageRoute(
298+
builder:
299+
(context) => MyHomePage(
300+
name:
301+
userCredential.user?.displayName?.split(
302+
" ",
303+
)[0] ??
304+
"User",
305+
semester: semester,
306+
),
307+
),
308+
);
309309
});
310310
});
311311
} on Exception catch (e) {

lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ Future<void> main() async {
6464
criticalAlert: true,
6565
);
6666
}
67+
// for handling the recieved notifications on windows, we are manualloy showing the notification using flutter local notifications
68+
6769
print(
6870
'Firebase Messaging Token: ${await FirebaseMessaging.instance.getToken()}',
6971
);

lib/unit_list_tile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,8 @@ class UnitListTile extends StatelessWidget {
725725
(units[index]
726726
.roadmap
727727
?.roadmapItems
728-
.last
729-
.isUnlocked ??
728+
.lastOrNull
729+
?.isUnlocked ??
730730
false)
731731
? Icons.chevron_right_outlined
732732
: Icons.lock_outline,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: chitti
22
description: "Your last minute exam preparation buddy"
33
publish_to: 'none'
4-
version: 2.0.3+19
4+
version: 2.0.4+20
55

66
environment:
77
sdk: ^3.7.0-267.0.dev

0 commit comments

Comments
 (0)