Insert attribute

pull/1326/head
toanlm 2 years ago
parent 2770367114
commit 923bd1bf3e
  1. 4
      flutter_quill_extensions/lib/embeds/builders.dart
  2. 12
      lib/src/models/documents/attribute.dart

@ -28,6 +28,7 @@ class ImageEmbedBuilder extends EmbedBuilder {
base.Embed node, base.Embed node,
bool readOnly, bool readOnly,
bool inline, bool inline,
TextStyle textStyle,
) { ) {
assert(!kIsWeb, 'Please provide image EmbedBuilder for Web'); assert(!kIsWeb, 'Please provide image EmbedBuilder for Web');
@ -164,6 +165,7 @@ class ImageEmbedBuilderWeb extends EmbedBuilder {
Embed node, Embed node,
bool readOnly, bool readOnly,
bool inline, bool inline,
TextStyle textStyle,
) { ) {
final imageUrl = node.value.data; final imageUrl = node.value.data;
@ -198,6 +200,7 @@ class VideoEmbedBuilder extends EmbedBuilder {
base.Embed node, base.Embed node,
bool readOnly, bool readOnly,
bool inline, bool inline,
TextStyle textStyle,
) { ) {
assert(!kIsWeb, 'Please provide video EmbedBuilder for Web'); assert(!kIsWeb, 'Please provide video EmbedBuilder for Web');
@ -226,6 +229,7 @@ class FormulaEmbedBuilder extends EmbedBuilder {
base.Embed node, base.Embed node,
bool readOnly, bool readOnly,
bool inline, bool inline,
TextStyle textStyle,
) { ) {
assert(!kIsWeb, 'Please provide formula EmbedBuilder for Web'); assert(!kIsWeb, 'Please provide formula EmbedBuilder for Web');

@ -382,10 +382,20 @@ enum ScriptAttributes {
class ImageAttribute extends Attribute<String?> { class ImageAttribute extends Attribute<String?> {
const ImageAttribute(String? url) const ImageAttribute(String? url)
: super('image', AttributeScope.EMBEDS, url); : super('img', AttributeScope.EMBEDS, url);
} }
class VideoAttribute extends Attribute<String?> { class VideoAttribute extends Attribute<String?> {
const VideoAttribute(String? url) const VideoAttribute(String? url)
: super('video', AttributeScope.EMBEDS, url); : super('video', AttributeScope.EMBEDS, url);
} }
class FileAttribute extends Attribute<String?> {
const FileAttribute(String? url)
: super('file', AttributeScope.EMBEDS, url);
}
class MentionAttribute extends Attribute<String?> {
const MentionAttribute(String? url)
: super('mention', AttributeScope.EMBEDS, url);
}

Loading…
Cancel
Save