Updated stacks & buttons

This commit is contained in:
2026-05-21 18:28:11 +02:00
parent 32a8a6090a
commit 021a546479
4 changed files with 113 additions and 107 deletions

View File

@@ -8,7 +8,7 @@ import 'package:tallee/data/db/database.dart';
import 'package:tallee/data/models/group.dart';
import 'package:tallee/data/models/player.dart';
import 'package:tallee/l10n/generated/app_localizations.dart';
import 'package:tallee/presentation/widgets/buttons/custom_width_button.dart';
import 'package:tallee/presentation/widgets/buttons/animated_dialog_button.dart';
import 'package:tallee/presentation/widgets/player_selection.dart';
import 'package:tallee/presentation/widgets/text_input/text_input_field.dart';
@@ -96,11 +96,16 @@ class _CreateGroupViewState extends State<CreateGroupView> {
},
),
),
CustomWidthButton(
text: widget.groupToEdit == null
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: AnimatedDialogButton(
buttonConstraints: const BoxConstraints(
minWidth: double.infinity,
minHeight: 50,
),
buttonText: widget.groupToEdit == null
? loc.create_group
: loc.edit_group,
sizeRelativeToWidth: 0.95,
buttonType: ButtonType.primary,
onPressed:
(_groupNameController.text.isEmpty ||
@@ -108,7 +113,7 @@ class _CreateGroupViewState extends State<CreateGroupView> {
? null
: _saveGroup,
),
const SizedBox(height: 20),
),
],
),
),

View File

@@ -14,7 +14,7 @@ import 'package:tallee/presentation/views/main_menu/match_view/create_match/choo
import 'package:tallee/presentation/views/main_menu/match_view/create_match/choose_group_view.dart';
import 'package:tallee/presentation/views/main_menu/match_view/create_match/create_teams/create_teams_view.dart';
import 'package:tallee/presentation/views/main_menu/match_view/match_result_view.dart';
import 'package:tallee/presentation/widgets/buttons/custom_width_button.dart';
import 'package:tallee/presentation/widgets/buttons/animated_dialog_button.dart';
import 'package:tallee/presentation/widgets/player_selection.dart';
import 'package:tallee/presentation/widgets/text_input/text_input_field.dart';
import 'package:tallee/presentation/widgets/tiles/choose_tile.dart';
@@ -175,15 +175,21 @@ class _CreateMatchViewState extends State<CreateMatchView> {
),
// Create or save button.
CustomWidthButton(
text: buttonText,
sizeRelativeToWidth: 0.95,
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: AnimatedDialogButton(
buttonConstraints: const BoxConstraints(
minWidth: double.infinity,
minHeight: 50,
),
buttonType: ButtonType.primary,
onPressed: isSubmitButtonEnabled()
? () {
submitButtonNavigation(context);
}
: null,
buttonText: buttonText,
),
),
],
),

View File

@@ -56,8 +56,8 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
return Scaffold(
backgroundColor: CustomTheme.backgroundColor,
appBar: AppBar(title: Text(loc.create_teams)),
body: SafeArea(
child: Column(
body: Stack(
alignment: Alignment.center,
children: [
Expanded(
child: ListView.builder(
@@ -68,9 +68,7 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
color: teams[index].color,
controller: nameController[index],
hintText: '${loc.team} ${index + 1}',
onDelete: teams.length <= 2
? null
: () => removeTeam(index),
onDelete: teams.length <= 2 ? null : () => removeTeam(index),
onColorSelection: (color) {
setState(() {
teams[index] = teams[index].copyWith(color: color);
@@ -82,7 +80,9 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
),
// Button row
Row(
Positioned(
bottom: MediaQuery.paddingOf(context).bottom + 20,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Add new team
@@ -95,7 +95,7 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
),
const SizedBox(width: 15),
// Confirm teams and continue with member assignment
// Confirm teams
MainMenuButton(
icon: Icons.arrow_forward_sharp,
onPressed: teams.length >= 2
@@ -115,8 +115,8 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
),
],
),
],
),
],
),
);
}

View File

@@ -52,8 +52,8 @@ class _ManageMembersViewState extends State<ManageMembersView> {
return Scaffold(
backgroundColor: CustomTheme.backgroundColor,
appBar: AppBar(title: Text(loc.manage_members)),
body: SafeArea(
child: Stack(
body: Stack(
alignment: AlignmentDirectional.center,
children: [
Expanded(
child: ReorderableListView.builder(
@@ -86,10 +86,7 @@ class _ManageMembersViewState extends State<ManageMembersView> {
),
),
Positioned(
bottom: MediaQuery.of(context).padding.bottom,
left: 0,
right: 0,
child: Center(
bottom: MediaQuery.of(context).padding.bottom + 20,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@@ -110,10 +107,8 @@ class _ManageMembersViewState extends State<ManageMembersView> {
],
),
),
),
],
),
),
);
}