flutter_elinux/lib/common/settings/custom_layout.dart
2024-03-09 14:29:48 +01:00

89 lines
1.3 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:virtual_keyboard_multi_language/virtual_keyboard_multi_language.dart';
// example custom layout file (example from the virtual_keyboard_multi_language package)
// here different layouts for different languages could be defined:
class CustomLayoutKeys extends VirtualKeyboardLayoutKeys {
@override
int getLanguagesCount() => 2;
@override
List<List> getLanguage(int index) {
switch (index) {
case 1:
return _arabicLayout;
default:
return defaultEnglishLayout;
}
}
}
const List<List> _arabicLayout = [
// Row 1
[
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
],
// Row 2
[
'ض',
'ص',
'ث',
'ق',
'ف',
'غ',
'ع',
'ه',
'خ',
'ح',
'د',
VirtualKeyboardKeyAction.Backspace
],
// Row 3
[
'ش',
'س',
'ي',
'ب',
'ل',
'ا',
'ت',
'ن',
'م',
'ك',
'ط',
VirtualKeyboardKeyAction.Return
],
// Row 4
[
'ذ',
'ئ',
'ء',
'ؤ',
'ر',
'لا',
'ى',
'ة',
'و',
'.',
'ظ',
VirtualKeyboardKeyAction.Shift
],
// Row 5
[
VirtualKeyboardKeyAction.SwithLanguage,
'@',
VirtualKeyboardKeyAction.Space,
'-',
'_',
]
];