Open VinhNgT opened 4 months ago
Currently on version 2.3.9:
Expected: The splash effect should stay inside the button border
Here is the code for the above widget, please note that I am using flutter_hooks:
class ChapterDropdown extends HookConsumerWidget { final GlobalKey<FormState>? formKey; const ChapterDropdown({super.key, this.formKey}); @override Widget build(BuildContext context, WidgetRef ref) { final selected = useState<Chapter?>(null); return Form( key: formKey, child: DropdownButtonFormField2( isExpanded: true, value: selected.value, onChanged: (value) => { selected.value = value, formKey?.currentState!.reset(), }, hint: Text( 'Chọn chương', style: context.textTheme.bodyLarge!.copyWith( color: context.materialScheme.onSurfaceVariant, ), ), validator: (value) { if (value == null) { return 'Vui lòng chọn chương để xoá'; } return null; }, items: Chapter.values .map( (item) => DropdownMenuItem( value: item, child: Text( item.chapterName, style: const TextStyle( fontSize: 14, ), ), ), ) .toList(), ), ); } }
Currently on version 2.3.9:
Expected: The splash effect should stay inside the button border
Here is the code for the above widget, please note that I am using flutter_hooks: