PageRoutes adaptable machen #145

Merged
flixcoo merged 10 commits from enhancement/128-PageRoutes-adaptable-machen into development 2026-01-10 14:06:10 +00:00
3 changed files with 286 additions and 279 deletions
Showing only changes of commit d5e7a17127 - Show all commits

View File

@@ -44,7 +44,8 @@ class _CreateGroupViewState extends State<CreateGroupView> {
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context);
return Scaffold(
return ScaffoldMessenger(
child: Scaffold(
backgroundColor: CustomTheme.backgroundColor,
appBar: AppBar(title: Text(loc.create_new_group)),
body: SafeArea(
@@ -106,6 +107,7 @@ class _CreateGroupViewState extends State<CreateGroupView> {
],
),
),
),
);
}
}

View File

@@ -1,3 +1,4 @@
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';
@@ -119,7 +120,8 @@ class _CreateMatchViewState extends State<CreateMatchView> {
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context);
return Scaffold(
return ScaffoldMessenger(
child: Scaffold(
backgroundColor: CustomTheme.backgroundColor,
appBar: AppBar(title: Text(loc.create_new_match)),
body: SafeArea(
@@ -140,7 +142,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
: games[selectedGameIndex].$1,
onPressed: () async {
selectedGameIndex = await Navigator.of(context).push(
adaptivePageRoute(
MaterialPageRoute(
builder: (context) => ChooseGameView(
games: games,
initialGameIndex: selectedGameIndex,
@@ -168,7 +170,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
: translateRulesetToString(selectedRuleset!, context),
onPressed: () async {
selectedRuleset = await Navigator.of(context).push(
adaptivePageRoute(
MaterialPageRoute(
builder: (context) => ChooseRulesetView(
rulesets: _rulesets,
initialRulesetIndex: selectedRulesetIndex,
@@ -190,7 +192,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
: selectedGroup!.name,
onPressed: () async {
selectedGroup = await Navigator.of(context).push(
adaptivePageRoute(
MaterialPageRoute(
builder: (context) => ChooseGroupView(
groups: groupsList,
initialGroupId: selectedGroupId,
@@ -240,7 +242,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
if (context.mounted) {
Navigator.pushReplacement(
context,
adaptivePageRoute(
CupertinoPageRoute(
fullscreenDialog: true,
builder: (context) => MatchResultView(
match: match,
@@ -255,6 +257,7 @@ class _CreateMatchViewState extends State<CreateMatchView> {
],
),
),
),
);
}

View File

@@ -21,7 +21,8 @@ class _SettingsViewState extends State<SettingsView> {
@override
Widget build(BuildContext context) {
final loc = AppLocalizations.of(context);
return Scaffold(
return ScaffoldMessenger(
child: Scaffold(
appBar: AppBar(backgroundColor: CustomTheme.backgroundColor),
backgroundColor: CustomTheme.backgroundColor,
body: LayoutBuilder(
@@ -121,6 +122,7 @@ class _SettingsViewState extends State<SettingsView> {
),
),
),
),
);
}