Skip to content

Commit

Permalink
Removed useless popscope
Browse files Browse the repository at this point in the history
  • Loading branch information
ferraridamiano committed Nov 1, 2024
1 parent 4659970 commit 9400fc1
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 68 deletions.
83 changes: 33 additions & 50 deletions lib/pages/app_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,56 +107,39 @@ class AppScaffold extends ConsumerWidget {
)
: null,
)
: PopScope(
canPop: selectedSection == AppPage.conversions,
onPopInvokedWithResult: (didPop, result) {
if (selectedSection == AppPage.settings) {
context.go('/');
} else if (selectedSection == AppPage.reorder) {
context.goNamed('settings');
} else if (selectedSection == AppPage.reorderDetails) {
//2 sided page
if (_isDrawerFixed) {
context.goNamed('settings');
} else {
context.goNamed('reorder-units');
}
}
},
child: Scaffold(
drawer: drawer,
body: SafeArea(child: child),
floatingActionButtonLocation:
FloatingActionButtonLocation.endContained,
bottomNavigationBar: selectedSection == AppPage.conversions
? BottomAppBar(
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
IconButton(
tooltip: AppLocalizations.of(context)!.search,
icon: const Icon(Icons.search),
onPressed: openSearch,
),
IconButton(
tooltip: AppLocalizations.of(context)!.calculator,
icon: const Icon(Icons.calculate_outlined),
onPressed: openCalculator,
),
],
),
)
: null,
floatingActionButton: (selectedSection == AppPage.conversions &&
MediaQuery.viewInsetsOf(context).bottom == 0)
? FloatingActionButton(
key: const ValueKey('clearAll'),
onPressed: () => clearAll(_isDrawerFixed),
tooltip: AppLocalizations.of(context)!.clearAll,
child: const Icon(Icons.clear_outlined),
)
: null,
),
: Scaffold(
drawer: drawer,
body: SafeArea(child: child),
floatingActionButtonLocation:
FloatingActionButtonLocation.endContained,
bottomNavigationBar: selectedSection == AppPage.conversions
? BottomAppBar(
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
IconButton(
tooltip: AppLocalizations.of(context)!.search,
icon: const Icon(Icons.search),
onPressed: openSearch,
),
IconButton(
tooltip: AppLocalizations.of(context)!.calculator,
icon: const Icon(Icons.calculate_outlined),
onPressed: openCalculator,
),
],
),
)
: null,
floatingActionButton: (selectedSection == AppPage.conversions &&
MediaQuery.viewInsetsOf(context).bottom == 0)
? FloatingActionButton(
key: const ValueKey('clearAll'),
onPressed: () => clearAll(_isDrawerFixed),
tooltip: AppLocalizations.of(context)!.clearAll,
child: const Icon(Icons.clear_outlined),
)
: null,
);

return Shortcuts(
Expand Down
14 changes: 7 additions & 7 deletions packages/calculator_widget/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
flutter_localizations:
dependency: transitive
description: flutter
Expand Down Expand Up @@ -124,10 +124,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -256,10 +256,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
sdks:
dart: ">=3.3.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 1 addition & 1 deletion packages/calculator_widget/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0

flutter:
uses-material-design: true
4 changes: 2 additions & 2 deletions packages/translations/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
14 changes: 7 additions & 7 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
flutter_localizations:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -279,10 +279,10 @@ packages:
dependency: "direct main"
description:
name: go_router
sha256: ddc16d34b0d74cb313986918c0f0885a7ba2fc24d8fb8419de75f0015144ccfe
sha256: "6f1b756f6e863259a99135ff3c95026c3cdca17d10ebef2bba2261a25ddc8bbc"
url: "https://pub.dev"
source: hosted
version: "14.2.3"
version: "14.3.0"
google_fonts:
dependency: "direct main"
description:
Expand Down Expand Up @@ -396,10 +396,10 @@ packages:
dependency: transitive
description:
name: lints
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
version: "5.0.0"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -1102,5 +1102,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=3.4.0 <4.0.0"
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.24.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
path: packages/translations

dev_dependencies:
flutter_lints: ^4.0.0
flutter_lints: ^5.0.0
flutter_test:
sdk: flutter
integration_test:
Expand Down

0 comments on commit 9400fc1

Please sign in to comment.