Skip to content

Commit

Permalink
fix: 4335 - "check" icon for "done" details - instead of "edit"
Browse files Browse the repository at this point in the history
Impacted files:
* `add_new_product_helper.dart`: added a specific trailing icon in some cases
* `smooth_large_button_with_icon.dart`: fixed color bug
  • Loading branch information
monsieurtanuki committed Oct 27, 2023
1 parent 2d90250 commit f9f707d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SmoothLargeButtonWithIcon extends StatelessWidget {
final ThemeData themeData = Theme.of(context);
TextStyle style = textStyle ?? themeData.textTheme.bodyMedium!;

if (style.color == null) {
if (foregroundColor != null) {
style = style.copyWith(color: _getForegroundColor(themeData));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ class AddNewProductButton extends StatelessWidget {
this.iconData,
this.onPressed, {
required this.done,
this.trailingIconData,
});

final String label;
final IconData iconData;
final VoidCallback? onPressed;
final bool done;
final IconData? trailingIconData;

static const IconData doneIconData = Icons.check;
static const IconData todoIconData = Icons.add;
Expand All @@ -95,7 +97,7 @@ class AddNewProductButton extends StatelessWidget {
text: label,
icon: iconData,
onPressed: onPressed,
trailing: Icons.edit,
trailing: trailingIconData ?? Icons.edit,
backgroundColor: onPressed == null
? (dark ? darkGrey : lightGrey)
: done
Expand Down Expand Up @@ -144,6 +146,7 @@ class AddNewProductEditorButton extends StatelessWidget {
isLoggedInMandatory: isLoggedInMandatory,
),
done: done,
trailingIconData: done ? AddNewProductButton.doneIconData : null,
);
}
}
Expand Down

0 comments on commit f9f707d

Please sign in to comment.