diff --git a/lib/pages/home.dart b/lib/pages/home.dart index 1247a6d..96d5683 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -1,3 +1,4 @@ +import 'package:animations/animations.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:obtainium/pages/add_app.dart'; @@ -36,10 +37,25 @@ class _HomePageState extends State { return WillPopScope( child: Scaffold( backgroundColor: Theme.of(context).colorScheme.surface, - body: pages - .elementAt( - selectedIndexHistory.isEmpty ? 0 : selectedIndexHistory.last) - .widget, + body: PageTransitionSwitcher( + transitionBuilder: ( + Widget child, + Animation animation, + Animation secondaryAnimation, + ) { + return SharedAxisTransition( + animation: animation, + secondaryAnimation: secondaryAnimation, + transitionType: SharedAxisTransitionType.horizontal, + child: child, + ); + }, + child: pages + .elementAt(selectedIndexHistory.isEmpty + ? 0 + : selectedIndexHistory.last) + .widget, + ), bottomNavigationBar: NavigationBar( destinations: pages .map((e) => diff --git a/pubspec.lock b/pubspec.lock index 2d0d9c9..64faa17 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,13 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + animations: + dependency: "direct main" + description: + name: animations + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" archive: dependency: transitive description: @@ -201,21 +208,21 @@ packages: name: flutter_local_notifications url: "https://pub.dartlang.org" source: hosted - version: "9.9.1" + version: "10.0.0" flutter_local_notifications_linux: dependency: transitive description: name: flutter_local_notifications_linux url: "https://pub.dartlang.org" source: hosted - version: "0.5.1" + version: "1.0.0" flutter_local_notifications_platform_interface: dependency: transitive description: name: flutter_local_notifications_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "6.0.0" flutter_plugin_android_lifecycle: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0de0f31..618e14a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: cupertino_icons: ^1.0.5 path_provider: ^2.0.11 flutter_fgbg: ^0.2.0 # Try removing reliance on this - flutter_local_notifications: ^9.9.1 + flutter_local_notifications: ^10.0.0 provider: ^6.0.3 http: ^0.13.5 webview_flutter: ^3.0.4 @@ -52,6 +52,7 @@ dependencies: fluttertoast: ^8.0.9 device_info_plus: ^4.1.2 file_picker: ^5.1.0 + animations: ^2.0.4 dev_dependencies: