mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-04-30 22:14:25 +02:00
revert: WillPopScope migration
This reverts commit ef9b1d5c2d72c6787246c4b6d11929044a13b54d. Why is this so hard to implement??? Are we missing something??
This commit is contained in:
parent
31a32eb11d
commit
3b0fed55e4
@ -619,8 +619,8 @@ class ManagerAPI {
|
|||||||
return showDialog(
|
return showDialog(
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => PopScope(
|
builder: (context) => WillPopScope(
|
||||||
canPop: false,
|
onWillPop: () async => false,
|
||||||
child: AlertDialog(
|
child: AlertDialog(
|
||||||
title: Text(t.warning),
|
title: Text(t.warning),
|
||||||
content: ValueListenableBuilder(
|
content: ValueListenableBuilder(
|
||||||
|
@ -16,9 +16,12 @@ class InstallerView extends StatelessWidget {
|
|||||||
return ViewModelBuilder<InstallerViewModel>.reactive(
|
return ViewModelBuilder<InstallerViewModel>.reactive(
|
||||||
onViewModelReady: (model) => model.initialize(context),
|
onViewModelReady: (model) => model.initialize(context),
|
||||||
viewModelBuilder: () => InstallerViewModel(),
|
viewModelBuilder: () => InstallerViewModel(),
|
||||||
builder: (context, model, child) => PopScope(
|
builder: (context, model, child) => WillPopScope(
|
||||||
onPopInvoked: (bool didPop) => model.onWillPop(context),
|
/*
|
||||||
canPop: false,
|
TODO(any): migrate to [PopScope],
|
||||||
|
we've tried to migrate it two times but
|
||||||
|
reverted it because we couldn't exit out of the screen.
|
||||||
|
*/
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
top: false,
|
top: false,
|
||||||
bottom: model.isPatching,
|
bottom: model.isPatching,
|
||||||
@ -108,6 +111,7 @@ class InstallerView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
onWillPop: () => model.onWillPop(context),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -13,10 +13,14 @@ class NavigationView extends StatelessWidget {
|
|||||||
return ViewModelBuilder<NavigationViewModel>.reactive(
|
return ViewModelBuilder<NavigationViewModel>.reactive(
|
||||||
onViewModelReady: (model) => model.initialize(context),
|
onViewModelReady: (model) => model.initialize(context),
|
||||||
viewModelBuilder: () => locator<NavigationViewModel>(),
|
viewModelBuilder: () => locator<NavigationViewModel>(),
|
||||||
builder: (context, model, child) => PopScope(
|
builder: (context, model, child) => WillPopScope(
|
||||||
canPop: model.currentIndex == 0,
|
onWillPop: () async {
|
||||||
onPopInvoked: (bool didPop) => {
|
if (model.currentIndex == 0) {
|
||||||
if (!didPop) model.setIndex(0),
|
return true;
|
||||||
|
} else {
|
||||||
|
model.setIndex(0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
body: PageTransitionSwitcher(
|
body: PageTransitionSwitcher(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user