format files
This commit is contained in:
parent
1d363db57d
commit
d5c3d00e45
@ -27,6 +27,6 @@
|
||||
|
||||
* Adding missing chars (ز-ج).
|
||||
|
||||
## [1.0.1] - 06/07/2022.
|
||||
## [1.0.2] - 06/07/2022.
|
||||
|
||||
* null safety
|
@ -1,22 +1,19 @@
|
||||
import 'package:virtual_keyboard_multi_language/virtual_keyboard_multi_language.dart';
|
||||
|
||||
class CustomLayoutKeys extends VirtualKeyboardLayoutKeys{
|
||||
|
||||
class CustomLayoutKeys extends VirtualKeyboardLayoutKeys {
|
||||
@override
|
||||
int getLanguagesCount() => 2;
|
||||
|
||||
List<List> getLanguage(int index){
|
||||
switch(index){
|
||||
case 1:
|
||||
return _arabicLayout;
|
||||
List<List> getLanguage(int index) {
|
||||
switch (index) {
|
||||
case 1:
|
||||
return _arabicLayout;
|
||||
default:
|
||||
return defaultEnglishLayout;
|
||||
return defaultEnglishLayout;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const List<List> _arabicLayout = [
|
||||
// Row 1
|
||||
const [
|
||||
@ -84,4 +81,4 @@ const List<List> _arabicLayout = [
|
||||
'-',
|
||||
'_',
|
||||
]
|
||||
];
|
||||
];
|
||||
|
@ -1,6 +1,3 @@
|
||||
part of virtual_keyboard_multi_language;
|
||||
|
||||
enum VirtualKeyboardDefaultLayouts{
|
||||
Arabic,
|
||||
English
|
||||
}
|
||||
enum VirtualKeyboardDefaultLayouts { Arabic, English }
|
||||
|
@ -44,11 +44,12 @@ List<VirtualKeyboardKey> _getKeyboardRowKeysNumeric(rowNum) {
|
||||
}
|
||||
|
||||
/// Returns a list of `VirtualKeyboardKey` objects.
|
||||
List<VirtualKeyboardKey> _getKeyboardRowKeys(VirtualKeyboardLayoutKeys layoutKeys,rowNum) {
|
||||
List<VirtualKeyboardKey> _getKeyboardRowKeys(
|
||||
VirtualKeyboardLayoutKeys layoutKeys, rowNum) {
|
||||
// Generate VirtualKeyboardKey objects for each row.
|
||||
return List.generate(layoutKeys.activeLayout[rowNum].length, (int keyNum) {
|
||||
// Get key string value.
|
||||
if(layoutKeys.activeLayout[rowNum][keyNum] is String){
|
||||
if (layoutKeys.activeLayout[rowNum][keyNum] is String) {
|
||||
String key = layoutKeys.activeLayout[rowNum][keyNum];
|
||||
|
||||
// Create and return new VirtualKeyboardKey object.
|
||||
@ -57,19 +58,21 @@ List<VirtualKeyboardKey> _getKeyboardRowKeys(VirtualKeyboardLayoutKeys layoutKey
|
||||
capsText: key.toUpperCase(),
|
||||
keyType: VirtualKeyboardKeyType.String,
|
||||
);
|
||||
}else{
|
||||
var action = layoutKeys.activeLayout[rowNum][keyNum] as VirtualKeyboardKeyAction;
|
||||
return VirtualKeyboardKey(
|
||||
keyType: VirtualKeyboardKeyType.Action,
|
||||
action: action);
|
||||
} else {
|
||||
var action =
|
||||
layoutKeys.activeLayout[rowNum][keyNum] as VirtualKeyboardKeyAction;
|
||||
return VirtualKeyboardKey(
|
||||
keyType: VirtualKeyboardKeyType.Action, action: action);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Returns a list of VirtualKeyboard rows with `VirtualKeyboardKey` objects.
|
||||
List<List<VirtualKeyboardKey>> _getKeyboardRows(VirtualKeyboardLayoutKeys layoutKeys) {
|
||||
List<List<VirtualKeyboardKey>> _getKeyboardRows(
|
||||
VirtualKeyboardLayoutKeys layoutKeys) {
|
||||
// Generate lists for each keyboard row.
|
||||
return List.generate(layoutKeys.activeLayout.length, (int rowNum) => _getKeyboardRowKeys(layoutKeys,rowNum));
|
||||
return List.generate(layoutKeys.activeLayout.length,
|
||||
(int rowNum) => _getKeyboardRowKeys(layoutKeys, rowNum));
|
||||
}
|
||||
|
||||
/// Returns a list of VirtualKeyboard rows with `VirtualKeyboardKey` objects.
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: virtual_keyboard_multi_language
|
||||
description: A simple package for dispaying virtual keyboards on a devices like kiosks and ATMs. The library is written in Dart and has no native code dependancy.
|
||||
version: 1.0.1
|
||||
version: 1.0.2
|
||||
#author: Ahmed El-Araby <ahmed-eg@live.com>
|
||||
homepage: https://github.com/ahmed-eg/virtual_keyboard_multi_language
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user