diff --git a/lib/app/accounts/account_form.dart b/lib/app/accounts/account_form.dart index f0a3c804..c3eeebea 100644 --- a/lib/app/accounts/account_form.dart +++ b/lib/app/accounts/account_form.dart @@ -248,7 +248,7 @@ class _AccountFormPageState extends State { size: 36, isOutline: true, outlineWidth: 1.5, - mainColor: _color.lighten(0.82), + mainColor: _color.lighten(IconDisplayer.darkLightenFactor), secondaryColor: _color, displayMode: IconDisplayMode.polygon, ), diff --git a/lib/app/categories/selectors/category_picker.dart b/lib/app/categories/selectors/category_picker.dart index e7c47ae7..799f534e 100644 --- a/lib/app/categories/selectors/category_picker.dart +++ b/lib/app/categories/selectors/category_picker.dart @@ -10,6 +10,7 @@ import 'package:monekin/core/models/category/category.dart'; import 'package:monekin/core/models/supported-icon/icon_displayer.dart'; import 'package:monekin/core/presentation/animations/animated_expanded.dart'; import 'package:monekin/core/presentation/app_colors.dart'; +import 'package:monekin/core/presentation/theme.dart'; import 'package:monekin/core/presentation/widgets/bottomSheetFooter.dart'; import 'package:monekin/core/presentation/widgets/modal_container.dart'; import 'package:monekin/core/presentation/widgets/scrollable_with_bottom_gradient.dart'; @@ -188,15 +189,11 @@ class _CategoryPickerState extends State { .copyWith(fontWeight: FontWeight.w700), ), ), + const SizedBox(height: 4), buildSubcategoryRow(context, subcategories) ], ), const SizedBox(height: 8), - const Divider( - thickness: 4, - endIndent: 16, - indent: 16, - ), ], ), ); @@ -219,6 +216,8 @@ class _CategoryPickerState extends State { SingleChildScrollView buildSubcategoryRow( BuildContext context, List? subcategories) { + final isDarkMode = isAppInDarkBrightness(context); + return SingleChildScrollView( physics: const BouncingScrollPhysics(), scrollDirection: Axis.horizontal, @@ -228,6 +227,15 @@ class _CategoryPickerState extends State { for (final subcat in subcategories ?? []) ...[ ChoiceChip.elevated( selected: selectedCategory?.id == subcat.id, + shape: RoundedRectangleBorder( + side: BorderSide( + color: selectedCategory?.id == subcat.id + ? ColorHex.get(selectedCategory!.color) + : ColorHex.get(selectedCategory!.color).lighten(), + width: 1.5, + ), + borderRadius: BorderRadius.circular(12), + ), label: Text( subcat.name, style: TextStyle( @@ -244,7 +252,8 @@ class _CategoryPickerState extends State { supportedIcon: subcat.icon, mainColor: selectedCategory?.id == subcat.id ? Colors.white - : ColorHex.get(subcat.color), + : ColorHex.get(subcat.color).lighten( + isDarkMode ? IconDisplayer.darkLightenFactor : 0), secondaryColor: Colors.transparent, padding: 0, ), diff --git a/lib/core/models/account/account.dart b/lib/core/models/account/account.dart index 8fc368ab..325df96e 100644 --- a/lib/core/models/account/account.dart +++ b/lib/core/models/account/account.dart @@ -95,8 +95,10 @@ class Account extends AccountInDB { return IconDisplayer( supportedIcon: icon, - mainColor: getComputedColor(context).lighten(isDark ? 0.82 : 0), - secondaryColor: getComputedColor(context).lighten(isDark ? 0 : 0.82), + mainColor: getComputedColor(context) + .lighten(isDark ? IconDisplayer.darkLightenFactor : 0), + secondaryColor: getComputedColor(context) + .lighten(isDark ? 0 : IconDisplayer.darkLightenFactor), displayMode: IconDisplayMode.polygon, size: size, borderRadius: 20, diff --git a/lib/core/models/supported-icon/icon_displayer.dart b/lib/core/models/supported-icon/icon_displayer.dart index e9d7de8d..1031d3ae 100644 --- a/lib/core/models/supported-icon/icon_displayer.dart +++ b/lib/core/models/supported-icon/icon_displayer.dart @@ -15,6 +15,8 @@ enum IconDisplayMode { @CopyWith() class IconDisplayer extends StatelessWidget { + static const darkLightenFactor = 0.82; + const IconDisplayer({ super.key, required this.mainColor, @@ -51,8 +53,10 @@ class IconDisplayer extends StatelessWidget { Color categoryColor = ColorHex.get(category.color); return IconDisplayer( - mainColor: isDark ? categoryColor.lighten(0.82) : categoryColor, - secondaryColor: isDark ? categoryColor : categoryColor.lighten(0.82), + mainColor: + categoryColor.lighten(isDark ? IconDisplayer.darkLightenFactor : 0), + secondaryColor: + categoryColor.lighten(isDark ? 0 : IconDisplayer.darkLightenFactor), supportedIcon: category.icon, isOutline: isOutline, borderRadius: borderRadius, @@ -86,7 +90,8 @@ class IconDisplayer extends StatelessWidget { @override Widget build(BuildContext context) { final calculatedPadding = padding ?? (size / (22 / 6)); - final secondaryColorInBuild = secondaryColor ?? mainColor.lighten(0.82); + final secondaryColorInBuild = + secondaryColor ?? mainColor.lighten(IconDisplayer.darkLightenFactor); final borderSide = BorderSide( width: isOutline ? outlineWidth : 0, diff --git a/pubspec.lock b/pubspec.lock index 8e010519..15fc81e5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -317,10 +317,10 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "824f5b9f389bfc4dddac3dea76cd70c51092d9dff0b2ece7ef4f53db8547d258" + sha256: "825aec673606875c33cd8d3c4083f1a3c3999015a84178b317b7ef396b7384f3" url: "https://pub.dev" source: hosted - version: "8.0.6" + version: "8.0.7" fixnum: dependency: transitive description: @@ -601,18 +601,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -649,18 +649,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -681,10 +681,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "4de6c36df77ffbcef0a5aefe04669d33f2d18397fea228277b852a2d4e58e860" + sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918 url: "https://pub.dev" source: hosted - version: "8.0.1" + version: "8.0.2" package_info_plus_platform_interface: dependency: transitive description: @@ -1038,10 +1038,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" timing: dependency: transitive description: @@ -1166,10 +1166,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.5" watcher: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d18740ac..79e11ddd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -13,7 +13,7 @@ publish_to: 'none' # The X represents the major releases, and can be up to infinity. Never start by a zero # The Y represents the minor releases, and can be up to 99. Always start by a zero # The Z represents the patch releases, and can be up to 999. Always start by a zero -version: 7.0.0+700000 +version: 7.0.1+700001 environment: flutter: 3.22.3 @@ -51,13 +51,13 @@ dependencies: permission_handler: ^11.3.0 json_annotation: ^4.8.1 fl_chart: ^0.68.0 - file_picker: ^8.0.3 + file_picker: ^8.0.7 share_plus: ^9.0.0 url_launcher: ^6.1.11 uuid: ^4.4.2 csv: ^6.0.0 dotted_border: ^2.0.0+3 - package_info_plus: ^8.0.1 + package_info_plus: ^8.0.2 introduction_screen: ^3.1.11 dynamic_color: ^1.7.0 copy_with_extension: ^5.0.4