mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 20:57:36 +02:00
refactor: Replace deprecated WillPopScope
(#1604)
This commit is contained in:
@ -13,14 +13,10 @@ class NavigationView extends StatelessWidget {
|
||||
return ViewModelBuilder<NavigationViewModel>.reactive(
|
||||
onViewModelReady: (model) => model.initialize(context),
|
||||
viewModelBuilder: () => locator<NavigationViewModel>(),
|
||||
builder: (context, model, child) => WillPopScope(
|
||||
onWillPop: () async {
|
||||
if (model.currentIndex == 0) {
|
||||
return true;
|
||||
} else {
|
||||
model.setIndex(0);
|
||||
return false;
|
||||
}
|
||||
builder: (context, model, child) => PopScope(
|
||||
canPop: model.currentIndex == 0,
|
||||
onPopInvoked: (bool didPop) => {
|
||||
if (!didPop) model.setIndex(0),
|
||||
},
|
||||
child: Scaffold(
|
||||
body: PageTransitionSwitcher(
|
||||
|
Reference in New Issue
Block a user