mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 01:01:56 +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(
|
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) => PopScope<Object?>(
|
||||||
canPop: !model.isPatching,
|
canPop: !model.isPatching,
|
||||||
onPopInvoked: (bool didPop) {
|
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||||
if (didPop) {
|
if (didPop) {
|
||||||
model.onPop();
|
model.onPop();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -13,9 +13,9 @@ 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) => PopScope<Object?>(
|
||||||
canPop: model.currentIndex == 0,
|
canPop: model.currentIndex == 0,
|
||||||
onPopInvoked: (bool didPop) {
|
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||||
if (!didPop) {
|
if (!didPop) {
|
||||||
model.setIndex(0);
|
model.setIndex(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue