step 15 : fix route navigator, not fixed

This commit is contained in:
sindhu
2024-01-26 23:37:16 +07:00
parent 0596fd4a75
commit a38a983561
2 changed files with 10 additions and 9 deletions

View File

@@ -153,13 +153,14 @@ class HomeScreen extends HookConsumerWidget {
} else if (next is CheckDistanceStateDone) {
isLoadingProsesCheckDistance.value = false;
if (varCurrentDistanceProvider?.selfie == "TRUE") {
ref.read(currentPageProvider.notifier).update((state) => -1);
Navigator.of(context).pushNamed(presensiSelfieRoute);
if (next.model.selfie == "TRUE") {
ref.read(currentPageProvider.notifier).update((state) => 99);
// Navigator.of(context).pop();
Navigator.of(context).restorablePushNamed(presensiSelfieRoute);
} else {
if (varCurrentDistanceProvider?.selfie == "FALSE") {
ref.read(currentPageProvider.notifier).update((state) => -1);
Navigator.of(context).pushNamed(presensiRoute);
if (next.model.selfie == "FALSE") {
ref.read(currentPageProvider.notifier).update((state) => 99);
Navigator.of(context).restorablePushNamed(presensiRoute);
}
}
}
@@ -197,7 +198,7 @@ class HomeScreen extends HookConsumerWidget {
)
: FloatingActionButton(
onPressed: () async {
requestLocationPermission();
await requestLocationPermission();
},
backgroundColor: Color(0xFFFFFFFF),
shape: CircleBorder(),

View File

@@ -134,7 +134,7 @@ class CustomDrawer extends HookConsumerWidget {
// Handle navigation to Home screen
Navigator.pop(context);
ref.read(currentPageProvider.state).update((state) => 0);
Navigator.pushNamed(context, homeRoute);
Navigator.of(context).popAndPushNamed(homeRoute);
},
),
@@ -170,7 +170,7 @@ class CustomDrawer extends HookConsumerWidget {
alignment: Alignment.bottomRight,
child: Text(
'Versi ${Constant.version}',
style: Constant.titleH1_700(context: context)
style: Constant.logintitle_700(context: context)
.copyWith(color: Constant.textLightGrey),
),
),