Skip to content

Commit 3ff3510

Browse files
committed
more languages
1 parent d4ba743 commit 3ff3510

File tree

3 files changed

+52
-19
lines changed

3 files changed

+52
-19
lines changed

Diff for: lib/constants.dart

+17
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,26 @@ final bool isAndroid = Platform.isAndroid;
1212
final bool isIos = Platform.isIOS;
1313

1414
const Map<String, String> langs = {
15+
"ar": "Arabic",
16+
"bn": "Bengali",
17+
"zh-CN": "Chinese",
18+
"de": "German",
1519
"en_US": "English",
20+
"es": "Spanish",
21+
"fr": "French",
22+
"gu": "Gujarati",
1623
"hi": "Hindi",
24+
"it": "Italian",
25+
"ja": "Japanese",
1726
"kn": "Kannada",
27+
"ko": "Korean",
28+
"ml": "Malayalam",
29+
"mr": "Marathi",
30+
"pt-BR": "Portuguese",
31+
"ru": "Russian",
32+
"ta": "Tamil",
33+
"te": "Telugu",
34+
"ur": "Urdu",
1835
};
1936

2037
String baseURL = "https://bipinkrish-signbridge.hf.space";

Diff for: lib/home.dart

+34-18
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class _MyHomePageState extends State<MyHomePage> {
137137
child: Text(
138138
isActive
139139
? "Talk something or type"
140-
: "Failed to connect. check 'Base URL'",
140+
: 'Failed to connect. check "Base URL"',
141141
style: TextStyle(
142142
color: tertiaryColor,
143143
),
@@ -329,7 +329,7 @@ class _MyHomePageState extends State<MyHomePage> {
329329
),
330330
child: TextButton(
331331
onPressed: () {
332-
_showOptionsDialog(context, tertiaryColor);
332+
_showOptionsDialog(context, secondaryColor, tertiaryColor);
333333
},
334334
child: Text(
335335
langs[selectedId]!,
@@ -476,28 +476,44 @@ class _MyHomePageState extends State<MyHomePage> {
476476
}
477477

478478
Future<void> _showOptionsDialog(
479-
BuildContext context, Color tertiaryColor) async {
479+
BuildContext context, Color secondaryColor, Color tertiaryColor) async {
480480
String? selectedOption = await showDialog(
481481
context: context,
482482
builder: (BuildContext context) {
483483
return AlertDialog(
484484
scrollable: true,
485-
titleTextStyle: TextStyle(
486-
fontWeight: FontWeight.bold,
487-
color: tertiaryColor,
488-
fontSize: 24,
485+
title: ListTile(
486+
title: const Text('Select a language'),
487+
isThreeLine: true,
488+
contentPadding: const EdgeInsets.symmetric(vertical: 8),
489+
minVerticalPadding: 0,
490+
titleTextStyle: TextStyle(
491+
fontWeight: FontWeight.bold,
492+
color: secondaryColor,
493+
fontSize: 24,
494+
),
495+
subtitle: const Text(
496+
"You need to have the language pack installed for the selected language.",
497+
),
498+
subtitleTextStyle: TextStyle(
499+
fontStyle: FontStyle.italic,
500+
color: tertiaryColor,
501+
fontSize: 14,
502+
),
489503
),
490-
title: const Text('Select a language'),
491-
content: SingleChildScrollView(
492-
child: ListBody(
493-
children: langs.keys.map((String key) {
494-
return ListTile(
495-
title: Text(langs[key]!),
496-
onTap: () {
497-
Navigator.of(context).pop(key);
498-
},
499-
);
500-
}).toList(),
504+
content: Container(
505+
constraints: const BoxConstraints(maxHeight: 400),
506+
child: SingleChildScrollView(
507+
child: ListBody(
508+
children: langs.keys.map((String key) {
509+
return ListTile(
510+
title: Text(langs[key]!),
511+
onTap: () {
512+
Navigator.of(context).pop(key);
513+
},
514+
);
515+
}).toList(),
516+
),
501517
),
502518
),
503519
);

Diff for: pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: signbridge
22
description: Effortless Real-Time Sign Language Production
33

44
publish_to: "none"
5-
version: 1.0.1+1
5+
version: 1.1.0+1
66

77
environment:
88
sdk: ">=3.2.0 <4.0.0"

0 commit comments

Comments
 (0)