diff --git a/example/assets/code_snippets/combobox_multi_select.md b/example/assets/code_snippets/combobox_multi_select.md index cc7c4dca..944567f7 100644 --- a/example/assets/code_snippets/combobox_multi_select.md +++ b/example/assets/code_snippets/combobox_multi_select.md @@ -128,7 +128,6 @@ class _ComboboxMultiSelectState extends State { onTap: () => setState(() => _selectedOptions.clear()), child: MoonTag( tagSize: MoonTagSize.xs, - isUpperCase: false, backgroundColor: context.moonColors!.bulma, label: Text( "${_selectedOptions.keys.length}", diff --git a/example/assets/code_snippets/dropdown.md b/example/assets/code_snippets/dropdown.md index 036973d4..679e15f3 100644 --- a/example/assets/code_snippets/dropdown.md +++ b/example/assets/code_snippets/dropdown.md @@ -77,7 +77,6 @@ class _DropdownState extends State { ? Center( child: MoonTag( tagSize: MoonTagSize.xs, - isUpperCase: false, backgroundColor: context.moonColors!.bulma, onTap: () => setState(() => _availableChoices.updateAll((key, value) => false)), label: Text( diff --git a/example/lib/src/storybook/stories/composites/combobox_multi_select.dart b/example/lib/src/storybook/stories/composites/combobox_multi_select.dart index 67e9cccf..cb2e6cc3 100644 --- a/example/lib/src/storybook/stories/composites/combobox_multi_select.dart +++ b/example/lib/src/storybook/stories/composites/combobox_multi_select.dart @@ -226,7 +226,6 @@ class _ComboboxMultiSelectStoryState extends State { ? Center( child: MoonTag( tagSize: MoonTagSize.xs, - isUpperCase: false, backgroundColor: context.moonColors!.bulma, onTap: () => setState(() => _selectedOptions.clear()), label: Text( diff --git a/example/lib/src/storybook/stories/primitives/dropdown.dart b/example/lib/src/storybook/stories/primitives/dropdown.dart index c93b4536..8abb6f70 100644 --- a/example/lib/src/storybook/stories/primitives/dropdown.dart +++ b/example/lib/src/storybook/stories/primitives/dropdown.dart @@ -195,7 +195,6 @@ class _DropdownStoryState extends State { ? Center( child: MoonTag( tagSize: MoonTagSize.xs, - isUpperCase: false, backgroundColor: context.moonColors!.bulma, onTap: () => setState(() => _availableChoices.updateAll((key, value) => false)), label: Text( diff --git a/example/lib/src/storybook/stories/primitives/tag.dart b/example/lib/src/storybook/stories/primitives/tag.dart index 324d85c6..48ae79b3 100644 --- a/example/lib/src/storybook/stories/primitives/tag.dart +++ b/example/lib/src/storybook/stories/primitives/tag.dart @@ -85,11 +85,6 @@ 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), @@ -97,7 +92,6 @@ class TagStory extends StatelessWidget { borderRadius: borderRadiusKnob != null ? BorderRadius.circular(borderRadiusKnob.toDouble()) : null, onTap: () {}, tagSize: tagSizeKnob, - isUpperCase: setUpperCaseKnob, backgroundColor: backgroundColor, leading: showLeadingKnob ? Icon( @@ -107,7 +101,7 @@ class TagStory extends StatelessWidget { : null, label: showLabelKnob ? Text( - setUpperCaseKnob ? customLabelTextKnob.toUpperCase() : customLabelTextKnob, + customLabelTextKnob, style: TextStyle(color: textColor), ) : null, diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index a9bb1bfb..b0c7a249 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,8 +7,10 @@ import Foundation import package_info_plus import path_provider_foundation +import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/lib/src/theme/tag/tag_size_properties.dart b/lib/src/theme/tag/tag_size_properties.dart index 7b1b1f2c..298d3203 100644 --- a/lib/src/theme/tag/tag_size_properties.dart +++ b/lib/src/theme/tag/tag_size_properties.dart @@ -24,6 +24,9 @@ class MoonTagSizeProperties extends ThemeExtension with D final TextStyle textStyle; /// The upper case text style of the MoonTag. + @Deprecated( + "Handle upper case text style properly at place of usage. This property will be removed in 1.0.0 release.", + ) final TextStyle upperCaseTextStyle; const MoonTagSizeProperties({ @@ -33,6 +36,9 @@ class MoonTagSizeProperties extends ThemeExtension with D required this.iconSizeValue, required this.padding, required this.textStyle, + @Deprecated( + "Handle upper case text style properly at place of usage. This property will be removed in 1.0.0 release.", + ) required this.upperCaseTextStyle, }); @@ -53,6 +59,7 @@ class MoonTagSizeProperties extends ThemeExtension 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, ); } @@ -68,6 +75,7 @@ class MoonTagSizeProperties extends ThemeExtension 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)!, ); } @@ -83,6 +91,7 @@ class MoonTagSizeProperties extends ThemeExtension with D ..add(DoubleProperty("iconSizeValue", iconSizeValue)) ..add(DiagnosticsProperty("padding", padding)) ..add(DiagnosticsProperty("textStyle", textStyle)) + // ignore: deprecated_member_use_from_same_package ..add(DiagnosticsProperty("upperCaseTextStyle", upperCaseTextStyle)); } } diff --git a/lib/src/widgets/tag/tag.dart b/lib/src/widgets/tag/tag.dart index afe28f40..18b4c8fc 100644 --- a/lib/src/widgets/tag/tag.dart +++ b/lib/src/widgets/tag/tag.dart @@ -17,6 +17,9 @@ enum MoonTagSize { class MoonTag extends StatelessWidget { /// Whether to use the upper case text style for the tag. + @Deprecated( + "Handle upper case text style properly at place of usage. This property will be removed in 1.0.0 release.", + ) final bool isUpperCase; /// The border radius of the tag. @@ -64,7 +67,10 @@ class MoonTag extends StatelessWidget { /// Creates a Moon Design tag. const MoonTag({ super.key, - this.isUpperCase = true, + @Deprecated( + "Handle upper case text style properly at place of usage. This property will be removed in 1.0.0 release.", + ) + this.isUpperCase = false, this.borderRadius, this.backgroundColor, this.height, @@ -147,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(