文本编辑器

一个类似 Instagram 的文本编辑器 Flutter 小部件,可帮助您更改文本样式。

特点

  • 编辑 TextStyle 对象
    • 字体颜色
    • 字体系列
    • 字体大小
  • 编辑 TextAlign

截图

text-editor-screenshot

安装

text_editor: ^0.1.3 添加到您的 pubspec.yaml 依赖项中。然后导入它

import 'package:texte_editor/text_editor.dart';

如何使用

只需创建一个 TextEditor 小部件,然后传入必需的参数

TextEditor(
  fonts: fonts,
  text: text,
  textStyle: textStyle,
  textAlingment: textAlign,
  onEditCompleted: (style, align, text) {
    setState(() {
      _text = text;
      _textStyle = style;
      _textAlign = align;
    });
  },
)

有关更多信息,请参阅 示例

GitHub

https://github.com/mehdizarepour/text_editor