diff --git a/lib/core/adaptive_page_route.dart b/lib/core/adaptive_page_route.dart index 631f000..ba68557 100644 --- a/lib/core/adaptive_page_route.dart +++ b/lib/core/adaptive_page_route.dart @@ -2,7 +2,7 @@ import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -Route AdaptivePageRoute({ +Route adaptivePageRoute({ required Widget Function(BuildContext) builder, bool fullscreenDialog = false, }) { diff --git a/lib/presentation/views/main_menu/custom_navigation_bar.dart b/lib/presentation/views/main_menu/custom_navigation_bar.dart index 4850e5a..0693189 100644 --- a/lib/presentation/views/main_menu/custom_navigation_bar.dart +++ b/lib/presentation/views/main_menu/custom_navigation_bar.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:game_tracker/core/adaptive_page_route.dart'; import 'package:game_tracker/core/custom_theme.dart'; @@ -58,7 +57,7 @@ class _CustomNavigationBarState extends State onPressed: () async { await Navigator.push( context, - AdaptivePageRoute(builder: (_) => const SettingsView()), + adaptivePageRoute(builder: (_) => const SettingsView()), ); setState(() { tabKeyCount++; diff --git a/lib/presentation/views/main_menu/group_view/groups_view.dart b/lib/presentation/views/main_menu/group_view/groups_view.dart index ce9f697..239aa23 100644 --- a/lib/presentation/views/main_menu/group_view/groups_view.dart +++ b/lib/presentation/views/main_menu/group_view/groups_view.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:game_tracker/core/adaptive_page_route.dart'; import 'package:game_tracker/core/constants.dart'; @@ -87,7 +86,7 @@ class _GroupsViewState extends State { onPressed: () async { await Navigator.push( context, - AdaptivePageRoute( + adaptivePageRoute( builder: (context) { return const CreateGroupView(); }, diff --git a/lib/presentation/views/main_menu/match_view/create_match/create_match_view.dart b/lib/presentation/views/main_menu/match_view/create_match/create_match_view.dart index 77fe6b9..281928e 100644 --- a/lib/presentation/views/main_menu/match_view/create_match/create_match_view.dart +++ b/lib/presentation/views/main_menu/match_view/create_match/create_match_view.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:game_tracker/core/adaptive_page_route.dart'; import 'package:game_tracker/core/custom_theme.dart'; @@ -141,7 +140,7 @@ class _CreateMatchViewState extends State { : games[selectedGameIndex].$1, onPressed: () async { selectedGameIndex = await Navigator.of(context).push( - AdaptivePageRoute( + adaptivePageRoute( builder: (context) => ChooseGameView( games: games, initialGameIndex: selectedGameIndex, @@ -169,7 +168,7 @@ class _CreateMatchViewState extends State { : translateRulesetToString(selectedRuleset!, context), onPressed: () async { selectedRuleset = await Navigator.of(context).push( - AdaptivePageRoute( + adaptivePageRoute( builder: (context) => ChooseRulesetView( rulesets: _rulesets, initialRulesetIndex: selectedRulesetIndex, @@ -191,7 +190,7 @@ class _CreateMatchViewState extends State { : selectedGroup!.name, onPressed: () async { selectedGroup = await Navigator.of(context).push( - AdaptivePageRoute( + adaptivePageRoute( builder: (context) => ChooseGroupView( groups: groupsList, initialGroupId: selectedGroupId, @@ -241,7 +240,7 @@ class _CreateMatchViewState extends State { if (context.mounted) { Navigator.pushReplacement( context, - AdaptivePageRoute( + adaptivePageRoute( fullscreenDialog: true, builder: (context) => MatchResultView( match: match, diff --git a/lib/presentation/views/main_menu/match_view/match_view.dart b/lib/presentation/views/main_menu/match_view/match_view.dart index 6797ffc..1781302 100644 --- a/lib/presentation/views/main_menu/match_view/match_view.dart +++ b/lib/presentation/views/main_menu/match_view/match_view.dart @@ -1,5 +1,4 @@ import 'dart:core' hide Match; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:game_tracker/core/adaptive_page_route.dart'; import 'package:game_tracker/core/constants.dart'; @@ -82,7 +81,7 @@ class _MatchViewState extends State { onTap: () async { Navigator.push( context, - AdaptivePageRoute( + adaptivePageRoute( fullscreenDialog: true, builder: (context) => MatchResultView( match: matches[index], @@ -105,7 +104,7 @@ class _MatchViewState extends State { onPressed: () async { Navigator.push( context, - AdaptivePageRoute( + adaptivePageRoute( builder: (context) => CreateMatchView(onWinnerChanged: loadGames)) );