Skip to content

Commit

Permalink
Use default page transition
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Mar 14, 2024
1 parent d09818b commit 0ba2af1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: |
FLUTTER_VERSION=$(cat ../FLUTTER_VERSION)
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV
- uses: subosito/[email protected].12.0
- uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'master'
Expand Down
1 change: 1 addition & 0 deletions app/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extensions:
90 changes: 26 additions & 64 deletions app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,6 @@ Future<void> main(List<String> args) async {
);
}

Page<void> Function(BuildContext, GoRouterState) _fadeTransitionBuilder(
Widget Function(BuildContext, GoRouterState) child) {
return (context, state) => CustomTransitionPage<void>(
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});

Expand Down Expand Up @@ -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(),
),
]),
]),
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0ba2af1

Please sign in to comment.