fix: route back button
This commit is contained in:
parent
33b2ab85e3
commit
f2f688f9f3
|
@ -66,18 +66,32 @@ class _SubmissionParentState extends State<SubmissionParent> {
|
||||||
return ChangeNotifierProvider(
|
return ChangeNotifierProvider(
|
||||||
create: (context) => SubmissionDataViewModel(),
|
create: (context) => SubmissionDataViewModel(),
|
||||||
builder: (context, child) {
|
builder: (context, child) {
|
||||||
return WillPopScope(
|
return PopScope(
|
||||||
onWillPop: () async {
|
canPop: false,
|
||||||
|
onPopInvoked: (didPop) async {
|
||||||
|
if (didPop) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
await routePush(context,
|
await routePush(context,
|
||||||
page: const BottomNavigationView(),
|
page: const BottomNavigationView(),
|
||||||
routeType: RouteType.pushReplace);
|
routeType: RouteType.pushReplace);
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
child: Consumer<SubmissionDataViewModel>(
|
child: Consumer<SubmissionDataViewModel>(
|
||||||
builder: (context, provider, child) {
|
builder: (context, provider, child) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: CustomAppBar(
|
appBar: CustomAppBar(
|
||||||
height: SizeConfig.height * .1, title: 'Registration'),
|
height: SizeConfig.height * .1,
|
||||||
|
title: 'Registration',
|
||||||
|
leading: BackButton(
|
||||||
|
onPressed: () {
|
||||||
|
routePush(
|
||||||
|
context,
|
||||||
|
page: const BottomNavigationView(),
|
||||||
|
routeType: RouteType.pushReplace,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user