mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +01:00
fix(navigation-view): back button closing the app from any page (#1019)
This commit is contained in:
parent
0462815014
commit
c5b0621323
1 changed files with 59 additions and 49 deletions
|
@ -13,7 +13,16 @@ class NavigationView extends StatelessWidget {
|
|||
return ViewModelBuilder<NavigationViewModel>.reactive(
|
||||
onViewModelReady: (model) => model.initialize(context),
|
||||
viewModelBuilder: () => locator<NavigationViewModel>(),
|
||||
builder: (context, model, child) => Scaffold(
|
||||
builder: (context, model, child) => WillPopScope(
|
||||
onWillPop: ()async{
|
||||
if(model.currentIndex == 0){
|
||||
return true;
|
||||
}else{
|
||||
model.setIndex(0);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
child: Scaffold(
|
||||
body: PageTransitionSwitcher(
|
||||
duration: const Duration(milliseconds: 400),
|
||||
transitionBuilder: (
|
||||
|
@ -67,6 +76,7 @@ class NavigationView extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue