https://github.com/bytedance/realrichtext
A Tricky Solution for Implementing Inline-Image-In-Text Feature in Flutter.
Science Score: 10.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
1 of 5 committers (20.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.6%) to scientific vocabulary
Keywords
Repository
A Tricky Solution for Implementing Inline-Image-In-Text Feature in Flutter.
Basic Info
Statistics
- Stars: 657
- Watchers: 16
- Forks: 85
- Open Issues: 16
- Releases: 0
Topics
Metadata Files
README.md
RealRichText
A Tricky Solution for Implementing Inline-Image-In-Text Feature in Flutter.

Getting Started
According to the related Flutter Issues(#2022) , Inline-Image-In-Text is a long-time(2 years) missing feature since RichText(or the underlying Paragraph) does only support pure text. But we can solve this problem in a simple/tricky way:
- Regard the images as a particular blank TextSpan, convert image's width and height to textspan's letterSpacing and fontSize. the origin paragraph will do the layout operation and leave the desired image space for us.
- Override the paint function,calculate the right offset via the getOffsetForCaret() api to draw the image over the space.
For more details, please refer to the source code.
Usage
The only thing you have to do is converting your origin text to a TextSpan/ImageSpan List first.
```Dart import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:realrichtext/realrichtext.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget { @override _MyAppState createState() => _MyAppState(); }
class MyAppState extends State
Note
ImageSpan must set the width & height properties.
if your image's width or height is not specific, you can wrap two RealRichText in a StatefulWidget, one for showing placeholder image and the other for showing the actual image when it is ready.
Owner
- Name: Bytedance Inc.
- Login: bytedance
- Kind: organization
- Location: Singapore
- Website: https://opensource.bytedance.com
- Twitter: ByteDanceOSS
- Repositories: 255
- Profile: https://github.com/bytedance
GitHub Events
Total
- Watch event: 2
- Fork event: 1
Last Year
- Watch event: 2
- Fork event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| limengyun2008 | l****8@g****m | 12 |
| Li Mengyun | l****n@b****m | 7 |
| David Zhang | d****g@s****u | 1 |
| DavidYang | d****1@f****m | 1 |
| zdwchang | z****g@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 26
- Total pull requests: 5
- Average time to close issues: 7 days
- Average time to close pull requests: 20 days
- Total issue authors: 18
- Total pull request authors: 4
- Average comments per issue: 1.15
- Average comments per pull request: 1.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- 2dxgujun (4)
- zucchiniEvader (2)
- charlesYun (2)
- badboy-tian (2)
- liubobo (1)
- BeanWei (1)
- JohnsonChung (1)
- ibrokemypie (1)
- lsp9876 (1)
- Windymonkeys (1)
- hyz1992 (1)
- LoveTheSkyBlue (1)
- ENUUI (1)
- Mericusta (1)
- Thomsen (1)
Pull Request Authors
- 2dxgujun (2)
- DavidYang1121 (1)
- LinXiaoTao (1)
- OnTheThirdDay (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- Flutter >= 0
- junit:junit 4.12 testImplementation
- flutter_test --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess sdk: flutter development
- real_rich_text --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess path: "../" development
- cupertino_icons ^0.1.2
- flutter --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess sdk: flutter
- flutter --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess sdk: flutter