You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add a new language or a keyboad layout to the package you only need to modify the language.dart file. The following steps will show you how to do that.
57
57
58
58
1. Add the short name form of your new language to the `Language` enum.
59
-
```
59
+
```dart
60
60
enum Language {
61
61
EN,
62
62
FR,
63
63
DE,
64
-
<yournewlanguage>,
64
+
<your language>,
65
65
}
66
66
```
67
67
2. Add your layout name to the `Layout` enum if not present.
68
-
```
68
+
```dart
69
69
enum Layout {
70
70
QWERTY,
71
71
QWERTZ,
72
72
AZERTY,
73
-
<newlayout>,
73
+
<your layout>,
74
74
}
75
75
```
76
76
3. Create a new map variable called `<language name>Config`. The keys of this map will be the layouts from the `Layout` enum (e.g: Layout.QWERTY), and the values will be maps with types `<String, String>` that contain the core configuration. These latter maps must contain four fields o:
@@ -82,24 +82,24 @@ enum Layout {
82
82
(The bottom/last row will just take the remaining keys).
83
83
84
84
example:
85
-
```
85
+
```dart
86
86
var frenchConfig = {
87
87
Layout.QWERTY: <String, String>{
88
88
'layout': 'qwertyuiopasdfghjklzxcvbnm',
89
-
'horizontalSpacing': '6.0',
90
-
'topLength': '10',
91
-
'middleLength': '9',
89
+
'horizontalSpacing': '6.0', // space between keys
90
+
'topLength': '10', // number of keys
91
+
'middleLength': '9', // number of keys
92
92
},
93
93
Layout.AZERTY: <String, String>{
94
94
'layout': 'azertyuiopqsdfghjklmwxcvbn',
95
-
'horizontalSpacing': '6.0',
96
-
'topLength': '10',
97
-
'middleLength': '9',
95
+
'horizontalSpacing': '6.0', // space between keys
96
+
'topLength': '10', // number of keys
97
+
'middleLength': '9', // number of keys
98
98
},
99
99
};
100
100
```
101
101
4. And finally your new language config map to the `languageConfig` map, with the key as the short language name from the `Language` enum.
0 commit comments