Skip to content

Commit c7fb426

Browse files
committed
version 3.4.0
1 parent 0bb7035 commit c7fb426

File tree

6 files changed

+37
-15
lines changed

6 files changed

+37
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [3.4.0] - 2023.01.05
2+
3+
- Remove `DefaultMongolTextEditingShortcuts` from `MongolEditableTextState` (#35) (@Satsrag)
4+
- To switch the behavior of left/right and up/down keys in `MongolEditableText`, developers now need to add `MongolTextEditingShortcuts` at the top of the widget tree. See [#33](https://github.com/suragch/mongol/issues/33) for discussion.
5+
16
## [3.3.1] - 2022.12.31
27

38
- Fix: crash when MongolTextField contain a line end with ' \n' (#34) (@Satsrag)

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ Since it's likely that some of your users' devices won't have a Mongolian font i
8181

8282
### 1. Get a font
8383

84-
You can find a font from the following companies:
84+
You can find a font from the following sources:
8585

86-
- [Menksoft](http://www.menksoft.com/site/alias__menkcms/2805/Default.aspx)
87-
- [Delehi](http://www.delehi.com/cn/2693.html)
88-
- [One BolorSoft font](https://www.mngl.net/downloads/fonts/MongolianScript.ttf)
86+
- [Menksoft](https://www.mklai.cn/download-font?productId=a0ec7735b5714334934ff3c094ca0a5e)
87+
- [MongolFont](http://www.mongolfont.com/en/font/index.html)
88+
- [BolorSoft](https://www.mngl.net/#download)
89+
- [Z Mongol Code](https://install.zcodetech.com/)
90+
- [CMs font](https://phabricator.wikimedia.org/T130502)
8991

9092
### 2. Add the font to your project
9193

@@ -109,9 +111,8 @@ In your `main.dart` file, set the `fontFamily` for the app theme.
109111

110112
```dart
111113
MaterialApp(
112-
title: 'My App',
113114
theme: ThemeData(fontFamily: 'MenksoftQagan'),
114-
home: MyHomePage(),
115+
// ...
115116
);
116117
```
117118

@@ -142,6 +143,15 @@ MongolTextField(
142143
),
143144
```
144145

146+
In order to correctly handle right/left and up/down keys on the web and desktop (or for physical keyboards connected to a mobile app), you need to return the `MongolTextEditingShortcuts` widget from the `builder` method of your `MaterialApp` (or `CupertinoApp` or `WidgetsApp`) at the top of your widget tree:
147+
148+
```dart
149+
MaterialApp(
150+
builder: (context, child) => MongolTextEditingShortcuts(child: child),
151+
// ...
152+
)
153+
```
154+
145155
## Horizontal lists
146156

147157
You can display horizontally scrolling lists with the standard `ListView` widget. All you need to do is set the scroll direction to horizontal.
@@ -227,6 +237,6 @@ This alert dialog works mostly the same as the Flutter `AlertDialog`.
227237
- Improve keyboard (this may be better as a separate package)
228238
- Various other text based widgets
229239
- Support `WidgetSpan`.
230-
- Add missing tests (currently commented out)
240+
- Add more tests
231241
- For `MongolTextAlign.bottom` don't count final space in line height
232242
- Add `MongolSelectableText` widget

example/lib/main.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ class DemoApp extends StatelessWidget {
2727
Widget build(BuildContext context) {
2828
return MaterialApp(
2929
debugShowCheckedModeBanner: false,
30-
builder: (context, child) {
31-
return MongolTextEditingShortcuts(child: child);
32-
},
30+
builder: (context, child) => MongolTextEditingShortcuts(child: child),
3331
title: 'mongol',
3432
theme: ThemeData(
3533
fontFamily: 'MenksoftQagan',
3634
),
3735
home: Scaffold(
38-
appBar: AppBar(title: const Text('Flutter mongol package 3.3.1')),
36+
appBar: AppBar(title: const Text('Flutter mongol package 3.4.0')),
3937
body: const HomeScreen(),
4038
),
4139
);

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ packages:
9494
path: ".."
9595
relative: true
9696
source: path
97-
version: "3.3.1"
97+
version: "3.4.0"
9898
path:
9999
dependency: transitive
100100
description:

lib/src/editing/mongol_text_editing_shortcuts.dart

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ import 'package:flutter/widgets.dart';
1111
import 'mongol_text_editing_intents.dart';
1212

1313
/// Switch up/down arrow keys and left/right arrow keys
14+
///
15+
/// Insert this widget just below the MaterialApp (or WidgetsApp or
16+
/// CupertinoApp) in order to cause the arrow keys to behave as expected
17+
/// in a `MongolTextField`.
18+
///
19+
/// ```
20+
/// MaterialApp(
21+
/// builder: (context, child) => MongolTextEditingShortcuts(child: child),
22+
/// ```
1423
class MongolTextEditingShortcuts extends StatelessWidget {
1524
const MongolTextEditingShortcuts({Key? key, required this.child})
1625
: super(key: key);
1726

1827
final Widget? child;
1928

20-
// These are shortcuts are shared between most platforms except macOS for it
21-
// uses different modifier keys as the line/word modifier.
29+
// These shortcuts are shared between most platforms except macOS, which
30+
// uses different modifier keys for the line/word modifier.
2231
static final Map<ShortcutActivator, Intent> _commonShortcuts =
2332
<ShortcutActivator, Intent>{
2433
// Arrow: Move Selection.

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: mongol
22
description: Flutter widget package for displaying and editing vertical Mongolian text.
33
# When updating version, also update CHANGELOG.md and example/lib/main.dart
4-
version: 3.3.1
4+
version: 3.4.0
55
homepage: https://github.com/suragch/mongol
66

77
environment:

0 commit comments

Comments
 (0)