Skip to content

Commit

Permalink
Start add language selection
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Sep 6, 2023
1 parent 2ba48c6 commit 36ba966
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,38 @@ class HomePageState extends State<HomePage> {
),
),
const Divider(),
ListTile(
leading: const Icon(Icons.language),
title: const Text('Language'),
trailing: SizedBox(
height: 32,
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(4),
),
padding: const EdgeInsets.symmetric(horizontal: 8),
child: DropdownButton<Locale>(
value: Localizations.localeOf(context),
onChanged: (Locale? locale) {
if (locale != null) {
// Handle locale selection
}
},
icon: const Icon(Icons.arrow_drop_down),
underline: Container(),
style: Theme.of(context).textTheme.titleMedium,
items: AppLocalizations.supportedLocales
.map((locale) => DropdownMenuItem<Locale>(
value: locale,
child: Text(locale.languageCode),
))
.toList(),
),
),
),
),
const Divider(),
InkWell(
highlightColor: Colors.transparent,
splashColor: Colors.transparent,
Expand Down

0 comments on commit 36ba966

Please sign in to comment.