Updated stacks & buttons
This commit is contained in:
@@ -8,7 +8,7 @@ import 'package:tallee/data/db/database.dart';
|
|||||||
import 'package:tallee/data/models/group.dart';
|
import 'package:tallee/data/models/group.dart';
|
||||||
import 'package:tallee/data/models/player.dart';
|
import 'package:tallee/data/models/player.dart';
|
||||||
import 'package:tallee/l10n/generated/app_localizations.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/player_selection.dart';
|
||||||
import 'package:tallee/presentation/widgets/text_input/text_input_field.dart';
|
import 'package:tallee/presentation/widgets/text_input/text_input_field.dart';
|
||||||
|
|
||||||
@@ -96,11 +96,16 @@ class _CreateGroupViewState extends State<CreateGroupView> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
CustomWidthButton(
|
Padding(
|
||||||
text: widget.groupToEdit == null
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
|
child: AnimatedDialogButton(
|
||||||
|
buttonConstraints: const BoxConstraints(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
minHeight: 50,
|
||||||
|
),
|
||||||
|
buttonText: widget.groupToEdit == null
|
||||||
? loc.create_group
|
? loc.create_group
|
||||||
: loc.edit_group,
|
: loc.edit_group,
|
||||||
sizeRelativeToWidth: 0.95,
|
|
||||||
buttonType: ButtonType.primary,
|
buttonType: ButtonType.primary,
|
||||||
onPressed:
|
onPressed:
|
||||||
(_groupNameController.text.isEmpty ||
|
(_groupNameController.text.isEmpty ||
|
||||||
@@ -108,7 +113,7 @@ class _CreateGroupViewState extends State<CreateGroupView> {
|
|||||||
? null
|
? null
|
||||||
: _saveGroup,
|
: _saveGroup,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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/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/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/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/player_selection.dart';
|
||||||
import 'package:tallee/presentation/widgets/text_input/text_input_field.dart';
|
import 'package:tallee/presentation/widgets/text_input/text_input_field.dart';
|
||||||
import 'package:tallee/presentation/widgets/tiles/choose_tile.dart';
|
import 'package:tallee/presentation/widgets/tiles/choose_tile.dart';
|
||||||
@@ -175,15 +175,21 @@ class _CreateMatchViewState extends State<CreateMatchView> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Create or save button.
|
// Create or save button.
|
||||||
CustomWidthButton(
|
Padding(
|
||||||
text: buttonText,
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
sizeRelativeToWidth: 0.95,
|
child: AnimatedDialogButton(
|
||||||
|
buttonConstraints: const BoxConstraints(
|
||||||
|
minWidth: double.infinity,
|
||||||
|
minHeight: 50,
|
||||||
|
),
|
||||||
buttonType: ButtonType.primary,
|
buttonType: ButtonType.primary,
|
||||||
onPressed: isSubmitButtonEnabled()
|
onPressed: isSubmitButtonEnabled()
|
||||||
? () {
|
? () {
|
||||||
submitButtonNavigation(context);
|
submitButtonNavigation(context);
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
|
buttonText: buttonText,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
appBar: AppBar(title: Text(loc.create_teams)),
|
appBar: AppBar(title: Text(loc.create_teams)),
|
||||||
body: SafeArea(
|
body: Stack(
|
||||||
child: Column(
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
@@ -68,9 +68,7 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
|
|||||||
color: teams[index].color,
|
color: teams[index].color,
|
||||||
controller: nameController[index],
|
controller: nameController[index],
|
||||||
hintText: '${loc.team} ${index + 1}',
|
hintText: '${loc.team} ${index + 1}',
|
||||||
onDelete: teams.length <= 2
|
onDelete: teams.length <= 2 ? null : () => removeTeam(index),
|
||||||
? null
|
|
||||||
: () => removeTeam(index),
|
|
||||||
onColorSelection: (color) {
|
onColorSelection: (color) {
|
||||||
setState(() {
|
setState(() {
|
||||||
teams[index] = teams[index].copyWith(color: color);
|
teams[index] = teams[index].copyWith(color: color);
|
||||||
@@ -82,7 +80,9 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Button row
|
// Button row
|
||||||
Row(
|
Positioned(
|
||||||
|
bottom: MediaQuery.paddingOf(context).bottom + 20,
|
||||||
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
// Add new team
|
// Add new team
|
||||||
@@ -95,7 +95,7 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 15),
|
const SizedBox(width: 15),
|
||||||
|
|
||||||
// Confirm teams and continue with member assignment
|
// Confirm teams
|
||||||
MainMenuButton(
|
MainMenuButton(
|
||||||
icon: Icons.arrow_forward_sharp,
|
icon: Icons.arrow_forward_sharp,
|
||||||
onPressed: teams.length >= 2
|
onPressed: teams.length >= 2
|
||||||
@@ -115,8 +115,8 @@ class _CreateTeamsViewState extends State<CreateTeamsView> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class _ManageMembersViewState extends State<ManageMembersView> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: CustomTheme.backgroundColor,
|
backgroundColor: CustomTheme.backgroundColor,
|
||||||
appBar: AppBar(title: Text(loc.manage_members)),
|
appBar: AppBar(title: Text(loc.manage_members)),
|
||||||
body: SafeArea(
|
body: Stack(
|
||||||
child: Stack(
|
alignment: AlignmentDirectional.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ReorderableListView.builder(
|
child: ReorderableListView.builder(
|
||||||
@@ -86,10 +86,7 @@ class _ManageMembersViewState extends State<ManageMembersView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: MediaQuery.of(context).padding.bottom,
|
bottom: MediaQuery.of(context).padding.bottom + 20,
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
child: Center(
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -110,10 +107,8 @@ class _ManageMembersViewState extends State<ManageMembersView> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user