mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05:00
chore(mobile): full width language change dropdown (#8806)
* chore(mobile): full width language change dropdown * linting
This commit is contained in:
parent
103cb60a57
commit
1aa8707b8a
1 changed files with 39 additions and 29 deletions
|
@ -23,36 +23,46 @@ class LanguageSettings extends HookConsumerWidget {
|
||||||
return ListView(
|
return ListView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
children: [
|
children: [
|
||||||
DropdownMenu(
|
LayoutBuilder(
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
builder: (context, constraints) {
|
||||||
border: OutlineInputBorder(
|
return DropdownMenu(
|
||||||
borderRadius: BorderRadius.circular(20),
|
width: constraints.maxWidth,
|
||||||
),
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
contentPadding: const EdgeInsets.only(left: 16),
|
border: OutlineInputBorder(
|
||||||
),
|
borderRadius: BorderRadius.circular(20),
|
||||||
menuStyle: MenuStyle(
|
|
||||||
shape: MaterialStatePropertyAll<OutlinedBorder>(
|
|
||||||
RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
menuHeight: context.height * 0.5,
|
|
||||||
hintText: "Languages",
|
|
||||||
label: const Text('Languages'),
|
|
||||||
dropdownMenuEntries: locales.keys
|
|
||||||
.map(
|
|
||||||
(countryName) => DropdownMenuEntry(
|
|
||||||
value: locales[countryName],
|
|
||||||
label: countryName,
|
|
||||||
),
|
),
|
||||||
)
|
contentPadding: const EdgeInsets.only(left: 16),
|
||||||
.toList(),
|
),
|
||||||
controller: textController,
|
menuStyle: MenuStyle(
|
||||||
onSelected: (value) {
|
shape: MaterialStatePropertyAll<OutlinedBorder>(
|
||||||
if (value != null) {
|
RoundedRectangleBorder(
|
||||||
selectedLocale.value = value;
|
borderRadius: BorderRadius.circular(15),
|
||||||
}
|
),
|
||||||
|
),
|
||||||
|
backgroundColor: MaterialStatePropertyAll<Color>(
|
||||||
|
context.isDarkTheme
|
||||||
|
? Colors.grey[900]!
|
||||||
|
: context.scaffoldBackgroundColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
menuHeight: context.height * 0.5,
|
||||||
|
hintText: "Languages",
|
||||||
|
label: const Text('Languages'),
|
||||||
|
dropdownMenuEntries: locales.keys
|
||||||
|
.map(
|
||||||
|
(countryName) => DropdownMenuEntry(
|
||||||
|
value: locales[countryName],
|
||||||
|
label: countryName,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList(),
|
||||||
|
controller: textController,
|
||||||
|
onSelected: (value) {
|
||||||
|
if (value != null) {
|
||||||
|
selectedLocale.value = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
Loading…
Reference in a new issue