A comprehensive Flutter package for rendering rich Markdown and LaTeX content in your apps, designed for seamless integration with AI outputs like ChatGPT and Gemini.
...
...
@@ -8,71 +8,106 @@ A comprehensive Flutter package for rendering rich Markdown and LaTeX content in
---
## Supported Markdown Features
| ✨ Feature | ✅ Supported | 🔜 Upcoming |
| --- | --- | --- |
| 💻 Code Block | ✅ | |
| 📊 Table | ✅ | |
| 📝 Heading | ✅ | |
| 📌 Unordered List | ✅ | |
| 📋 Ordered List | ✅ | |
| 🔘 Radio Button | ✅ | |
| ☑️ Check Box | ✅ | |
| ➖ Horizontal Line | ✅ | |
| 🔢 Latex Math | ✅ | |
| ↩️ Indent | ✅ |
| 🖼️ Image | ✅ |
| ✨ Highlighted Text | ✅ |
| ✂️ Striked Text | ✅ |
| 🔵 Bold Text | ✅ |
| 📜 Italic Text | ✅ |
| 🔗 Links | ✅ |
| 📎 Underline | | 🔜 |
| 🧩 Custom components | | 🔜 |
## ✨ Key Features
Render a wide variety of content with full Markdown and LaTeX support, including:
- List
- Unordered list item
1. Ordered list item
```
- Unordered list item
1. Ordered list item
```
- Horizontal line
---
```
---
```
- Links
[<text here>](<href>)
```
[<text here>](<href>)
```
- Images with size

```

```
- Table
```
| Name | Roll |
|-------------|-------------|
| sohag | 1 |
```
| Name | Roll |
|-------------|-------------|
| sohag | 1 |
- Striked text
```
| Name | Roll |
|-------|------|
| sohag | 1 |
~~striked text~~
```
- Bold text
| Name | Roll |
|-------|------|
| sohag | 1 |
**Bold text**
- ~~Striked text~~
```
~~striked text~~
```
- Italic text
-**Bold text**
```
**Bold text**
```
*Italic text*
-*Italic text*
```
*Italic text*
```
- heading texts
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
```
# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
```
- Latex formula `\(\frac a b\)` or `\[\frac ab\]`
\(\frac a b\)
```
\(\frac a b\)
```
- Radio button and checkbox
() Unchecked radio
(x) Checked radio
[] Unchecked checkbox
[x] Checked checkbox
```
() Unchecked radio
(x) Checked radio
[] Unchecked checkbox
[x] Checked checkbox
```
- You can also make the content selectable using `SelectiionArea` widget.
- You can also make the content selectable using `SelectionArea` widget.
## 🚀 Why Use GPT Markdown?
...
...
@@ -90,7 +125,7 @@ flutter pub add gpt_markdown
## 📖 Usage
Check the documentation [here.](https://github.com/saminsohag/flutter_packages/tree/main/gpt_markdown/example)
Check the documentation [here.](https://github.com/Infinitix-LLC/gpt_markdown/tree/main/example)
```dart
import'package:flutter/material.dart';
...
...
@@ -145,6 +180,8 @@ You can also use LaTeX for mathematical expressions. Here's an example:
Markdown and LaTeX can be powerful tools for formatting text and mathematical expressions in your Flutter app. If you have any questions or need further assistance, feel free to ask!
```
### Output from gpt_markdown
<imgwidth="614"alt="Screenshot 2024-02-15 at 4 13 59 AM"src="https://github.com/saminsohag/flutter_packages/assets/59507062/8f4a4068-a12c-45d1-a954-ebaf3822e754">
@@ -73,3 +73,55 @@ class _MyHomePageState extends State<MyHomePage> {
}
```
Use `SelectableAdapter` to make any non selectable widget selectable.
```dart
SelectableAdapter(
selectedText:'sin(x^2)',
child:Math.tex('sin(x^2)'),
);
```
Use `GptMarkdownTheme` widget and `GptMarkdownThemeData` to customize the GptMarkdown.
```dart
GptMarkdownTheme(
data:GptMarkdownThemeData.of(context).copyWith(
highlightColor:Colors.red,
),
child:GptMarkdown(
text,
),
);
```
In theme extension you can use `GptMarkdownThemeData` to customize the GptMarkdown.
```dart
theme:ThemeData(
useMaterial3:true,
brightness:Brightness.light,
colorSchemeSeed:Colors.blue,
extensions:[
GptMarkdownThemeData(
brightness:Brightness.light,
highlightColor:Colors.red,
),
],
),
darkTheme:ThemeData(
useMaterial3:true,
brightness:Brightness.dark,
colorSchemeSeed:Colors.blue,
extensions:[
GptMarkdownThemeData(
brightness:Brightness.dark,
highlightColor:Colors.red,
),
],
),
```
Please see the [README.md](https://github.com/Infinitix-LLC/gpt_markdown) and also [example](https://github.com/Infinitix-LLC/gpt_markdown/tree/main/example/lib/main.dart) app for more details.