import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter_quill/flutter_quill.dart' as fq; import 'package:meta/meta.dart' show immutable; import 'embeds/image/editor/image_embed.dart'; import 'embeds/image/editor/image_web_embed.dart'; import 'embeds/image/toolbar/image_button.dart'; import 'embeds/others/camera_button/camera_button.dart'; import 'embeds/video/editor/video_embed.dart'; import 'embeds/video/editor/video_web_embed.dart'; import 'embeds/video/toolbar/video_button.dart'; import 'models/config/camera/camera_configurations.dart'; import 'models/config/image/editor/image_configurations.dart'; import 'models/config/image/toolbar/image_configurations.dart'; import 'models/config/media/media_button_configurations.dart'; import 'models/config/video/editor/video_configurations.dart'; import 'models/config/video/editor/video_web_configurations.dart'; import 'models/config/video/toolbar/video_configurations.dart'; @immutable class FlutterQuillEmbeds { const FlutterQuillEmbeds._(); /// Returns a list of embed builders for [fq.QuillEditor]. /// /// This method provides a collection of embed builders to enhance the /// functionality /// of a [fq.QuillEditor]. It offers customization options for /// handling various types of /// embedded content, such as images, videos, and formulas. /// /// The method returns a list of [fq.EmbedBuilder] objects that can be used with /// QuillEditor /// to enable embedded content features like images, videos, and formulas. /// /// /// final quillEditor = QuillEditor( /// // Other editor configurations /// embedBuilders: embedBuilders, /// ); /// ``` /// static List editorBuilders({ QuillEditorImageEmbedConfigurations? imageEmbedConfigurations = const QuillEditorImageEmbedConfigurations(), QuillEditorVideoEmbedConfigurations? videoEmbedConfigurations = const QuillEditorVideoEmbedConfigurations(), }) { if (kIsWeb) { throw UnsupportedError( 'The editorBuilders() is not for web, please use editorBuilders() ' 'instead', ); } return [ if (imageEmbedConfigurations != null) QuillEditorImageEmbedBuilder( configurations: imageEmbedConfigurations, ), if (videoEmbedConfigurations != null) QuillEditorVideoEmbedBuilder( configurations: videoEmbedConfigurations, ), ]; } /// Returns a list of embed builders specifically designed for web support. /// /// [QuillEditorWebImageEmbedBuilder] is the embed builder for handling /// images on the web. this will use tag of HTML /// /// [QuillEditorWebVideoEmbedBuilder] is the embed builder for handling /// videos iframe on the web. this will use