feat: add icon to dropdown button in language view (#2031)

- drop down button gives the default icon
- set auto focus true in dropdown button
- add padding to dropdown button
- change edgeIsets.only(left,right) to edgeInsets.symmetric(horizontal)
This commit is contained in:
Sudhanva-Nadiger 2023-03-20 16:14:41 +05:30 committed by GitHub
parent b21ee5d2de
commit 81e50b8dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,12 +57,14 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> {
onEnter: (event) => {hoverEnterLanguage()},
onExit: (event) => {hoverExitLanguage()},
child: Container(
margin: const EdgeInsets.only(left: 8, right: 8),
margin: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: currHoverColor,
),
child: DropdownButtonHideUnderline(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 6),
child: DropdownButton<Locale>(
value: context.locale,
onChanged: (val) {
@ -72,12 +74,10 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> {
.setLocale(context, val!);
});
},
icon: const Visibility(
visible: false,
child: (Icon(Icons.arrow_downward)),
),
autofocus: true,
borderRadius: BorderRadius.circular(8),
items: EasyLocalization.of(context)!.supportedLocales.map((locale) {
items:
EasyLocalization.of(context)!.supportedLocales.map((locale) {
return DropdownMenuItem<Locale>(
value: locale,
child: Padding(
@ -89,6 +89,7 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> {
),
),
),
),
);
}
}