Skip to content

Commit

Permalink
update app theme color as the setting is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansen4857 committed Oct 6, 2023
1 parent 9db4062 commit 916b8e1
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions lib/widgets/dialogs/settings_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class _SettingsDialogState extends State<SettingsDialog> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text('Team Color:'),
const Text('Theme Color:'),
const SizedBox(height: 4),
SizedBox(
height: 48,
Expand All @@ -383,25 +383,29 @@ class _SettingsDialogState extends State<SettingsDialog> {
onPressed: () {
showDialog(
context: context,
barrierColor: Colors.transparent,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Pick Team Color'),
content: SingleChildScrollView(
child: ColorPicker(
pickerColor: _teamColor,
enableAlpha: false,
hexInputBar: true,
onColorChanged: (Color color) {
setState(() {
_teamColor = color;
});
},
title: const Text('Pick Theme Color'),
content: Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: SingleChildScrollView(
child: ColorPicker(
pickerColor: _teamColor,
enableAlpha: false,
hexInputBar: true,
onColorChanged: (Color color) {
setState(() {
_teamColor = color;
});
widget.onTeamColorChanged(_teamColor);
},
),
),
),
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
setState(() {
_teamColor = const Color(Defaults.teamColor);
widget.onTeamColorChanged(_teamColor);
Expand All @@ -410,11 +414,8 @@ class _SettingsDialogState extends State<SettingsDialog> {
child: const Text('Reset'),
),
TextButton(
onPressed: () {
Navigator.of(context).pop();
widget.onTeamColorChanged(_teamColor);
},
child: const Text('Confirm'),
onPressed: Navigator.of(context).pop,
child: const Text('Close'),
),
],
);
Expand Down

0 comments on commit 916b8e1

Please sign in to comment.