mirror of
https://github.com/revanced/revanced-manager
synced 2024-05-14 13:56:57 +02:00
fix(navigation-view): back button closing the app from any page (#1019)
This commit is contained in:
parent
0462815014
commit
c5b0621323
@ -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…
x
Reference in New Issue
Block a user