From fbdf822354d596e7c2b735130644707f723329ed Mon Sep 17 00:00:00 2001 From: Efrain Date: Mon, 5 Apr 2021 21:13:17 -0500 Subject: [PATCH] [Presentation] Minor improvements --- .../materials/widgets/material_card.dart | 8 ++++++-- lib/presentation/shared/utils/toast_utils.dart | 8 ++++---- .../widgets/tierlist_row_color_picker.dart | 16 +++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/presentation/materials/widgets/material_card.dart b/lib/presentation/materials/widgets/material_card.dart index 8f8d6a1c9..ba95a7c86 100644 --- a/lib/presentation/materials/widgets/material_card.dart +++ b/lib/presentation/materials/widgets/material_card.dart @@ -135,7 +135,10 @@ class MaterialCard extends StatelessWidget { borderRadius: BorderRadius.circular(10), color: theme.accentColor.withOpacity(0.8), ), - child: Text(' - ${CurrencyUtils.formatNumber(usedQuantity)} '), + child: Text( + ' - ${CurrencyUtils.formatNumber(usedQuantity)} ', + style: theme.textTheme.subtitle2.copyWith(color: Colors.white), + ), ), ), ), @@ -146,7 +149,7 @@ class MaterialCard extends StatelessWidget { margin: const EdgeInsets.only(bottom: 5), child: Text( CurrencyUtils.formatNumber(quantity), - style: theme.textTheme.subtitle2, + style: theme.textTheme.subtitle2.copyWith(color: Colors.white), ), ), if (!withoutDetails && !isInQuantityMode) @@ -191,6 +194,7 @@ class MaterialCard extends StatelessWidget { builder: (_) => ItemQuantityDialog(quantity: quantity), ); + context.read().add(const ItemQuantityFormEvent.close()); if (newValue == null) { return; } diff --git a/lib/presentation/shared/utils/toast_utils.dart b/lib/presentation/shared/utils/toast_utils.dart index 9c46933c0..85494cef6 100644 --- a/lib/presentation/shared/utils/toast_utils.dart +++ b/lib/presentation/shared/utils/toast_utils.dart @@ -36,19 +36,19 @@ class ToastUtils { switch (type) { case ToastType.info: bgColor = Colors.blue; - icon = const Icon(Icons.info); + icon = const Icon(Icons.info, color: Colors.white); break; case ToastType.succeed: bgColor = Colors.green; - icon = const Icon(Icons.check); + icon = const Icon(Icons.check, color: Colors.white); break; case ToastType.warning: bgColor = Colors.orange; - icon = const Icon(Icons.warning); + icon = const Icon(Icons.warning, color: Colors.white); break; case ToastType.error: bgColor = Colors.red; - icon = const Icon(Icons.dangerous); + icon = const Icon(Icons.dangerous, color: Colors.white); break; default: throw Exception('Invalid toast type = $type'); diff --git a/lib/presentation/tierlist/widgets/tierlist_row_color_picker.dart b/lib/presentation/tierlist/widgets/tierlist_row_color_picker.dart index 3b4a89cec..dd6cd602a 100644 --- a/lib/presentation/tierlist/widgets/tierlist_row_color_picker.dart +++ b/lib/presentation/tierlist/widgets/tierlist_row_color_picker.dart @@ -23,15 +23,13 @@ class _TierListRowColorPickerState extends State { final s = S.of(context); return AlertDialog( title: Text(s.pickColor), - content: SingleChildScrollView( - child: BlockPicker( - pickerColor: widget.currentColor, - onColorChanged: (color) { - setState(() { - selectedColor = color; - }); - }, - ), + content: BlockPicker( + pickerColor: widget.currentColor, + onColorChanged: (color) { + setState(() { + selectedColor = color; + }); + }, ), actions: [ OutlineButton(