Loading...
Loading...
Use ShadRadioGroup and ShadRadio for single-choice options; ShadRadioGroupFormField for forms. Use when adding radio buttons or single-select options in a Flutter shadcn_ui app or ShadForm.
npx skill4agent add serverpod/skills-registry shadcn_ui-radio-groupShadRadioGroup<T>itemsShadRadio<T>valuelabelShadRadioGroupFormField<T>ShadFormidlabelitemsvalidatorShadRadioGroup<String>(
items: [
ShadRadio(label: Text('Default'), value: 'default'),
ShadRadio(label: Text('Comfortable'), value: 'comfortable'),
ShadRadio(label: Text('Nothing'), value: 'nothing'),
],
)enum NotifyAbout { all, mentions, nothing; }
ShadRadioGroupFormField<NotifyAbout>(
label: const Text('Notify me about'),
items: NotifyAbout.values.map(
(e) => ShadRadio(
value: e,
label: Text(e.message),
),
),
validator: (v) {
if (v == null) return 'You need to select a notification type.';
return null;
},
)