diff --git a/forui/example/lib/main.dart b/forui/example/lib/main.dart index ddecac047..746c93cf0 100644 --- a/forui/example/lib/main.dart +++ b/forui/example/lib/main.dart @@ -52,15 +52,6 @@ class _ExampleWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - FTextField( - rawHelp: Text('Some error text'), - ), - const SizedBox(height: 10), - FTextField(rawHelp: Text('Some error text', style: context.theme.textFieldStyle.enabled.footer,)), - const SizedBox(height: 10), - Text('Some error text', style: context.theme.textFieldStyle.enabled.footer,), - FTextField(help: 'Some error text', textAlign: TextAlign.start,), - const SizedBox(height: 10), FButton( design: FButtonVariant.destructive, labelText: 'Delete?', diff --git a/forui/lib/src/widgets/badge/badge.dart b/forui/lib/src/widgets/badge/badge.dart index 0023f35a9..da4eb8ea8 100644 --- a/forui/lib/src/widgets/badge/badge.dart +++ b/forui/lib/src/widgets/badge/badge.dart @@ -146,9 +146,9 @@ final class FBadgeStyle with Diagnosticable implements FBadgeDesign { properties ..add(ColorProperty('background', background)) ..add(ColorProperty('border', border)) - ..add(DiagnosticsProperty('borderRadius', borderRadius, defaultValue: BorderRadius.circular(100))) + ..add(DiagnosticsProperty('borderRadius', borderRadius, defaultValue: BorderRadius.circular(100))) ..add(DoubleProperty('borderWidth', borderWidth)) - ..add(DiagnosticsProperty('content', content)); + ..add(DiagnosticsProperty('content', content)); } @override diff --git a/forui/lib/src/widgets/button/button_icon.dart b/forui/lib/src/widgets/button/button_icon.dart index cd6c16bfd..463a00dfe 100644 --- a/forui/lib/src/widgets/button/button_icon.dart +++ b/forui/lib/src/widgets/button/button_icon.dart @@ -17,6 +17,11 @@ class FButtonIcon extends StatelessWidget { colorFilter: ColorFilter.mode(enabled ? style.icon.enabled : style.icon.disabled, BlendMode.srcIn), ); } + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(DiagnosticsProperty('icon', icon)); + } } /// [FButtonIcon]'s style. diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-badge-content.png deleted file mode 100644 index 6b818296b..000000000 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-raw-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-raw-badge-content.png index bc2c91154..862d5f4fc 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-raw-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-text-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-text-badge-content.png index bc2c91154..862d5f4fc 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-text-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.destructive-text-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-badge-content.png deleted file mode 100644 index 4e6ffa2f1..000000000 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-raw-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-raw-badge-content.png index aacd07743..4ad642ac3 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-raw-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-text-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-text-badge-content.png index aacd07743..4ad642ac3 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-text-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.outline-text-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-badge-content.png deleted file mode 100644 index 291f623b1..000000000 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-raw-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-raw-badge-content.png index 6a028ed14..d23304fa8 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-raw-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-text-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-text-badge-content.png index 6a028ed14..d23304fa8 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-text-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.primary-text-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-badge-content.png deleted file mode 100644 index b40cee4bc..000000000 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-raw-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-raw-badge-content.png index 77c4e4ded..ab2c1677b 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-raw-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-text-badge-content.png b/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-text-badge-content.png index 77c4e4ded..ab2c1677b 100644 Binary files a/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-text-badge-content.png and b/forui/test/golden/badge/zinc-dark-FBadgeVariant.secondary-text-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-badge-content.png deleted file mode 100644 index 763e1e130..000000000 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-raw-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-raw-badge-content.png index b958e13b0..320bda7eb 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-raw-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-text-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-text-badge-content.png index b958e13b0..320bda7eb 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-text-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.destructive-text-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-badge-content.png deleted file mode 100644 index cb569cdb8..000000000 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-raw-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-raw-badge-content.png index 696220b21..152c49ec0 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-raw-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-text-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-text-badge-content.png index 696220b21..152c49ec0 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-text-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.outline-text-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-badge-content.png deleted file mode 100644 index 945f7a789..000000000 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-raw-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-raw-badge-content.png index 230f42a61..f3162779e 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-raw-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-text-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-text-badge-content.png index 230f42a61..f3162779e 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-text-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.primary-text-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-badge-content.png deleted file mode 100644 index c6419b9c4..000000000 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-badge-content.png and /dev/null differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-raw-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-raw-badge-content.png index 7666439f5..7477e6029 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-raw-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-raw-badge-content.png differ diff --git a/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-text-badge-content.png b/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-text-badge-content.png index 7666439f5..7477e6029 100644 Binary files a/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-text-badge-content.png and b/forui/test/golden/badge/zinc-light-FBadgeVariant.secondary-text-badge-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-disabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-disabled-button-content.png index 95ec9014b..2dbb03e6d 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-disabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-enabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-enabled-button-content.png index ebdc01d26..46daf75eb 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-enabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.destructive-enabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-disabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-disabled-button-content.png index a5fb6bb23..1d244d672 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-disabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-enabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-enabled-button-content.png index 2abd960b8..eb9221b23 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-enabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.outlined-enabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.primary-disabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.primary-disabled-button-content.png index 7dea7a0b0..fa0f554af 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.primary-disabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.primary-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.primary-enabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.primary-enabled-button-content.png index ac53d69ad..7e3e7f7b0 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.primary-enabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.primary-enabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-disabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-disabled-button-content.png index e653b9e07..721d21df0 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-disabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-enabled-button-content.png b/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-enabled-button-content.png index 516f9a0fd..df13b4775 100644 Binary files a/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-enabled-button-content.png and b/forui/test/golden/button/zinc-dark-FButtonVariant.secondary-enabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.destructive-disabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.destructive-disabled-button-content.png index 8da2d1b84..811f86e4d 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.destructive-disabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.destructive-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.destructive-enabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.destructive-enabled-button-content.png index fc9925261..2113bd3dc 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.destructive-enabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.destructive-enabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.outlined-disabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.outlined-disabled-button-content.png index 1ed3acc46..74f73bdeb 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.outlined-disabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.outlined-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.outlined-enabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.outlined-enabled-button-content.png index cd58c4046..5db85d579 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.outlined-enabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.outlined-enabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.primary-disabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.primary-disabled-button-content.png index 895a7551a..8ff1fdef2 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.primary-disabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.primary-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.primary-enabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.primary-enabled-button-content.png index ac66a79ec..6cd3e1746 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.primary-enabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.primary-enabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.secondary-disabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.secondary-disabled-button-content.png index 97a70752c..eddd1aac9 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.secondary-disabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.secondary-disabled-button-content.png differ diff --git a/forui/test/golden/button/zinc-light-FButtonVariant.secondary-enabled-button-content.png b/forui/test/golden/button/zinc-light-FButtonVariant.secondary-enabled-button-content.png index c6abeed59..3c4f00355 100644 Binary files a/forui/test/golden/button/zinc-light-FButtonVariant.secondary-enabled-button-content.png and b/forui/test/golden/button/zinc-light-FButtonVariant.secondary-enabled-button-content.png differ diff --git a/forui/test/golden/card/zinc-dark-card-content.png b/forui/test/golden/card/zinc-dark-card-content.png deleted file mode 100644 index 97d806e1f..000000000 Binary files a/forui/test/golden/card/zinc-dark-card-content.png and /dev/null 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 new file mode 100644 index 000000000..386dc5ef3 Binary files /dev/null and b/forui/test/golden/card/zinc-dark-raw-card-content.png differ diff --git a/forui/test/golden/card/zinc-dark-text-card-content.png b/forui/test/golden/card/zinc-dark-text-card-content.png new file mode 100644 index 000000000..386dc5ef3 Binary files /dev/null and b/forui/test/golden/card/zinc-dark-text-card-content.png differ diff --git a/forui/test/golden/card/zinc-light-card-content.png b/forui/test/golden/card/zinc-light-card-content.png deleted file mode 100644 index bb4d7c075..000000000 Binary files a/forui/test/golden/card/zinc-light-card-content.png and /dev/null 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 new file mode 100644 index 000000000..7feb996ed Binary files /dev/null and b/forui/test/golden/card/zinc-light-raw-card-content.png differ diff --git a/forui/test/golden/card/zinc-light-text-card-content.png b/forui/test/golden/card/zinc-light-text-card-content.png new file mode 100644 index 000000000..7feb996ed Binary files /dev/null and b/forui/test/golden/card/zinc-light-text-card-content.png differ diff --git a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-content.png b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-content.png deleted file mode 100644 index 481d1cad9..000000000 Binary files a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-raw-dialog-content.png b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-raw-dialog-content.png new file mode 100644 index 000000000..6e0bac4d3 Binary files /dev/null and b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-raw-dialog-content.png differ diff --git a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-text-dialog-content.png b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-text-dialog-content.png new file mode 100644 index 000000000..6e0bac4d3 Binary files /dev/null and b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.horizontal-text-dialog-content.png differ diff --git a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-content.png b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-content.png deleted file mode 100644 index 3ca875fad..000000000 Binary files a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-raw-dialog-content.png b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-raw-dialog-content.png new file mode 100644 index 000000000..f0150b091 Binary files /dev/null and b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-raw-dialog-content.png differ diff --git a/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-text-dialog-content.png b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-text-dialog-content.png new file mode 100644 index 000000000..f0150b091 Binary files /dev/null and b/forui/test/golden/dialog/zinc-dark-FDialogAlignment.vertical-text-dialog-content.png differ diff --git a/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-content.png b/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-content.png deleted file mode 100644 index 76fa99cbe..000000000 Binary files a/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-raw-dialog-content.png b/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-raw-dialog-content.png new file mode 100644 index 000000000..ba9a0b1f9 Binary files /dev/null and b/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-raw-dialog-content.png differ diff --git a/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-text-dialog-content.png b/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-text-dialog-content.png new file mode 100644 index 000000000..ba9a0b1f9 Binary files /dev/null and b/forui/test/golden/dialog/zinc-light-FDialogAlignment.horizontal-text-dialog-content.png differ diff --git a/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-content.png b/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-content.png deleted file mode 100644 index 0bc62d568..000000000 Binary files a/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-content.png and /dev/null differ diff --git a/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-raw-dialog-content.png b/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-raw-dialog-content.png new file mode 100644 index 000000000..8a0c8c260 Binary files /dev/null and b/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-raw-dialog-content.png differ diff --git a/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-text-dialog-content.png b/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-text-dialog-content.png new file mode 100644 index 000000000..8a0c8c260 Binary files /dev/null and b/forui/test/golden/dialog/zinc-light-FDialogAlignment.vertical-text-dialog-content.png differ diff --git a/forui/test/golden/header/zinc-dark-header-overflow.png b/forui/test/golden/header/zinc-dark-header-overflow.png deleted file mode 100644 index 199ab0d3b..000000000 Binary files a/forui/test/golden/header/zinc-dark-header-overflow.png and /dev/null differ diff --git a/forui/test/golden/header/zinc-dark-header.png b/forui/test/golden/header/zinc-dark-header.png index 8f8f2556c..a99ee2519 100644 Binary files a/forui/test/golden/header/zinc-dark-header.png and b/forui/test/golden/header/zinc-dark-header.png differ diff --git a/forui/test/golden/header/zinc-dark-header-actions.png b/forui/test/golden/header/zinc-dark-raw-title.png similarity index 56% rename from forui/test/golden/header/zinc-dark-header-actions.png rename to forui/test/golden/header/zinc-dark-raw-title.png index 364125ba7..72dcab638 100644 Binary files a/forui/test/golden/header/zinc-dark-header-actions.png and b/forui/test/golden/header/zinc-dark-raw-title.png differ diff --git a/forui/test/golden/header/zinc-light-header-overflow.png b/forui/test/golden/header/zinc-light-header-overflow.png deleted file mode 100644 index 1500e1b82..000000000 Binary files a/forui/test/golden/header/zinc-light-header-overflow.png and /dev/null differ diff --git a/forui/test/golden/header/zinc-light-header.png b/forui/test/golden/header/zinc-light-header.png index 7f71a2ab7..eea9fcee0 100644 Binary files a/forui/test/golden/header/zinc-light-header.png and b/forui/test/golden/header/zinc-light-header.png differ diff --git a/forui/test/golden/header/zinc-light-header-actions.png b/forui/test/golden/header/zinc-light-raw-title.png similarity index 58% rename from forui/test/golden/header/zinc-light-header-actions.png rename to forui/test/golden/header/zinc-light-raw-title.png index 7ea3a208e..753eab311 100644 Binary files a/forui/test/golden/header/zinc-light-header-actions.png and b/forui/test/golden/header/zinc-light-raw-title.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.png index b8d3538b6..a0971e19b 100644 Binary files a/forui/test/golden/text_field/default-zinc-dark-focused-no-text.png and b/forui/test/golden/text_field/default-zinc-dark-focused-no-text.png differ diff --git a/forui/test/golden/text_field/default-zinc-dark-focused-raw-text.png b/forui/test/golden/text_field/default-zinc-dark-focused-raw-text.png new file mode 100644 index 000000000..a2e0127be Binary files /dev/null and b/forui/test/golden/text_field/default-zinc-dark-focused-raw-text.png differ 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.png index ebdd25dba..25faae303 100644 Binary files a/forui/test/golden/text_field/default-zinc-dark-focused-text.png and b/forui/test/golden/text_field/default-zinc-dark-focused-text.png differ 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.png index e1199aa57..8e7b13fa4 100644 Binary files a/forui/test/golden/text_field/default-zinc-dark-unfocused-no-text.png and b/forui/test/golden/text_field/default-zinc-dark-unfocused-no-text.png differ diff --git a/forui/test/golden/text_field/default-zinc-dark-unfocused-raw-text.png b/forui/test/golden/text_field/default-zinc-dark-unfocused-raw-text.png new file mode 100644 index 000000000..7a1e46320 Binary files /dev/null and b/forui/test/golden/text_field/default-zinc-dark-unfocused-raw-text.png differ 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.png index 3411431a4..bad7d3367 100644 Binary files a/forui/test/golden/text_field/default-zinc-dark-unfocused-text.png and b/forui/test/golden/text_field/default-zinc-dark-unfocused-text.png differ 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.png index f13e6beeb..22095100a 100644 Binary files a/forui/test/golden/text_field/default-zinc-light-focused-no-text.png and b/forui/test/golden/text_field/default-zinc-light-focused-no-text.png differ diff --git a/forui/test/golden/text_field/default-zinc-light-focused-raw-text.png b/forui/test/golden/text_field/default-zinc-light-focused-raw-text.png new file mode 100644 index 000000000..95870e393 Binary files /dev/null and b/forui/test/golden/text_field/default-zinc-light-focused-raw-text.png differ 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.png index 6d84c5337..63b5fc75e 100644 Binary files a/forui/test/golden/text_field/default-zinc-light-focused-text.png and b/forui/test/golden/text_field/default-zinc-light-focused-text.png differ 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.png index 19eaef775..f8447c986 100644 Binary files a/forui/test/golden/text_field/default-zinc-light-unfocused-no-text.png and b/forui/test/golden/text_field/default-zinc-light-unfocused-no-text.png differ diff --git a/forui/test/golden/text_field/default-zinc-light-unfocused-raw-text.png b/forui/test/golden/text_field/default-zinc-light-unfocused-raw-text.png new file mode 100644 index 000000000..c0a0eb39b Binary files /dev/null and b/forui/test/golden/text_field/default-zinc-light-unfocused-raw-text.png differ 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.png index a186a28e4..aa94e58e3 100644 Binary files a/forui/test/golden/text_field/default-zinc-light-unfocused-text.png and b/forui/test/golden/text_field/default-zinc-light-unfocused-text.png differ 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.png index ab3c651b0..414170fea 100644 Binary files a/forui/test/golden/text_field/email-zinc-dark-focused-no-text.png and b/forui/test/golden/text_field/email-zinc-dark-focused-no-text.png differ 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.png index 74b8332ac..c1b8e08bf 100644 Binary files a/forui/test/golden/text_field/email-zinc-dark-focused-text.png and b/forui/test/golden/text_field/email-zinc-dark-focused-text.png differ 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.png index 015e28748..45bb933c1 100644 Binary files a/forui/test/golden/text_field/email-zinc-dark-unfocused-no-text.png and b/forui/test/golden/text_field/email-zinc-dark-unfocused-no-text.png differ 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.png index afed1d0f4..2f646e22e 100644 Binary files a/forui/test/golden/text_field/email-zinc-dark-unfocused-text.png and b/forui/test/golden/text_field/email-zinc-dark-unfocused-text.png differ 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.png index fc8a3c859..b6f6a3cc2 100644 Binary files a/forui/test/golden/text_field/email-zinc-light-focused-no-text.png and b/forui/test/golden/text_field/email-zinc-light-focused-no-text.png differ 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.png index bdff36501..284dbc672 100644 Binary files a/forui/test/golden/text_field/email-zinc-light-focused-text.png and b/forui/test/golden/text_field/email-zinc-light-focused-text.png differ 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.png index 19c21dfb9..6e04cf61b 100644 Binary files a/forui/test/golden/text_field/email-zinc-light-unfocused-no-text.png and b/forui/test/golden/text_field/email-zinc-light-unfocused-no-text.png differ 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.png index b62d9e506..5172c1229 100644 Binary files a/forui/test/golden/text_field/email-zinc-light-unfocused-text.png and b/forui/test/golden/text_field/email-zinc-light-unfocused-text.png differ 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.png index a5854f0c4..f37078e31 100644 Binary files a/forui/test/golden/text_field/error-zinc-dark-focused-no-text.png and b/forui/test/golden/text_field/error-zinc-dark-focused-no-text.png differ diff --git a/forui/test/golden/text_field/error-zinc-dark-focused-raw-text.png b/forui/test/golden/text_field/error-zinc-dark-focused-raw-text.png new file mode 100644 index 000000000..2dcc9ea3c Binary files /dev/null and b/forui/test/golden/text_field/error-zinc-dark-focused-raw-text.png differ 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.png index af50450f8..d850eab0e 100644 Binary files a/forui/test/golden/text_field/error-zinc-dark-focused-text.png and b/forui/test/golden/text_field/error-zinc-dark-focused-text.png differ 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.png index 5e41fa604..595def582 100644 Binary files a/forui/test/golden/text_field/error-zinc-dark-unfocused-no-text.png and b/forui/test/golden/text_field/error-zinc-dark-unfocused-no-text.png differ diff --git a/forui/test/golden/text_field/error-zinc-dark-unfocused-raw-text.png b/forui/test/golden/text_field/error-zinc-dark-unfocused-raw-text.png new file mode 100644 index 000000000..c8784e4c8 Binary files /dev/null and b/forui/test/golden/text_field/error-zinc-dark-unfocused-raw-text.png differ 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.png index 936a868c3..92a1cb6e8 100644 Binary files a/forui/test/golden/text_field/error-zinc-dark-unfocused-text.png and b/forui/test/golden/text_field/error-zinc-dark-unfocused-text.png differ 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.png index cead17e16..61ec8378d 100644 Binary files a/forui/test/golden/text_field/error-zinc-light-focused-no-text.png and b/forui/test/golden/text_field/error-zinc-light-focused-no-text.png differ diff --git a/forui/test/golden/text_field/error-zinc-light-focused-raw-text.png b/forui/test/golden/text_field/error-zinc-light-focused-raw-text.png new file mode 100644 index 000000000..a5bb434a2 Binary files /dev/null and b/forui/test/golden/text_field/error-zinc-light-focused-raw-text.png differ 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.png index 446166722..465cae999 100644 Binary files a/forui/test/golden/text_field/error-zinc-light-focused-text.png and b/forui/test/golden/text_field/error-zinc-light-focused-text.png differ 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.png index 7aa78de0d..83125d37f 100644 Binary files a/forui/test/golden/text_field/error-zinc-light-unfocused-no-text.png and b/forui/test/golden/text_field/error-zinc-light-unfocused-no-text.png differ diff --git a/forui/test/golden/text_field/error-zinc-light-unfocused-raw-text.png b/forui/test/golden/text_field/error-zinc-light-unfocused-raw-text.png new file mode 100644 index 000000000..b0b0f3240 Binary files /dev/null and b/forui/test/golden/text_field/error-zinc-light-unfocused-raw-text.png differ 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.png index c57b9628a..b871a892d 100644 Binary files a/forui/test/golden/text_field/error-zinc-light-unfocused-text.png and b/forui/test/golden/text_field/error-zinc-light-unfocused-text.png differ 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.png index 53837cd5c..6c64bd7f5 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-dark-focused-no-text.png and b/forui/test/golden/text_field/multiline-zinc-dark-focused-no-text.png differ 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.png index e6729286c..daa675dd7 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-dark-focused-text.png and b/forui/test/golden/text_field/multiline-zinc-dark-focused-text.png differ 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.png index 4a0f9f02f..1928d1fa4 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-dark-unfocused-no-text.png and b/forui/test/golden/text_field/multiline-zinc-dark-unfocused-no-text.png differ 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.png index 62fc506a7..fa3b77738 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-dark-unfocused-text.png and b/forui/test/golden/text_field/multiline-zinc-dark-unfocused-text.png differ 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.png index 75b2cec59..1f9fcf650 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-light-focused-no-text.png and b/forui/test/golden/text_field/multiline-zinc-light-focused-no-text.png differ 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.png index 0116cb435..0f34bef89 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-light-focused-text.png and b/forui/test/golden/text_field/multiline-zinc-light-focused-text.png differ 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.png index c2898c00d..3ec65d60b 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-light-unfocused-no-text.png and b/forui/test/golden/text_field/multiline-zinc-light-unfocused-no-text.png differ 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.png index 52831c15c..4c06afe80 100644 Binary files a/forui/test/golden/text_field/multiline-zinc-light-unfocused-text.png and b/forui/test/golden/text_field/multiline-zinc-light-unfocused-text.png differ 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.png index 6119a8b14..db10bf479 100644 Binary files a/forui/test/golden/text_field/password-zinc-dark-focused-no-text.png and b/forui/test/golden/text_field/password-zinc-dark-focused-no-text.png differ 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.png index 3cf839085..fe5196125 100644 Binary files a/forui/test/golden/text_field/password-zinc-dark-focused-text.png and b/forui/test/golden/text_field/password-zinc-dark-focused-text.png differ 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.png index 83888c8c0..9bf104208 100644 Binary files a/forui/test/golden/text_field/password-zinc-dark-unfocused-no-text.png and b/forui/test/golden/text_field/password-zinc-dark-unfocused-no-text.png differ 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.png index 9f19b3507..9f31ef685 100644 Binary files a/forui/test/golden/text_field/password-zinc-dark-unfocused-text.png and b/forui/test/golden/text_field/password-zinc-dark-unfocused-text.png differ 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.png index e02f64e1f..74384304c 100644 Binary files a/forui/test/golden/text_field/password-zinc-light-focused-no-text.png and b/forui/test/golden/text_field/password-zinc-light-focused-no-text.png differ 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.png index 903271a23..30f3620f9 100644 Binary files a/forui/test/golden/text_field/password-zinc-light-focused-text.png and b/forui/test/golden/text_field/password-zinc-light-focused-text.png differ 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.png index 264a6232d..ca5a86653 100644 Binary files a/forui/test/golden/text_field/password-zinc-light-unfocused-no-text.png and b/forui/test/golden/text_field/password-zinc-light-unfocused-no-text.png differ 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.png index 99803066b..9ea182b1e 100644 Binary files a/forui/test/golden/text_field/password-zinc-light-unfocused-text.png and b/forui/test/golden/text_field/password-zinc-light-unfocused-text.png differ diff --git a/forui/test/src/widgets/card_golden_test.dart b/forui/test/src/widgets/card/card_golden_test.dart similarity index 63% rename from forui/test/src/widgets/card_golden_test.dart rename to forui/test/src/widgets/card/card_golden_test.dart index 6010b1f4e..fa6a7f149 100644 --- a/forui/test/src/widgets/card_golden_test.dart +++ b/forui/test/src/widgets/card/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 FCardContent', (tester) async { + testWidgets('$name with text FCardContent', (tester) async { await tester.pumpWidget( TestScaffold( data: theme, @@ -30,7 +30,30 @@ void main() { await expectLater( find.byType(TestScaffold), - matchesGoldenFile('card/$name-card-content.png'), + 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'), ); }); diff --git a/forui/test/src/widgets/card/card_test.dart b/forui/test/src/widgets/card/card_test.dart new file mode 100644 index 000000000..6801cb89e --- /dev/null +++ b/forui/test/src/widgets/card/card_test.dart @@ -0,0 +1,59 @@ +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/dialog/dialog_golden_test.dart b/forui/test/src/widgets/dialog/dialog_golden_test.dart index 92f33ad01..84b13526d 100644 --- a/forui/test/src/widgets/dialog/dialog_golden_test.dart +++ b/forui/test/src/widgets/dialog/dialog_golden_test.dart @@ -8,26 +8,43 @@ import '../../test_scaffold.dart'; class UnderTest extends StatelessWidget { final FDialogAlignment alignment; + final bool raw; - const UnderTest({required this.alignment, super.key}); + const UnderTest({required this.alignment, required this.raw, super.key}); @override - Widget build(BuildContext context) => FDialog( - alignment: alignment, - 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: [ + Widget build(BuildContext context) { + final actions = [ FButton(labelText: 'Continue', onPress: () {}), FButton(design: FButtonVariant.outlined, labelText: 'Cancel', onPress: () { Navigator.of(context).pop(); }), - ], - ); + ]; + + if (raw) { + return FDialog( + alignment: alignment, + 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( + alignment: alignment, + 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, + ); + } + } @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - properties.add(EnumProperty('alignment', alignment)); + properties + ..add(EnumProperty('alignment', alignment)) + ..add(DiagnosticsProperty('raw', raw)); } } @@ -36,24 +53,40 @@ void main() { group('FDialog', () { for (final (name, theme, background) in TestScaffold.themes) { for (final alignment in [FDialogAlignment.horizontal, FDialogAlignment.vertical]) { - testWidgets('$name with $alignment content', (tester) async { + testWidgets('$name with $alignment text FDialogContent', (tester) async { + await tester.pumpWidget( + MaterialApp( + home: TestScaffold( + data: theme, + background: background, + child: UnderTest(alignment: alignment, raw: false), + ), + ), + ); + + await expectLater( + find.byType(UnderTest), + matchesGoldenFile('dialog/$name-$alignment-text-dialog-content.png'), + ); + }); + + testWidgets('$name with $alignment raw FDialogContent', (tester) async { await tester.pumpWidget( MaterialApp( home: TestScaffold( data: theme, background: background, - child: UnderTest(alignment: alignment), + child: UnderTest(alignment: alignment, raw: true), ), ), ); await expectLater( find.byType(UnderTest), - matchesGoldenFile('dialog/$name-$alignment-content.png'), + matchesGoldenFile('dialog/$name-$alignment-raw-dialog-content.png'), ); }); } - testWidgets('$name with raw content', (tester) async { await tester.pumpWidget( diff --git a/forui/test/src/widgets/dialog/dialog_test.dart b/forui/test/src/widgets/dialog/dialog_test.dart new file mode 100644 index 000000000..93479f8db --- /dev/null +++ b/forui/test/src/widgets/dialog/dialog_test.dart @@ -0,0 +1,63 @@ +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/header/header_golden_test.dart b/forui/test/src/widgets/header/header_golden_test.dart new file mode 100644 index 000000000..c1656720e --- /dev/null +++ b/forui/test/src/widgets/header/header_golden_test.dart @@ -0,0 +1,75 @@ +@Tags(['golden']) +library; + +import 'package:flutter/cupertino.dart'; + +import 'package:flutter_test/flutter_test.dart'; + +import 'package:forui/forui.dart'; +import '../../test_scaffold.dart'; + +const title = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'; + +void main() { + group('FHeader', () { + for (final (name, theme, _) in TestScaffold.themes) { + testWidgets('$name with FHeader actions', (tester) async { + await tester.pumpWidget( + TestScaffold( + data: theme, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: FHeader( + title: title, + actions: [ + FHeaderAction( + icon: FAssets.icons.alarmClock, + onPress: null, + ), + FHeaderAction( + icon: FAssets.icons.plus, + onPress: () {}, + ), + ], + ), + ) + ), + ); + + await expectLater( + find.byType(TestScaffold), + matchesGoldenFile('header/$name-header.png'), + ); + }); + + testWidgets('$name with raw title', (tester) async { + await tester.pumpWidget( + TestScaffold( + data: theme, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: FHeader( + rawTitle: const Text('Title'), + actions: [ + FHeaderAction( + icon: FAssets.icons.alarmClock, + onPress: null, + ), + FHeaderAction( + icon: FAssets.icons.plus, + onPress: () {}, + ), + ], + ), + ) + ), + ); + + await expectLater( + find.byType(TestScaffold), + matchesGoldenFile('header/$name-raw-title.png'), + ); + }); + } + }); +} diff --git a/forui/test/src/widgets/header/header_test.dart b/forui/test/src/widgets/header/header_test.dart new file mode 100644 index 000000000..22743a29d --- /dev/null +++ b/forui/test/src/widgets/header/header_test.dart @@ -0,0 +1,39 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_test/flutter_test.dart'; + +import 'package:forui/forui.dart'; + +void main() { + group('FHeader', () { + for (final (title, rawTitle) in [ + ('', null), + (null, const SizedBox()), + ]) { + testWidgets('constructor does not throw error', (tester) async { + expect( + () => FHeader( + title: title, + rawTitle: rawTitle, + ), + returnsNormally, + ); + }); + } + + for (final (title, rawTitle) in [ + (null, null), + ('', const SizedBox()), + ]) { + testWidgets('constructor throws error', (tester) async { + expect( + () => FHeader( + title: title, + rawTitle: rawTitle, + ), + throwsAssertionError, + ); + }); + } + }); +} diff --git a/forui/test/src/widgets/header_golden_test.dart b/forui/test/src/widgets/header_golden_test.dart deleted file mode 100644 index 997f9362e..000000000 --- a/forui/test/src/widgets/header_golden_test.dart +++ /dev/null @@ -1,90 +0,0 @@ -@Tags(['golden']) -library; - -import 'package:flutter/cupertino.dart'; - -import 'package:flutter_test/flutter_test.dart'; - -import 'package:forui/forui.dart'; -import '../test_scaffold.dart'; - -void main() { - group('FHeader', () { - for (final (name, theme, _) in TestScaffold.themes) { - testWidgets('$name with FHeader actions', (tester) async { - await tester.pumpWidget( - TestScaffold( - data: theme, - child: const Padding( - padding: EdgeInsets.symmetric(horizontal: 20), - child: FHeader(title: 'Title'), - ) - ), - ); - - await expectLater( - find.byType(TestScaffold), - matchesGoldenFile('header/$name-header.png'), - ); - }); - - testWidgets('$name with FHeader actions', (tester) async { - await tester.pumpWidget( - TestScaffold( - data: theme, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: FHeader( - title: 'Title', - actions: [ - FHeaderAction( - icon: FAssets.icons.alarmClock, - onPress: null, - ), - FHeaderAction( - icon: FAssets.icons.plus, - onPress: () {}, - ), - ], - ), - ) - ), - ); - - await expectLater( - find.byType(TestScaffold), - matchesGoldenFile('header/$name-header-actions.png'), - ); - }); - - testWidgets('$name with FHeader title overflow', (tester) async { - await tester.pumpWidget( - TestScaffold( - data: theme, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), - child: FHeader( - title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', - actions: [ - FHeaderAction( - icon: FAssets.icons.alarmClock, - onPress: null, - ), - FHeaderAction( - icon: FAssets.icons.plus, - onPress: () {}, - ), - ], - ), - ) - ), - ); - - await expectLater( - find.byType(TestScaffold), - matchesGoldenFile('header/$name-header-overflow.png'), - ); - }); - } - }); -} 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 01645c9f5..1b6130f6f 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 @@ -18,6 +18,60 @@ void main() { group('FTextField', () { for (final (theme, theme_, _) in TestScaffold.themes) { for (final (focused, focused_) in [('focused', true), ('unfocused', false)]) { + testWidgets('default - $theme - $focused - raw text', (tester) async { + await tester.pumpWidget( + MaterialApp( + home: TestScaffold( + data: theme_, + child: Padding( + padding: const EdgeInsets.all(20), + child: FTextField( + controller: TextEditingController(text: 'short text'), + autofocus: focused_, + rawLabel: const Text('My Label'), + hint: 'hint', + rawHelp: const Text('Some help text.'), + ), + ), + ), + ), + ); + + await tester.pumpAndSettle(); + + await expectLater( + find.byType(TestScaffold), + matchesGoldenFile('text_field/default-$theme-$focused-raw-text.png'), + ); + }); + + testWidgets('error - $theme - $focused - raw text', (tester) async { + await tester.pumpWidget( + MaterialApp( + home: TestScaffold( + data: theme_, + child: Padding( + padding: const EdgeInsets.all(20), + child: FTextField( + controller: TextEditingController(text: 'short text'), + autofocus: focused_, + rawLabel: const Text('My Label'), + hint: 'hint', + rawError: const Text('An error has occurred.'), + ), + ), + ), + ), + ); + + await tester.pumpAndSettle(); + + await expectLater( + find.byType(TestScaffold), + matchesGoldenFile('text_field/error-$theme-$focused-raw-text.png'), + ); + }); + for (final (text, text_) in [('text', 'short text'), ('no-text', null)]) { testWidgets('default - $theme - $focused - $text', (tester) async { final controller = text_ == null ? null : TextEditingController(text: text_); @@ -158,7 +212,6 @@ void main() { ); }); } - } } }); diff --git a/forui/test/src/widgets/text_field/text_field_test.dart b/forui/test/src/widgets/text_field/text_field_test.dart index d29c77530..6f41015fc 100644 --- a/forui/test/src/widgets/text_field/text_field_test.dart +++ b/forui/test/src/widgets/text_field/text_field_test.dart @@ -63,5 +63,34 @@ void main() { expect(tester.takeException(), null); }); + + for (final constructor in [ + (string, raw) => FTextField(label: string, rawLabel: raw), + (string, raw) => FTextField(help: string, rawHelp: raw), + (string, raw) => FTextField(error: string, rawError: raw), + (string, raw) => FTextField.email(label: string, rawLabel: raw), + (string, raw) => FTextField.email(help: string, rawHelp: raw), + (string, raw) => FTextField.email(error: string, rawError: raw), + (string, raw) => FTextField.password(label: string, rawLabel: raw), + (string, raw) => FTextField.password(help: string, rawHelp: raw), + (string, raw) => FTextField.password(error: string, rawError: raw), + (string, raw) => FTextField.multiline(label: string, rawLabel: raw), + (string, raw) => FTextField.multiline(help: string, rawHelp: raw), + (string, raw) => FTextField.multiline(error: string, rawError: raw), + ]) { + for (final (string, raw) in [ + (null, null), + ('', null), + (null, const SizedBox()), + ]) { + testWidgets('constructor does not throw error', (tester) async { + expect(() => constructor(string, raw), returnsNormally); + }); + } + + testWidgets('constructor title throws error', (tester) async { + expect(() => constructor('', const SizedBox()), throwsAssertionError); + }); + } }); }