Merge remote-tracking branch 'origin/development' into feature/100-lokalisierung-hinzufügen
# Conflicts: # lib/presentation/views/main_menu/match_view/create_match/choose_game_view.dart # lib/presentation/views/main_menu/match_view/create_match/choose_group_view.dart # lib/presentation/views/main_menu/match_view/create_match/choose_ruleset_view.dart
This commit is contained in:
@@ -48,7 +48,17 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: Column(
|
||||
body: PopScope(
|
||||
// This fixes that the Android Back Gesture didn't return the
|
||||
// selectedGameIndex and therefore the selected Game wasn't saved
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pop(selectedGameIndex);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
@@ -85,6 +95,7 @@ class _ChooseGameViewState extends State<ChooseGameView> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,23 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: Column(
|
||||
body: PopScope(
|
||||
// This fixes that the Android Back Gesture didn't return the
|
||||
// selectedGroupId and therefore the selected Group wasn't saved
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pop(
|
||||
selectedGroupId == ''
|
||||
? null
|
||||
: widget.groups.firstWhere(
|
||||
(group) => group.id == selectedGroupId,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
@@ -115,6 +131,7 @@ class _ChooseGroupViewState extends State<ChooseGroupView> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,21 @@ class _ChooseRulesetViewState extends State<ChooseRulesetView> {
|
||||
),
|
||||
centerTitle: true,
|
||||
),
|
||||
body: ListView.builder(
|
||||
body: PopScope(
|
||||
// This fixes that the Android Back Gesture didn't return the
|
||||
// selectedRulesetIndex and therefore the selected Ruleset wasn't saved
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||
if (didPop) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pop(
|
||||
selectedRulesetIndex == -1
|
||||
? null
|
||||
: widget.rulesets[selectedRulesetIndex].$1,
|
||||
);
|
||||
},
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.only(bottom: 85),
|
||||
itemCount: widget.rulesets.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
@@ -77,6 +91,7 @@ class _ChooseRulesetViewState extends State<ChooseRulesetView> {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user