From 0ba2af10103003017dc8455c24e27d468b2c2e43 Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Thu, 14 Mar 2024 19:01:01 +0100 Subject: [PATCH] Use default page transition --- .github/workflows/dart.yml | 2 +- app/devtools_options.yaml | 1 + app/lib/main.dart | 90 ++++++------------- .../metadata/android/en-US/changelogs/7.txt | 1 + 4 files changed, 29 insertions(+), 65 deletions(-) create mode 100644 app/devtools_options.yaml diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index bb1eb048f52..b3dfdc1a533 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -18,7 +18,7 @@ jobs: run: | FLUTTER_VERSION=$(cat ../FLUTTER_VERSION) echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV - - uses: subosito/flutter-action@v2.12.0.12.0 + - uses: subosito/flutter-action@v2.12.0 with: flutter-version: ${{ env.FLUTTER_VERSION }} channel: 'master' diff --git a/app/devtools_options.yaml b/app/devtools_options.yaml new file mode 100644 index 00000000000..7e7e7f67dee --- /dev/null +++ b/app/devtools_options.yaml @@ -0,0 +1 @@ +extensions: diff --git a/app/lib/main.dart b/app/lib/main.dart index b38f9917f35..c80ab4e148c 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -65,23 +65,6 @@ Future main(List args) async { ); } -Page Function(BuildContext, GoRouterState) _fadeTransitionBuilder( - Widget Function(BuildContext, GoRouterState) child) { - return (context, state) => CustomTransitionPage( - key: state.pageKey, - child: child(context, state), - transitionDuration: const Duration(milliseconds: 200), - transitionsBuilder: (context, animation, secondaryAnimation, child) => - FadeTransition( - opacity: CurvedAnimation( - parent: animation, - curve: Curves.easeInOut, - ), - child: child, - ), - ); -} - class FlowApp extends StatelessWidget { FlowApp({super.key}); @@ -135,91 +118,70 @@ class FlowApp extends StatelessWidget { routes: [ GoRoute( path: '/', - pageBuilder: _fadeTransitionBuilder( - (context, state) => const DashboardPage()), + builder: (context, state) => const DashboardPage(), routes: [ GoRoute( path: 'calendar', - pageBuilder: _fadeTransitionBuilder( - (context, state) => CalendarPage( - filter: state.extra is CalendarFilter - ? state.extra as CalendarFilter - : const CalendarFilter(), - ), + builder: (context, state) => CalendarPage( + filter: state.extra is CalendarFilter + ? state.extra as CalendarFilter + : const CalendarFilter(), ), ), GoRoute( path: 'events', - pageBuilder: _fadeTransitionBuilder( - (context, state) => const EventsPage(), - ), + builder: (context, state) => const EventsPage(), ), GoRoute( path: 'groups', - pageBuilder: _fadeTransitionBuilder( - (context, state) => const GroupsPage(), - ), + builder: (context, state) => const GroupsPage(), ), GoRoute( path: 'notes', - pageBuilder: _fadeTransitionBuilder( - (context, state) => const NotesPage(), - ), + builder: (context, state) => const NotesPage(), routes: [ GoRoute( path: ':source/:id', name: 'subnote', - pageBuilder: _fadeTransitionBuilder( - (context, state) => NotesPage( - parent: SourcedModel( - state.pathParameters['source']!, - Multihash.fromBase64Url( - state.pathParameters['id']!), - ), + builder: (context, state) => NotesPage( + parent: SourcedModel( + state.pathParameters['source']!, + Multihash.fromBase64Url( + state.pathParameters['id']!), ), ), ), GoRoute( path: ':id', name: 'subnote-local', - pageBuilder: _fadeTransitionBuilder( - (context, state) => NotesPage( - parent: SourcedModel( - '', - Multihash.fromBase64Url( - state.pathParameters['id']!), - ), + builder: (context, state) => NotesPage( + parent: SourcedModel( + '', + Multihash.fromBase64Url( + state.pathParameters['id']!), ), ), - ) + ), ]), GoRoute( path: 'places', - pageBuilder: _fadeTransitionBuilder( - (context, state) => const PlacesPage(), - ), + builder: (context, state) => const PlacesPage(), ), GoRoute( path: 'users', - pageBuilder: _fadeTransitionBuilder( - (context, state) => UsersPage( - filter: state.extra is UserFilter - ? state.extra as UserFilter - : const UserFilter(), - ), + builder: (context, state) => UsersPage( + filter: state.extra is UserFilter + ? state.extra as UserFilter + : const UserFilter(), ), ), GoRoute( path: 'sources', - pageBuilder: _fadeTransitionBuilder( - (context, state) => const SourcesPage(), - ), + builder: (context, state) => const SourcesPage(), ), GoRoute( path: 'settings', - pageBuilder: _fadeTransitionBuilder( - (context, state) => const SettingsPage(), - ), + builder: (context, state) => const SettingsPage(), ), ]), ]), diff --git a/fastlane/metadata/android/en-US/changelogs/7.txt b/fastlane/metadata/android/en-US/changelogs/7.txt index 1feaaa112b0..b3175bcb78b 100644 --- a/fastlane/metadata/android/en-US/changelogs/7.txt +++ b/fastlane/metadata/android/en-US/changelogs/7.txt @@ -3,4 +3,5 @@ * Add high contrast mode * Make dashboard the back page * Improve custom title bar window buttons +* Use default page transition instead of fade * Upgrade to flutter 3.19 \ No newline at end of file