Skip to content

Commit 6193e66

Browse files
author
Alexander Petermann
committed
feature: add localization and tool tips to expandable buttons
additionally, migrate to newer flutter versions
1 parent 12a2f3f commit 6193e66

18 files changed

+995
-139
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
This is a fork of [simple_markdown_editor by zahnia88](https://github.com/zahniar88/simple_markdown_editor)
44
with contributions from [fossfreaks](https://github.com/fossfreaks)
55

6-
Simple markdown editor library For flutter.
6+
Simple markdown editor library For flutter.
77
For demo video, you can see it at this url [Demo](https://youtu.be/aYBeXXDoNPo)
88

9-
109
## Features
10+
1111
- ✅ Convert to Bold, Italic, Strikethrough
1212
- ✅ Convert to Code, Quote, Links
1313
- ✅ Convert to Heading (H1, H2, H3).
14+
- ✅ Convert to order list
1415
- ✅ Convert to unorder list and checkbox list
1516
- ✅ Support multiline convert
1617
- ✅ Support auto convert emoji
@@ -21,11 +22,26 @@ Add dependencies to your `pubspec.yaml`
2122

2223
```yaml
2324
dependencies:
24-
markdown_editor_plus: ^latest
25+
markdown_editor_plus: ^latest
2526
```
2627
2728
Run `flutter pub get` to install.
2829

30+
Add the localization delegate:
31+
32+
```dart
33+
return MaterialApp(
34+
localizationsDelegates: [
35+
MarkdownEditorPlusLocalizations.delegate, // <- Add this line
36+
GlobalMaterialLocalizations.delegate,
37+
GlobalWidgetsLocalizations.delegate,
38+
GlobalCupertinoLocalizations.delegate,
39+
],
40+
home: HomeScreen(),
41+
);
42+
43+
```
44+
2945
## How it works
3046

3147
Import library
@@ -96,4 +112,4 @@ MarkdownAutoPreview(
96112
)
97113
```
98114

99-
___
115+
---

example/lib/main.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
import 'package:flutter/material.dart';
22
import 'package:markdown_editor_plus/markdown_editor_plus.dart';
3+
import 'package:flutter_localizations/flutter_localizations.dart';
34

45
void main() {
56
runApp(const MyApp());
67
}
78

89
class MyApp extends StatelessWidget {
9-
const MyApp({Key? key}) : super(key: key);
10+
const MyApp({super.key});
1011

1112
@override
1213
Widget build(BuildContext context) {
1314
return const MaterialApp(
1415
debugShowCheckedModeBanner: false,
16+
localizationsDelegates: [
17+
MarkdownEditorPlusLocalizations.delegate, // Add this line
18+
GlobalMaterialLocalizations.delegate,
19+
GlobalWidgetsLocalizations.delegate,
20+
GlobalCupertinoLocalizations.delegate,
21+
],
22+
supportedLocales: [
23+
Locale('en'), // English
24+
Locale('de'), // German
25+
],
1526
home: HomeScreen(),
1627
);
1728
}
1829
}
1930

2031
class HomeScreen extends StatefulWidget {
21-
const HomeScreen({Key? key}) : super(key: key);
32+
const HomeScreen({super.key});
2233

2334
@override
2435
State<HomeScreen> createState() => _HomeScreenState();
@@ -50,6 +61,7 @@ class _HomeScreenState extends State<HomeScreen> {
5061
),
5162
emojiConvert: true,
5263
),
64+
MarkdownField(),
5365
],
5466
),
5567
);

0 commit comments

Comments
 (0)