mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
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:
parent
b21ee5d2de
commit
81e50b8dd5
@ -57,35 +57,36 @@ class _LanguageSelectorDropdownState extends State<LanguageSelectorDropdown> {
|
|||||||
onEnter: (event) => {hoverEnterLanguage()},
|
onEnter: (event) => {hoverEnterLanguage()},
|
||||||
onExit: (event) => {hoverExitLanguage()},
|
onExit: (event) => {hoverExitLanguage()},
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.only(left: 8, right: 8),
|
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
color: currHoverColor,
|
color: currHoverColor,
|
||||||
),
|
),
|
||||||
child: DropdownButtonHideUnderline(
|
child: DropdownButtonHideUnderline(
|
||||||
child: DropdownButton<Locale>(
|
child: Padding(
|
||||||
value: context.locale,
|
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||||
onChanged: (val) {
|
child: DropdownButton<Locale>(
|
||||||
setState(() {
|
value: context.locale,
|
||||||
context
|
onChanged: (val) {
|
||||||
.read<AppearanceSettingsCubit>()
|
setState(() {
|
||||||
.setLocale(context, val!);
|
context
|
||||||
});
|
.read<AppearanceSettingsCubit>()
|
||||||
},
|
.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) {
|
||||||
|
return DropdownMenuItem<Locale>(
|
||||||
|
value: locale,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(12.0),
|
||||||
|
child: FlowyText.medium(languageFromLocale(locale)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
items: EasyLocalization.of(context)!.supportedLocales.map((locale) {
|
|
||||||
return DropdownMenuItem<Locale>(
|
|
||||||
value: locale,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(12.0),
|
|
||||||
child: FlowyText.medium(languageFromLocale(locale)),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user