Skip to content

Commit 6e9f778

Browse files
committed
Fixed double tap to exit app bug by removing onboarding screen and splash screen from navigation stack using Get.off
1 parent 3d8aaa6 commit 6e9f778

File tree

5 files changed

+4
-14
lines changed

5 files changed

+4
-14
lines changed

lib/app/modules/home/views/home_page_body.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class HomePageBody extends StatelessWidget {
2020
controller.showInAppTour(context);
2121
return DoubleBackToCloseApp(
2222
snackBar: const SnackBar(content: Text('Tap back again to exit')),
23-
// ignore: avoid_unnecessary_containers
2423
child: Container(
2524
color: AppSettings.isDarkMode
2625
? Palette.kToDark.shade200

lib/app/modules/home/views/home_view.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ class HomeView extends GetView<HomeController> {
3333

3434
controller.checkForSync(context);
3535

36-
// var taskData = controller.searchedTasks;
37-
38-
// var pendingFilter = controller.pendingFilter;
39-
// var waitingFilter = controller.waitingFilter;
40-
// var pendingTags = controller.pendingTags;
41-
4236
return Obx(
4337
() => Scaffold(
4438
appBar: HomePageAppBar(

lib/app/modules/onboarding/views/onboarding_page_start_button.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ class OnboardingPageStartButton extends StatelessWidget {
1616
child: ElevatedButton(
1717
onPressed: () {
1818
controller.markOnboardingAsCompleted();
19-
// Navigator.of(context).pushAndRemoveUntil(
20-
// MaterialPageRoute(builder: (context) => const HomeView()),
21-
// (Route<dynamic> route) => false,
22-
// );
23-
Get.toNamed(Routes.HOME);
19+
Get.offNamed(Routes.HOME);
2420
},
2521
style: ElevatedButton.styleFrom(
2622
backgroundColor: TaskWarriorColors.black,

lib/app/modules/splash/bindings/splash_binding.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class SplashBinding extends Bindings {
77
void dependencies() {
88
Get.put<SplashController>(
99
SplashController(),
10+
permanent: true,
1011
);
1112
}
1213
}

lib/app/modules/splash/controllers/splash_controller.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ class SplashController extends GetxController {
9595
void sendToNextPage() async {
9696
await checkOnboardingStatus();
9797
if (hasCompletedOnboarding.value) {
98-
Get.toNamed(Routes.HOME);
98+
Get.offNamed(Routes.HOME);
9999
} else {
100-
Get.toNamed(Routes.ONBOARDING);
100+
Get.offNamed(Routes.ONBOARDING);
101101
}
102102
}
103103
}

0 commit comments

Comments
 (0)