Skip to content

feature: add localization and tool tips to expandable buttons #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
This is a fork of [simple_markdown_editor by zahnia88](https://github.com/zahniar88/simple_markdown_editor)
with contributions from [fossfreaks](https://github.com/fossfreaks)

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


## Features

- ✅ Convert to Bold, Italic, Strikethrough
- ✅ Convert to Code, Quote, Links
- ✅ Convert to Heading (H1, H2, H3).
- ✅ Convert to order list
- ✅ Convert to unorder list and checkbox list
- ✅ Support multiline convert
- ✅ Support auto convert emoji
Expand All @@ -21,11 +22,26 @@ Add dependencies to your `pubspec.yaml`

```yaml
dependencies:
markdown_editor_plus: ^latest
markdown_editor_plus: ^latest
```

Run `flutter pub get` to install.

Add the localization delegate:

```dart
return MaterialApp(
localizationsDelegates: [
MarkdownEditorPlusLocalizations.delegate, // <- Add this line
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
home: HomeScreen(),
);

```

## How it works

Import library
Expand Down Expand Up @@ -96,4 +112,4 @@ MarkdownAutoPreview(
)
```

___
---
16 changes: 14 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
import 'package:flutter/material.dart';
import 'package:markdown_editor_plus/markdown_editor_plus.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
localizationsDelegates: [
MarkdownEditorPlusLocalizations.delegate, // Add this line
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [
Locale('en'), // English
Locale('de'), // German
],
home: HomeScreen(),
);
}
}

class HomeScreen extends StatefulWidget {
const HomeScreen({Key? key}) : super(key: key);
const HomeScreen({super.key});

@override
State<HomeScreen> createState() => _HomeScreenState();
Expand Down Expand Up @@ -50,6 +61,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
emojiConvert: true,
),
MarkdownField(),
],
),
);
Expand Down
Loading