diff --git a/example/assets/code_snippets/accordion.md b/example/assets/code_snippets/accordion.md index eea4d005..34cbec82 100644 --- a/example/assets/code_snippets/accordion.md +++ b/example/assets/code_snippets/accordion.md @@ -33,7 +33,7 @@ class _AccordionState extends State { () => _currentlyOpenAccordionItem = value, ), leading: const Icon(MoonIcons.other_frame_24_light), - title: const Text("Grouped MoonAccordion item #1"), + label: const Text("Grouped MoonAccordion item #1"), children: const [ Text(contentText), ], @@ -50,7 +50,7 @@ class _AccordionState extends State { () => _currentlyOpenAccordionItem = value, ), leading: const Icon(MoonIcons.other_frame_24_light), - title: const Text("Grouped MoonAccordion item #2"), + label: const Text("Grouped MoonAccordion item #2"), children: const [ Text(contentText), ], diff --git a/example/assets/code_snippets/alert.md b/example/assets/code_snippets/alert.md index ba4f8961..34d0a9d9 100644 --- a/example/assets/code_snippets/alert.md +++ b/example/assets/code_snippets/alert.md @@ -11,20 +11,20 @@ class Alert extends StatelessWidget { MoonAlert( show: true, leading: const Icon(MoonIcons.other_frame_24_light), - title: const Text("Base MoonAlert"), + label: const Text("Base MoonAlert"), trailing: MoonButton.icon( buttonSize: MoonButtonSize.xs, onTap: () => {}, icon: const Icon(MoonIcons.controls_close_24_light), ), - body: const Text("Here goes MoonAlert body"), + content: const Text("Here goes MoonAlert content"), ), MoonAlert.filled( show: true, color: context.moonColors!.chichi, backgroundColor: context.moonColors!.chichi10, leading: const Icon(MoonIcons.notifications_alert_24_light), - title: const Text("Filled error MoonAlert"), + label: const Text("Filled error MoonAlert"), trailing: MoonButton.icon( buttonSize: MoonButtonSize.xs, onTap: () {}, @@ -39,7 +39,7 @@ class Alert extends StatelessWidget { color: context.moonColors!.roshi, borderColor: context.moonColors!.roshi, leading: const Icon(MoonIcons.generic_check_rounded_24_light), - title: const Text("Outlined success MoonAlert"), + label: const Text("Outlined success MoonAlert"), trailing: MoonButton.icon( buttonSize: MoonButtonSize.xs, onTap: () {}, diff --git a/example/assets/code_snippets/dropdown.md b/example/assets/code_snippets/dropdown.md index 5c2029e9..222a7c5e 100644 --- a/example/assets/code_snippets/dropdown.md +++ b/example/assets/code_snippets/dropdown.md @@ -99,7 +99,7 @@ class _DropdownState extends State { _buttonName = "Piccolo"; _buttonColor = context.moonColors!.piccolo; }), - title: const Text("Piccolo"), + label: const Text("Piccolo"), ), MoonDropdown( show: _showMenuInner, @@ -117,7 +117,7 @@ class _DropdownState extends State { _buttonName = "Roshi"; _buttonColor = context.moonColors!.roshi; }), - title: const Text("Roshi"), + label: const Text("Roshi"), ), MoonMenuItem( onTap: () => setState(() { @@ -126,7 +126,7 @@ class _DropdownState extends State { _buttonName = "Roshi60"; _buttonColor = context.moonColors!.roshi60; }), - title: const Text("Roshi60"), + label: const Text("Roshi60"), ), MoonMenuItem( onTap: () => setState(() { @@ -135,14 +135,14 @@ class _DropdownState extends State { _buttonName = "Roshi10"; _buttonColor = context.moonColors!.roshi10; }), - title: const Text("Roshi10"), + label: const Text("Roshi10"), ), ], ), child: MoonMenuItem( backgroundColor: _showMenuInner ? context.moonColors!.heles : null, onTap: () => setState(() => _showMenuInner = !_showMenuInner), - title: const Text("Roshi"), + label: const Text("Roshi"), trailing: const Icon( MoonIcons.controls_chevron_right_16_light, size: 16, diff --git a/example/assets/code_snippets/menu_item.md b/example/assets/code_snippets/menu_item.md index 3806efe2..00f324c0 100644 --- a/example/assets/code_snippets/menu_item.md +++ b/example/assets/code_snippets/menu_item.md @@ -13,7 +13,7 @@ class _MenuItemState extends State { Widget build(BuildContext context) { return MoonMenuItem( onTap: () {}, - title: const Text("Menu Item"), + label: const Text("Menu Item"), leading: const Icon(MoonIcons.notifications_activity_32_regular), trailing: const Icon(MoonIcons.controls_chevron_right_24_light), ); diff --git a/example/assets/code_snippets/toast.md b/example/assets/code_snippets/toast.md index db6311f4..4b28628a 100644 --- a/example/assets/code_snippets/toast.md +++ b/example/assets/code_snippets/toast.md @@ -9,7 +9,7 @@ class Toast extends StatelessWidget { return MoonFilledButton( onTap: () => MoonToast.show( context, - title: const Text('This is MoonToast'), + label: const Text('This is MoonToast'), ), label: const Text("Show toast"), ); diff --git a/example/lib/src/storybook/stories/accordion.dart b/example/lib/src/storybook/stories/accordion.dart index 3cacac44..a667777b 100644 --- a/example/lib/src/storybook/stories/accordion.dart +++ b/example/lib/src/storybook/stories/accordion.dart @@ -190,7 +190,7 @@ class _AccordionStoryState extends State { childrenPadding: const EdgeInsets.all(12), onExpansionChanged: (AccordionItems? value) => setState(() => _currentlyOpenAccordionItem = value), leading: const Icon(MoonIcons.other_frame_24_light), - title: const Text("Grouped MoonAccordion item #1"), + label: const Text("Grouped MoonAccordion item #1"), children: [ Text( contentText, @@ -218,7 +218,7 @@ class _AccordionStoryState extends State { childrenPadding: const EdgeInsets.all(12), onExpansionChanged: (AccordionItems? value) => setState(() => _currentlyOpenAccordionItem = value), leading: const Icon(MoonIcons.other_frame_24_light), - title: const Text("Grouped MoonAccordion item #2"), + label: const Text("Grouped MoonAccordion item #2"), children: [ Text( contentText, @@ -242,7 +242,7 @@ class _AccordionStoryState extends State { showBorder: showBorderKnob, shadows: showShadowKnob == true ? null : [], childrenPadding: const EdgeInsets.symmetric(vertical: 12), - title: const Text("Ungrouped MoonAccordion item #1"), + label: const Text("Ungrouped MoonAccordion item #1"), children: [ Text( contentText, @@ -266,7 +266,7 @@ class _AccordionStoryState extends State { showBorder: showBorderKnob, shadows: showShadowKnob == true ? null : [], childrenPadding: const EdgeInsets.symmetric(vertical: 12), - title: const Text("Ungrouped MoonAccordion item #2"), + label: const Text("Ungrouped MoonAccordion item #2"), children: [ Text( contentText, diff --git a/example/lib/src/storybook/stories/alert.dart b/example/lib/src/storybook/stories/alert.dart index bcc4fe76..efbab361 100644 --- a/example/lib/src/storybook/stories/alert.dart +++ b/example/lib/src/storybook/stories/alert.dart @@ -29,16 +29,16 @@ class _AlertStoryState extends State { final leadingColor = colorTable(context)[leadingColorKnob ?? 40]; - final titleColorKnob = context.knobs.nullable.options( - label: "Title color", - description: "MoonColors variants for MoonAlert title slot.", + final labelColorKnob = context.knobs.nullable.options( + label: "Label color", + description: "MoonColors variants for MoonAlert label slot.", enabled: false, initial: 0, // piccolo options: colorOptions, ); - final titleColor = colorTable(context)[titleColorKnob ?? 40]; + final labelColor = colorTable(context)[labelColorKnob ?? 40]; final trailingColorKnob = context.knobs.nullable.options( label: "Trailing color", @@ -51,16 +51,16 @@ class _AlertStoryState extends State { final trailingColor = colorTable(context)[trailingColorKnob ?? 40]; - final bodyColorKnob = context.knobs.nullable.options( - label: "Body color", - description: "MoonColors variants for MoonAlert body slot.", + final contentColorKnob = context.knobs.nullable.options( + label: "Content color", + description: "MoonColors variants for MoonAlert content slot.", enabled: false, initial: 0, // piccolo options: colorOptions, ); - final bodyColor = colorTable(context)[bodyColorKnob ?? 40]; + final contentColor = colorTable(context)[contentColorKnob ?? 40]; final backgroundColorKnob = context.knobs.nullable.options( label: "backgroundColor", @@ -103,9 +103,9 @@ class _AlertStoryState extends State { initial: true, ); - final showBodyKnob = context.knobs.boolean( - label: "body", - description: "Show widget in MoonAlert body slot.", + final showContentKnob = context.knobs.boolean( + label: "content", + description: "Show widget in MoonAlert content slot.", ); final showTrailingKnob = context.knobs.boolean( @@ -146,13 +146,13 @@ class _AlertStoryState extends State { color: leadingColor, ) : null, - title: SizedBox( + label: SizedBox( height: 24, child: Align( alignment: AlignmentDirectional.centerStart, child: Text( "Base MoonAlert", - style: TextStyle(color: titleColor), + style: TextStyle(color: labelColor), ), ), ), @@ -170,14 +170,14 @@ class _AlertStoryState extends State { onTap: showDisabledKnob ? null : () => setState(() => _showAlert = !_showAlert), ) : null, - body: showBodyKnob + content: showContentKnob ? SizedBox( height: 24, child: Align( alignment: AlignmentDirectional.centerStart, child: Text( - "Here goes MoonAlert body", - style: TextStyle(color: bodyColor), + "Here goes MoonAlert content", + style: TextStyle(color: contentColor), ), ), ) @@ -198,7 +198,7 @@ class _AlertStoryState extends State { backgroundColor: context.moonColors!.chichi10, borderRadius: borderRadius, leading: showLeadingKnob ? const Icon(MoonIcons.notifications_alert_24_light) : null, - title: const Text("Filled error MoonAlert"), + label: const Text("Filled error MoonAlert"), trailing: MoonButton.icon( buttonSize: MoonButtonSize.xs, borderRadius: borderRadius, @@ -210,12 +210,12 @@ class _AlertStoryState extends State { color: context.moonColors!.chichi, ), ), - body: showBodyKnob + content: showContentKnob ? const SizedBox( height: 24, child: Align( alignment: AlignmentDirectional.centerStart, - child: Text("Here goes MoonAlert body"), + child: Text("Here goes MoonAlert content"), ), ) : null, @@ -227,7 +227,7 @@ class _AlertStoryState extends State { backgroundColor: context.moonColors!.krillin10, borderRadius: borderRadius, leading: showLeadingKnob ? const Icon(MoonIcons.generic_alarm_round_24_light) : null, - title: const Text("Filled warning MoonAlert"), + label: const Text("Filled warning MoonAlert"), trailing: MoonButton.icon( buttonSize: MoonButtonSize.xs, borderRadius: borderRadius, @@ -239,12 +239,12 @@ class _AlertStoryState extends State { color: context.moonColors!.krillin, ), ), - body: showBodyKnob + content: showContentKnob ? const SizedBox( height: 24, child: Align( alignment: AlignmentDirectional.centerStart, - child: Text("Here goes MoonAlert body"), + child: Text("Here goes MoonAlert content"), ), ) : null, @@ -256,7 +256,7 @@ class _AlertStoryState extends State { borderColor: context.moonColors!.roshi, borderRadius: borderRadius, leading: showLeadingKnob ? const Icon(MoonIcons.generic_check_rounded_24_light) : null, - title: const Text("Outlined success MoonAlert"), + label: const Text("Outlined success MoonAlert"), trailing: MoonButton.icon( buttonSize: MoonButtonSize.xs, borderRadius: borderRadius, @@ -268,12 +268,12 @@ class _AlertStoryState extends State { color: context.moonColors!.roshi, ), ), - body: showBodyKnob + content: showContentKnob ? const SizedBox( height: 24, child: Align( alignment: AlignmentDirectional.centerStart, - child: Text("Here goes MoonAlert body"), + child: Text("Here goes MoonAlert content"), ), ) : null, @@ -285,7 +285,7 @@ class _AlertStoryState extends State { borderColor: context.moonColors!.whis, borderRadius: borderRadius, leading: showLeadingKnob ? const Icon(MoonIcons.notifications_alert_24_light) : null, - title: const Text('Outlined info MoonAlert'), + label: const Text('Outlined info MoonAlert'), trailing: MoonButton.icon( buttonSize: MoonButtonSize.xs, borderRadius: borderRadius, @@ -297,12 +297,12 @@ class _AlertStoryState extends State { color: context.moonColors!.whis, ), ), - body: showBodyKnob + content: showContentKnob ? const SizedBox( height: 24, child: Align( alignment: AlignmentDirectional.centerStart, - child: Text("Here goes MoonAlert body"), + child: Text("Here goes MoonAlert content"), ), ) : null, diff --git a/example/lib/src/storybook/stories/dropdown.dart b/example/lib/src/storybook/stories/dropdown.dart index b1d41759..23ce55d0 100644 --- a/example/lib/src/storybook/stories/dropdown.dart +++ b/example/lib/src/storybook/stories/dropdown.dart @@ -208,7 +208,7 @@ class _DropdownStoryState extends State { content: Column( children: [ MoonMenuItem( - title: const Text("Piccolo"), + label: const Text("Piccolo"), borderRadius: const MoonSquircleBorderRadius.all(MoonSquircleRadius(cornerRadius: 12)), onTap: () => setState(() { _showMenu = false; @@ -218,7 +218,7 @@ class _DropdownStoryState extends State { ), const SizedBox(height: 4), MoonMenuItem( - title: const Text("Krillin"), + label: const Text("Krillin"), borderRadius: const MoonSquircleBorderRadius.all(MoonSquircleRadius(cornerRadius: 12)), onTap: () => setState(() { _showMenu = false; @@ -240,7 +240,7 @@ class _DropdownStoryState extends State { content: Column( children: [ MoonMenuItem( - title: const Text("Roshi100"), + label: const Text("Roshi100"), borderRadius: const MoonSquircleBorderRadius.all(MoonSquircleRadius(cornerRadius: 12)), onTap: () => setState(() { _showMenu = false; @@ -251,7 +251,7 @@ class _DropdownStoryState extends State { ), const SizedBox(height: 4), MoonMenuItem( - title: const Text("Roshi60"), + label: const Text("Roshi60"), borderRadius: const MoonSquircleBorderRadius.all(MoonSquircleRadius(cornerRadius: 12)), onTap: () => setState(() { _showMenu = false; @@ -262,7 +262,7 @@ class _DropdownStoryState extends State { ), const SizedBox(height: 4), MoonMenuItem( - title: const Text("Roshi10"), + label: const Text("Roshi10"), borderRadius: const MoonSquircleBorderRadius.all(MoonSquircleRadius(cornerRadius: 12)), onTap: () => setState(() { _showMenu = false; @@ -275,7 +275,7 @@ class _DropdownStoryState extends State { ), child: MoonMenuItem( backgroundColor: _showMenuInner ? context.moonColors!.heles : null, - title: const Text("Roshi"), + label: const Text("Roshi"), borderRadius: const MoonSquircleBorderRadius.all(MoonSquircleRadius(cornerRadius: 12)), onTap: () => setState(() { _showMenuInner = !_showMenuInner; diff --git a/example/lib/src/storybook/stories/menu_item.dart b/example/lib/src/storybook/stories/menu_item.dart index ab1f9570..65120ea3 100644 --- a/example/lib/src/storybook/stories/menu_item.dart +++ b/example/lib/src/storybook/stories/menu_item.dart @@ -34,27 +34,27 @@ class _MenuItemStoryState extends State { final leadingColor = colorTable(context)[leadingColorKnob ?? 40]; - final titleColorKnob = context.knobs.nullable.options( - label: "Title color", - description: "MoonColors variants for MoonMenuItem title slot.", + final labelColorKnob = context.knobs.nullable.options( + label: "Label color", + description: "MoonColors variants for MoonMenuItem label slot.", enabled: false, initial: 0, // piccolo options: colorOptions, ); - final titleTextColor = colorTable(context)[titleColorKnob ?? 40]; + final labelTextColor = colorTable(context)[labelColorKnob ?? 40]; - final descriptionTextColorKnob = context.knobs.nullable.options( - label: "Description color", - description: "MoonColors variants for MoonMenuItem description slot.", + final contentTextColorKnob = context.knobs.nullable.options( + label: "Content color", + description: "MoonColors variants for MoonMenuItem content slot.", enabled: false, initial: 0, // piccolo options: colorOptions, ); - final descriptionTextColor = colorTable(context)[descriptionTextColorKnob ?? 40]; + final contentTextColor = colorTable(context)[contentTextColorKnob ?? 40]; final trailingColorKnob = context.knobs.nullable.options( label: "Trailing color", @@ -92,9 +92,9 @@ class _MenuItemStoryState extends State { initial: true, ); - final showDescriptionKnob = context.knobs.boolean( - label: "description", - description: "Show widget in MoonMenuItem description slot.", + final showContentKnob = context.knobs.boolean( + label: "content", + description: "Show widget in MoonMenuItem content slot.", initial: true, ); @@ -125,14 +125,14 @@ class _MenuItemStoryState extends State { MoonMenuItem( borderRadius: borderRadius, backgroundColor: backgroundColor, - title: Text( + label: Text( "Multi-line menu item", - style: TextStyle(color: titleTextColor), + style: TextStyle(color: labelTextColor), ), - description: showDescriptionKnob + content: showContentKnob ? Text( - "Multi-line default description field as an example for menu item component.", - style: TextStyle(color: descriptionTextColor), + "Multi-line default content field as an example for menu item component.", + style: TextStyle(color: contentTextColor), ) : null, leading: showLeadingKnob @@ -155,14 +155,14 @@ class _MenuItemStoryState extends State { MoonMenuItem( backgroundColor: backgroundColor, borderRadius: borderRadius, - title: Text( + label: Text( "One-line menu item", - style: TextStyle(color: titleTextColor), + style: TextStyle(color: labelTextColor), ), - description: showDescriptionKnob + content: showContentKnob ? Text( - 'One-line description field example', - style: TextStyle(color: descriptionTextColor), + 'One-line content field example', + style: TextStyle(color: contentTextColor), ) : null, leading: showLeadingKnob @@ -185,9 +185,9 @@ class _MenuItemStoryState extends State { MoonMenuItem( borderRadius: borderRadius, backgroundColor: backgroundColor, - title: Text( + label: Text( "Menu item with MoonCheckbox", - style: TextStyle(color: titleTextColor), + style: TextStyle(color: labelTextColor), ), leading: showLeadingKnob ? Icon( @@ -208,9 +208,9 @@ class _MenuItemStoryState extends State { MoonMenuItem( borderRadius: borderRadius, backgroundColor: backgroundColor, - title: Text( + label: Text( "Menu item with MoonSwitch", - style: TextStyle(color: titleTextColor), + style: TextStyle(color: labelTextColor), ), leading: showLeadingKnob ? Icon( @@ -237,10 +237,10 @@ class _MenuItemStoryState extends State { iconColor: trailingColor, backgroundColor: backgroundColor ?? Colors.transparent, expandedBackgroundColor: backgroundColor ?? context.moonColors!.heles, - title: Text( + label: Text( 'Expandable menu item', style: context.moonTypography!.body.textDefault.copyWith( - color: titleTextColor, + color: labelTextColor, fontWeight: FontWeight.w400, ), ), @@ -257,9 +257,9 @@ class _MenuItemStoryState extends State { MoonMenuItem( backgroundColor: backgroundColor, borderRadius: borderRadius, - title: Text( + label: Text( "Menu item 1 with MoonRadio", - style: TextStyle(color: titleTextColor), + style: TextStyle(color: labelTextColor), ), leading: showLeadingKnob ? MoonRadio( @@ -282,9 +282,9 @@ class _MenuItemStoryState extends State { MoonMenuItem( backgroundColor: backgroundColor, borderRadius: borderRadius, - title: Text( + label: Text( "Menu item 2 with MoonRadio", - style: TextStyle(color: titleTextColor), + style: TextStyle(color: labelTextColor), ), leading: showLeadingKnob ? MoonRadio( diff --git a/example/lib/src/storybook/stories/table.dart b/example/lib/src/storybook/stories/table.dart index 4473fbce..4719e183 100644 --- a/example/lib/src/storybook/stories/table.dart +++ b/example/lib/src/storybook/stories/table.dart @@ -48,7 +48,6 @@ class _TableStoryState extends State { lastName: 'Subject$index', age: Random().nextInt(81), activity: Random().nextInt(100), - colStickyTitle: 'Sticky title $index', ), ); } @@ -320,7 +319,7 @@ class _TableStoryState extends State { final rowGapKnob = context.knobs.nullable.sliderInt( label: "rowGap", - description: "Row gap between MoonTable rows.", + description: "Gap between MoonTable rows.", enabled: false, initial: 4, max: 16, @@ -416,7 +415,6 @@ class _TableData { String lastName; int age; int activity; - String colStickyTitle; _TableData({ required this.selected, @@ -425,6 +423,5 @@ class _TableData { required this.lastName, required this.age, required this.activity, - required this.colStickyTitle, }); } diff --git a/example/lib/src/storybook/stories/toast.dart b/example/lib/src/storybook/stories/toast.dart index 1c32db24..d73b6824 100644 --- a/example/lib/src/storybook/stories/toast.dart +++ b/example/lib/src/storybook/stories/toast.dart @@ -114,9 +114,9 @@ class ToastStory extends StatelessWidget { initial: true, ); - final showBodyKnob = context.knobs.boolean( - label: "body", - description: "Show widget in MoonToast body slot.", + final showContentKnob = context.knobs.boolean( + label: "content", + description: "Show widget in MoonToast content slot.", ); return Center( @@ -141,7 +141,7 @@ class ToastStory extends StatelessWidget { MoonIcons.generic_info_24_light, color: iconColor, ), - title: Text( + label: Text( customLabelTextKnob, style: TextStyle(color: textColor), ), @@ -149,11 +149,11 @@ class ToastStory extends StatelessWidget { MoonIcons.generic_star_24_light, color: iconColor, ), - body: showBodyKnob + content: showContentKnob ? Align( alignment: AlignmentDirectional.centerStart, child: Text( - "Here goes MoonToast body", + "Here goes MoonToast content", style: TextStyle(color: textColor), ), ) diff --git a/lib/src/theme/accordion/accordion_size_properties.dart b/lib/src/theme/accordion/accordion_size_properties.dart index 1fb7f5ff..4b2dea22 100644 --- a/lib/src/theme/accordion/accordion_size_properties.dart +++ b/lib/src/theme/accordion/accordion_size_properties.dart @@ -14,7 +14,7 @@ class MoonAccordionSizeProperties extends ThemeExtension with Diagn /// Border radius for alert. final BorderRadiusGeometry borderRadius; - /// Horizontal space between alert leading, trailing and title. + /// Horizontal space between alert leading, trailing and label. final double horizontalGap; /// Alert Widget minimum height. @@ -26,11 +26,11 @@ class MoonAlertProperties extends ThemeExtension with Diagn /// Alert padding. final EdgeInsetsGeometry padding; - /// Alert body text style. - final TextStyle bodyTextStyle; + /// Alert content text style. + final TextStyle contentTextStyle; - /// Alert title text style. - final TextStyle titleTextStyle; + /// Alert label text style. + final TextStyle labelTextStyle; const MoonAlertProperties({ required this.borderRadius, @@ -40,8 +40,8 @@ class MoonAlertProperties extends ThemeExtension with Diagn required this.transitionDuration, required this.transitionCurve, required this.padding, - required this.bodyTextStyle, - required this.titleTextStyle, + required this.contentTextStyle, + required this.labelTextStyle, }); @override @@ -53,8 +53,8 @@ class MoonAlertProperties extends ThemeExtension with Diagn Duration? transitionDuration, Curve? transitionCurve, EdgeInsetsGeometry? padding, - TextStyle? bodyTextStyle, - TextStyle? titleTextStyle, + TextStyle? contentTextStyle, + TextStyle? labelTextStyle, }) { return MoonAlertProperties( borderRadius: borderRadius ?? this.borderRadius, @@ -64,8 +64,8 @@ class MoonAlertProperties extends ThemeExtension with Diagn transitionDuration: transitionDuration ?? this.transitionDuration, transitionCurve: transitionCurve ?? this.transitionCurve, padding: padding ?? this.padding, - bodyTextStyle: bodyTextStyle ?? this.bodyTextStyle, - titleTextStyle: titleTextStyle ?? this.titleTextStyle, + contentTextStyle: contentTextStyle ?? this.contentTextStyle, + labelTextStyle: labelTextStyle ?? this.labelTextStyle, ); } @@ -81,8 +81,8 @@ class MoonAlertProperties extends ThemeExtension with Diagn transitionDuration: lerpDuration(transitionDuration, other.transitionDuration, t), transitionCurve: other.transitionCurve, padding: EdgeInsetsGeometry.lerp(padding, other.padding, t)!, - bodyTextStyle: TextStyle.lerp(bodyTextStyle, other.bodyTextStyle, t)!, - titleTextStyle: TextStyle.lerp(titleTextStyle, other.titleTextStyle, t)!, + contentTextStyle: TextStyle.lerp(contentTextStyle, other.contentTextStyle, t)!, + labelTextStyle: TextStyle.lerp(labelTextStyle, other.labelTextStyle, t)!, ); } @@ -98,7 +98,7 @@ class MoonAlertProperties extends ThemeExtension with Diagn ..add(DiagnosticsProperty("transitionDuration", transitionDuration)) ..add(DiagnosticsProperty("transitionCurve", transitionCurve)) ..add(DiagnosticsProperty("padding", padding)) - ..add(DiagnosticsProperty("bodyTextStyle", bodyTextStyle)) - ..add(DiagnosticsProperty("titleTextStyle", titleTextStyle)); + ..add(DiagnosticsProperty("contentTextStyle", contentTextStyle)) + ..add(DiagnosticsProperty("labelTextStyle", labelTextStyle)); } } diff --git a/lib/src/theme/alert/alert_theme.dart b/lib/src/theme/alert/alert_theme.dart index 388b6ee8..17e3a137 100644 --- a/lib/src/theme/alert/alert_theme.dart +++ b/lib/src/theme/alert/alert_theme.dart @@ -36,8 +36,8 @@ class MoonAlertTheme extends ThemeExtension with DiagnosticableT transitionDuration: tokens.transitions.defaultTransitionDuration, transitionCurve: tokens.transitions.defaultTransitionCurve, padding: EdgeInsets.all(tokens.sizes.x2s), - bodyTextStyle: tokens.typography.body.textDefault, - titleTextStyle: tokens.typography.heading.textDefault, + contentTextStyle: tokens.typography.body.textDefault, + labelTextStyle: tokens.typography.heading.textDefault, ); @override diff --git a/lib/src/theme/menu_item/menu_item_colors.dart b/lib/src/theme/menu_item/menu_item_colors.dart index 64ffca2a..24e06fc0 100644 --- a/lib/src/theme/menu_item/menu_item_colors.dart +++ b/lib/src/theme/menu_item/menu_item_colors.dart @@ -14,18 +14,18 @@ class MoonMenuItemColors extends ThemeExtension with Diagnos /// MenuItem icon color. final Color iconColor; - /// MenuItem title text color. - final Color titleTextColor; + /// MenuItem label text color. + final Color labelTextColor; - /// MenuItem description text color. - final Color descriptionTextColor; + /// MenuItem content text color. + final Color contentTextColor; const MoonMenuItemColors({ required this.backgroundColor, required this.dividerColor, required this.iconColor, - required this.titleTextColor, - required this.descriptionTextColor, + required this.labelTextColor, + required this.contentTextColor, }); @override @@ -33,15 +33,15 @@ class MoonMenuItemColors extends ThemeExtension with Diagnos Color? backgroundColor, Color? dividerColor, Color? iconColor, - Color? titleTextColor, - Color? descriptionTextColor, + Color? labelTextColor, + Color? contentTextColor, }) { return MoonMenuItemColors( backgroundColor: backgroundColor ?? this.backgroundColor, dividerColor: dividerColor ?? this.dividerColor, iconColor: iconColor ?? this.iconColor, - titleTextColor: titleTextColor ?? this.titleTextColor, - descriptionTextColor: descriptionTextColor ?? this.descriptionTextColor, + labelTextColor: labelTextColor ?? this.labelTextColor, + contentTextColor: contentTextColor ?? this.contentTextColor, ); } @@ -53,8 +53,8 @@ class MoonMenuItemColors extends ThemeExtension with Diagnos backgroundColor: colorPremulLerp(backgroundColor, other.backgroundColor, t)!, dividerColor: colorPremulLerp(dividerColor, other.dividerColor, t)!, iconColor: colorPremulLerp(iconColor, other.iconColor, t)!, - titleTextColor: colorPremulLerp(titleTextColor, other.titleTextColor, t)!, - descriptionTextColor: colorPremulLerp(descriptionTextColor, other.descriptionTextColor, t)!, + labelTextColor: colorPremulLerp(labelTextColor, other.labelTextColor, t)!, + contentTextColor: colorPremulLerp(contentTextColor, other.contentTextColor, t)!, ); } @@ -66,7 +66,7 @@ class MoonMenuItemColors extends ThemeExtension with Diagnos ..add(ColorProperty("backgroundColor", backgroundColor)) ..add(ColorProperty("dividerColor", dividerColor)) ..add(ColorProperty("iconColor", iconColor)) - ..add(ColorProperty("titleTextColor", titleTextColor)) - ..add(ColorProperty("descriptionTextColor", descriptionTextColor)); + ..add(ColorProperty("labelTextColor", labelTextColor)) + ..add(ColorProperty("contentTextColor", contentTextColor)); } } diff --git a/lib/src/theme/menu_item/menu_item_properties.dart b/lib/src/theme/menu_item/menu_item_properties.dart index 3a9e4f96..76bd331e 100644 --- a/lib/src/theme/menu_item/menu_item_properties.dart +++ b/lib/src/theme/menu_item/menu_item_properties.dart @@ -8,7 +8,7 @@ class MoonMenuItemProperties extends ThemeExtension with /// MenuItem border radius. final BorderRadiusGeometry borderRadius; - /// Vertical space between MenuItem title and description. + /// Vertical space between MenuItem label and content. final double verticalGap; /// MenuItem minimum height. @@ -17,19 +17,19 @@ class MoonMenuItemProperties extends ThemeExtension with /// MenuItem padding. final EdgeInsetsGeometry padding; - /// MenuItem title text style. - final TextStyle titleTextStyle; + /// MenuItem label text style. + final TextStyle labelTextStyle; - /// MenuItem description text style. - final TextStyle descriptionTextStyle; + /// MenuItem content text style. + final TextStyle contentTextStyle; const MoonMenuItemProperties({ required this.borderRadius, required this.verticalGap, required this.minimumHeight, required this.padding, - required this.titleTextStyle, - required this.descriptionTextStyle, + required this.labelTextStyle, + required this.contentTextStyle, }); @override @@ -38,16 +38,16 @@ class MoonMenuItemProperties extends ThemeExtension with double? verticalGap, double? minimumHeight, EdgeInsetsGeometry? padding, - TextStyle? titleTextStyle, - TextStyle? descriptionTextStyle, + TextStyle? labelTextStyle, + TextStyle? contentTextStyle, }) { return MoonMenuItemProperties( borderRadius: borderRadius ?? this.borderRadius, verticalGap: verticalGap ?? this.verticalGap, minimumHeight: minimumHeight ?? this.minimumHeight, padding: padding ?? this.padding, - titleTextStyle: titleTextStyle ?? this.titleTextStyle, - descriptionTextStyle: descriptionTextStyle ?? this.descriptionTextStyle, + labelTextStyle: labelTextStyle ?? this.labelTextStyle, + contentTextStyle: contentTextStyle ?? this.contentTextStyle, ); } @@ -60,8 +60,8 @@ class MoonMenuItemProperties extends ThemeExtension with verticalGap: lerpDouble(verticalGap, other.verticalGap, t)!, minimumHeight: lerpDouble(minimumHeight, other.minimumHeight, t)!, padding: EdgeInsetsGeometry.lerp(padding, other.padding, t)!, - titleTextStyle: TextStyle.lerp(titleTextStyle, other.titleTextStyle, t)!, - descriptionTextStyle: TextStyle.lerp(descriptionTextStyle, other.descriptionTextStyle, t)!, + labelTextStyle: TextStyle.lerp(labelTextStyle, other.labelTextStyle, t)!, + contentTextStyle: TextStyle.lerp(contentTextStyle, other.contentTextStyle, t)!, ); } @@ -74,7 +74,7 @@ class MoonMenuItemProperties extends ThemeExtension with ..add(DoubleProperty("verticalGap", verticalGap)) ..add(DoubleProperty("minimumHeight", minimumHeight)) ..add(DiagnosticsProperty("padding", padding)) - ..add(DiagnosticsProperty("titleTextStyle", titleTextStyle)) - ..add(DiagnosticsProperty("descriptionTextStyle", descriptionTextStyle)); + ..add(DiagnosticsProperty("labelTextStyle", labelTextStyle)) + ..add(DiagnosticsProperty("contentTextStyle", contentTextStyle)); } } diff --git a/lib/src/theme/menu_item/menu_item_theme.dart b/lib/src/theme/menu_item/menu_item_theme.dart index 76967258..352d8a4a 100644 --- a/lib/src/theme/menu_item/menu_item_theme.dart +++ b/lib/src/theme/menu_item/menu_item_theme.dart @@ -24,8 +24,8 @@ class MoonMenuItemTheme extends ThemeExtension with Diagnosti backgroundColor: Colors.transparent, dividerColor: tokens.colors.beerus, iconColor: tokens.colors.iconPrimary, - titleTextColor: tokens.colors.textPrimary, - descriptionTextColor: tokens.colors.textSecondary, + labelTextColor: tokens.colors.textPrimary, + contentTextColor: tokens.colors.textSecondary, ), properties = properties ?? MoonMenuItemProperties( @@ -33,8 +33,8 @@ class MoonMenuItemTheme extends ThemeExtension with Diagnosti verticalGap: tokens.sizes.x5s, minimumHeight: tokens.sizes.md, padding: EdgeInsets.all(tokens.sizes.x3s), - titleTextStyle: tokens.typography.body.textDefault, - descriptionTextStyle: tokens.typography.body.text12, + labelTextStyle: tokens.typography.body.textDefault, + contentTextStyle: tokens.typography.body.text12, ); @override diff --git a/lib/src/theme/segmented_control/segmented_control_size_properties.dart b/lib/src/theme/segmented_control/segmented_control_size_properties.dart index 30f58c43..e6f8a687 100644 --- a/lib/src/theme/segmented_control/segmented_control_size_properties.dart +++ b/lib/src/theme/segmented_control/segmented_control_size_properties.dart @@ -18,7 +18,7 @@ class MoonSegmentedControlSizeProperties extends ThemeExtension with Diagnosticabl /// Table row text color. final Color rowTextColor; - /// Table row title text color. - final Color rowTitleTextColor; + /// Table row label text color. + final Color rowLabelTextColor; - /// Table row pinned and animated title text color. - final Color rowPinnedAnimatedTitleTextColor; + /// Table row pinned and animated label text color. + final Color rowPinnedAnimatedLabelTextColor; /// Table icon color. final Color iconColor; @@ -26,8 +25,8 @@ class MoonTableColors extends ThemeExtension with Diagnosticabl const MoonTableColors({ required this.columnTextColor, required this.rowTextColor, - required this.rowTitleTextColor, - required this.rowPinnedAnimatedTitleTextColor, + required this.rowLabelTextColor, + required this.rowPinnedAnimatedLabelTextColor, required this.iconColor, required this.rowBackgroundColor, }); @@ -36,16 +35,16 @@ class MoonTableColors extends ThemeExtension with Diagnosticabl MoonTableColors copyWith({ Color? columnTextColor, Color? rowTextColor, - Color? rowTitleTextColor, - Color? rowPinnedAnimatedTitleTextColor, + Color? rowLabelTextColor, + Color? rowPinnedAnimatedLabelTextColor, Color? iconColor, Color? rowBackgroundColor, }) { return MoonTableColors( columnTextColor: columnTextColor ?? this.columnTextColor, rowTextColor: rowTextColor ?? this.rowTextColor, - rowTitleTextColor: rowTitleTextColor ?? this.rowTitleTextColor, - rowPinnedAnimatedTitleTextColor: rowPinnedAnimatedTitleTextColor ?? this.rowPinnedAnimatedTitleTextColor, + rowLabelTextColor: rowLabelTextColor ?? this.rowLabelTextColor, + rowPinnedAnimatedLabelTextColor: rowPinnedAnimatedLabelTextColor ?? this.rowPinnedAnimatedLabelTextColor, iconColor: iconColor ?? this.iconColor, rowBackgroundColor: rowBackgroundColor ?? this.rowBackgroundColor, ); @@ -58,10 +57,9 @@ class MoonTableColors extends ThemeExtension with Diagnosticabl return MoonTableColors( columnTextColor: colorPremulLerp(columnTextColor, other.columnTextColor, t)!, rowTextColor: colorPremulLerp(rowTextColor, other.rowTextColor, t)!, - rowTitleTextColor: - colorPremulLerp(rowTitleTextColor, other.rowTitleTextColor, t)!, - rowPinnedAnimatedTitleTextColor: - colorPremulLerp(rowPinnedAnimatedTitleTextColor, other.rowPinnedAnimatedTitleTextColor, t)!, + rowLabelTextColor: colorPremulLerp(rowLabelTextColor, other.rowLabelTextColor, t)!, + rowPinnedAnimatedLabelTextColor: + colorPremulLerp(rowPinnedAnimatedLabelTextColor, other.rowPinnedAnimatedLabelTextColor, t)!, iconColor: colorPremulLerp(iconColor, other.iconColor, t)!, rowBackgroundColor: colorPremulLerp(rowBackgroundColor, other.rowBackgroundColor, t)!, ); @@ -74,8 +72,8 @@ class MoonTableColors extends ThemeExtension with Diagnosticabl ..add(DiagnosticsProperty("type", "MoonTableColors")) ..add(ColorProperty("columnTextColor", columnTextColor)) ..add(ColorProperty("rowTextColor", rowTextColor)) - ..add(ColorProperty("rowTitleTextColor", rowTitleTextColor)) - ..add(ColorProperty("rowPinnedAnimatedTitleTextColor", rowPinnedAnimatedTitleTextColor)) + ..add(ColorProperty("rowLabelTextColor", rowLabelTextColor)) + ..add(ColorProperty("rowPinnedAnimatedLabelTextColor", rowPinnedAnimatedLabelTextColor)) ..add(ColorProperty("iconColor", iconColor)) ..add(ColorProperty("rowBackgroundColor", rowBackgroundColor)); } diff --git a/lib/src/theme/table/table_properties.dart b/lib/src/theme/table/table_properties.dart index 337818e6..debadd89 100644 --- a/lib/src/theme/table/table_properties.dart +++ b/lib/src/theme/table/table_properties.dart @@ -3,10 +3,10 @@ import 'package:flutter/material.dart'; @immutable class MoonTableProperties extends ThemeExtension with DiagnosticableTreeMixin { - /// Table row animated title transition duration. + /// Table row animated label transition duration. final Duration transitionDuration; - /// Table row animated title transition curve. + /// Table row animated label transition curve. final Curve transitionCurve; const MoonTableProperties({ diff --git a/lib/src/theme/table/table_size_properties.dart b/lib/src/theme/table/table_size_properties.dart index 1cda9749..61d5eb72 100644 --- a/lib/src/theme/table/table_size_properties.dart +++ b/lib/src/theme/table/table_size_properties.dart @@ -17,14 +17,14 @@ class MoonTableSizeProperties extends ThemeExtension wi /// Horizontal gap between column label and sort icon. final double sortIconGap; - /// Table sort icon size value. + /// Table column sort icon size value. final double sortIconSizeValue; /// Table row cell padding. final EdgeInsetsGeometry cellPadding; - /// Table row cell padding. - final EdgeInsetsGeometry rowTitlePadding; + /// Table row label padding. + final EdgeInsetsGeometry rowLabelPadding; /// Table column text style. final TextStyle columnTextStyle; @@ -32,11 +32,11 @@ class MoonTableSizeProperties extends ThemeExtension wi /// Table row text style. final TextStyle rowTextStyle; - /// Table row title text style. - final TextStyle rowTitleTextStyle; + /// Table row label text style. + final TextStyle rowLabelTextStyle; - /// Table row animated title text style. - final TextStyle rowPinnedAnimatedTitleTextStyle; + /// Table row animated label text style. + final TextStyle rowPinnedAnimatedLabelTextStyle; const MoonTableSizeProperties({ required this.rowBorderRadius, @@ -45,11 +45,11 @@ class MoonTableSizeProperties extends ThemeExtension wi required this.sortIconGap, required this.sortIconSizeValue, required this.cellPadding, - required this.rowTitlePadding, + required this.rowLabelPadding, required this.columnTextStyle, required this.rowTextStyle, - required this.rowTitleTextStyle, - required this.rowPinnedAnimatedTitleTextStyle, + required this.rowLabelTextStyle, + required this.rowPinnedAnimatedLabelTextStyle, }); @override @@ -60,11 +60,11 @@ class MoonTableSizeProperties extends ThemeExtension wi double? sortIconGap, double? sortIconSizeValue, EdgeInsetsGeometry? cellPadding, - EdgeInsetsGeometry? rowTitlePadding, + EdgeInsetsGeometry? rowLabelPadding, TextStyle? columnTextStyle, TextStyle? rowTextStyle, - TextStyle? rowTitleTextStyle, - TextStyle? rowPinnedAnimatedTitleTextStyle, + TextStyle? rowLabelTextStyle, + TextStyle? rowPinnedAnimatedLabelTextStyle, }) { return MoonTableSizeProperties( rowBorderRadius: rowBorderRadius ?? this.rowBorderRadius, @@ -73,11 +73,11 @@ class MoonTableSizeProperties extends ThemeExtension wi sortIconGap: sortIconGap ?? this.sortIconGap, sortIconSizeValue: sortIconSizeValue ?? this.sortIconSizeValue, cellPadding: cellPadding ?? this.cellPadding, - rowTitlePadding: rowTitlePadding ?? this.rowTitlePadding, + rowLabelPadding: rowLabelPadding ?? this.rowLabelPadding, columnTextStyle: columnTextStyle ?? this.columnTextStyle, rowTextStyle: rowTextStyle ?? this.rowTextStyle, - rowTitleTextStyle: rowTitleTextStyle ?? this.rowTitleTextStyle, - rowPinnedAnimatedTitleTextStyle: rowPinnedAnimatedTitleTextStyle ?? this.rowPinnedAnimatedTitleTextStyle, + rowLabelTextStyle: rowLabelTextStyle ?? this.rowLabelTextStyle, + rowPinnedAnimatedLabelTextStyle: rowPinnedAnimatedLabelTextStyle ?? this.rowPinnedAnimatedLabelTextStyle, ); } @@ -92,11 +92,11 @@ class MoonTableSizeProperties extends ThemeExtension wi sortIconGap: lerpDouble(sortIconGap, other.sortIconGap, t)!, sortIconSizeValue: lerpDouble(sortIconSizeValue, other.sortIconSizeValue, t)!, cellPadding: EdgeInsetsGeometry.lerp(cellPadding, other.cellPadding, t)!, - rowTitlePadding: EdgeInsetsGeometry.lerp(rowTitlePadding, other.rowTitlePadding, t)!, + rowLabelPadding: EdgeInsetsGeometry.lerp(rowLabelPadding, other.rowLabelPadding, t)!, columnTextStyle: TextStyle.lerp(columnTextStyle, other.columnTextStyle, t)!, rowTextStyle: TextStyle.lerp(rowTextStyle, other.rowTextStyle, t)!, - rowTitleTextStyle: TextStyle.lerp(rowTitleTextStyle, other.rowTitleTextStyle, t)!, - rowPinnedAnimatedTitleTextStyle: TextStyle.lerp(rowPinnedAnimatedTitleTextStyle, other.rowPinnedAnimatedTitleTextStyle, t)!, + rowLabelTextStyle: TextStyle.lerp(rowLabelTextStyle, other.rowLabelTextStyle, t)!, + rowPinnedAnimatedLabelTextStyle: TextStyle.lerp(rowPinnedAnimatedLabelTextStyle, other.rowPinnedAnimatedLabelTextStyle, t)!, ); } @@ -111,10 +111,10 @@ class MoonTableSizeProperties extends ThemeExtension wi ..add(DoubleProperty("sortIconGap", sortIconGap)) ..add(DoubleProperty("sortIconSizeValue", sortIconSizeValue)) ..add(DiagnosticsProperty("cellPadding", cellPadding)) - ..add(DiagnosticsProperty("rowTitlePadding", rowTitlePadding)) + ..add(DiagnosticsProperty("rowLabelPadding", rowLabelPadding)) ..add(DiagnosticsProperty("columnTextStyle", columnTextStyle)) ..add(DiagnosticsProperty("rowTextStyle", rowTextStyle)) - ..add(DiagnosticsProperty("rowTitleTextStyle", rowTitleTextStyle)) - ..add(DiagnosticsProperty("rowAnimatedTitleTextStyle", rowPinnedAnimatedTitleTextStyle)); + ..add(DiagnosticsProperty("rowLabelTextStyle", rowLabelTextStyle)) + ..add(DiagnosticsProperty("rowPinnedAnimatedLabelTextStyle", rowPinnedAnimatedLabelTextStyle)); } } diff --git a/lib/src/theme/table/table_sizes.dart b/lib/src/theme/table/table_sizes.dart index 49d77f6f..37417252 100644 --- a/lib/src/theme/table/table_sizes.dart +++ b/lib/src/theme/table/table_sizes.dart @@ -43,11 +43,11 @@ class MoonTableSizes extends ThemeExtension with DiagnosticableT sortIconSizeValue: tokens.sizes.x2s, sortIconGap: tokens.sizes.x5s, cellPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x4s), - rowTitlePadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x4s), + rowLabelPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x4s), columnTextStyle: tokens.typography.heading.text12, rowTextStyle: tokens.typography.body.text12, - rowTitleTextStyle: tokens.typography.body.text12, - rowPinnedAnimatedTitleTextStyle: tokens.typography.body.text12, + rowLabelTextStyle: tokens.typography.body.text12, + rowPinnedAnimatedLabelTextStyle: tokens.typography.body.text12, ), sm = sm ?? MoonTableSizeProperties( @@ -57,11 +57,11 @@ class MoonTableSizes extends ThemeExtension with DiagnosticableT sortIconSizeValue: tokens.sizes.x2s, sortIconGap: tokens.sizes.x5s, cellPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), - rowTitlePadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), + rowLabelPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), columnTextStyle: tokens.typography.heading.textDefault, rowTextStyle: tokens.typography.body.textDefault, - rowTitleTextStyle: tokens.typography.body.textDefault, - rowPinnedAnimatedTitleTextStyle: tokens.typography.body.textDefault, + rowLabelTextStyle: tokens.typography.body.textDefault, + rowPinnedAnimatedLabelTextStyle: tokens.typography.body.textDefault, ), md = md ?? MoonTableSizeProperties( @@ -71,11 +71,11 @@ class MoonTableSizes extends ThemeExtension with DiagnosticableT sortIconSizeValue: tokens.sizes.x2s, sortIconGap: tokens.sizes.x5s, cellPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), - rowTitlePadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), + rowLabelPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), columnTextStyle: tokens.typography.heading.textDefault, rowTextStyle: tokens.typography.body.textDefault, - rowTitleTextStyle: tokens.typography.body.textDefault, - rowPinnedAnimatedTitleTextStyle: tokens.typography.body.textDefault, + rowLabelTextStyle: tokens.typography.body.textDefault, + rowPinnedAnimatedLabelTextStyle: tokens.typography.body.textDefault, ), lg = lg ?? MoonTableSizeProperties( @@ -85,11 +85,11 @@ class MoonTableSizes extends ThemeExtension with DiagnosticableT sortIconSizeValue: tokens.sizes.x2s, sortIconGap: tokens.sizes.x5s, cellPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), - rowTitlePadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), + rowLabelPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), columnTextStyle: tokens.typography.heading.textDefault, rowTextStyle: tokens.typography.body.textDefault, - rowTitleTextStyle: tokens.typography.body.textDefault, - rowPinnedAnimatedTitleTextStyle: tokens.typography.body.textDefault, + rowLabelTextStyle: tokens.typography.body.textDefault, + rowPinnedAnimatedLabelTextStyle: tokens.typography.body.textDefault, ), xl = xl ?? MoonTableSizeProperties( @@ -99,11 +99,11 @@ class MoonTableSizes extends ThemeExtension with DiagnosticableT sortIconSizeValue: tokens.sizes.x2s, sortIconGap: tokens.sizes.x5s, cellPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), - rowTitlePadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), + rowLabelPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), columnTextStyle: tokens.typography.heading.textDefault, rowTextStyle: tokens.typography.body.textDefault, - rowTitleTextStyle: tokens.typography.body.textDefault, - rowPinnedAnimatedTitleTextStyle: tokens.typography.body.textDefault, + rowLabelTextStyle: tokens.typography.body.textDefault, + rowPinnedAnimatedLabelTextStyle: tokens.typography.body.textDefault, ), x2l = x2l ?? MoonTableSizeProperties( @@ -113,11 +113,11 @@ class MoonTableSizes extends ThemeExtension with DiagnosticableT sortIconSizeValue: tokens.sizes.x2s, sortIconGap: tokens.sizes.x5s, cellPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), - rowTitlePadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), + rowLabelPadding: EdgeInsets.symmetric(horizontal: tokens.sizes.x3s), columnTextStyle: tokens.typography.heading.textDefault, rowTextStyle: tokens.typography.body.textDefault, - rowTitleTextStyle: tokens.typography.body.textDefault, - rowPinnedAnimatedTitleTextStyle: tokens.typography.body.textDefault, + rowLabelTextStyle: tokens.typography.body.textDefault, + rowPinnedAnimatedLabelTextStyle: tokens.typography.body.textDefault, ); @override diff --git a/lib/src/theme/table/table_theme.dart b/lib/src/theme/table/table_theme.dart index 55994009..5bddb796 100644 --- a/lib/src/theme/table/table_theme.dart +++ b/lib/src/theme/table/table_theme.dart @@ -29,8 +29,8 @@ class MoonTableTheme extends ThemeExtension with DiagnosticableT MoonTableColors( columnTextColor: tokens.colors.textPrimary, rowTextColor: tokens.colors.textPrimary, - rowTitleTextColor: tokens.colors.textPrimary, - rowPinnedAnimatedTitleTextColor: tokens.colors.trunks, + rowLabelTextColor: tokens.colors.textPrimary, + rowPinnedAnimatedLabelTextColor: tokens.colors.trunks, iconColor: tokens.colors.iconPrimary, rowBackgroundColor: tokens.colors.goku, ), diff --git a/lib/src/theme/tag/tag_size_properties.dart b/lib/src/theme/tag/tag_size_properties.dart index 3e807064..e559391f 100644 --- a/lib/src/theme/tag/tag_size_properties.dart +++ b/lib/src/theme/tag/tag_size_properties.dart @@ -20,10 +20,10 @@ class MoonTagSizeProperties extends ThemeExtension with D /// Padding around tag children. final EdgeInsetsGeometry padding; - /// Tag body style. + /// Tag text style. final TextStyle textStyle; - /// Tag upper case body style. + /// Tag upper case text style. final TextStyle upperCaseTextStyle; const MoonTagSizeProperties({ diff --git a/lib/src/theme/toast/toast_properties.dart b/lib/src/theme/toast/toast_properties.dart index 56658c36..ae0f19c8 100644 --- a/lib/src/theme/toast/toast_properties.dart +++ b/lib/src/theme/toast/toast_properties.dart @@ -8,7 +8,7 @@ class MoonToastProperties extends ThemeExtension with Diagn /// Toast border radius. final BorderRadiusGeometry borderRadius; - /// The horizontal space between toast leading, trailing and title. + /// The horizontal space between toast leading, trailing and label. final double horizontalGap; /// The vertical space between toast header and body. diff --git a/lib/src/theme/tooltip/tooltip_properties.dart b/lib/src/theme/tooltip/tooltip_properties.dart index eb9b5122..994cff83 100644 --- a/lib/src/theme/tooltip/tooltip_properties.dart +++ b/lib/src/theme/tooltip/tooltip_properties.dart @@ -26,7 +26,7 @@ class MoonTooltipProperties extends ThemeExtension with D /// Padding around tooltip content. final EdgeInsetsGeometry contentPadding; - /// Tooltip body style. + /// Tooltip text style. final TextStyle textStyle; const MoonTooltipProperties({ diff --git a/lib/src/widgets/accordion/accordion.dart b/lib/src/widgets/accordion/accordion.dart index a73ac083..2e6cc3bd 100644 --- a/lib/src/widgets/accordion/accordion.dart +++ b/lib/src/widgets/accordion/accordion.dart @@ -111,7 +111,7 @@ class MoonAccordion extends StatefulWidget { /// Custom decoration for the accordion. final Decoration? decoration; - /// The gap between the leading, title and trailing widgets. + /// The gap between the leading, label and trailing widgets. final double? gap; /// The height of the accordion header. @@ -138,7 +138,7 @@ class MoonAccordion extends StatefulWidget { /// The size of the accordion. final MoonAccordionSize? accordionSize; - /// The semantic title for the accordion. + /// The semantic label for the accordion. final String? semanticLabel; /// The identity value represented by this accordion. @@ -154,7 +154,7 @@ class MoonAccordion extends StatefulWidget { /// When the accordion expansion changes, this function is called with the [identityValue]. final ValueChanged? onExpansionChanged; - /// A widget to display before the title. + /// A widget to display before the label. /// /// Typically a [CircleAvatar] widget. final Widget? leading; @@ -162,9 +162,9 @@ class MoonAccordion extends StatefulWidget { /// The primary content of the accordion header. /// /// Typically a [Text] widget. - final Widget title; + final Widget label; - /// A widget to display after the title. + /// A widget to display after the label. /// /// Note that depending on the value of [controlAffinity], the [trailing] widget /// may replace the rotating expansion arrow icon. @@ -210,7 +210,7 @@ class MoonAccordion extends StatefulWidget { this.groupIdentityValue, this.onExpansionChanged, this.leading, - required this.title, + required this.label, this.trailing, this.children = const [], }) : assert( @@ -523,7 +523,7 @@ class _MoonAccordionState extends State> with TickerProvider padding: EdgeInsetsDirectional.only(end: widget.gap ?? _resolvedDirectionalHeaderPadding.left), child: widget.leading, ), - Expanded(child: widget.title), + Expanded(child: widget.label), Padding( padding: EdgeInsetsDirectional.only(start: widget.gap ?? _resolvedDirectionalHeaderPadding.right), child: widget.trailing ?? _buildIcon(context)!, diff --git a/lib/src/widgets/alert/alert.dart b/lib/src/widgets/alert/alert.dart index c05ba437..9339592d 100644 --- a/lib/src/widgets/alert/alert.dart +++ b/lib/src/widgets/alert/alert.dart @@ -32,13 +32,13 @@ class MoonAlert extends StatefulWidget { /// The border width of the alert. final double? borderWidth; - /// The horizontal space between alert leading, trailing and title. + /// The horizontal space between alert leading, trailing and label. final double? horizontalGap; /// The minimum height of Alert. final double? minimumHeight; - /// The vertical space between alert header and body. + /// The vertical space between alert header and content. final double? verticalGap; /// Alert transition duration (show and hide animation). @@ -59,14 +59,14 @@ class MoonAlert extends StatefulWidget { /// The widget in the leading slot of the alert. final Widget? leading; - /// The widget in the title slot of the alert. - final Widget title; + /// The widget in the label slot of the alert. + final Widget label; /// The widget in the trailing slot of the alert. final Widget? trailing; - /// The widget in the body slot of the alert. - final Widget? body; + /// The widget in the content slot of the alert. + final Widget? content; /// MDS base alert. /// @@ -92,9 +92,9 @@ class MoonAlert extends StatefulWidget { this.decoration, this.semanticLabel, this.leading, - required this.title, + required this.label, this.trailing, - this.body, + this.content, }); /// MDS filled alert variant. @@ -110,9 +110,9 @@ class MoonAlert extends StatefulWidget { required this.backgroundColor, this.semanticLabel, this.leading, - required this.title, + required this.label, this.trailing, - this.body, + this.content, }) : showBorder = false, borderColor = null, borderWidth = null, @@ -138,9 +138,9 @@ class MoonAlert extends StatefulWidget { required this.borderColor, this.semanticLabel, this.leading, - required this.title, + required this.label, this.trailing, - this.body, + this.content, }) : showBorder = true, backgroundColor = Colors.transparent, decoration = null, @@ -161,11 +161,11 @@ class _MoonAlertState extends State with SingleTickerProviderStateMix AnimationController? _animationController; Animation? _curvedAnimation; - TextStyle _getTitleTextStyle({required BuildContext context}) { - if (widget.body != null) { - return context.moonTheme?.alertTheme.properties.titleTextStyle ?? MoonTypography.typography.heading.textDefault; + TextStyle _getLabelTextStyle({required BuildContext context}) { + if (widget.content != null) { + return context.moonTheme?.alertTheme.properties.labelTextStyle ?? MoonTypography.typography.heading.textDefault; } else { - return context.moonTheme?.alertTheme.properties.bodyTextStyle ?? MoonTypography.typography.body.textDefault; + return context.moonTheme?.alertTheme.properties.contentTextStyle ?? MoonTypography.typography.body.textDefault; } } @@ -243,10 +243,10 @@ class _MoonAlertState extends State with SingleTickerProviderStateMix final EdgeInsetsGeometry effectivePadding = widget.padding ?? context.moonTheme?.alertTheme.properties.padding ?? EdgeInsets.all(MoonSizes.sizes.x2s); - final TextStyle effectiveTitleTextStyle = _getTitleTextStyle(context: context); + final TextStyle effectiveLabelTextStyle = _getLabelTextStyle(context: context); - final TextStyle effectiveBodyTextStyle = - context.moonTheme?.alertTheme.properties.bodyTextStyle ?? MoonTypography.typography.body.textDefault; + final TextStyle effectiveContentTextStyle = + context.moonTheme?.alertTheme.properties.contentTextStyle ?? MoonTypography.typography.body.textDefault; final Duration effectiveTransitionDuration = widget.transitionDuration ?? context.moonTheme?.alertTheme.properties.transitionDuration ?? @@ -293,7 +293,7 @@ class _MoonAlertState extends State with SingleTickerProviderStateMix color: effectiveIconColor, ), child: DefaultTextStyle( - style: effectiveBodyTextStyle.copyWith(color: effectiveTextColor), + style: effectiveContentTextStyle.copyWith(color: effectiveTextColor), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -305,9 +305,9 @@ class _MoonAlertState extends State with SingleTickerProviderStateMix child: widget.leading, ), DefaultTextStyle( - style: effectiveTitleTextStyle.copyWith(color: effectiveTextColor), + style: effectiveLabelTextStyle.copyWith(color: effectiveTextColor), child: Expanded( - child: widget.title, + child: widget.label, ), ), if (widget.trailing != null) @@ -317,13 +317,13 @@ class _MoonAlertState extends State with SingleTickerProviderStateMix ), ], ), - if (widget.body != null) + if (widget.content != null) Row( children: [ Expanded( child: Padding( padding: EdgeInsetsDirectional.only(top: effectiveVerticalGap), - child: widget.body, + child: widget.content, ), ), ], diff --git a/lib/src/widgets/menu_item/menu_item.dart b/lib/src/widgets/menu_item/menu_item.dart index 41815d22..f5c87e6b 100644 --- a/lib/src/widgets/menu_item/menu_item.dart +++ b/lib/src/widgets/menu_item/menu_item.dart @@ -13,7 +13,7 @@ import 'package:moon_design/src/widgets/common/base_control.dart'; import 'package:moon_tokens/moon_tokens.dart'; class MoonMenuItem extends StatefulWidget { - /// Specifies the alignment of title and description of menu item. + /// Specifies the alignment of label and content of menu item. /// /// Default value is [CrossAxisAlignment.start]. final CrossAxisAlignment? crossAxisAlignment; @@ -36,10 +36,10 @@ class MoonMenuItem extends StatefulWidget { /// The width of the menu item. final double? width; - /// The horizontal gap between the leading, title/description and trailing widgets. + /// The horizontal gap between the leading, label/content and trailing widgets. final double? horizontalGap; - /// The vertical space between title and description. + /// The vertical gap between the label and content widgets. final double? verticalGap; /// Menu item hover effect duration. @@ -64,10 +64,10 @@ class MoonMenuItem extends StatefulWidget { final Widget? leading; /// The primary content of the menu item header. - final Widget title; + final Widget label; /// The secondary content of the menu item header. - final Widget? description; + final Widget? content; /// A widget to display after the menu item header. final Widget? trailing; @@ -91,12 +91,12 @@ class MoonMenuItem extends StatefulWidget { this.semanticLabel, this.onTap, this.leading, - required this.title, - this.description, + required this.label, + this.content, this.trailing, }) : assert( crossAxisAlignment != CrossAxisAlignment.baseline, - 'CrossAxisAlignment.baseline is not supported since the title and description of menu item ' + 'CrossAxisAlignment.baseline is not supported since the label and content of menu item ' 'are aligned in a column, not in a row. Try to use another constant.', ); @@ -181,17 +181,17 @@ class _MoonMenuItemState extends State with TickerProviderStateMix final Color effectiveIconColor = context.moonTheme?.menuItemTheme.colors.iconColor ?? MoonColors.light.iconPrimary; - final Color effectiveTitleTextColor = - context.moonTheme?.menuItemTheme.colors.titleTextColor ?? MoonColors.light.textPrimary; + final Color effectiveLabelTextColor = + context.moonTheme?.menuItemTheme.colors.labelTextColor ?? MoonColors.light.textPrimary; - final Color effectiveDescriptionTextColor = - context.moonTheme?.menuItemTheme.colors.descriptionTextColor ?? MoonColors.light.textSecondary; + final Color effectiveContentTextColor = + context.moonTheme?.menuItemTheme.colors.contentTextColor ?? MoonColors.light.textSecondary; - final TextStyle effectiveTitleTextStyle = - context.moonTheme?.menuItemTheme.properties.titleTextStyle ?? MoonTypography.typography.body.textDefault; + final TextStyle effectiveLabelTextStyle = + context.moonTheme?.menuItemTheme.properties.labelTextStyle ?? MoonTypography.typography.body.textDefault; - final TextStyle effectiveDescriptionTextStyle = - context.moonTheme?.menuItemTheme.properties.descriptionTextStyle ?? MoonTypography.typography.body.text12; + final TextStyle effectiveContentTextStyle = + context.moonTheme?.menuItemTheme.properties.contentTextStyle ?? MoonTypography.typography.body.text12; final Color effectiveHoverEffectColor = context.moonEffects?.controlHoverEffect.primaryHoverColor ?? MoonEffectsTheme(tokens: MoonTokens.light).controlHoverEffect.primaryHoverColor; @@ -250,7 +250,7 @@ class _MoonMenuItemState extends State with TickerProviderStateMix child: IconTheme( data: IconThemeData(color: effectiveIconColor), child: DefaultTextStyle( - style: effectiveTitleTextStyle.copyWith(color: effectiveTitleTextColor), + style: effectiveLabelTextStyle.copyWith(color: effectiveLabelTextColor), child: Row( children: [ if (widget.leading != null) @@ -265,13 +265,13 @@ class _MoonMenuItemState extends State with TickerProviderStateMix mainAxisSize: MainAxisSize.min, crossAxisAlignment: widget.crossAxisAlignment ?? CrossAxisAlignment.start, children: [ - widget.title, - if (widget.description != null) + widget.label, + if (widget.content != null) DefaultTextStyle( - style: effectiveDescriptionTextStyle.copyWith(color: effectiveDescriptionTextColor), + style: effectiveContentTextStyle.copyWith(color: effectiveContentTextColor), child: Padding( padding: EdgeInsets.only(top: effectiveVerticalGap), - child: widget.description, + child: widget.content, ), ), ], diff --git a/lib/src/widgets/table/table.dart b/lib/src/widgets/table/table.dart index 02193e2e..1fe66f9b 100644 --- a/lib/src/widgets/table/table.dart +++ b/lib/src/widgets/table/table.dart @@ -29,8 +29,8 @@ class MoonTableRow { /// Callback when the row is tapped. final VoidCallback? onTap; - /// Title of the row, which expands to the whole row width. - final MoonTableRowTitle? title; + /// Label of the row which expands to the whole width of the row. Placed on top of the row cells. + final MoonTableRowLabel? label; /// List of table row cells. /// The length of the list must be equal to the length of [MoonTableHeader.columns] and can not be empty. @@ -42,7 +42,7 @@ class MoonTableRow { this.decoration, this.onSelectChanged, this.onTap, - this.title, + this.label, required this.cells, }) : assert(cells.length > 0, 'Cells length must not be empty.'); } @@ -132,37 +132,37 @@ class MoonTableFooter { }) : assert(cells.length > 0, 'If footer is provided, cells must not be empty.'); } -/// [MoonTableRowTitle] used in [MoonTableRow.title]. -class MoonTableRowTitle { - /// Controls whether title of the row is pinned or not during table horizontal scroll. +/// [MoonTableRowLabel] used in [MoonTableRow.label]. +class MoonTableRowLabel { + /// Controls whether label of the row is pinned or not during table horizontal scroll. final bool pinned; - /// Row animated title transition duration during horizontal scroll. + /// Row's animated label transition duration during horizontal scroll. final Duration? transitionDuration; - /// Row animated title transition curve during horizontal scroll. + /// Row's animated label transition curve during horizontal scroll. final Curve? transitionCurve; - /// Row title padding. + /// Label padding. final EdgeInsetsGeometry? padding; - /// Text style of the row title if [pinned] is false or table is not being horizontally scrolled. + /// Text style of the row's label when [pinned] is true and the table is being horizontally scrolled. final TextStyle? textStyle; - /// Animated text style of the row title when [pinned] is true and table is being horizontally scrolled. + /// Animated text style of row's label when [pinned] is true and the table is being horizontally scrolled. final TextStyle? pinnedAnimatedTextStyle; - /// Row title widget. - final Widget title; + /// Row label widget. Placed on top of the row cells. + final Widget label; - const MoonTableRowTitle({ + const MoonTableRowLabel({ this.pinned = true, this.transitionDuration, this.transitionCurve, this.padding, this.textStyle, this.pinnedAnimatedTextStyle, - required this.title, + required this.label, }); } @@ -544,15 +544,15 @@ class _MoonTableState extends State { final double? effectiveRowHeight = currentRow.height ?? (widget.rowSize == null ? null : _effectiveMoonTableRowSize.rowHeight); - final EdgeInsetsGeometry effectiveTitlePadding = - currentRow.title?.padding ?? _effectiveMoonTableRowSize.rowTitlePadding; + final EdgeInsetsGeometry effectiveLabelPadding = + currentRow.label?.padding ?? _effectiveMoonTableRowSize.rowLabelPadding; - final TextStyle effectiveTitleTextStyle = - _effectiveMoonTableRowSize.rowTitleTextStyle.merge(currentRow.title?.textStyle); + final TextStyle effectiveLabelTextStyle = + _effectiveMoonTableRowSize.rowLabelTextStyle.merge(currentRow.label?.textStyle); - final TextStyle effectiveAnimatedTitleTextStyle = _effectiveMoonTableRowSize - .rowPinnedAnimatedTitleTextStyle - .merge(currentRow.title?.pinnedAnimatedTextStyle); + final TextStyle effectiveAnimatedLabelTextStyle = _effectiveMoonTableRowSize + .rowPinnedAnimatedLabelTextStyle + .merge(currentRow.label?.pinnedAnimatedTextStyle); return GestureDetector( onTap: () { @@ -576,13 +576,13 @@ class _MoonTableState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (currentRow.title != null) + if (currentRow.label != null) Padding( - padding: effectiveTitlePadding, - child: _TableRowTitle( - rowTitle: currentRow.title!, - titleTextStyle: effectiveTitleTextStyle, - animatedTitleTextStyle: effectiveAnimatedTitleTextStyle, + padding: effectiveLabelPadding, + child: _TableRowLabel( + label: currentRow.label!, + labelTextStyle: effectiveLabelTextStyle, + animatedLabelTextStyle: effectiveAnimatedLabelTextStyle, horizontalScrollController: _tableControllers.horizontalScrollController, ), ), @@ -591,7 +591,7 @@ class _MoonTableState extends State { for (var i = 0; i < currentRow.cells.length; i++) SizedBox( width: widget.header?.columns[i].width ?? _columnEqualWidth, - height: currentRow.title != null ? null : effectiveRowHeight, + height: currentRow.label != null ? null : effectiveRowHeight, child: DefaultTextStyle( style: effectiveTextStyle, child: Padding( @@ -706,42 +706,42 @@ class _MoonTableState extends State { } } -class _TableRowTitle extends StatelessWidget { - final MoonTableRowTitle rowTitle; - final TextStyle titleTextStyle; - final TextStyle animatedTitleTextStyle; +class _TableRowLabel extends StatelessWidget { + final MoonTableRowLabel label; + final TextStyle labelTextStyle; + final TextStyle animatedLabelTextStyle; final ScrollController horizontalScrollController; - const _TableRowTitle({ - required this.rowTitle, - required this.titleTextStyle, - required this.animatedTitleTextStyle, + const _TableRowLabel({ + required this.label, + required this.labelTextStyle, + required this.animatedLabelTextStyle, required this.horizontalScrollController, }); @override Widget build(BuildContext context) { - final Color effectiveTitleTextColor = - titleTextStyle.color ?? context.moonTheme?.tableTheme.colors.rowTitleTextColor ?? MoonColors.light.textPrimary; + final Color effectiveLableTextColor = + labelTextStyle.color ?? context.moonTheme?.tableTheme.colors.rowLabelTextColor ?? MoonColors.light.textPrimary; - final Color effectiveAnimatedTitleTextColor = animatedTitleTextStyle.color ?? - context.moonTheme?.tableTheme.colors.rowPinnedAnimatedTitleTextColor ?? + final Color effectiveAnimatedLabelTextColor = animatedLabelTextStyle.color ?? + context.moonTheme?.tableTheme.colors.rowPinnedAnimatedLabelTextColor ?? MoonColors.light.trunks; - final Duration effectiveTransitionDuration = rowTitle.transitionDuration ?? + final Duration effectiveTransitionDuration = label.transitionDuration ?? context.moonTheme?.tableTheme.properties.transitionDuration ?? const Duration(milliseconds: 400); - final Curve effectiveTransitionCurve = rowTitle.transitionCurve ?? + final Curve effectiveTransitionCurve = label.transitionCurve ?? context.moonTheme?.tableTheme.properties.transitionCurve ?? MoonTransitions.transitions.defaultTransitionCurve; - final TextStyle resolvedTitleTextStyle = titleTextStyle.copyWith(color: effectiveTitleTextColor); + final TextStyle resolvedLabelTextStyle = labelTextStyle.copyWith(color: effectiveLableTextColor); - final TextStyle resolvedAnimatedTitleTextStyle = - animatedTitleTextStyle.copyWith(color: effectiveAnimatedTitleTextColor); + final TextStyle resolvedAnimatedLabelTextStyle = + animatedLabelTextStyle.copyWith(color: effectiveAnimatedLabelTextColor); - return rowTitle.pinned + return label.pinned ? AnimatedBuilder( animation: horizontalScrollController, builder: (BuildContext context, Widget? child) { @@ -756,18 +756,18 @@ class _TableRowTitle extends StatelessWidget { return Padding( padding: EdgeInsetsDirectional.only(start: widgetOffset), child: MoonAnimatedDefaultTextStyle( - textStyle: offsetIsIncreasing ? resolvedAnimatedTitleTextStyle : resolvedTitleTextStyle, + textStyle: offsetIsIncreasing ? resolvedAnimatedLabelTextStyle : resolvedLabelTextStyle, curve: effectiveTransitionCurve, duration: effectiveTransitionDuration, child: child!, ), ); }, - child: rowTitle.title, + child: label.label, ) : DefaultTextStyle( - style: resolvedTitleTextStyle, - child: rowTitle.title, + style: resolvedLabelTextStyle, + child: label.label, ); } } diff --git a/lib/src/widgets/toast/toast.dart b/lib/src/widgets/toast/toast.dart index dfe273a1..54452604 100644 --- a/lib/src/widgets/toast/toast.dart +++ b/lib/src/widgets/toast/toast.dart @@ -48,10 +48,10 @@ class MoonToast { /// The background color of the toast. Color? backgroundColor, - /// The horizontal space between toast leading, trailing and title. + /// The horizontal gap between toast leading, trailing and label. double? horizontalGap, - /// The vertical space between toast header and body. + /// The vertical gap between toast header and content. double? verticalGap, /// The width of the toast. If null the toast will be as wide as its children. @@ -88,14 +88,14 @@ class MoonToast { /// The widget in the leading slot of the toast. Widget? leading, - /// The widget in the title slot of the toast. - required Widget title, + /// The widget in the label slot of the toast. + required Widget label, /// The widget in the trailing slot of the toast. Widget? trailing, - /// The widget in the body slot of the toast. - Widget? body, + /// The widget in the content slot of the toast. + Widget? content, }) { final BorderRadiusGeometry effectiveBorderRadius = borderRadius ?? context.moonTheme?.toastTheme.properties.borderRadius ?? MoonBorders.borders.surfaceSm; @@ -225,16 +225,16 @@ class MoonToast { leading, SizedBox(width: effectiveHorizontalGap), ], - Flexible(child: title), + Flexible(child: label), if (trailing != null) ...[ SizedBox(width: effectiveHorizontalGap), trailing, ], ], ), - if (body != null) ...[ + if (content != null) ...[ SizedBox(height: effectiveVerticalGap), - body, + content, ], ], ), diff --git a/test/accordion_test.dart b/test/accordion_test.dart index 842f14f5..048a9bb4 100644 --- a/test/accordion_test.dart +++ b/test/accordion_test.dart @@ -13,7 +13,7 @@ void main() { textDirection: TextDirection.ltr, child: MoonAccordion( key: key, - title: const Text("Title"), + label: const Text("Title"), children: [ Container(), ], @@ -40,7 +40,7 @@ void main() { await tester.pumpAndSettle(); expect(child, findsOneWidget); - expect(find.text(accordionText), findsOneWidget); + expect(find.text(accordionContent), findsOneWidget); }); testWidgets("Disabled accordion not expands after click", (tester) async { await tester.pumpWidget( @@ -95,8 +95,8 @@ void main() { }); } -const String accordionText = "Accordion content"; const String accordionTitle = "Single MoonAccordion item"; +const String accordionContent = "Accordion content"; const IconData accordionIcon = MoonIcons.other_frame_24_light; const firstAccordionKey = Key("first_accordion"); @@ -125,10 +125,10 @@ class SingleAccordionTestWidget extends StatelessWidget { expandedBackgroundColor: Colors.brown, childrenPadding: const EdgeInsets.all(12), leading: const Icon(accordionIcon), - title: const Text(accordionTitle), + label: const Text(accordionTitle), children: const [ Text( - accordionText, + accordionContent, key: firstAccordionChildKey, ), ], @@ -167,10 +167,10 @@ class _GroupedAccordionTestWidgetState setState(() => _currentlyOpenAccordionItem = value); }, leading: const Icon(MoonIcons.other_frame_24_light), - title: const Text("Grouped MoonAccordion item #1"), + label: const Text("Grouped MoonAccordion item #1"), children: const [ Text( - accordionText, + accordionContent, key: firstAccordionChildKey, ), ], @@ -184,10 +184,10 @@ class _GroupedAccordionTestWidgetState setState(() => _currentlyOpenAccordionItem = value); }, leading: const Icon(MoonIcons.other_frame_24_light), - title: const Text("Grouped MoonAccordion item #2"), + label: const Text("Grouped MoonAccordion item #2"), children: const [ Text( - accordionText, + accordionContent, key: secondAccordionChildKey, ), ], diff --git a/test/alert_test.dart b/test/alert_test.dart index 78a44d29..02c868a0 100644 --- a/test/alert_test.dart +++ b/test/alert_test.dart @@ -11,7 +11,7 @@ void main() { textDirection: TextDirection.ltr, child: MoonAlert( key: key, - title: Text(alertTitle), + label: Text(alertTitle), ), ), ); @@ -87,7 +87,7 @@ class _TestWidgetState extends State { body: MoonAlert( show: _showAlert, leading: widget.showLeading ? const Icon(leadingIcon) : null, - title: const SizedBox( + label: const SizedBox( height: 24, child: Align( alignment: AlignmentDirectional.centerStart, @@ -103,7 +103,7 @@ class _TestWidgetState extends State { onTap: () => setState(() => _showAlert = !_showAlert), ) : null, - body: widget.showBody + content: widget.showBody ? const SizedBox( height: 24, child: Align( diff --git a/test/menu_item_test.dart b/test/menu_item_test.dart index 2b5710a5..43f76648 100644 --- a/test/menu_item_test.dart +++ b/test/menu_item_test.dart @@ -26,7 +26,7 @@ void main() { await tester.pumpWidget( const TestWidget( showLeading: true, - showDiscription: true, + showDescription: true, showTrailing: true, ), ); @@ -56,14 +56,14 @@ const IconData trailingIcon = MoonIcons.controls_close_small_24_light; class TestWidget extends StatelessWidget { final bool showLeading; final bool showTrailing; - final bool showDiscription; + final bool showDescription; final Key? widgetKey; final VoidCallback? onTap; const TestWidget({ super.key, this.showLeading = false, - this.showDiscription = false, + this.showDescription = false, this.showTrailing = false, this.widgetKey, this.onTap, @@ -75,8 +75,8 @@ class TestWidget extends StatelessWidget { body: MoonMenuItem( key: widgetKey, leading: showLeading ? const Icon(leadingIcon) : null, - description: showDiscription ? const Text(description) : null, - title: const Text(title), + content: showDescription ? const Text(description) : null, + label: const Text(title), trailing: showTrailing ? const Icon(trailingIcon) : null, onTap: onTap, ), diff --git a/test/toast_test.dart b/test/toast_test.dart index e8a18669..ea93fd8d 100644 --- a/test/toast_test.dart +++ b/test/toast_test.dart @@ -45,9 +45,9 @@ class TestWidget extends StatelessWidget { displayDuration: const Duration(milliseconds: 500), transitionDuration: Duration.zero, leading: const Icon(leadingIcon), - title: const Text(title), + label: const Text(title), trailing: const Icon(trailingIcon), - body: const Text(body), + content: const Text(body), ); }, );