mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-09 16:52:14 +01:00
fix: Migrate to onPopInvokedWithResult
Reference: https://docs.flutter.dev/release/breaking-changes/popscope-with-result Signed-off-by: validcube <pun.butrach@gmail.com>
This commit is contained in:
parent
646feae0ec
commit
43d5888182
2 changed files with 4 additions and 4 deletions
|
@ -16,9 +16,9 @@ class InstallerView extends StatelessWidget {
|
|||
return ViewModelBuilder<InstallerViewModel>.reactive(
|
||||
onViewModelReady: (model) => model.initialize(context),
|
||||
viewModelBuilder: () => InstallerViewModel(),
|
||||
builder: (context, model, child) => PopScope(
|
||||
builder: (context, model, child) => PopScope<Object?>(
|
||||
canPop: !model.isPatching,
|
||||
onPopInvoked: (bool didPop) {
|
||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||
if (didPop) {
|
||||
model.onPop();
|
||||
} else {
|
||||
|
|
|
@ -13,9 +13,9 @@ class NavigationView extends StatelessWidget {
|
|||
return ViewModelBuilder<NavigationViewModel>.reactive(
|
||||
onViewModelReady: (model) => model.initialize(context),
|
||||
viewModelBuilder: () => locator<NavigationViewModel>(),
|
||||
builder: (context, model, child) => PopScope(
|
||||
builder: (context, model, child) => PopScope<Object?>(
|
||||
canPop: model.currentIndex == 0,
|
||||
onPopInvoked: (bool didPop) {
|
||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||
if (!didPop) {
|
||||
model.setIndex(0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue