Rich text editor for Flutter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
661 B

import 'package:flutter/widgets.dart';
import '../../../extensions.dart';
import '../../controller/quill_controller.dart';
import '../../document/nodes/leaf.dart' as leaf;
abstract class EmbedBuilder {
const EmbedBuilder();
String get key;
bool get expanded => true;
WidgetSpan buildWidgetSpan(Widget widget) {
return WidgetSpan(child: widget);
}
String toPlainText(Embed node) => Embed.kObjectReplacementCharacter;
Widget build(
BuildContext context,
QuillController controller,
leaf.Embed node,
bool readOnly,
bool inline,
TextStyle textStyle,
);
}
typedef EmbedsBuilder = EmbedBuilder Function(Embed node);