Skip to content

Commit

Permalink
Fix PR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante committed Oct 5, 2024
1 parent d02b815 commit 4f07572
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion forui/example/lib/sandbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class _SandboxState extends State<Sandbox> {
label: const Text('Select Group'),
description: const Text('Select Group Description'),
controller: FMultiSelectGroupController(min: 1, max: 2, values: {1}),
children: [
items: [
FSelectGroupItem.checkbox(value: 1, label: const Text('Checkbox 1'), semanticLabel: 'Checkbox 1'),
FSelectGroupItem.checkbox(value: 2, label: const Text('Checkbox 2'), semanticLabel: 'Checkbox 2'),
FSelectGroupItem.checkbox(value: 3, label: const Text('Checkbox 3'), semanticLabel: 'Checkbox 3'),
Expand Down
8 changes: 4 additions & 4 deletions forui/lib/src/widgets/select_group/select_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class FSelectGroup<T> extends FormField<Set<T>> {
final Widget Function(BuildContext, String) errorBuilder;

/// The children.
final List<FSelectGroupItem<T>> children;
final List<FSelectGroupItem<T>> items;

/// Creates a [FSelectGroup].
FSelectGroup({
required this.controller,
required this.children,
required this.items,
this.style,
this.label,
this.description,
Expand Down Expand Up @@ -75,7 +75,7 @@ class FSelectGroup<T> extends FormField<Set<T>> {
error: error,
child: Column(
children: [
for (final child in children)
for (final child in items)
FSelectGroupItemData<T>(
controller: controller,
style: groupStyle,
Expand All @@ -99,7 +99,7 @@ class FSelectGroup<T> extends FormField<Set<T>> {
..add(DiagnosticsProperty('controller', controller))
..add(ObjectFlagProperty.has('errorBuilder', errorBuilder))
..add(DiagnosticsProperty('testing', (1, 2, 3)))
..add(IterableProperty('items', children));
..add(IterableProperty('items', items));
}
}

Expand Down
7 changes: 6 additions & 1 deletion forui/lib/src/widgets/select_group/select_group_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ class _Builder<T> extends FSelectGroupItem<T> {
final ValueWidgetBuilder<FSelectGroupItemState<T>> builder;
final Widget? child;

const _Builder({required this.builder, required super.value, this.child, super.key}) : super._();
const _Builder({
required this.builder,
required super.value,
this.child,
super.key,
}) : super._();

@override
Widget build(BuildContext context) {
Expand Down
26 changes: 13 additions & 13 deletions forui/test/src/test_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ class TestScaffold extends StatelessWidget {
colorScheme: const FColorScheme(
brightness: Brightness.light,
disabledColorLightness: 0.1,
background: Colors.lightBlue,
foreground: Colors.lightBlue,
primary: Colors.lightBlue,
primaryForeground: Colors.lightBlue,
secondary: Colors.lightBlue,
secondaryForeground: Colors.lightBlue,
muted: Colors.lightBlue,
mutedForeground: Colors.lightBlue,
destructive: Colors.lightBlue,
destructiveForeground: Colors.lightBlue,
error: Colors.lightBlue,
errorForeground: Colors.lightBlue,
border: Colors.lightBlue,
background: Color(0xFF03A9F4),
foreground: Color(0xFF03A9F4),
primary: Color(0xFF03A9F4),
primaryForeground: Color(0xFF03A9F4),
secondary: Color(0xFF03A9F4),
secondaryForeground: Color(0xFF03A9F4),
muted: Color(0xFF03A9F4),
mutedForeground: Color(0xFF03A9F4),
destructive: Color(0xFF03A9F4),
destructiveForeground: Color(0xFF03A9F4),
error: Color(0xFF03A9F4),
errorForeground: Color(0xFF03A9F4),
border: Color(0xFF03A9F4),
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void main() {
label: const Text('Select Group'),
description: const Text('Select Group Description'),
controller: FMultiSelectGroupController(values: {1}),
children: [
items: [
FSelectGroupItem.checkbox(
value: 1,
label: const Text('Checkbox 1'),
Expand Down Expand Up @@ -60,7 +60,7 @@ void main() {
label: const Text('Select Group'),
description: const Text('Select Group Description'),
controller: FMultiSelectGroupController(values: {1}),
children: [
items: [
FSelectGroupItem.checkbox(
value: 1,
label: const Text('Checkbox 1'),
Expand Down Expand Up @@ -102,7 +102,7 @@ void main() {
description: const Text('Select Group Description'),
forceErrorText: 'Some error message.',
controller: FMultiSelectGroupController(values: {1}),
children: [
items: [
FSelectGroupItem.checkbox(
value: 1,
label: const Text('Checkbox 1'),
Expand Down Expand Up @@ -147,7 +147,7 @@ void main() {
label: const Text('Select Group'),
description: const Text('Select Group Description'),
controller: FRadioSelectGroupController(value: 1),
children: [
items: [
FSelectGroupItem.radio(
value: 1,
label: const Text('Radio 1'),
Expand Down Expand Up @@ -189,7 +189,7 @@ void main() {
description: const Text('Select Group Description'),
forceErrorText: 'Some error message.',
controller: FRadioSelectGroupController(value: 1),
children: [
items: [
FSelectGroupItem.radio(
value: 1,
label: const Text('Radio 1'),
Expand Down
6 changes: 3 additions & 3 deletions samples/lib/widgets/select_group.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SelectGroupPage extends SampleScaffold {
controller: FMultiSelectGroupController(values: {Sidebar.recents}),
label: const Text('Sidebar'),
description: const Text('These will be shown in the sidebar.'),
children: [
items: [
FSelectGroupItem.checkbox(
value: Sidebar.recents,
label: const Text('Recents'),
Expand Down Expand Up @@ -78,7 +78,7 @@ class CheckboxFormState extends State<CheckboxForm> {
label: const Text('Favorite Languages'),
description: const Text('Your favorite language.'),
validator: (values) => values?.isEmpty ?? true ? 'Please select at least one language.' : null,
children: [
items: [
FSelectGroupItem.checkbox(
value: Language.dart,
label: const Text('Dart'),
Expand Down Expand Up @@ -152,7 +152,7 @@ class RadioFormState extends State<RadioForm> {
label: const Text('Notifications'),
description: const Text('Select the notifications.'),
validator: (values) => values?.isEmpty ?? true ? 'Please select a value.' : null,
children: [
items: [
FSelectGroupItem.radio(
value: Notification.all,
label: const Text('All new messages'),
Expand Down

0 comments on commit 4f07572

Please sign in to comment.