Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kypsis committed May 14, 2024
1 parent e63e483 commit 5535328
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ class _ComboboxMultiSelectStoryState extends State<ComboboxMultiSelectStory> {
? Center(
child: MoonTag(
tagSize: MoonTagSize.xs,
isUpperCase: false,
backgroundColor: context.moonColors!.bulma,
onTap: () => setState(() => _selectedOptions.clear()),
label: Text(
Expand Down
1 change: 0 additions & 1 deletion example/lib/src/storybook/stories/primitives/dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ class _DropdownStoryState extends State<DropdownStory> {
? Center(
child: MoonTag(
tagSize: MoonTagSize.xs,
isUpperCase: false,
backgroundColor: context.moonColors!.bulma,
onTap: () => setState(() => _availableChoices.updateAll((key, value) => false)),
label: Text(
Expand Down
8 changes: 1 addition & 7 deletions example/lib/src/storybook/stories/primitives/tag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,13 @@ class TagStory extends StatelessWidget {
initial: true,
);

final setUpperCaseKnob = context.knobs.boolean(
label: "isUpperCase",
description: "Use upper case text for MoonTag.",
);

return Center(
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(vertical: 64.0, horizontal: 16.0),
child: MoonTag(
borderRadius: borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null,
onTap: () {},
tagSize: tagSizeKnob,
isUpperCase: setUpperCaseKnob,
backgroundColor: backgroundColor,
leading: showLeadingKnob
? Icon(
Expand All @@ -107,7 +101,7 @@ class TagStory extends StatelessWidget {
: null,
label: showLabelKnob
? Text(
setUpperCaseKnob ? customLabelTextKnob.toUpperCase() : customLabelTextKnob,
customLabelTextKnob,
style: TextStyle(color: textColor),
)
: null,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/theme/tag/tag_size_properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class MoonTagSizeProperties extends ThemeExtension<MoonTagSizeProperties> with D
iconSizeValue: iconSizeValue ?? this.iconSizeValue,
padding: padding ?? this.padding,
textStyle: textStyle ?? this.textStyle,
// ignore: deprecated_member_use_from_same_package
upperCaseTextStyle: upperCaseTextStyle ?? this.upperCaseTextStyle,
);
}
Expand All @@ -74,6 +75,7 @@ class MoonTagSizeProperties extends ThemeExtension<MoonTagSizeProperties> with D
iconSizeValue: lerpDouble(iconSizeValue, other.iconSizeValue, t)!,
padding: EdgeInsetsGeometry.lerp(padding, other.padding, t)!,
textStyle: TextStyle.lerp(textStyle, other.textStyle, t)!,
// ignore: deprecated_member_use_from_same_package
upperCaseTextStyle: TextStyle.lerp(upperCaseTextStyle, other.upperCaseTextStyle, t)!,
);
}
Expand All @@ -89,6 +91,7 @@ class MoonTagSizeProperties extends ThemeExtension<MoonTagSizeProperties> with D
..add(DoubleProperty("iconSizeValue", iconSizeValue))
..add(DiagnosticsProperty<EdgeInsetsGeometry>("padding", padding))
..add(DiagnosticsProperty<TextStyle>("textStyle", textStyle))
// ignore: deprecated_member_use_from_same_package
..add(DiagnosticsProperty<TextStyle>("upperCaseTextStyle", upperCaseTextStyle));
}
}
4 changes: 3 additions & 1 deletion lib/src/widgets/tag/tag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MoonTag extends StatelessWidget {
@Deprecated(
"Handle upper case text style properly at place of usage. This property will be removed in 1.0.0 release.",
)
this.isUpperCase = true,
this.isUpperCase = false,
this.borderRadius,
this.backgroundColor,
this.height,
Expand Down Expand Up @@ -153,7 +153,9 @@ class MoonTag extends StatelessWidget {
size: effectiveMoonTagSize.iconSizeValue,
),
child: DefaultTextStyle(
// ignore: deprecated_member_use_from_same_package
style: isUpperCase
// ignore: deprecated_member_use_from_same_package
? effectiveMoonTagSize.upperCaseTextStyle.copyWith(color: effectiveTextColor)
: effectiveMoonTagSize.textStyle.copyWith(color: effectiveTextColor),
child: Row(
Expand Down

0 comments on commit 5535328

Please sign in to comment.