diff --git a/forui/CHANGELOG.md b/forui/CHANGELOG.md index 30f0728f5..3c2ad90d3 100644 --- a/forui/CHANGELOG.md +++ b/forui/CHANGELOG.md @@ -20,6 +20,8 @@ * Add label and description to `FCheckbox`. +* Add label and description to `FSwitch`. + * Add `FPortal`. * Add `FPopover`. diff --git a/forui/example/lib/sandbox.dart b/forui/example/lib/sandbox.dart index 8ae56f934..73a0e9381 100644 --- a/forui/example/lib/sandbox.dart +++ b/forui/example/lib/sandbox.dart @@ -20,10 +20,9 @@ class _SandboxState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ const FSwitch( - label: Text('Accept terms and conditions'), - description: Text('You agree to our terms and conditions.'), - semanticLabel: 'Accept terms and conditions', - enabled: true, + label: Text('Airplane Mode'), + description: Text('Disable all wireless connections.'), + semanticLabel: 'Airplane Mode', ), FTooltip( longPressExitDuration: const Duration(seconds: 5000), diff --git a/forui/test/golden/switch/zinc-dark-checked-disabled-switch.png b/forui/test/golden/switch/zinc-dark-checked-disabled-switch.png index 9edb34764..e6c610d19 100644 Binary files a/forui/test/golden/switch/zinc-dark-checked-disabled-switch.png and b/forui/test/golden/switch/zinc-dark-checked-disabled-switch.png differ diff --git a/forui/test/golden/switch/zinc-dark-checked-focused-switch.png b/forui/test/golden/switch/zinc-dark-checked-focused-switch.png index 6e215403c..6c541898a 100644 Binary files a/forui/test/golden/switch/zinc-dark-checked-focused-switch.png and b/forui/test/golden/switch/zinc-dark-checked-focused-switch.png differ diff --git a/forui/test/golden/switch/zinc-dark-checked-unfocused-switch.png b/forui/test/golden/switch/zinc-dark-checked-unfocused-switch.png index 6e215403c..6c541898a 100644 Binary files a/forui/test/golden/switch/zinc-dark-checked-unfocused-switch.png and b/forui/test/golden/switch/zinc-dark-checked-unfocused-switch.png differ diff --git a/forui/test/golden/switch/zinc-dark-unchecked-disabled-switch.png b/forui/test/golden/switch/zinc-dark-unchecked-disabled-switch.png index 3c075c60a..c7e7383b4 100644 Binary files a/forui/test/golden/switch/zinc-dark-unchecked-disabled-switch.png and b/forui/test/golden/switch/zinc-dark-unchecked-disabled-switch.png differ diff --git a/forui/test/golden/switch/zinc-dark-unchecked-focused-switch.png b/forui/test/golden/switch/zinc-dark-unchecked-focused-switch.png index c77c254de..c40aba496 100644 Binary files a/forui/test/golden/switch/zinc-dark-unchecked-focused-switch.png and b/forui/test/golden/switch/zinc-dark-unchecked-focused-switch.png differ diff --git a/forui/test/golden/switch/zinc-dark-unchecked-unfocused-switch.png b/forui/test/golden/switch/zinc-dark-unchecked-unfocused-switch.png index c77c254de..c40aba496 100644 Binary files a/forui/test/golden/switch/zinc-dark-unchecked-unfocused-switch.png and b/forui/test/golden/switch/zinc-dark-unchecked-unfocused-switch.png differ diff --git a/forui/test/golden/switch/zinc-light-checked-disabled-switch.png b/forui/test/golden/switch/zinc-light-checked-disabled-switch.png index 8d161b3b9..05c15114d 100644 Binary files a/forui/test/golden/switch/zinc-light-checked-disabled-switch.png and b/forui/test/golden/switch/zinc-light-checked-disabled-switch.png differ diff --git a/forui/test/golden/switch/zinc-light-checked-focused-switch.png b/forui/test/golden/switch/zinc-light-checked-focused-switch.png index 27ef8b8ce..fc185fe07 100644 Binary files a/forui/test/golden/switch/zinc-light-checked-focused-switch.png and b/forui/test/golden/switch/zinc-light-checked-focused-switch.png differ diff --git a/forui/test/golden/switch/zinc-light-checked-unfocused-switch.png b/forui/test/golden/switch/zinc-light-checked-unfocused-switch.png index 27ef8b8ce..fc185fe07 100644 Binary files a/forui/test/golden/switch/zinc-light-checked-unfocused-switch.png and b/forui/test/golden/switch/zinc-light-checked-unfocused-switch.png differ diff --git a/forui/test/golden/switch/zinc-light-unchecked-disabled-switch.png b/forui/test/golden/switch/zinc-light-unchecked-disabled-switch.png index db304ca9b..1f59744d5 100644 Binary files a/forui/test/golden/switch/zinc-light-unchecked-disabled-switch.png and b/forui/test/golden/switch/zinc-light-unchecked-disabled-switch.png differ diff --git a/forui/test/golden/switch/zinc-light-unchecked-focused-switch.png b/forui/test/golden/switch/zinc-light-unchecked-focused-switch.png index d952fa6e2..87c0bf4e1 100644 Binary files a/forui/test/golden/switch/zinc-light-unchecked-focused-switch.png and b/forui/test/golden/switch/zinc-light-unchecked-focused-switch.png differ diff --git a/forui/test/golden/switch/zinc-light-unchecked-unfocused-switch.png b/forui/test/golden/switch/zinc-light-unchecked-unfocused-switch.png index d952fa6e2..87c0bf4e1 100644 Binary files a/forui/test/golden/switch/zinc-light-unchecked-unfocused-switch.png and b/forui/test/golden/switch/zinc-light-unchecked-unfocused-switch.png differ diff --git a/forui/test/src/widgets/switch_golden_test.dart b/forui/test/src/widgets/switch_golden_test.dart index ab66a7600..02cc8c1ef 100644 --- a/forui/test/src/widgets/switch_golden_test.dart +++ b/forui/test/src/widgets/switch_golden_test.dart @@ -18,6 +18,9 @@ void main() { data: theme, child: Center( child: FSwitch( + label: const Text('Airplane Mode'), + description: const Text('Disable all wireless connections.'), + semanticLabel: 'Airplane Mode', initialValue: value, ), ), @@ -36,6 +39,9 @@ void main() { data: theme, child: Center( child: FSwitch( + label: const Text('Airplane Mode'), + description: const Text('Disable all wireless connections.'), + semanticLabel: 'Airplane Mode', initialValue: value, autofocus: true, ), @@ -55,6 +61,9 @@ void main() { data: theme, child: Center( child: FSwitch( + label: const Text('Airplane Mode'), + description: const Text('Disable all wireless connections.'), + semanticLabel: 'Airplane Mode', enabled: false, initialValue: value, autofocus: true,