diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c6e8eba6a..ab17e4383 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,22 +97,6 @@ They should: 5. implement `operator ==` and `hashCode`. -## Expose `String` and `Widget` variants of the same parameter. - -Widgets typically contain string-based content such as titles and labels. These widgets should expose a `String` and -`Widget` variant of the same parameter. For example, a widget that has a title should expose `String? label` and `Widget? -rawLabel` constructor parameters. The constructor should then assert that only one of these parameters is non-null. - -[Example](https://github.com/forus-labs/forui/blob/e61a11a346e8e1d788ba2eb9031b73a18a407402/forui/lib/src/widgets/badge/badge.dart#L20): -```dart -FBadge({ - String? label, - Widget? rawLabel, -}) : - assert((label == null) ^ (rawLabel == null), 'Either "label" or "rawLabel" must be provided, but not both.'), -``` - - ## Conventions * Avoid [double negatives](https://en.wikipedia.org/wiki/Double_negative) when naming things, i.e. a boolean field should diff --git a/docs/pages/docs/badge.mdx b/docs/pages/docs/badge.mdx index 6696e0a0d..65c769ad0 100644 --- a/docs/pages/docs/badge.mdx +++ b/docs/pages/docs/badge.mdx @@ -10,7 +10,7 @@ A badge typically draws attention to specific information, such as labels and co ```dart - FBadge(label: 'Badge'); + FBadge(label: const Text('Badge')); ``` @@ -20,7 +20,7 @@ A badge typically draws attention to specific information, such as labels and co ### `FBadge(...)` ```dart -FBadge(label: 'Badge'); +FBadge(label: const Text('Badge')); ``` ### `FBadge.raw(...)` @@ -37,7 +37,7 @@ FBadge.raw(builder: (context, style) => Text('Badge')); ```dart - FBadge(label: 'Badge'); + FBadge(label: const Text('Badge')); ``` @@ -50,7 +50,7 @@ FBadge.raw(builder: (context, style) => Text('Badge')); ```dart FBadge( - label: 'Badge', + label: const Text('Badge'), style: FBadgeStyle.secondary, ); ``` @@ -65,7 +65,7 @@ FBadge.raw(builder: (context, style) => Text('Badge')); ```dart FBadge( - label: 'Badge', + label: const Text('Badge'), style: FBadgeStyle.outline, ); ``` @@ -80,7 +80,7 @@ FBadge.raw(builder: (context, style) => Text('Badge')); ```dart FBadge( - label: 'Badge', + label: const Text('Badge'), style: FBadgeStyle.destructive, ); ``` diff --git a/docs/pages/docs/button.mdx b/docs/pages/docs/button.mdx index 36a85097d..a4f2297ea 100644 --- a/docs/pages/docs/button.mdx +++ b/docs/pages/docs/button.mdx @@ -11,7 +11,7 @@ A button. ```dart FButton( - label: 'Button', + label: const Text('Button'), onPress: () {}, ); ``` @@ -24,7 +24,7 @@ A button. ```dart FButton( - label: 'Button', + label: const Text('Button'), onPress: () {}, ); ``` @@ -33,7 +33,7 @@ FButton( ```dart FButton.raw( - child: Text('Button'), + child: const Text('Button'), onPress: () {}, ); ``` @@ -48,7 +48,7 @@ FButton.raw( ```dart FButton( - label: 'Button', + label: const Text('Button'), onPress: () {}, ); ``` @@ -63,7 +63,7 @@ FButton.raw( ```dart FButton( - label: 'Button', + label: const Text('Button'), style: FButtonStyle.secondary, onPress: () {}, ); @@ -79,7 +79,7 @@ FButton.raw( ```dart FButton( - label: 'Button', + label: const Text('Button'), style: FButtonStyle.outline, onPress: () {}, ); @@ -95,7 +95,7 @@ FButton.raw( ```dart FButton( - label: 'Button', + label: const Text('Button'), style: FButtonStyle.destructive, onPress: () {}, ); @@ -111,8 +111,8 @@ FButton.raw( ```dart FButton( - prefixIcon: FButtonIcon(icon: FAssets.icons.mail), - label: 'Login with Email', + prefix: FButtonIcon(icon: FAssets.icons.mail), + label: const Text('Login with Email'), onPress: () {}, ), ``` diff --git a/docs/pages/docs/card.mdx b/docs/pages/docs/card.mdx index 3ec8222c3..e47423239 100644 --- a/docs/pages/docs/card.mdx +++ b/docs/pages/docs/card.mdx @@ -11,8 +11,8 @@ A card, typically with a title, subtitle, and child widget. ```dart FCard( - title: 'Notification', - subtitle: 'You have 3 unread messages.', + title: const Text('Notification'), + subtitle: const Text('You have 3 unread messages.'), ); ``` @@ -24,9 +24,9 @@ A card, typically with a title, subtitle, and child widget. ```dart FCard( - title: 'Notification', - subtitle: 'You have 3 unread messages.', - child: FButton(label: 'Read messages', onPress: () {}), + title: const Text('Notification'), + subtitle: const Text('You have 3 unread messages.'), + child: FButton(label: const Text('Read messages'), onPress: () {}), ); ``` diff --git a/docs/pages/docs/dialog.mdx b/docs/pages/docs/dialog.mdx index dc09a5557..41d08e139 100644 --- a/docs/pages/docs/dialog.mdx +++ b/docs/pages/docs/dialog.mdx @@ -15,16 +15,16 @@ A modal dialog interrupts the user with important content and expects a response children: [ IntrinsicWidth( child: FButton( - label: 'Show Dialog', + label: const Text('Show Dialog'), onPress: () => showAdaptiveDialog( context: context, builder: (context) => FDialog( direction: Axis.horizontal, - title: 'Are you absolutely sure?', - body: 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', + title: const Text('Are you absolutely sure?'), + body: const Text('This action cannot be undone. This will permanently delete your account and remove your data from our servers.'), actions: [ - FButton(style: FButtonStyle.outline, label: 'Cancel', onPress: () => Navigator.of(context).pop()), - FButton(label: 'Continue', onPress: () => Navigator.of(context).pop()), + FButton(style: FButtonStyle.outline, label: const Text('Cancel'), onPress: () => Navigator.of(context).pop()), + FButton(label: const Text('Continue'), onPress: () => Navigator.of(context).pop()), ], ), ), @@ -43,11 +43,11 @@ A modal dialog interrupts the user with important content and expects a response ```dart FDialog( direction: Axis.horizontal, - title: 'Are you absolutely sure?', - body: 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', + title: const Text('Are you absolutely sure?'), + body: const Text('This action cannot be undone. This will permanently delete your account and remove your data from our servers.'), actions: [ - FButton(style: FButtonStyle.outline, label: 'Cancel', onPress: () => Navigator.of(context).pop()), - FButton(label: 'Continue', onPress: () => Navigator.of(context).pop()), + FButton(style: FButtonStyle.outline, label: const Text('Cancel'), onPress: () => Navigator.of(context).pop()), + FButton(label: const Text('Continue'), onPress: () => Navigator.of(context).pop()), ], ); ``` @@ -74,16 +74,16 @@ FDialog.raw( children: [ IntrinsicWidth( child: FButton( - label: 'Show Dialog', + label: const Text('Show Dialog'), onPress: () => showAdaptiveDialog( context: context, builder: (context) => FDialog( direction: Axis.horizontal, - title: 'Are you absolutely sure?', - body: 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', + title: const Text('Are you absolutely sure?'), + body: const Text('This action cannot be undone. This will permanently delete your account and remove your data from our servers.'), actions: [ - FButton(style: FButtonStyle.outline, label: 'Cancel', onPress: () => Navigator.of(context).pop()), - FButton(label: 'Continue', onPress: () => Navigator.of(context).pop()), + FButton(style: FButtonStyle.outline, label: const Text('Cancel'), onPress: () => Navigator.of(context).pop()), + FButton(label: const Text('Continue'), onPress: () => Navigator.of(context).pop()), ], ), ), @@ -108,16 +108,16 @@ FDialog.raw( children: [ IntrinsicWidth( child: FButton( - label: 'Show Dialog', + label: const Text('Show Dialog'), onPress: () => showAdaptiveDialog( context: context, builder: (context) => FDialog( direction: Axis.vertical, - title: 'Are you absolutely sure?', - body: 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', + title: const Text('Are you absolutely sure?'), + body: const Text('This action cannot be undone. This will permanently delete your account and remove your data from our servers.'), actions: [ - FButton(label: 'Continue', onPress: () => Navigator.of(context).pop()), - FButton(style: FButtonStyle.outline, label: 'Cancel', onPress: () => Navigator.of(context).pop()), + FButton(label: const Text('Continue'), onPress: () => Navigator.of(context).pop()), + FButton(style: FButtonStyle.outline, label: const Text('Cancel'), onPress: () => Navigator.of(context).pop()), ], ), ), diff --git a/docs/pages/docs/scaffold.mdx b/docs/pages/docs/scaffold.mdx index af16760f5..0e0ad86e3 100644 --- a/docs/pages/docs/scaffold.mdx +++ b/docs/pages/docs/scaffold.mdx @@ -23,25 +23,25 @@ Creates a visual scaffold for Forui widgets. content: ListView( children: [ FCard( - title: 'Account', - subtitle: 'Make changes to your account here. Click save when you are done.', + title: const Text('Account'), + subtitle: const Text('Make changes to your account here. Click save when you are done.'), child: Padding( padding: const EdgeInsets.only(top: 10), child: Column( children: [ const FTextField( - label: 'Name', + label: Text('Name'), hint: 'John Renalo', ), const SizedBox(height: 10), const FTextField( - label: 'Email', + label: Text('Email'), hint: 'john@doe.com', ), Padding( padding: const EdgeInsets.only(top: 24, bottom: 16), child: FButton( - label: 'Save', + label: const Text('Save'), onPress: () {}, ), ), @@ -75,9 +75,9 @@ FScaffold( content: Column( children: [ FCard( - title: 'Notification', - subtitle: 'You have 3 unread messages.', - child: FButton(label: 'Read messages', onPress: () {}), + title: const Text('Notification'), + subtitle: const Text('You have 3 unread messages.'), + child: FButton(label: const Text('Read messages'), onPress: () {}), ), ], ), diff --git a/docs/pages/docs/tabs.mdx b/docs/pages/docs/tabs.mdx index 855a6d1b0..668917633 100644 --- a/docs/pages/docs/tabs.mdx +++ b/docs/pages/docs/tabs.mdx @@ -15,27 +15,27 @@ A set of layered sections of content—known as tab entries—that are displayed child: FTabs( tabs: [ FTabEntry( - label: 'Account', + label: const Text('Account'), content: FCard( - title: 'Account', - subtitle: 'Make changes to your account here. Click save when you are done.', + title: const Text('Account'), + subtitle: const Text('Make changes to your account here. Click save when you are done.'), child: Padding( padding: const EdgeInsets.only(top: 12), child: Column( children: [ const FTextField( - label: 'Name', + label: Text('Name'), hint: 'John Renalo', ), const SizedBox(height: 10), const FTextField( - label: 'Email', + label: Text('Email'), hint: 'john@doe.com', ), Padding( padding: const EdgeInsets.only(top: 24, bottom: 16), child: FButton( - label: 'Save', + label: const Text('Save'), onPress: () {}, ), ), @@ -45,21 +45,21 @@ A set of layered sections of content—known as tab entries—that are displayed ), ), FTabEntry( - label: 'Password', + label: const Text(Password'), content: FCard( - title: 'Password', - subtitle: 'Change your password here. After saving, you will be logged out.', + title: const Text('Password'), + subtitle: const Text('Change your password here. After saving, you will be logged out.'), child: Padding( padding: const EdgeInsets.only(top: 12), child: Column( children: [ - const FTextField(label: 'Current password'), + const FTextField(label: Text('Current password')), const SizedBox(height: 10), - const FTextField(label: 'New password'), + const FTextField(label: Text('New password')), Padding( padding: const EdgeInsets.only(top: 24, bottom: 16), child: FButton( - label: 'Save', + label: const Text('Save'), onPress: () {}, ), ), @@ -82,9 +82,9 @@ A set of layered sections of content—known as tab entries—that are displayed ```dart FTabs( initialIndex: 1, - tabs: [ - FTabEntry(label: 'Account', content: FCard()), - FTabEntry(label: 'Password', content: FCard()), + tabs: const [ + FTabEntry(label: Text('Account'), content: Placeholder()), + FTabEntry(label: Text('Password'), content: Placeholder()), ], onPress: (index) {}, ); diff --git a/docs/pages/docs/text-field.mdx b/docs/pages/docs/text-field.mdx index a873c13ab..23d7e871b 100644 --- a/docs/pages/docs/text-field.mdx +++ b/docs/pages/docs/text-field.mdx @@ -15,7 +15,7 @@ in a form. enabled: enabled, label: 'Email', hint: 'john@doe.com', - footer: Text('Enter your email associated with your Forui account.'), + footer: const Text('Enter your email associated with your Forui account.'), ); ``` @@ -28,9 +28,9 @@ in a form. ```dart FTextField( enabled: true, - label: Text('Email'), + label: const Text('Email'), hint: 'john@doe.com', - footer: Text('Enter your email associated with your Forui account.'), + footer: const Text('Enter your email associated with your Forui account.'), keyboardType: TextInputType.emailAddress, textCapitalization: TextCapitalization.none, ); @@ -41,7 +41,7 @@ FTextField( ```dart FTextField.email( hint: 'john@doe.com', - footer: Text('Enter your email associated with your Forui account.'), + footer: const Text('Enter your email associated with your Forui account.'), ); ``` @@ -49,7 +49,7 @@ FTextField.email( ```dart FTextField.password( - footer: Text('Your password must be at least 8 characters long.'), + footer: const Text('Your password must be at least 8 characters long.'), ); ``` @@ -57,9 +57,9 @@ FTextField.password( ```dart FTextField.multiline( - label: Text('Description'), + label: const Text('Description'), hint: 'Enter a description...', - footer: Text('Enter a description of the item.'), + footer: const Text('Enter a description of the item.'), ); ``` @@ -123,7 +123,7 @@ FTextField.multiline( ```dart FTextField.multiline( - label: Text('Leave a review'), + label: const Text('Leave a review'), maxLines: 4, ); ``` @@ -172,7 +172,7 @@ FTextField.multiline( ), const SizedBox(height: 30), FButton( - rawLabel: const Text('Login'), + label: const Text('Login'), onPress: () { if (!_formKey.currentState!.validate()) { // Handle errors here. diff --git a/forui/CHANGELOG.md b/forui/CHANGELOG.md index 2798daaec..95788f7e9 100644 --- a/forui/CHANGELOG.md +++ b/forui/CHANGELOG.md @@ -2,13 +2,15 @@ ### Changes * Add `Header.nested` widget. -* Change `FTextField` to be usable in `Form`s. -* Change `FTextFieldStyle`'s default vertical content padding from `5` to `15`. * **Breaking** Move `FHeaderStyle` to `FHeaderStyles.rootStyle`. * **Breaking** Move `FHeaderActionStyle.padding` to `FRootHeaderStyle.actionSpacing`. -* Split exports in `forui.dart` into sub-libraries. * **Breaking** Suffix style parameters with `Style`, i.e. `FRootHeaderStyle.action` has been renamed to `FRootHeaderStyle.actionStyle`. +* **Breaking** Raw fields have been removed, wrap strings with the Text() widget. Eg. `Button(label: 'Hello')` or `Button(rawLabel: 'Hello')` should be replaced with `Button(label: Text('Hello'))`. +* Change `FTextField` to be usable in `Form`s. +* Change `FTextFieldStyle`'s default vertical content padding from `5` to `15`. * Fix missing `key` parameter in `FTextField` constructors. +* **Breaking** `FButton.prefixIcon` and `FButton.suffixIcon` have been renamed to `FButton.prefix` and `FButton.suffix`. +* Split exports in `forui.dart` into sub-libraries. ## 0.1.0 diff --git a/forui/example/lib/example.dart b/forui/example/lib/example.dart index fe4a300cd..6933bcebf 100644 --- a/forui/example/lib/example.dart +++ b/forui/example/lib/example.dart @@ -25,10 +25,10 @@ class _ExampleState extends State { child: FTabs( tabs: [ FTabEntry( - label: 'Account', + label: const Text('Account'), content: FCard( - title: 'Account', - subtitle: 'Make changes to your account here. Click save when you are done.', + title: const Text('Account'), + subtitle: const Text('Make changes to your account here. Click save when you are done.'), child: Column( children: [ Container( @@ -40,10 +40,10 @@ class _ExampleState extends State { ), ), FTabEntry( - label: 'Password', + label: const Text('Password'), content: FCard( - title: 'Password', - subtitle: 'Change your password here. After saving, you will be logged out.', + title: const Text('Password'), + subtitle: const Text('Change your password here. After saving, you will be logged out.'), child: Column( children: [ Container( diff --git a/forui/lib/src/widgets/badge/badge.dart b/forui/lib/src/widgets/badge/badge.dart index 43b06ad8f..bf58d1a8d 100644 --- a/forui/lib/src/widgets/badge/badge.dart +++ b/forui/lib/src/widgets/badge/badge.dart @@ -24,19 +24,12 @@ class FBadge extends StatelessWidget { /// The builder used to build the badge's content. final Widget Function(BuildContext, FBadgeCustomStyle) builder; - /// Creates a [FBadge] that contains a [label] or a [rawLabel]. - /// - /// ## Contract: - /// Throws [AssertionError] if: - /// * both [label] and [rawLabel] are not null - /// * both [label] and [rawLabel] are null + /// Creates a [FBadge] that contains a [label]. FBadge({ - String? label, - Widget? rawLabel, + required Widget label, this.style = FBadgeStyle.primary, super.key, - }) : assert((label == null) ^ (rawLabel == null), 'Either "label" or "rawLabel" must be provided, but not both.'), - builder = ((context, style) => FBadgeContent(rawLabel: rawLabel, label: label, style: style)); + }) : builder = ((context, style) => _FBadgeContent(label: label, style: style)); /// Creates a [FBadge] with custom content. const FBadge.raw({ diff --git a/forui/lib/src/widgets/badge/badge_content.dart b/forui/lib/src/widgets/badge/badge_content.dart index 46b29a5d0..6cb705c5b 100644 --- a/forui/lib/src/widgets/badge/badge_content.dart +++ b/forui/lib/src/widgets/badge/badge_content.dart @@ -1,16 +1,12 @@ part of 'badge.dart'; -@internal -final class FBadgeContent extends StatelessWidget { +final class _FBadgeContent extends StatelessWidget { final FBadgeCustomStyle style; - final String? label; - final Widget? rawLabel; + final Widget label; - const FBadgeContent({ + const _FBadgeContent({ required this.style, - this.label, - this.rawLabel, - super.key, + required this.label, }); @override @@ -19,11 +15,7 @@ final class FBadgeContent extends StatelessWidget { padding: style.content.padding, child: DefaultTextStyle.merge( style: style.content.labelTextStyle, - child: switch ((label, rawLabel)) { - (final String label, _) => Text(label), - (_, final Widget label) => label, - _ => const Placeholder(), - }, + child: label, ), ), ); @@ -31,13 +23,11 @@ final class FBadgeContent extends StatelessWidget { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties - ..add(DiagnosticsProperty('style', style)) - ..add(StringProperty('label', label)); + properties.add(DiagnosticsProperty('style', style)); } } -/// A badge content's style. +/// [FBadge] content's style. final class FBadgeContentStyle with Diagnosticable { static const _defaultPadding = EdgeInsets.symmetric(horizontal: 14, vertical: 2); diff --git a/forui/lib/src/widgets/button/button.dart b/forui/lib/src/widgets/button/button.dart index aea9cc575..29e60e4ec 100644 --- a/forui/lib/src/widgets/button/button.dart +++ b/forui/lib/src/widgets/button/button.dart @@ -72,39 +72,31 @@ class FButton extends StatelessWidget { /// The child. final Widget child; - /// Creates a [FButton] that contains a [prefixIcon], [label]/[rawLabel], and [suffixIcon]. + /// Creates a [FButton] that contains a [prefix], [label], and [suffix]. /// /// The button layout is as follows, assuming the locale is read from left to right: /// ``` - /// |---------------------------------------------------| - /// | [prefixIcon] [label]/[rawLabel] [suffixIcon] | - /// |---------------------------------------------------| + /// |---------------------------------------------| + /// | [prefixIcon] [label] [suffixIcon] | + /// |---------------------------------------------| /// ``` /// - /// [FButtonIcon] provides a convenient way to transform a bundled SVG icon into a [prefixIcon] and [suffixIcon]. - /// - /// ## Contract: - /// Throws [AssertionError] if: - /// * both [label] and [rawLabel] are not null - /// * both [label] and [rawLabel] are null + /// [FButtonIcon] provides a convenient way to transform a bundled SVG icon into a [prefix] and [suffix]. FButton({ required this.onPress, + required Widget label, this.style = Variant.primary, this.onLongPress, this.autofocus = false, this.focusNode, this.onFocusChange, - Widget? prefixIcon, - Widget? suffixIcon, - String? label, - Widget? rawLabel, + Widget? prefix, + Widget? suffix, super.key, - }) : assert((label != null) ^ (rawLabel != null), 'Either "label" or "rawLabel" must be provided, but not both.'), - child = FButtonContent( - prefixIcon: prefixIcon, - suffixIcon: suffixIcon, + }) : child = _FButtonContent( + prefix: prefix, + suffix: suffix, label: label, - rawLabel: rawLabel, ); /// Creates a [FButton] with custom content. diff --git a/forui/lib/src/widgets/button/button_content.dart b/forui/lib/src/widgets/button/button_content.dart index bac9d6b73..01be48609 100644 --- a/forui/lib/src/widgets/button/button_content.dart +++ b/forui/lib/src/widgets/button/button_content.dart @@ -1,18 +1,14 @@ part of 'button.dart'; -@internal -final class FButtonContent extends StatelessWidget { - final Widget? prefixIcon; - final Widget? suffixIcon; - final String? label; - final Widget? rawLabel; +final class _FButtonContent extends StatelessWidget { + final Widget? prefix; + final Widget? suffix; + final Widget label; - const FButtonContent({ - this.prefixIcon, - this.suffixIcon, - this.label, - this.rawLabel, - super.key, + const _FButtonContent({ + required this.label, + this.prefix, + this.suffix, }); @override @@ -27,13 +23,9 @@ final class FButtonContent extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: separate( [ - if (prefixIcon != null) prefixIcon!, - switch ((label, rawLabel)) { - (final String label, _) => Text(label), - (_, final Widget label) => label, - _ => const Placeholder(), - }, - if (suffixIcon != null) suffixIcon!, + if (prefix != null) prefix!, + label, + if (suffix != null) suffix!, ], by: [ const SizedBox(width: 10), @@ -43,15 +35,9 @@ final class FButtonContent extends StatelessWidget { ), ); } - - @override - void debugFillProperties(DiagnosticPropertiesBuilder properties) { - super.debugFillProperties(properties); - properties.add(StringProperty('label', label)); - } } -/// [FButtonContent]'s style. +/// [FButton] content's style. class FButtonContentStyle with Diagnosticable { /// The [TextStyle] when this button is enabled. final TextStyle enabledTextStyle; diff --git a/forui/lib/src/widgets/card/card.dart b/forui/lib/src/widgets/card/card.dart index 0f8b6b3ce..554d3b1f1 100644 --- a/forui/lib/src/widgets/card/card.dart +++ b/forui/lib/src/widgets/card/card.dart @@ -26,32 +26,21 @@ final class FCard extends StatelessWidget { /// The card's layout is as follows: /// ``` /// |---------------------------| - /// | [title]/[rawTitle] | - /// | [subtitle]/[rawSubTitle] | + /// | [title] | + /// | [subtitle] | /// | | /// | [child] | /// |---------------------------| /// ``` - /// - /// ## Contract: - /// Throws [AssertionError] if: - /// * [title] and [rawTitle] are both not null. - /// * [subtitle] and [rawSubtitle] are both not null. FCard({ - String? title, - Widget? rawTitle, - String? subtitle, - Widget? rawSubtitle, + Widget? title, + Widget? subtitle, Widget? child, this.style, super.key, - }) : assert(title == null || rawTitle == null, 'Cannot provide both a title and a rawTitle.'), - assert(subtitle == null || rawSubtitle == null, 'Cannot provide both a subtitle and a rawSubtitle.'), - child = FCardContent( + }) : child = _FCardContent( title: title, - rawTitle: rawTitle, subtitle: subtitle, - rawSubtitle: rawSubtitle, style: style?.content, child: child, ); @@ -77,7 +66,7 @@ final class FCardStyle with Diagnosticable { /// The decoration. final BoxDecoration decoration; - /// The [FCardContent] style. + /// The card content's style. final FCardContentStyle content; /// Creates a [FCardStyle]. diff --git a/forui/lib/src/widgets/card/card_content.dart b/forui/lib/src/widgets/card/card_content.dart index 509b8ee91..5389199e8 100644 --- a/forui/lib/src/widgets/card/card_content.dart +++ b/forui/lib/src/widgets/card/card_content.dart @@ -1,40 +1,22 @@ part of 'card.dart'; -@internal -final class FCardContent extends StatelessWidget { - final String? title; - final Widget? rawTitle; - final String? subtitle; - final Widget? rawSubtitle; +final class _FCardContent extends StatelessWidget { + final Widget? title; + final Widget? subtitle; final Widget? child; final FCardContentStyle? style; - const FCardContent({ + const _FCardContent({ this.title, - this.rawTitle, this.subtitle, - this.rawSubtitle, this.child, this.style, - super.key, }); @override Widget build(BuildContext context) { final style = this.style ?? context.theme.cardStyle.content; - final title = switch ((this.title, rawTitle)) { - (final String title, _) => Text(title), - (_, final Widget title) => title, - _ => null, - }; - - final subtitle = switch ((this.subtitle, rawSubtitle)) { - (final String subtitle, _) => Text(subtitle), - (_, final Widget subtitle) => subtitle, - _ => null, - }; - return Padding( padding: style.padding, child: Column( @@ -43,12 +25,12 @@ final class FCardContent extends StatelessWidget { if (title != null) DefaultTextStyle.merge( style: style.titleTextStyle, - child: title, + child: title!, ), if (subtitle != null) DefaultTextStyle.merge( style: style.subtitleTextStyle, - child: subtitle, + child: subtitle!, ), if (child != null) Padding( @@ -64,14 +46,11 @@ final class FCardContent extends StatelessWidget { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties - ..add(StringProperty('title', title)) - ..add(StringProperty('subtitle', subtitle)) - ..add(DiagnosticsProperty('style', style)); + properties.add(DiagnosticsProperty('style', style)); } } -/// A card content's style. +/// [FCard] content's style. final class FCardContentStyle with Diagnosticable { /// The title's [TextStyle]. final TextStyle titleTextStyle; diff --git a/forui/lib/src/widgets/dialog/dialog.dart b/forui/lib/src/widgets/dialog/dialog.dart index a0b850cf7..d52a6cf7e 100644 --- a/forui/lib/src/widgets/dialog/dialog.dart +++ b/forui/lib/src/widgets/dialog/dialog.dart @@ -54,9 +54,9 @@ class FDialog extends StatelessWidget { /// The [Axis.vertical] layout with two possibles actions is: /// ``` /// |--------------------| - /// | [title]/[rawTitle] | + /// | [title] | /// | | - /// | [body]/[rawBody] | + /// | [body] | /// | | /// | [first action] | /// | [second action] | @@ -66,47 +66,33 @@ class FDialog extends StatelessWidget { /// The [Axis.horizontal] layout with two possibles actions is: /// ``` /// |--------------------------------------------| - /// | [title]/[rawTitle] | + /// | [title] | /// | | - /// | [body]/[rawBody] | + /// | [body] | /// | | /// | [first action] [second action] | /// |--------------------------------------------| - /// - /// ## Contract: - /// Throws [AssertionError] if: - /// * [title] and [rawTitle] are both not null - /// * [body] and [rawBody] are both not null FDialog({ required List actions, this.style, this.insetAnimationDuration = _defaultDuration, this.insetAnimationCurve = Curves.decelerate, - String? semanticLabel, - String? title, - Widget? rawTitle, - String? body, - Widget? rawBody, + this.semanticLabel, + Widget? title, + Widget? body, Axis direction = Axis.vertical, super.key, - }) : assert(title == null || rawTitle == null, 'Cannot provide both a title and a rawTitle.'), - assert(body == null || rawBody == null, 'Cannot provide both a body and a rawBody.'), - semanticLabel = semanticLabel ?? title, - builder = switch (direction) { - Axis.horizontal => (context, style) => FHorizontalDialogContent( + }) : builder = switch (direction) { + Axis.horizontal => (context, style) => _FHorizontalDialogContent( style: style.horizontal, title: title, - rawTitle: rawTitle, body: body, - rawBody: rawBody, actions: actions, ), - Axis.vertical => (context, style) => FVerticalDialogContent( + Axis.vertical => (context, style) => _FVerticalDialogContent( style: style.vertical, title: title, - rawTitle: rawTitle, body: body, - rawBody: rawBody, actions: actions, ), }; @@ -271,4 +257,25 @@ final class FDialogStyle with Diagnosticable { ..add(DoubleProperty('minWidth', minWidth, defaultValue: 280)) ..add(DoubleProperty('maxWidth', maxWidth, defaultValue: 560)); } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FDialogStyle && + runtimeType == other.runtimeType && + decoration == other.decoration && + insetPadding == other.insetPadding && + horizontal == other.horizontal && + vertical == other.vertical && + minWidth == other.minWidth && + maxWidth == other.maxWidth; + + @override + int get hashCode => + decoration.hashCode ^ + insetPadding.hashCode ^ + horizontal.hashCode ^ + vertical.hashCode ^ + minWidth.hashCode ^ + maxWidth.hashCode; } diff --git a/forui/lib/src/widgets/dialog/dialog_content.dart b/forui/lib/src/widgets/dialog/dialog_content.dart index 9d057ce1d..dd7b354ec 100644 --- a/forui/lib/src/widgets/dialog/dialog_content.dart +++ b/forui/lib/src/widgets/dialog/dialog_content.dart @@ -1,81 +1,61 @@ part of 'dialog.dart'; -@internal -sealed class FDialogContent extends StatelessWidget { +sealed class _FDialogContent extends StatelessWidget { final FDialogContentStyle style; final CrossAxisAlignment alignment; - final String? title; + final Widget? title; final TextAlign titleTextAlign; - final Widget? rawTitle; - final String? body; + final Widget? body; final TextAlign bodyTextAlign; - final Widget? rawBody; final List actions; - const FDialogContent({ + const _FDialogContent({ required this.style, required this.alignment, required this.title, required this.titleTextAlign, - required this.rawTitle, required this.body, required this.bodyTextAlign, - required this.rawBody, required this.actions, - super.key, }); @override - Widget build(BuildContext context) { - final title = switch ((this.title, rawTitle)) { - (final String title, _) => Text(title), - (_, final Widget title) => title, - _ => null, - }; - - final body = switch ((this.body, rawBody)) { - (final String body, _) => Text(body), - (_, final Widget body) => body, - _ => null, - }; - - return IntrinsicWidth( - child: Padding( - padding: style.padding, - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: alignment, - children: [ - if (title != null) - Padding( - padding: const EdgeInsets.only(bottom: 12), - child: Semantics( - container: true, - child: DefaultTextStyle.merge( - textAlign: titleTextAlign, - style: style.titleTextStyle, - child: title, + Widget build(BuildContext context) => IntrinsicWidth( + child: Padding( + padding: style.padding, + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: alignment, + children: [ + if (title != null) + Padding( + padding: const EdgeInsets.only(bottom: 12), + child: Semantics( + container: true, + child: DefaultTextStyle.merge( + textAlign: titleTextAlign, + style: style.titleTextStyle, + child: title!, + ), ), ), - ), - if (body != null) - Padding( - padding: const EdgeInsets.only(bottom: 16), - child: Semantics( - container: true, - child: DefaultTextStyle.merge( - textAlign: bodyTextAlign, - style: style.bodyTextStyle, - child: body, + if (body != null) + Padding( + padding: const EdgeInsets.only(bottom: 16), + child: Semantics( + container: true, + child: DefaultTextStyle.merge( + textAlign: bodyTextAlign, + style: style.bodyTextStyle, + child: body!, + ), ), ), - ), - _actions(context), - ], + _actions(context), + ], + ), ), - ), - ); - } + ); Widget _actions(BuildContext context); @@ -85,24 +65,18 @@ sealed class FDialogContent extends StatelessWidget { properties ..add(DiagnosticsProperty('style', style)) ..add(DiagnosticsProperty('alignment', alignment)) - ..add(StringProperty('title', title)) ..add(DiagnosticsProperty('titleTextAlign', titleTextAlign)) - ..add(StringProperty('body', body)) ..add(DiagnosticsProperty('bodyTextAlign', bodyTextAlign)) ..add(IterableProperty('actions', actions)); } } -@internal -class FHorizontalDialogContent extends FDialogContent { - const FHorizontalDialogContent({ +class _FHorizontalDialogContent extends _FDialogContent { + const _FHorizontalDialogContent({ required super.style, required super.title, - required super.rawTitle, required super.body, - required super.rawBody, required super.actions, - super.key, }) : super(alignment: CrossAxisAlignment.start, titleTextAlign: TextAlign.start, bodyTextAlign: TextAlign.start); @override @@ -117,16 +91,12 @@ class FHorizontalDialogContent extends FDialogContent { ); } -@internal -class FVerticalDialogContent extends FDialogContent { - const FVerticalDialogContent({ +class _FVerticalDialogContent extends _FDialogContent { + const _FVerticalDialogContent({ required super.style, required super.title, - required super.rawTitle, required super.body, - required super.rawBody, required super.actions, - super.key, }) : super(alignment: CrossAxisAlignment.center, titleTextAlign: TextAlign.center, bodyTextAlign: TextAlign.center); @override @@ -139,7 +109,7 @@ class FVerticalDialogContent extends FDialogContent { ); } -/// The dialog content's style. +/// [FDialog] content's style. final class FDialogContentStyle with Diagnosticable { /// The title's [TextStyle]. final TextStyle titleTextStyle; @@ -212,4 +182,17 @@ final class FDialogContentStyle with Diagnosticable { ..add(DiagnosticsProperty('padding', padding)) ..add(DoubleProperty('actionPadding', actionPadding)); } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FDialogContentStyle && + runtimeType == other.runtimeType && + titleTextStyle == other.titleTextStyle && + bodyTextStyle == other.bodyTextStyle && + padding == other.padding && + actionPadding == other.actionPadding; + + @override + int get hashCode => titleTextStyle.hashCode ^ bodyTextStyle.hashCode ^ padding.hashCode ^ actionPadding.hashCode; } diff --git a/forui/lib/src/widgets/header/header_action.dart b/forui/lib/src/widgets/header/header_action.dart index 15ed8471a..70f0dc30e 100644 --- a/forui/lib/src/widgets/header/header_action.dart +++ b/forui/lib/src/widgets/header/header_action.dart @@ -152,6 +152,18 @@ class FHeaderActionStyle with Diagnosticable { ..add(ColorProperty('disabledColor', disabledColor)) ..add(DoubleProperty('size', size)); } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FHeaderActionStyle && + runtimeType == other.runtimeType && + enabledColor == other.enabledColor && + disabledColor == other.disabledColor && + size == other.size; + + @override + int get hashCode => enabledColor.hashCode ^ disabledColor.hashCode ^ size.hashCode; } class _InheritedActionStyle extends InheritedWidget { diff --git a/forui/lib/src/widgets/scaffold.dart b/forui/lib/src/widgets/scaffold.dart index 741088c8f..c268a978e 100644 --- a/forui/lib/src/widgets/scaffold.dart +++ b/forui/lib/src/widgets/scaffold.dart @@ -112,4 +112,18 @@ final class FScaffoldStyle with Diagnosticable { ..add(DiagnosticsProperty('headerDecoration', headerDecoration)) ..add(DiagnosticsProperty('footerDecoration', footerDecoration)); } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FScaffoldStyle && + runtimeType == other.runtimeType && + backgroundColor == other.backgroundColor && + contentPadding == other.contentPadding && + headerDecoration == other.headerDecoration && + footerDecoration == other.footerDecoration; + + @override + int get hashCode => + backgroundColor.hashCode ^ contentPadding.hashCode ^ headerDecoration.hashCode ^ footerDecoration.hashCode; } diff --git a/forui/lib/src/widgets/separator.dart b/forui/lib/src/widgets/separator.dart index 713e87cad..2caaca56b 100644 --- a/forui/lib/src/widgets/separator.dart +++ b/forui/lib/src/widgets/separator.dart @@ -1,5 +1,4 @@ import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; diff --git a/forui/lib/src/widgets/tabs/tab_controller.dart b/forui/lib/src/widgets/tabs/tab_controller.dart index d58a33e5a..6ea0e1553 100644 --- a/forui/lib/src/widgets/tabs/tab_controller.dart +++ b/forui/lib/src/widgets/tabs/tab_controller.dart @@ -33,4 +33,12 @@ class FTabController implements Listenable { /// it is called. Consumers of this class must decide on whether to notify /// listeners or not immediately before disposal. void dispose() => _controller.dispose(); + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FTabController && runtimeType == other.runtimeType && _controller == other._controller; + + @override + int get hashCode => _controller.hashCode; } diff --git a/forui/lib/src/widgets/tabs/tabs.dart b/forui/lib/src/widgets/tabs/tabs.dart index d1306068c..93fe4861d 100644 --- a/forui/lib/src/widgets/tabs/tabs.dart +++ b/forui/lib/src/widgets/tabs/tabs.dart @@ -11,21 +11,25 @@ part 'tab_controller.dart'; /// An object that represents a tab entry in a group of tabs. class FTabEntry { - /// The label. - final String? label; - - /// A raw label. - final Widget? rawLabel; + /// A label. + final Widget label; /// The content of a tab. final Widget content; /// Creates a [FTabs]. - FTabEntry({ + const FTabEntry({ required this.content, - this.label, - this.rawLabel, - }) : assert((label == null) ^ (rawLabel == null), 'Either "label" or "rawLabel" must be provided, but not both.'); + required this.label, + }); + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FTabEntry && runtimeType == other.runtimeType && label == other.label && content == other.content; + + @override + int get hashCode => label.hashCode ^ content.hashCode; } /// A [FTabs] that allows switching between tabs. @@ -108,7 +112,7 @@ class _FTabsState extends State with SingleTickerProviderStateMixin { for (final tab in tabs) Tab( height: style.height, - child: tab.rawLabel ?? Text(tab.label!), + child: tab.label, ), ], controller: (widget.controller ?? _controller)._controller, diff --git a/forui/lib/src/widgets/tabs/tabs_style.dart b/forui/lib/src/widgets/tabs/tabs_style.dart index 3ae9e2f20..561fe0848 100644 --- a/forui/lib/src/widgets/tabs/tabs_style.dart +++ b/forui/lib/src/widgets/tabs/tabs_style.dart @@ -117,4 +117,29 @@ final class FTabsStyle with Diagnosticable { ..add(DoubleProperty('height', height)) ..add(DoubleProperty('spacing', spacing)); } + + @override + bool operator ==(Object other) => + identical(this, other) || + other is FTabsStyle && + runtimeType == other.runtimeType && + decoration == other.decoration && + padding == other.padding && + unselectedLabel == other.unselectedLabel && + selectedLabel == other.selectedLabel && + indicator == other.indicator && + indicatorSize == other.indicatorSize && + height == other.height && + spacing == other.spacing; + + @override + int get hashCode => + decoration.hashCode ^ + padding.hashCode ^ + unselectedLabel.hashCode ^ + selectedLabel.hashCode ^ + indicator.hashCode ^ + indicatorSize.hashCode ^ + height.hashCode ^ + spacing.hashCode; } diff --git a/forui/lib/src/widgets/text_field/text_field.dart b/forui/lib/src/widgets/text_field/text_field.dart index 140243b3e..31c1c04b1 100644 --- a/forui/lib/src/widgets/text_field/text_field.dart +++ b/forui/lib/src/widgets/text_field/text_field.dart @@ -42,12 +42,12 @@ final class FTextField extends StatelessWidget { /// See [InputDecoration.hintText] for more information. final String? hint; - /// The raw help text. + /// The help text. /// /// See [InputDecoration.helper] for more information. final Widget? help; - /// The raw error text. + /// The error text. /// /// See [InputDecoration.error] for more information. final Widget? error; diff --git a/forui/lib/widgets.dart b/forui/lib/widgets.dart index 7e2a630ef..ea4d454e2 100644 --- a/forui/lib/widgets.dart +++ b/forui/lib/widgets.dart @@ -1,10 +1,10 @@ /// The Forui widgets and their corresponding styles. library forui.widgets; -export 'src/widgets/badge/badge.dart' hide FBadgeContent, Variant; -export 'src/widgets/button/button.dart' hide FButtonContent, Variant; -export 'src/widgets/card/card.dart' hide FCardContent; -export 'src/widgets/dialog/dialog.dart' hide FDialogContent, FHorizontalDialogContent, FVerticalDialogContent; +export 'src/widgets/badge/badge.dart' hide Variant; +export 'src/widgets/button/button.dart' hide Variant; +export 'src/widgets/card/card.dart'; +export 'src/widgets/dialog/dialog.dart'; export 'src/widgets/header/header.dart'; export 'src/widgets/tabs/tabs.dart'; export 'src/widgets/text_field/text_field.dart'; diff --git a/forui/test/golden/badge/zinc-dark-Variant.outline-raw-badge-content.png b/forui/test/golden/badge/zinc-dark-Variant.destructive-content-badge.png similarity index 61% rename from forui/test/golden/badge/zinc-dark-Variant.outline-raw-badge-content.png rename to forui/test/golden/badge/zinc-dark-Variant.destructive-content-badge.png index 6d28e3a50..852f5c06e 100644 Binary files a/forui/test/golden/badge/zinc-dark-Variant.outline-raw-badge-content.png and b/forui/test/golden/badge/zinc-dark-Variant.destructive-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-dark-Variant.destructive-raw-content.png b/forui/test/golden/badge/zinc-dark-Variant.destructive-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-dark-Variant.destructive-raw-content.png rename to forui/test/golden/badge/zinc-dark-Variant.destructive-raw-badge.png diff --git a/forui/test/golden/badge/zinc-dark-Variant.destructive-text-badge-content.png b/forui/test/golden/badge/zinc-dark-Variant.outline-content-badge.png similarity index 57% rename from forui/test/golden/badge/zinc-dark-Variant.destructive-text-badge-content.png rename to forui/test/golden/badge/zinc-dark-Variant.outline-content-badge.png index 75d2644e7..edf3f6a76 100644 Binary files a/forui/test/golden/badge/zinc-dark-Variant.destructive-text-badge-content.png and b/forui/test/golden/badge/zinc-dark-Variant.outline-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-dark-Variant.outline-raw-content.png b/forui/test/golden/badge/zinc-dark-Variant.outline-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-dark-Variant.outline-raw-content.png rename to forui/test/golden/badge/zinc-dark-Variant.outline-raw-badge.png diff --git a/forui/test/golden/badge/zinc-dark-Variant.outline-text-badge-content.png b/forui/test/golden/badge/zinc-dark-Variant.outline-text-badge-content.png deleted file mode 100644 index 6d28e3a50..000000000 Binary files a/forui/test/golden/badge/zinc-dark-Variant.outline-text-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-dark-Variant.primary-raw-badge-content.png b/forui/test/golden/badge/zinc-dark-Variant.primary-content-badge.png similarity index 71% rename from forui/test/golden/badge/zinc-dark-Variant.primary-raw-badge-content.png rename to forui/test/golden/badge/zinc-dark-Variant.primary-content-badge.png index 10aeded39..51e617f3c 100644 Binary files a/forui/test/golden/badge/zinc-dark-Variant.primary-raw-badge-content.png and b/forui/test/golden/badge/zinc-dark-Variant.primary-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-dark-Variant.primary-raw-content.png b/forui/test/golden/badge/zinc-dark-Variant.primary-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-dark-Variant.primary-raw-content.png rename to forui/test/golden/badge/zinc-dark-Variant.primary-raw-badge.png diff --git a/forui/test/golden/badge/zinc-dark-Variant.primary-text-badge-content.png b/forui/test/golden/badge/zinc-dark-Variant.secondary-content-badge.png similarity index 60% rename from forui/test/golden/badge/zinc-dark-Variant.primary-text-badge-content.png rename to forui/test/golden/badge/zinc-dark-Variant.secondary-content-badge.png index 10aeded39..d190ddf8d 100644 Binary files a/forui/test/golden/badge/zinc-dark-Variant.primary-text-badge-content.png and b/forui/test/golden/badge/zinc-dark-Variant.secondary-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-dark-Variant.secondary-raw-badge-content.png b/forui/test/golden/badge/zinc-dark-Variant.secondary-raw-badge-content.png deleted file mode 100644 index ed67ebee6..000000000 Binary files a/forui/test/golden/badge/zinc-dark-Variant.secondary-raw-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-dark-Variant.secondary-raw-content.png b/forui/test/golden/badge/zinc-dark-Variant.secondary-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-dark-Variant.secondary-raw-content.png rename to forui/test/golden/badge/zinc-dark-Variant.secondary-raw-badge.png diff --git a/forui/test/golden/badge/zinc-dark-Variant.secondary-text-badge-content.png b/forui/test/golden/badge/zinc-dark-Variant.secondary-text-badge-content.png deleted file mode 100644 index ed67ebee6..000000000 Binary files a/forui/test/golden/badge/zinc-dark-Variant.secondary-text-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-dark-Variant.destructive-raw-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.destructive-content-badge.png similarity index 64% rename from forui/test/golden/badge/zinc-dark-Variant.destructive-raw-badge-content.png rename to forui/test/golden/badge/zinc-light-Variant.destructive-content-badge.png index 75d2644e7..e75e8ed3c 100644 Binary files a/forui/test/golden/badge/zinc-dark-Variant.destructive-raw-badge-content.png and b/forui/test/golden/badge/zinc-light-Variant.destructive-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-light-Variant.destructive-raw-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.destructive-raw-badge-content.png deleted file mode 100644 index 8801d40aa..000000000 Binary files a/forui/test/golden/badge/zinc-light-Variant.destructive-raw-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-Variant.destructive-raw-content.png b/forui/test/golden/badge/zinc-light-Variant.destructive-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-light-Variant.destructive-raw-content.png rename to forui/test/golden/badge/zinc-light-Variant.destructive-raw-badge.png diff --git a/forui/test/golden/badge/zinc-light-Variant.destructive-text-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.destructive-text-badge-content.png deleted file mode 100644 index 8801d40aa..000000000 Binary files a/forui/test/golden/badge/zinc-light-Variant.destructive-text-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-Variant.primary-text-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.outline-content-badge.png similarity index 60% rename from forui/test/golden/badge/zinc-light-Variant.primary-text-badge-content.png rename to forui/test/golden/badge/zinc-light-Variant.outline-content-badge.png index c4faaf840..ba2865582 100644 Binary files a/forui/test/golden/badge/zinc-light-Variant.primary-text-badge-content.png and b/forui/test/golden/badge/zinc-light-Variant.outline-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-light-Variant.outline-raw-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.outline-raw-badge-content.png deleted file mode 100644 index 622ccb8b5..000000000 Binary files a/forui/test/golden/badge/zinc-light-Variant.outline-raw-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-Variant.outline-raw-content.png b/forui/test/golden/badge/zinc-light-Variant.outline-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-light-Variant.outline-raw-content.png rename to forui/test/golden/badge/zinc-light-Variant.outline-raw-badge.png diff --git a/forui/test/golden/badge/zinc-light-Variant.outline-text-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.outline-text-badge-content.png deleted file mode 100644 index 622ccb8b5..000000000 Binary files a/forui/test/golden/badge/zinc-light-Variant.outline-text-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-Variant.primary-content-badge.png b/forui/test/golden/badge/zinc-light-Variant.primary-content-badge.png new file mode 100644 index 000000000..932110f89 Binary files /dev/null and b/forui/test/golden/badge/zinc-light-Variant.primary-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-light-Variant.primary-raw-content.png b/forui/test/golden/badge/zinc-light-Variant.primary-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-light-Variant.primary-raw-content.png rename to forui/test/golden/badge/zinc-light-Variant.primary-raw-badge.png diff --git a/forui/test/golden/badge/zinc-light-Variant.primary-raw-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.secondary-content-badge.png similarity index 60% rename from forui/test/golden/badge/zinc-light-Variant.primary-raw-badge-content.png rename to forui/test/golden/badge/zinc-light-Variant.secondary-content-badge.png index c4faaf840..66d4e0442 100644 Binary files a/forui/test/golden/badge/zinc-light-Variant.primary-raw-badge-content.png and b/forui/test/golden/badge/zinc-light-Variant.secondary-content-badge.png differ diff --git a/forui/test/golden/badge/zinc-light-Variant.secondary-raw-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.secondary-raw-badge-content.png deleted file mode 100644 index 1794c691a..000000000 Binary files a/forui/test/golden/badge/zinc-light-Variant.secondary-raw-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-Variant.secondary-raw-content.png b/forui/test/golden/badge/zinc-light-Variant.secondary-raw-badge.png similarity index 100% rename from forui/test/golden/badge/zinc-light-Variant.secondary-raw-content.png rename to forui/test/golden/badge/zinc-light-Variant.secondary-raw-badge.png diff --git a/forui/test/golden/badge/zinc-light-Variant.secondary-text-badge-content.png b/forui/test/golden/badge/zinc-light-Variant.secondary-text-badge-content.png deleted file mode 100644 index 1794c691a..000000000 Binary files a/forui/test/golden/badge/zinc-light-Variant.secondary-text-badge-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-dark-Variant.destructive-disabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.destructive-disabled-button-content.png deleted file mode 100644 index 647f37ac4..000000000 Binary files a/forui/test/golden/button/zinc-dark-Variant.destructive-disabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-dark-Variant.destructive-enabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.destructive-disabled-content-button.png similarity index 50% rename from forui/test/golden/button/zinc-dark-Variant.destructive-enabled-button-content.png rename to forui/test/golden/button/zinc-dark-Variant.destructive-disabled-content-button.png index 8be1314f7..c1a56444d 100644 Binary files a/forui/test/golden/button/zinc-dark-Variant.destructive-enabled-button-content.png and b/forui/test/golden/button/zinc-dark-Variant.destructive-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.destructive-disabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.destructive-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.destructive-disabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.destructive-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-dark-Variant.destructive-enabled-content-button.png b/forui/test/golden/button/zinc-dark-Variant.destructive-enabled-content-button.png new file mode 100644 index 000000000..7bf9f1cc3 Binary files /dev/null and b/forui/test/golden/button/zinc-dark-Variant.destructive-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.destructive-enabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.destructive-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.destructive-enabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.destructive-enabled-raw-button.png diff --git a/forui/test/golden/button/zinc-dark-Variant.outline-disabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.outline-disabled-button-content.png deleted file mode 100644 index 518d29c80..000000000 Binary files a/forui/test/golden/button/zinc-dark-Variant.outline-disabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-dark-Variant.outline-disabled-content-button.png b/forui/test/golden/button/zinc-dark-Variant.outline-disabled-content-button.png new file mode 100644 index 000000000..88df4a935 Binary files /dev/null and b/forui/test/golden/button/zinc-dark-Variant.outline-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.outline-disabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.outline-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.outline-disabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.outline-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-dark-Variant.outline-enabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.outline-enabled-content-button.png similarity index 59% rename from forui/test/golden/button/zinc-dark-Variant.outline-enabled-button-content.png rename to forui/test/golden/button/zinc-dark-Variant.outline-enabled-content-button.png index 7abca1b2a..effa0053e 100644 Binary files a/forui/test/golden/button/zinc-dark-Variant.outline-enabled-button-content.png and b/forui/test/golden/button/zinc-dark-Variant.outline-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.outline-enabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.outline-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.outline-enabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.outline-enabled-raw-button.png diff --git a/forui/test/golden/button/zinc-dark-Variant.primary-disabled-content-button.png b/forui/test/golden/button/zinc-dark-Variant.primary-disabled-content-button.png new file mode 100644 index 000000000..dfe43a958 Binary files /dev/null and b/forui/test/golden/button/zinc-dark-Variant.primary-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.primary-disabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.primary-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.primary-disabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.primary-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-dark-Variant.primary-enabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.primary-enabled-button-content.png deleted file mode 100644 index 238224375..000000000 Binary files a/forui/test/golden/button/zinc-dark-Variant.primary-enabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-dark-Variant.primary-disabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.primary-enabled-content-button.png similarity index 50% rename from forui/test/golden/button/zinc-dark-Variant.primary-disabled-button-content.png rename to forui/test/golden/button/zinc-dark-Variant.primary-enabled-content-button.png index 37737357a..db442bdd4 100644 Binary files a/forui/test/golden/button/zinc-dark-Variant.primary-disabled-button-content.png and b/forui/test/golden/button/zinc-dark-Variant.primary-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.primary-enabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.primary-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.primary-enabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.primary-enabled-raw-button.png diff --git a/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-button-content.png deleted file mode 100644 index 10809214b..000000000 Binary files a/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-content-button.png b/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-content-button.png new file mode 100644 index 000000000..b0df6c978 Binary files /dev/null and b/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.secondary-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.secondary-disabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.secondary-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-dark-Variant.secondary-enabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.secondary-enabled-button-content.png deleted file mode 100644 index a06be7216..000000000 Binary files a/forui/test/golden/button/zinc-dark-Variant.secondary-enabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-light-Variant.outline-enabled-button-content.png b/forui/test/golden/button/zinc-dark-Variant.secondary-enabled-content-button.png similarity index 50% rename from forui/test/golden/button/zinc-light-Variant.outline-enabled-button-content.png rename to forui/test/golden/button/zinc-dark-Variant.secondary-enabled-content-button.png index 5a7c4d97f..68c6ffaf5 100644 Binary files a/forui/test/golden/button/zinc-light-Variant.outline-enabled-button-content.png and b/forui/test/golden/button/zinc-dark-Variant.secondary-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-dark-Variant.secondary-enabled-raw-content.png b/forui/test/golden/button/zinc-dark-Variant.secondary-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-dark-Variant.secondary-enabled-raw-content.png rename to forui/test/golden/button/zinc-dark-Variant.secondary-enabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.secondary-disabled-button-content.png b/forui/test/golden/button/zinc-light-Variant.destructive-disabled-content-button.png similarity index 52% rename from forui/test/golden/button/zinc-light-Variant.secondary-disabled-button-content.png rename to forui/test/golden/button/zinc-light-Variant.destructive-disabled-content-button.png index cd217e44f..181943bbe 100644 Binary files a/forui/test/golden/button/zinc-light-Variant.secondary-disabled-button-content.png and b/forui/test/golden/button/zinc-light-Variant.destructive-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.destructive-disabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.destructive-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.destructive-disabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.destructive-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.destructive-enabled-button-content.png b/forui/test/golden/button/zinc-light-Variant.destructive-enabled-button-content.png deleted file mode 100644 index d379f406c..000000000 Binary files a/forui/test/golden/button/zinc-light-Variant.destructive-enabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-light-Variant.destructive-enabled-content-button.png b/forui/test/golden/button/zinc-light-Variant.destructive-enabled-content-button.png new file mode 100644 index 000000000..ebec052d9 Binary files /dev/null and b/forui/test/golden/button/zinc-light-Variant.destructive-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.destructive-enabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.destructive-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.destructive-enabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.destructive-enabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.outline-disabled-button-content.png b/forui/test/golden/button/zinc-light-Variant.outline-disabled-content-button.png similarity index 57% rename from forui/test/golden/button/zinc-light-Variant.outline-disabled-button-content.png rename to forui/test/golden/button/zinc-light-Variant.outline-disabled-content-button.png index 61ae8e18a..77b15abfc 100644 Binary files a/forui/test/golden/button/zinc-light-Variant.outline-disabled-button-content.png and b/forui/test/golden/button/zinc-light-Variant.outline-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.outline-disabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.outline-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.outline-disabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.outline-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.outline-enabled-content-button.png b/forui/test/golden/button/zinc-light-Variant.outline-enabled-content-button.png new file mode 100644 index 000000000..9520937e0 Binary files /dev/null and b/forui/test/golden/button/zinc-light-Variant.outline-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.outline-enabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.outline-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.outline-enabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.outline-enabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.primary-disabled-button-content.png b/forui/test/golden/button/zinc-light-Variant.primary-disabled-button-content.png deleted file mode 100644 index c75d3d810..000000000 Binary files a/forui/test/golden/button/zinc-light-Variant.primary-disabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-light-Variant.primary-disabled-content-button.png b/forui/test/golden/button/zinc-light-Variant.primary-disabled-content-button.png new file mode 100644 index 000000000..d697dada1 Binary files /dev/null and b/forui/test/golden/button/zinc-light-Variant.primary-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.primary-disabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.primary-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.primary-disabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.primary-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.primary-enabled-button-content.png b/forui/test/golden/button/zinc-light-Variant.primary-enabled-button-content.png deleted file mode 100644 index 40d264870..000000000 Binary files a/forui/test/golden/button/zinc-light-Variant.primary-enabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-light-Variant.primary-enabled-content-button.png b/forui/test/golden/button/zinc-light-Variant.primary-enabled-content-button.png new file mode 100644 index 000000000..16ed97b54 Binary files /dev/null and b/forui/test/golden/button/zinc-light-Variant.primary-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.primary-enabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.primary-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.primary-enabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.primary-enabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.destructive-disabled-button-content.png b/forui/test/golden/button/zinc-light-Variant.secondary-disabled-content-button.png similarity index 53% rename from forui/test/golden/button/zinc-light-Variant.destructive-disabled-button-content.png rename to forui/test/golden/button/zinc-light-Variant.secondary-disabled-content-button.png index 7bfa2fc8a..2bd9623c3 100644 Binary files a/forui/test/golden/button/zinc-light-Variant.destructive-disabled-button-content.png and b/forui/test/golden/button/zinc-light-Variant.secondary-disabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.secondary-disabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.secondary-disabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.secondary-disabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.secondary-disabled-raw-button.png diff --git a/forui/test/golden/button/zinc-light-Variant.secondary-enabled-button-content.png b/forui/test/golden/button/zinc-light-Variant.secondary-enabled-button-content.png deleted file mode 100644 index 11e930d98..000000000 Binary files a/forui/test/golden/button/zinc-light-Variant.secondary-enabled-button-content.png and /dev/null differ diff --git a/forui/test/golden/button/zinc-light-Variant.secondary-enabled-content-button.png b/forui/test/golden/button/zinc-light-Variant.secondary-enabled-content-button.png new file mode 100644 index 000000000..ac1da6c0e Binary files /dev/null and b/forui/test/golden/button/zinc-light-Variant.secondary-enabled-content-button.png differ diff --git a/forui/test/golden/button/zinc-light-Variant.secondary-enabled-raw-content.png b/forui/test/golden/button/zinc-light-Variant.secondary-enabled-raw-button.png similarity index 100% rename from forui/test/golden/button/zinc-light-Variant.secondary-enabled-raw-content.png rename to forui/test/golden/button/zinc-light-Variant.secondary-enabled-raw-button.png diff --git a/forui/test/golden/card/zinc-dark-content-card.png b/forui/test/golden/card/zinc-dark-content-card.png new file mode 100644 index 000000000..53fcef0ff Binary files /dev/null and b/forui/test/golden/card/zinc-dark-content-card.png differ diff --git a/forui/test/golden/card/zinc-dark-raw-card-content.png b/forui/test/golden/card/zinc-dark-raw-card-content.png deleted file mode 100644 index c32e54384..000000000 Binary files a/forui/test/golden/card/zinc-dark-raw-card-content.png and /dev/null differ diff --git a/forui/test/golden/card/zinc-dark-raw-content.png b/forui/test/golden/card/zinc-dark-raw-card.png similarity index 100% rename from forui/test/golden/card/zinc-dark-raw-content.png rename to forui/test/golden/card/zinc-dark-raw-card.png diff --git a/forui/test/golden/card/zinc-dark-text-card-content.png b/forui/test/golden/card/zinc-dark-text-card-content.png deleted file mode 100644 index c32e54384..000000000 Binary files a/forui/test/golden/card/zinc-dark-text-card-content.png and /dev/null differ diff --git a/forui/test/golden/card/zinc-light-content-card.png b/forui/test/golden/card/zinc-light-content-card.png new file mode 100644 index 000000000..7cc2cdd46 Binary files /dev/null and b/forui/test/golden/card/zinc-light-content-card.png differ diff --git a/forui/test/golden/card/zinc-light-raw-card-content.png b/forui/test/golden/card/zinc-light-raw-card-content.png deleted file mode 100644 index 74c2b9a0f..000000000 Binary files a/forui/test/golden/card/zinc-light-raw-card-content.png and /dev/null differ diff --git a/forui/test/golden/card/zinc-light-raw-content.png b/forui/test/golden/card/zinc-light-raw-card.png similarity index 100% rename from forui/test/golden/card/zinc-light-raw-content.png rename to forui/test/golden/card/zinc-light-raw-card.png diff --git a/forui/test/golden/card/zinc-light-text-card-content.png b/forui/test/golden/card/zinc-light-text-card-content.png deleted file mode 100644 index 74c2b9a0f..000000000 Binary files a/forui/test/golden/card/zinc-light-text-card-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-dark-Axis.horizontal-raw-dialog-content.png b/forui/test/golden/dialog/zinc-dark-Axis.horizontal-content-dialog.png similarity index 100% rename from forui/test/golden/dialog/zinc-dark-Axis.horizontal-raw-dialog-content.png rename to forui/test/golden/dialog/zinc-dark-Axis.horizontal-content-dialog.png diff --git a/forui/test/golden/dialog/zinc-dark-Axis.horizontal-text-dialog-content.png b/forui/test/golden/dialog/zinc-dark-Axis.horizontal-text-dialog-content.png deleted file mode 100644 index 4558c75c6..000000000 Binary files a/forui/test/golden/dialog/zinc-dark-Axis.horizontal-text-dialog-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-dark-Axis.vertical-raw-dialog-content.png b/forui/test/golden/dialog/zinc-dark-Axis.vertical-content-dialog.png similarity index 100% rename from forui/test/golden/dialog/zinc-dark-Axis.vertical-raw-dialog-content.png rename to forui/test/golden/dialog/zinc-dark-Axis.vertical-content-dialog.png diff --git a/forui/test/golden/dialog/zinc-dark-Axis.vertical-text-dialog-content.png b/forui/test/golden/dialog/zinc-dark-Axis.vertical-text-dialog-content.png deleted file mode 100644 index ad2e6080a..000000000 Binary files a/forui/test/golden/dialog/zinc-dark-Axis.vertical-text-dialog-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-dark-raw-content.png b/forui/test/golden/dialog/zinc-dark-raw-content-dialog.png similarity index 100% rename from forui/test/golden/dialog/zinc-dark-raw-content.png rename to forui/test/golden/dialog/zinc-dark-raw-content-dialog.png diff --git a/forui/test/golden/dialog/zinc-light-Axis.horizontal-raw-dialog-content.png b/forui/test/golden/dialog/zinc-light-Axis.horizontal-content-dialog.png similarity index 100% rename from forui/test/golden/dialog/zinc-light-Axis.horizontal-raw-dialog-content.png rename to forui/test/golden/dialog/zinc-light-Axis.horizontal-content-dialog.png diff --git a/forui/test/golden/dialog/zinc-light-Axis.horizontal-text-dialog-content.png b/forui/test/golden/dialog/zinc-light-Axis.horizontal-text-dialog-content.png deleted file mode 100644 index 360a4b851..000000000 Binary files a/forui/test/golden/dialog/zinc-light-Axis.horizontal-text-dialog-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-light-Axis.vertical-raw-dialog-content.png b/forui/test/golden/dialog/zinc-light-Axis.vertical-content-dialog.png similarity index 100% rename from forui/test/golden/dialog/zinc-light-Axis.vertical-raw-dialog-content.png rename to forui/test/golden/dialog/zinc-light-Axis.vertical-content-dialog.png diff --git a/forui/test/golden/dialog/zinc-light-Axis.vertical-text-dialog-content.png b/forui/test/golden/dialog/zinc-light-Axis.vertical-text-dialog-content.png deleted file mode 100644 index c3596ee8d..000000000 Binary files a/forui/test/golden/dialog/zinc-light-Axis.vertical-text-dialog-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-light-raw-content.png b/forui/test/golden/dialog/zinc-light-raw-content-dialog.png similarity index 100% rename from forui/test/golden/dialog/zinc-light-raw-content.png rename to forui/test/golden/dialog/zinc-light-raw-content-dialog.png diff --git a/forui/test/golden/scaffold/zinc-dark.png b/forui/test/golden/scaffold/zinc-dark-scaffold.png similarity index 100% rename from forui/test/golden/scaffold/zinc-dark.png rename to forui/test/golden/scaffold/zinc-dark-scaffold.png diff --git a/forui/test/golden/scaffold/zinc-light.png b/forui/test/golden/scaffold/zinc-light-scaffold.png similarity index 100% rename from forui/test/golden/scaffold/zinc-light.png rename to forui/test/golden/scaffold/zinc-light-scaffold.png diff --git a/forui/test/golden/separator/zinc-dark-horizontal.png b/forui/test/golden/separator/zinc-dark-horizontal-separator.png similarity index 100% rename from forui/test/golden/separator/zinc-dark-horizontal.png rename to forui/test/golden/separator/zinc-dark-horizontal-separator.png diff --git a/forui/test/golden/separator/zinc-dark-vertical.png b/forui/test/golden/separator/zinc-dark-vertical-separator.png similarity index 100% rename from forui/test/golden/separator/zinc-dark-vertical.png rename to forui/test/golden/separator/zinc-dark-vertical-separator.png diff --git a/forui/test/golden/separator/zinc-light-horizontal.png b/forui/test/golden/separator/zinc-light-horizontal-separator.png similarity index 100% rename from forui/test/golden/separator/zinc-light-horizontal.png rename to forui/test/golden/separator/zinc-light-horizontal-separator.png diff --git a/forui/test/golden/separator/zinc-light-vertical.png b/forui/test/golden/separator/zinc-light-vertical-separator.png similarity index 100% rename from forui/test/golden/separator/zinc-light-vertical.png rename to forui/test/golden/separator/zinc-light-vertical-separator.png diff --git a/forui/test/golden/switch/zinc-dark-checked-disabled.png b/forui/test/golden/switch/zinc-dark-checked-disabled-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-dark-checked-disabled.png rename to forui/test/golden/switch/zinc-dark-checked-disabled-switch.png diff --git a/forui/test/golden/switch/zinc-dark-checked-focused.png b/forui/test/golden/switch/zinc-dark-checked-focused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-dark-checked-focused.png rename to forui/test/golden/switch/zinc-dark-checked-focused-switch.png diff --git a/forui/test/golden/switch/zinc-dark-checked-unfocused.png b/forui/test/golden/switch/zinc-dark-checked-unfocused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-dark-checked-unfocused.png rename to forui/test/golden/switch/zinc-dark-checked-unfocused-switch.png diff --git a/forui/test/golden/switch/zinc-dark-unchecked-disabled.png b/forui/test/golden/switch/zinc-dark-unchecked-disabled-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-dark-unchecked-disabled.png rename to forui/test/golden/switch/zinc-dark-unchecked-disabled-switch.png diff --git a/forui/test/golden/switch/zinc-dark-unchecked-focused.png b/forui/test/golden/switch/zinc-dark-unchecked-focused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-dark-unchecked-focused.png rename to forui/test/golden/switch/zinc-dark-unchecked-focused-switch.png diff --git a/forui/test/golden/switch/zinc-dark-unchecked-unfocused.png b/forui/test/golden/switch/zinc-dark-unchecked-unfocused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-dark-unchecked-unfocused.png rename to forui/test/golden/switch/zinc-dark-unchecked-unfocused-switch.png diff --git a/forui/test/golden/switch/zinc-light-checked-disabled.png b/forui/test/golden/switch/zinc-light-checked-disabled-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-light-checked-disabled.png rename to forui/test/golden/switch/zinc-light-checked-disabled-switch.png diff --git a/forui/test/golden/switch/zinc-light-checked-focused.png b/forui/test/golden/switch/zinc-light-checked-focused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-light-checked-focused.png rename to forui/test/golden/switch/zinc-light-checked-focused-switch.png diff --git a/forui/test/golden/switch/zinc-light-checked-unfocused.png b/forui/test/golden/switch/zinc-light-checked-unfocused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-light-checked-unfocused.png rename to forui/test/golden/switch/zinc-light-checked-unfocused-switch.png diff --git a/forui/test/golden/switch/zinc-light-unchecked-disabled.png b/forui/test/golden/switch/zinc-light-unchecked-disabled-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-light-unchecked-disabled.png rename to forui/test/golden/switch/zinc-light-unchecked-disabled-switch.png diff --git a/forui/test/golden/switch/zinc-light-unchecked-focused.png b/forui/test/golden/switch/zinc-light-unchecked-focused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-light-unchecked-focused.png rename to forui/test/golden/switch/zinc-light-unchecked-focused-switch.png diff --git a/forui/test/golden/switch/zinc-light-unchecked-unfocused.png b/forui/test/golden/switch/zinc-light-unchecked-unfocused-switch.png similarity index 100% rename from forui/test/golden/switch/zinc-light-unchecked-unfocused.png rename to forui/test/golden/switch/zinc-light-unchecked-unfocused-switch.png diff --git a/forui/test/golden/tabs/zinc-dark-tab.png b/forui/test/golden/tabs/zinc-dark-tab.png deleted file mode 100644 index bd59b88d7..000000000 Binary files a/forui/test/golden/tabs/zinc-dark-tab.png and /dev/null differ diff --git a/forui/test/golden/tabs/zinc-dark-tabs.png b/forui/test/golden/tabs/zinc-dark-tabs.png new file mode 100644 index 000000000..fa8ecd5e2 Binary files /dev/null and b/forui/test/golden/tabs/zinc-dark-tabs.png differ diff --git a/forui/test/golden/tabs/zinc-light-tab.png b/forui/test/golden/tabs/zinc-light-tab.png deleted file mode 100644 index 5444b898d..000000000 Binary files a/forui/test/golden/tabs/zinc-light-tab.png and /dev/null differ diff --git a/forui/test/golden/tabs/zinc-light-tabs.png b/forui/test/golden/tabs/zinc-light-tabs.png new file mode 100644 index 000000000..37caf9ad7 Binary files /dev/null and b/forui/test/golden/tabs/zinc-light-tabs.png differ diff --git a/forui/test/golden/text_field/default-zinc-dark-focused-no-text.png b/forui/test/golden/text_field/default-zinc-dark-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-dark-focused-no-text.png rename to forui/test/golden/text_field/default-zinc-dark-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/default-zinc-dark-focused-text.png b/forui/test/golden/text_field/default-zinc-dark-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-dark-focused-text.png rename to forui/test/golden/text_field/default-zinc-dark-focused-text-text-field.png diff --git a/forui/test/golden/text_field/default-zinc-dark-unfocused-no-text.png b/forui/test/golden/text_field/default-zinc-dark-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-dark-unfocused-no-text.png rename to forui/test/golden/text_field/default-zinc-dark-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/default-zinc-dark-unfocused-text.png b/forui/test/golden/text_field/default-zinc-dark-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-dark-unfocused-text.png rename to forui/test/golden/text_field/default-zinc-dark-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/default-zinc-light-focused-no-text.png b/forui/test/golden/text_field/default-zinc-light-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-light-focused-no-text.png rename to forui/test/golden/text_field/default-zinc-light-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/default-zinc-light-focused-text.png b/forui/test/golden/text_field/default-zinc-light-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-light-focused-text.png rename to forui/test/golden/text_field/default-zinc-light-focused-text-text-field.png diff --git a/forui/test/golden/text_field/default-zinc-light-unfocused-no-text.png b/forui/test/golden/text_field/default-zinc-light-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-light-unfocused-no-text.png rename to forui/test/golden/text_field/default-zinc-light-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/default-zinc-light-unfocused-text.png b/forui/test/golden/text_field/default-zinc-light-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/default-zinc-light-unfocused-text.png rename to forui/test/golden/text_field/default-zinc-light-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-dark-focused-no-text.png b/forui/test/golden/text_field/email-zinc-dark-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-dark-focused-no-text.png rename to forui/test/golden/text_field/email-zinc-dark-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-dark-focused-text.png b/forui/test/golden/text_field/email-zinc-dark-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-dark-focused-text.png rename to forui/test/golden/text_field/email-zinc-dark-focused-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-dark-unfocused-no-text.png b/forui/test/golden/text_field/email-zinc-dark-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-dark-unfocused-no-text.png rename to forui/test/golden/text_field/email-zinc-dark-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-dark-unfocused-text.png b/forui/test/golden/text_field/email-zinc-dark-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-dark-unfocused-text.png rename to forui/test/golden/text_field/email-zinc-dark-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-light-focused-no-text.png b/forui/test/golden/text_field/email-zinc-light-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-light-focused-no-text.png rename to forui/test/golden/text_field/email-zinc-light-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-light-focused-text.png b/forui/test/golden/text_field/email-zinc-light-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-light-focused-text.png rename to forui/test/golden/text_field/email-zinc-light-focused-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-light-unfocused-no-text.png b/forui/test/golden/text_field/email-zinc-light-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-light-unfocused-no-text.png rename to forui/test/golden/text_field/email-zinc-light-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/email-zinc-light-unfocused-text.png b/forui/test/golden/text_field/email-zinc-light-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/email-zinc-light-unfocused-text.png rename to forui/test/golden/text_field/email-zinc-light-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-dark-focused-no-text.png b/forui/test/golden/text_field/error-zinc-dark-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-dark-focused-no-text.png rename to forui/test/golden/text_field/error-zinc-dark-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-dark-focused-text.png b/forui/test/golden/text_field/error-zinc-dark-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-dark-focused-text.png rename to forui/test/golden/text_field/error-zinc-dark-focused-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-dark-unfocused-no-text.png b/forui/test/golden/text_field/error-zinc-dark-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-dark-unfocused-no-text.png rename to forui/test/golden/text_field/error-zinc-dark-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-dark-unfocused-text.png b/forui/test/golden/text_field/error-zinc-dark-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-dark-unfocused-text.png rename to forui/test/golden/text_field/error-zinc-dark-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-light-focused-no-text.png b/forui/test/golden/text_field/error-zinc-light-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-light-focused-no-text.png rename to forui/test/golden/text_field/error-zinc-light-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-light-focused-text.png b/forui/test/golden/text_field/error-zinc-light-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-light-focused-text.png rename to forui/test/golden/text_field/error-zinc-light-focused-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-light-unfocused-no-text.png b/forui/test/golden/text_field/error-zinc-light-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-light-unfocused-no-text.png rename to forui/test/golden/text_field/error-zinc-light-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/error-zinc-light-unfocused-text.png b/forui/test/golden/text_field/error-zinc-light-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/error-zinc-light-unfocused-text.png rename to forui/test/golden/text_field/error-zinc-light-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-dark-focused-no-text.png b/forui/test/golden/text_field/multiline-zinc-dark-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-dark-focused-no-text.png rename to forui/test/golden/text_field/multiline-zinc-dark-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-dark-focused-text.png b/forui/test/golden/text_field/multiline-zinc-dark-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-dark-focused-text.png rename to forui/test/golden/text_field/multiline-zinc-dark-focused-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-dark-unfocused-no-text.png b/forui/test/golden/text_field/multiline-zinc-dark-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-dark-unfocused-no-text.png rename to forui/test/golden/text_field/multiline-zinc-dark-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-dark-unfocused-text.png b/forui/test/golden/text_field/multiline-zinc-dark-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-dark-unfocused-text.png rename to forui/test/golden/text_field/multiline-zinc-dark-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-light-focused-no-text.png b/forui/test/golden/text_field/multiline-zinc-light-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-light-focused-no-text.png rename to forui/test/golden/text_field/multiline-zinc-light-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-light-focused-text.png b/forui/test/golden/text_field/multiline-zinc-light-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-light-focused-text.png rename to forui/test/golden/text_field/multiline-zinc-light-focused-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-light-unfocused-no-text.png b/forui/test/golden/text_field/multiline-zinc-light-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-light-unfocused-no-text.png rename to forui/test/golden/text_field/multiline-zinc-light-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/multiline-zinc-light-unfocused-text.png b/forui/test/golden/text_field/multiline-zinc-light-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/multiline-zinc-light-unfocused-text.png rename to forui/test/golden/text_field/multiline-zinc-light-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-dark-focused-no-text.png b/forui/test/golden/text_field/password-zinc-dark-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-dark-focused-no-text.png rename to forui/test/golden/text_field/password-zinc-dark-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-dark-focused-text.png b/forui/test/golden/text_field/password-zinc-dark-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-dark-focused-text.png rename to forui/test/golden/text_field/password-zinc-dark-focused-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-dark-unfocused-no-text.png b/forui/test/golden/text_field/password-zinc-dark-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-dark-unfocused-no-text.png rename to forui/test/golden/text_field/password-zinc-dark-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-dark-unfocused-text.png b/forui/test/golden/text_field/password-zinc-dark-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-dark-unfocused-text.png rename to forui/test/golden/text_field/password-zinc-dark-unfocused-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-light-focused-no-text.png b/forui/test/golden/text_field/password-zinc-light-focused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-light-focused-no-text.png rename to forui/test/golden/text_field/password-zinc-light-focused-no-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-light-focused-text.png b/forui/test/golden/text_field/password-zinc-light-focused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-light-focused-text.png rename to forui/test/golden/text_field/password-zinc-light-focused-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-light-unfocused-no-text.png b/forui/test/golden/text_field/password-zinc-light-unfocused-no-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-light-unfocused-no-text.png rename to forui/test/golden/text_field/password-zinc-light-unfocused-no-text-text-field.png diff --git a/forui/test/golden/text_field/password-zinc-light-unfocused-text.png b/forui/test/golden/text_field/password-zinc-light-unfocused-text-text-field.png similarity index 100% rename from forui/test/golden/text_field/password-zinc-light-unfocused-text.png rename to forui/test/golden/text_field/password-zinc-light-unfocused-text-text-field.png diff --git a/forui/test/src/widgets/badge/badge_test.dart b/forui/test/src/widgets/badge/badge_test.dart deleted file mode 100644 index 2b6702558..000000000 --- a/forui/test/src/widgets/badge/badge_test.dart +++ /dev/null @@ -1,39 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_test/flutter_test.dart'; - -import 'package:forui/forui.dart'; - -void main() { - group('FBadge', () { - for (final (label, rawLabel) in [ - ('', null), - (null, const SizedBox()), - ]) { - testWidgets('constructor does not throw error', (tester) async { - expect( - () => FBadge( - label: label, - rawLabel: rawLabel, - ), - returnsNormally, - ); - }); - } - - for (final (label, rawLabel) in [ - (null, null), - ('', const SizedBox()), - ]) { - testWidgets('constructor throws error', (tester) async { - expect( - () => FBadge( - label: label, - rawLabel: rawLabel, - ), - throwsAssertionError, - ); - }); - } - }); -} diff --git a/forui/test/src/widgets/badge/badge_golden_test.dart b/forui/test/src/widgets/badge_golden_test.dart similarity index 68% rename from forui/test/src/widgets/badge/badge_golden_test.dart rename to forui/test/src/widgets/badge_golden_test.dart index b58cbe86c..8510f37f3 100644 --- a/forui/test/src/widgets/badge/badge_golden_test.dart +++ b/forui/test/src/widgets/badge_golden_test.dart @@ -6,19 +6,19 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:forui/src/widgets/badge/badge.dart'; -import '../../test_scaffold.dart'; +import '../test_scaffold.dart'; void main() { group('FBadge', () { for (final (name, theme, background) in TestScaffold.themes) { for (final variant in Variant.values) { - testWidgets('$name with text FBadgeContent', (tester) async { + testWidgets('$name with FBadgeContent', (tester) async { await tester.pumpWidget( TestScaffold( data: theme, background: background, child: FBadge( - label: 'Badge', + label: const Text('Badge'), style: variant, ), ), @@ -26,25 +26,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('badge/$name-$variant-text-badge-content.png'), - ); - }); - - testWidgets('$name with raw FBadgeContent', (tester) async { - await tester.pumpWidget( - TestScaffold( - data: theme, - background: background, - child: FBadge( - rawLabel: const Text('Badge'), - style: variant, - ), - ), - ); - - await expectLater( - find.byType(TestScaffold), - matchesGoldenFile('badge/$name-$variant-raw-badge-content.png'), + matchesGoldenFile('badge/$name-$variant-content-badge.png'), ); }); @@ -80,7 +62,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('badge/$name-$variant-raw-content.png'), + matchesGoldenFile('badge/$name-$variant-raw-badge.png'), ); }); } diff --git a/forui/test/src/widgets/button/button_golden_test.dart b/forui/test/src/widgets/button/button_golden_test.dart index b68eeb0b3..9ed587cc9 100644 --- a/forui/test/src/widgets/button/button_golden_test.dart +++ b/forui/test/src/widgets/button/button_golden_test.dart @@ -20,10 +20,10 @@ void main() { child: Padding( padding: const EdgeInsets.symmetric(horizontal: 20), child: FButton( - label: 'Button', + label: const Text('Button'), style: variant, - prefixIcon: FButtonIcon(icon: FAssets.icons.circlePlay), - suffixIcon: FButtonIcon(icon: FAssets.icons.circleStop), + prefix: FButtonIcon(icon: FAssets.icons.circlePlay), + suffix: FButtonIcon(icon: FAssets.icons.circleStop), onPress: () {}, ), ), @@ -32,7 +32,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('button/$name-$variant-enabled-button-content.png'), + matchesGoldenFile('button/$name-$variant-enabled-content-button.png'), ); }); @@ -43,10 +43,10 @@ void main() { child: Padding( padding: const EdgeInsets.symmetric(horizontal: 20), child: FButton( - label: 'Button', + label: const Text('Button'), style: variant, - prefixIcon: FButtonIcon(icon: FAssets.icons.circlePlay), - suffixIcon: FButtonIcon(icon: FAssets.icons.circleStop), + prefix: FButtonIcon(icon: FAssets.icons.circlePlay), + suffix: FButtonIcon(icon: FAssets.icons.circleStop), onPress: null, ), ), @@ -55,7 +55,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('button/$name-$variant-disabled-button-content.png'), + matchesGoldenFile('button/$name-$variant-disabled-content-button.png'), ); }); @@ -94,7 +94,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('button/$name-$variant-enabled-raw-content.png'), + matchesGoldenFile('button/$name-$variant-enabled-raw-button.png'), ); }); @@ -133,7 +133,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('button/$name-$variant-disabled-raw-content.png'), + matchesGoldenFile('button/$name-$variant-disabled-raw-button.png'), ); }); } diff --git a/forui/test/src/widgets/button/buttoin_icon_test.dart b/forui/test/src/widgets/button/button_icon_test.dart similarity index 56% rename from forui/test/src/widgets/button/buttoin_icon_test.dart rename to forui/test/src/widgets/button/button_icon_test.dart index 52be774cf..492cc4e10 100644 --- a/forui/test/src/widgets/button/buttoin_icon_test.dart +++ b/forui/test/src/widgets/button/button_icon_test.dart @@ -8,14 +8,22 @@ void main() { group('FButtonIconStyle', () { test('invalid height', () { expect( - () => FButtonIconStyle(height: 0, enabledColor: Colors.white, disabledColor: Colors.white), + () => FButtonIconStyle( + height: 0, + enabledColor: Colors.white, + disabledColor: Colors.white, + ), throwsAssertionError, ); }); test('valid height', () { expect( - () => FButtonIconStyle(height: 1, enabledColor: Colors.white, disabledColor: Colors.white), + () => FButtonIconStyle( + height: 1, + enabledColor: Colors.white, + disabledColor: Colors.white, + ), returnsNormally, ); }); diff --git a/forui/test/src/widgets/button/button_test.dart b/forui/test/src/widgets/button/button_test.dart deleted file mode 100644 index e80246549..000000000 --- a/forui/test/src/widgets/button/button_test.dart +++ /dev/null @@ -1,41 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_test/flutter_test.dart'; - -import 'package:forui/forui.dart'; - -void main() { - group('FButton', () { - for (final (label, rawLabel) in [ - ('', null), - (null, const SizedBox()), - ]) { - testWidgets('constructor does not throw error', (tester) async { - expect( - () => FButton( - label: label, - rawLabel: rawLabel, - onPress: () {}, - ), - returnsNormally, - ); - }); - } - - for (final (label, rawLabel) in [ - (null, null), - ('', const SizedBox()), - ]) { - testWidgets('constructor throws error', (tester) async { - expect( - () => FButton( - label: label, - rawLabel: rawLabel, - onPress: () {}, - ), - throwsAssertionError, - ); - }); - } - }); -} diff --git a/forui/test/src/widgets/card/card_test.dart b/forui/test/src/widgets/card/card_test.dart deleted file mode 100644 index 6801cb89e..000000000 --- a/forui/test/src/widgets/card/card_test.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_test/flutter_test.dart'; - -import 'package:forui/forui.dart'; - -void main() { - group('FCard', () { - for (final (string, raw) in [ - (null, null), - ('', null), - (null, const SizedBox()), - ]) { - testWidgets('constructor title does not throw error', (tester) async { - expect( - () => FCard( - title: string, - rawTitle: raw, - ), - returnsNormally, - ); - }); - - testWidgets('constructor subtitle does not throw error', (tester) async { - expect( - () => FCard( - subtitle: string, - rawSubtitle: raw, - ), - returnsNormally, - ); - }); - } - - for (final (string, raw) in [ - ('', const SizedBox()), - ]) { - testWidgets('constructor title throws error', (tester) async { - expect( - () => FCard( - title: string, - rawTitle: raw, - ), - throwsAssertionError, - ); - }); - - testWidgets('constructor subtitle throws error', (tester) async { - expect( - () => FCard( - subtitle: string, - rawSubtitle: raw, - ), - throwsAssertionError, - ); - }); - } - }); -} diff --git a/forui/test/src/widgets/card/card_golden_test.dart b/forui/test/src/widgets/card_golden_test.dart similarity index 56% rename from forui/test/src/widgets/card/card_golden_test.dart rename to forui/test/src/widgets/card_golden_test.dart index fa6a7f149..f728474bd 100644 --- a/forui/test/src/widgets/card/card_golden_test.dart +++ b/forui/test/src/widgets/card_golden_test.dart @@ -6,12 +6,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:forui/forui.dart'; -import '../../test_scaffold.dart'; +import '../test_scaffold.dart'; void main() { group('FCard', () { for (final (name, theme, background) in TestScaffold.themes) { - testWidgets('$name with text FCardContent', (tester) async { + testWidgets('$name with FCardContent', (tester) async { await tester.pumpWidget( TestScaffold( data: theme, @@ -20,8 +20,8 @@ void main() { mainAxisAlignment: MainAxisAlignment.center, children: [ FCard( - title: 'Notifications', - subtitle: 'You have 3 unread messages.', + title: const Text('Notifications'), + subtitle: const Text('You have 3 unread messages.'), ), ], ), @@ -30,30 +30,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('card/$name-text-card-content.png'), - ); - }); - - testWidgets('$name with raw FCardContent', (tester) async { - await tester.pumpWidget( - TestScaffold( - data: theme, - background: background, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FCard( - rawTitle: const Text('Notifications'), - rawSubtitle: const Text('You have 3 unread messages.'), - ), - ], - ), - ), - ); - - await expectLater( - find.byType(TestScaffold), - matchesGoldenFile('card/$name-raw-card-content.png'), + matchesGoldenFile('card/$name-content-card.png'), ); }); @@ -78,7 +55,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('card/$name-raw-content.png'), + matchesGoldenFile('card/$name-raw-card.png'), ); }); } diff --git a/forui/test/src/widgets/dialog/dialog_golden_test.dart b/forui/test/src/widgets/dialog/dialog_golden_test.dart index 7057ed1d1..ea2ff4326 100644 --- a/forui/test/src/widgets/dialog/dialog_golden_test.dart +++ b/forui/test/src/widgets/dialog/dialog_golden_test.dart @@ -8,49 +8,42 @@ import '../../test_scaffold.dart'; class UnderTest extends StatelessWidget { final Axis direction; - final bool raw; - const UnderTest({required this.direction, required this.raw, super.key}); + const UnderTest({ + required this.direction, + super.key, + }); @override Widget build(BuildContext context) { final actions = [ - FButton(label: 'Continue', onPress: () {}), + FButton( + label: const Text('Continue'), + onPress: () {}, + ), FButton( style: FButtonStyle.outline, - label: 'Cancel', + label: const Text('Cancel'), onPress: () { Navigator.of(context).pop(); }, ), ]; - if (raw) { - return FDialog( - direction: direction, - rawTitle: const Text('Are you absolutely sure?'), - rawBody: const Text( - 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', - ), - actions: actions, - ); - } else { - return FDialog( - direction: direction, - title: 'Are you absolutely sure?', - body: - 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', - actions: actions, - ); - } + return FDialog( + direction: direction, + title: const Text('Are you absolutely sure?'), + body: const Text( + 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', + ), + actions: actions, + ); } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties - ..add(EnumProperty('alignment', direction)) - ..add(DiagnosticsProperty('raw', raw)); + properties.add(EnumProperty('alignment', direction)); } } @@ -58,37 +51,20 @@ void main() { group('FDialog', () { for (final (name, theme, background) in TestScaffold.themes) { for (final direction in Axis.values) { - testWidgets('$name with $direction text FDialogContent', (tester) async { - await tester.pumpWidget( - MaterialApp( - home: TestScaffold( - data: theme, - background: background, - child: UnderTest(direction: direction, raw: false), - ), - ), - ); - - await expectLater( - find.byType(UnderTest), - matchesGoldenFile('dialog/$name-$direction-text-dialog-content.png'), - ); - }); - - testWidgets('$name with $direction raw FDialogContent', (tester) async { + testWidgets('$name with $direction FDialogContent', (tester) async { await tester.pumpWidget( MaterialApp( home: TestScaffold( data: theme, background: background, - child: UnderTest(direction: direction, raw: true), + child: UnderTest(direction: direction), ), ), ); await expectLater( find.byType(UnderTest), - matchesGoldenFile('dialog/$name-$direction-raw-dialog-content.png'), + matchesGoldenFile('dialog/$name-$direction-content-dialog.png'), ); }); } @@ -114,7 +90,7 @@ void main() { await expectLater( find.byType(FDialog), - matchesGoldenFile('dialog/$name-raw-content.png'), + matchesGoldenFile('dialog/$name-raw-content-dialog.png'), ); }); } diff --git a/forui/test/src/widgets/dialog/dialog_test.dart b/forui/test/src/widgets/dialog/dialog_test.dart deleted file mode 100644 index 93479f8db..000000000 --- a/forui/test/src/widgets/dialog/dialog_test.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:flutter_test/flutter_test.dart'; - -import 'package:forui/forui.dart'; - -void main() { - group('FDialog', () { - for (final (string, raw) in [ - (null, null), - ('', null), - (null, const SizedBox()), - ]) { - testWidgets('constructor title does not throw error', (tester) async { - expect( - () => FDialog( - title: string, - rawTitle: raw, - actions: const [], - ), - returnsNormally, - ); - }); - - testWidgets('constructor body does not throw error', (tester) async { - expect( - () => FDialog( - body: string, - rawBody: raw, - actions: const [], - ), - returnsNormally, - ); - }); - } - - for (final (string, raw) in [ - ('', const SizedBox()), - ]) { - testWidgets('constructor title throws error', (tester) async { - expect( - () => FDialog( - title: string, - rawTitle: raw, - actions: const [], - ), - throwsAssertionError, - ); - }); - - testWidgets('constructor body throws error', (tester) async { - expect( - () => FDialog( - body: string, - rawBody: raw, - actions: const [], - ), - throwsAssertionError, - ); - }); - } - }); -} diff --git a/forui/test/src/widgets/scaffold_golden_test.dart b/forui/test/src/widgets/scaffold_golden_test.dart index c9d3f2a40..54e6f59f4 100644 --- a/forui/test/src/widgets/scaffold_golden_test.dart +++ b/forui/test/src/widgets/scaffold_golden_test.dart @@ -37,7 +37,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('scaffold/$name.png'), + matchesGoldenFile('scaffold/$name-scaffold.png'), ); }); } diff --git a/forui/test/src/widgets/separator_golden_test.dart b/forui/test/src/widgets/separator_golden_test.dart index 82565d71d..42fc0bafe 100644 --- a/forui/test/src/widgets/separator_golden_test.dart +++ b/forui/test/src/widgets/separator_golden_test.dart @@ -50,7 +50,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('separator/$name-$orientation.png'), + matchesGoldenFile('separator/$name-$orientation-separator.png'), ); }); } diff --git a/forui/test/src/widgets/switch_golden_test.dart b/forui/test/src/widgets/switch_golden_test.dart index 0f463432e..4c501c3b8 100644 --- a/forui/test/src/widgets/switch_golden_test.dart +++ b/forui/test/src/widgets/switch_golden_test.dart @@ -9,7 +9,7 @@ import 'package:forui/forui.dart'; import '../test_scaffold.dart'; void main() { - group('FSeparator', () { + group('FSwitch', () { for (final (name, theme, _) in TestScaffold.themes) { for (final (checked, value) in [('checked', true), ('unchecked', false)]) { testWidgets('$name - $checked - unfocused', (tester) async { @@ -27,7 +27,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('switch/$name-$checked-unfocused.png'), + matchesGoldenFile('switch/$name-$checked-unfocused-switch.png'), ); }); @@ -47,7 +47,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('switch/$name-$checked-focused.png'), + matchesGoldenFile('switch/$name-$checked-focused-switch.png'), ); }); @@ -67,7 +67,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('switch/$name-$checked-disabled.png'), + matchesGoldenFile('switch/$name-$checked-disabled-switch.png'), ); }); } diff --git a/forui/test/src/widgets/tabs/tabs_golden_test.dart b/forui/test/src/widgets/tabs/tabs_golden_test.dart index d7ef3421d..8106d4800 100644 --- a/forui/test/src/widgets/tabs/tabs_golden_test.dart +++ b/forui/test/src/widgets/tabs/tabs_golden_test.dart @@ -16,46 +16,49 @@ void main() { MaterialApp( home: TestScaffold( data: theme, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - child: FTabs( - tabs: [ - FTabEntry( - label: 'Account', - content: FCard( - title: 'Account', - subtitle: 'Make changes to your account here. Click save when you are done.', - child: Column( - children: [ - Container( - color: Colors.blue, - height: 100, - ), - ], + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + child: FTabs( + tabs: [ + FTabEntry( + label: const Text('Account'), + content: FCard( + title: const Text('Account'), + subtitle: const Text('Make changes to your account here. Click save when you are done.'), + child: Column( + children: [ + Container( + color: Colors.blue, + height: 100, + ), + ], + ), ), ), - ), - FTabEntry( - label: 'Password', - content: FCard( - title: 'Password', - subtitle: 'Change your password here. After saving, you will be logged out.', - child: Column( - children: [ - Container( - color: Colors.red, - height: 100, - ), - ], + FTabEntry( + label: const Text('Password'), + content: FCard( + title: const Text('Password'), + subtitle: const Text('Change your password here. After saving, you will be logged out.'), + child: Column( + children: [ + Container( + color: Colors.red, + height: 100, + ), + ], + ), ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), ), @@ -63,7 +66,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('tabs/$name-tab.png'), + matchesGoldenFile('tabs/$name-tabs.png'), ); }); } diff --git a/forui/test/src/widgets/tabs/tabs_test.dart b/forui/test/src/widgets/tabs/tabs_test.dart index f3511bc75..989fa94a5 100644 --- a/forui/test/src/widgets/tabs/tabs_test.dart +++ b/forui/test/src/widgets/tabs/tabs_test.dart @@ -15,7 +15,7 @@ void main() { data: FThemes.zinc.light, child: FTabs( tabs: [ - FTabEntry(label: 'Account', content: Container(height: 100)), + FTabEntry(label: const Text('Account'), content: Container(height: 100)), ], ), ), @@ -32,7 +32,7 @@ void main() { data: FThemes.zinc.light, child: FTabs( tabs: [ - FTabEntry(label: 'Account', content: Container(height: 100)), + FTabEntry(label: const Text('Account'), content: Container(height: 100)), ], ), ), @@ -48,7 +48,7 @@ void main() { data: FThemes.zinc.light, child: FTabs( tabs: [ - FTabEntry(label: 'Account', content: Container(height: 100)), + FTabEntry(label: const Text('Account'), content: Container(height: 100)), ], ), ), @@ -70,7 +70,7 @@ void main() { data: FThemes.zinc.light, child: FTabs( tabs: [ - FTabEntry(label: 'Account', content: Container(height: 100)), + FTabEntry(label: const Text('Account'), content: Container(height: 100)), ], ), ), @@ -79,29 +79,5 @@ void main() { expect(tester.takeException(), null); }); - - for (final (string, raw) in [ - ('', null), - (null, const Text('test')), - ]) { - testWidgets('constructor does not throw error', (tester) async { - expect( - () => FTabEntry(label: string, rawLabel: raw, content: const SizedBox()), - returnsNormally, - ); - }); - } - - for (final (string, raw) in [ - (null, null), - ('', const Text('test')), - ]) { - testWidgets('constructor throws assertion error', (tester) async { - expect( - () => FTabEntry(label: string, rawLabel: raw, content: const SizedBox()), - throwsAssertionError, - ); - }); - } }); } diff --git a/forui/test/src/widgets/text_field/text_field_golden_test.dart b/forui/test/src/widgets/text_field/text_field_golden_test.dart index 850b64248..59d911da8 100644 --- a/forui/test/src/widgets/text_field/text_field_golden_test.dart +++ b/forui/test/src/widgets/text_field/text_field_golden_test.dart @@ -43,7 +43,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('text_field/default-$theme-$focused-$text.png'), + matchesGoldenFile('text_field/default-$theme-$focused-$text-text-field.png'), ); }); @@ -71,7 +71,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('text_field/error-$theme-$focused-$text.png'), + matchesGoldenFile('text_field/error-$theme-$focused-$text-text-field.png'), ); }); @@ -97,7 +97,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('text_field/email-$theme-$focused-$text.png'), + matchesGoldenFile('text_field/email-$theme-$focused-$text-text-field.png'), ); }); @@ -123,7 +123,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('text_field/password-$theme-$focused-$text.png'), + matchesGoldenFile('text_field/password-$theme-$focused-$text-text-field.png'), ); }); } @@ -152,7 +152,7 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('text_field/multiline-$theme-$focused-$text.png'), + matchesGoldenFile('text_field/multiline-$theme-$focused-$text-text-field.png'), ); }); } diff --git a/samples/lib/widgets/badge.dart b/samples/lib/widgets/badge.dart index 003ed497a..3cd689cc6 100644 --- a/samples/lib/widgets/badge.dart +++ b/samples/lib/widgets/badge.dart @@ -22,7 +22,7 @@ class BadgePage extends SampleScaffold { @override Widget child(BuildContext context) => FBadge( - label: 'Badge', + label: const Text('Badge'), style: style, ); } diff --git a/samples/lib/widgets/button.dart b/samples/lib/widgets/button.dart index c390dfa63..5ade2741e 100644 --- a/samples/lib/widgets/button.dart +++ b/samples/lib/widgets/button.dart @@ -26,7 +26,7 @@ class ButtonTextPage extends SampleScaffold { @override Widget child(BuildContext context) => IntrinsicWidth( child: FButton( - label: label, + label: Text(label), style: variant, onPress: () {}, ), @@ -45,8 +45,8 @@ class ButtonIconPage extends SampleScaffold { @override Widget child(BuildContext context) => IntrinsicWidth( child: FButton( - prefixIcon: FButtonIcon(icon: FAssets.icons.mail), - label: 'Login with Email', + prefix: FButtonIcon(icon: FAssets.icons.mail), + label: const Text('Login with Email'), style: variant, onPress: () {}, ), diff --git a/samples/lib/widgets/card.dart b/samples/lib/widgets/card.dart index db2bcffa6..ab0f4dac4 100644 --- a/samples/lib/widgets/card.dart +++ b/samples/lib/widgets/card.dart @@ -16,8 +16,8 @@ class CardPage extends SampleScaffold { mainAxisAlignment: MainAxisAlignment.center, children: [ FCard( - title: 'Notifications', - subtitle: 'You have 3 unread messages.', + title: const Text('Notifications'), + subtitle: const Text('You have 3 unread messages.'), ), ], ); diff --git a/samples/lib/widgets/dialog.dart b/samples/lib/widgets/dialog.dart index f58ac0981..aa85bd658 100644 --- a/samples/lib/widgets/dialog.dart +++ b/samples/lib/widgets/dialog.dart @@ -17,8 +17,8 @@ class DialogPage extends SampleScaffold { @override Widget child(BuildContext context) { final actions = [ - FButton(style: FButtonStyle.outline, label: 'Cancel', onPress: () => Navigator.of(context).pop()), - FButton(label: 'Continue', onPress: () => Navigator.of(context).pop()), + FButton(style: FButtonStyle.outline, label: const Text('Cancel'), onPress: () => Navigator.of(context).pop()), + FButton(label: const Text('Continue'), onPress: () => Navigator.of(context).pop()), ]; return Column( @@ -26,14 +26,15 @@ class DialogPage extends SampleScaffold { children: [ IntrinsicWidth( child: FButton( - label: 'Show Dialog', + label: const Text('Show Dialog'), onPress: () => showAdaptiveDialog( context: context, builder: (context) => FDialog( direction: direction, - title: 'Are you absolutely sure?', - body: - 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', + title: const Text('Are you absolutely sure?'), + body: const Text( + 'This action cannot be undone. This will permanently delete your account and remove your data from our servers.', + ), actions: direction == Axis.vertical ? actions.reversed.toList() : actions, ), ), diff --git a/samples/lib/widgets/scaffold.dart b/samples/lib/widgets/scaffold.dart index 76a1ae041..d2be8578b 100644 --- a/samples/lib/widgets/scaffold.dart +++ b/samples/lib/widgets/scaffold.dart @@ -32,8 +32,8 @@ class ScaffoldPage extends SampleScaffold { children: [ const SizedBox(height: 5), FCard( - title: 'Account', - subtitle: 'Make changes to your account here. Click save when you are done.', + title: const Text('Account'), + subtitle: const Text('Make changes to your account here. Click save when you are done.'), child: Padding( padding: const EdgeInsets.only(top: 10), child: Column( @@ -50,7 +50,7 @@ class ScaffoldPage extends SampleScaffold { Padding( padding: const EdgeInsets.only(top: 24, bottom: 16), child: FButton( - label: 'Save', + label: const Text('Save'), onPress: () {}, ), ), diff --git a/samples/lib/widgets/tabs.dart b/samples/lib/widgets/tabs.dart index b3102eff7..e4f28f12d 100644 --- a/samples/lib/widgets/tabs.dart +++ b/samples/lib/widgets/tabs.dart @@ -20,10 +20,10 @@ class TabsPage extends SampleScaffold { child: FTabs( tabs: [ FTabEntry( - label: 'Account', + label: const Text('Account'), content: FCard( - title: 'Account', - subtitle: 'Make changes to your account here. Click save when you are done.', + title: const Text('Account'), + subtitle: const Text('Make changes to your account here. Click save when you are done.'), child: Padding( padding: const EdgeInsets.only(top: 10), child: Column( @@ -40,7 +40,7 @@ class TabsPage extends SampleScaffold { Padding( padding: const EdgeInsets.only(top: 24, bottom: 16), child: FButton( - label: 'Save', + label: const Text('Save'), onPress: () {}, ), ), @@ -50,10 +50,10 @@ class TabsPage extends SampleScaffold { ), ), FTabEntry( - label: 'Password', + label: const Text('Password'), content: FCard( - title: 'Password', - subtitle: 'Change your password here. After saving, you will be logged out.', + title: const Text('Password'), + subtitle: const Text('Change your password here. After saving, you will be logged out.'), child: Padding( padding: const EdgeInsets.only(top: 10), child: Column( @@ -64,7 +64,7 @@ class TabsPage extends SampleScaffold { Padding( padding: const EdgeInsets.only(top: 24, bottom: 16), child: FButton( - label: 'Save', + label: const Text('Save'), onPress: () {}, ), ), diff --git a/samples/lib/widgets/text_field.dart b/samples/lib/widgets/text_field.dart index 26d6a4065..5a6f2510b 100644 --- a/samples/lib/widgets/text_field.dart +++ b/samples/lib/widgets/text_field.dart @@ -117,7 +117,7 @@ class _LoginFormState extends State { ), const SizedBox(height: 30), FButton( - rawLabel: const Text('Login'), + label: const Text('Login'), onPress: () => _formKey.currentState!.validate(), ), ],