Skip to content

Commit

Permalink
Rename name to getName() because name overrides default Enum name pro…
Browse files Browse the repository at this point in the history
…perty we want to use.
  • Loading branch information
akiller authored and rydmike committed Oct 19, 2024
1 parent 19344e9 commit 4439d9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class ScaffoldBasePopupMenu extends StatelessWidget {
wrapWithDefaultLabel ? 'default ($resolvedLabel)' : resolvedLabel;

final String selectedLabel = enabled && value != null
? value?.name(isLight) ?? ''
? value?.getName(isLight) ?? ''
: effectiveDefaultLabel;

return Theme(
Expand Down Expand Up @@ -282,7 +282,7 @@ class ScaffoldBasePopupMenu extends StatelessWidget {
),
title: i <= 0
? Text(effectiveDefaultLabel, style: txtStyle)
: Text(FlexScaffoldBaseColor.values[i - 1].name(isLight),
: Text(FlexScaffoldBaseColor.values[i - 1].getName(isLight),
style: txtStyle),
),
)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/flex_color_scheme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ enum FlexScaffoldBaseColor {
}

/// Return the name of the enum value.
String name(bool isLight) {
String getName(bool isLight) {
switch (this) {
case FlexScaffoldBaseColor.lowestBase:
return isLight ? 'Lowest base (White)' : 'Lowest base (Black)';
Expand Down

0 comments on commit 4439d9b

Please sign in to comment.