From 9465fb90780df61fcf65ab70c00e2264e6807edd Mon Sep 17 00:00:00 2001 From: Damiano Ferrari Date: Sat, 11 May 2024 18:37:45 +0200 Subject: [PATCH] Color picker tweaks --- .../app/FlutterMultiDexApplication.java | 25 +++++++++++++++++++ lib/pages/settings_page.dart | 14 ++++++----- lib/utils/palette.dart | 8 +++--- 3 files changed, 37 insertions(+), 10 deletions(-) create mode 100644 android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java diff --git a/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 00000000..752fc185 --- /dev/null +++ b/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,25 @@ +// Generated file. +// +// If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. + +package io.flutter.app; + +import android.app.Application; +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link android.app.Application}, adding multidex support. + */ +public class FlutterMultiDexApplication extends Application { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 2cb057d3..bb98ca9d 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -492,12 +492,14 @@ class ColorPickerDialog extends ConsumerWidget { style: Theme.of(context).textTheme.titleMedium, ), const SizedBox(height: 4), - Palette( - initial: themeColor.colorTheme, - enabled: !themeColor.useDeviceColor, - onSelected: (color) => ref - .read(ThemeColorNotifier.provider.notifier) - .setColorTheme(color), + Center( + child: Palette( + initial: themeColor.colorTheme, + enabled: !themeColor.useDeviceColor, + onSelected: (color) => ref + .read(ThemeColorNotifier.provider.notifier) + .setColorTheme(color), + ), ) ], ), diff --git a/lib/utils/palette.dart b/lib/utils/palette.dart index b72fb636..e433a852 100644 --- a/lib/utils/palette.dart +++ b/lib/utils/palette.dart @@ -19,8 +19,8 @@ class _PaletteState extends State { Color? hoveredColor; late Color selectedColor; - static const double squareSize = 45; - static const double checkSize = 25; + static const double squareSize = 43; + static const double checkSize = 24; @override void initState() { @@ -31,8 +31,8 @@ class _PaletteState extends State { @override Widget build(BuildContext context) { final palette = Wrap( - spacing: 5, - runSpacing: 5, + spacing: 4, + runSpacing: 4, children: [ Colors.red, Colors.pink,