Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The splash effect goes above the error / validation text #262

Open
VinhNgT opened this issue Apr 24, 2024 · 0 comments
Open

The splash effect goes above the error / validation text #262

VinhNgT opened this issue Apr 24, 2024 · 0 comments

Comments

@VinhNgT
Copy link

VinhNgT commented Apr 24, 2024

Currently on version 2.3.9:

Screenshot_20240424-113319_Drive Ready

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(),
      ),
    );
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant