@ -1,9 +1,9 @@
import ' dart:io ' ;
import ' dart:io ' ;
import ' package:flutter/foundation.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:flutter/material.dart ' ;
import ' ../models/documents/attribute.dart ' ;
import ' ../models/documents/attribute.dart ' ;
import ' ../utils/media_pick_setting.dart ' ;
import ' controller.dart ' ;
import ' controller.dart ' ;
import ' toolbar/arrow_indicated_button_list.dart ' ;
import ' toolbar/arrow_indicated_button_list.dart ' ;
import ' toolbar/camera_button.dart ' ;
import ' toolbar/camera_button.dart ' ;
@ -19,6 +19,7 @@ import 'toolbar/toggle_check_list_button.dart';
import ' toolbar/toggle_style_button.dart ' ;
import ' toolbar/toggle_style_button.dart ' ;
import ' toolbar/video_button.dart ' ;
import ' toolbar/video_button.dart ' ;
export ' ../utils/media_pick_setting.dart ' ;
export ' toolbar/clear_format_button.dart ' ;
export ' toolbar/clear_format_button.dart ' ;
export ' toolbar/color_button.dart ' ;
export ' toolbar/color_button.dart ' ;
export ' toolbar/history_button.dart ' ;
export ' toolbar/history_button.dart ' ;
@ -31,6 +32,7 @@ export 'toolbar/quill_icon_button.dart';
export ' toolbar/select_header_style_button.dart ' ;
export ' toolbar/select_header_style_button.dart ' ;
export ' toolbar/toggle_check_list_button.dart ' ;
export ' toolbar/toggle_check_list_button.dart ' ;
export ' toolbar/toggle_style_button.dart ' ;
export ' toolbar/toggle_style_button.dart ' ;
export ' toolbar/video_button.dart ' ;
typedef OnImagePickCallback = Future < String ? > Function ( File file ) ;
typedef OnImagePickCallback = Future < String ? > Function ( File file ) ;
typedef OnVideoPickCallback = Future < String ? > Function ( File file ) ;
typedef OnVideoPickCallback = Future < String ? > Function ( File file ) ;
@ -39,6 +41,8 @@ typedef WebImagePickImpl = Future<String?> Function(
OnImagePickCallback onImagePickCallback ) ;
OnImagePickCallback onImagePickCallback ) ;
typedef WebVideoPickImpl = Future < String ? > Function (
typedef WebVideoPickImpl = Future < String ? > Function (
OnVideoPickCallback onImagePickCallback ) ;
OnVideoPickCallback onImagePickCallback ) ;
typedef MediaPickSettingSelector = Future < MediaPickSetting ? > Function (
BuildContext context ) ;
/ / The default size of the icon of a button .
/ / The default size of the icon of a button .
const double kDefaultIconSize = 18 ;
const double kDefaultIconSize = 18 ;
@ -77,9 +81,12 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
bool showHistory = true ,
bool showHistory = true ,
bool showHorizontalRule = false ,
bool showHorizontalRule = false ,
bool multiRowsDisplay = true ,
bool multiRowsDisplay = true ,
bool showCamera = true ,
bool showImageButton = true ,
bool showVideoButton = true ,
bool showCameraButton = true ,
OnImagePickCallback ? onImagePickCallback ,
OnImagePickCallback ? onImagePickCallback ,
OnVideoPickCallback ? onVideoPickCallback ,
OnVideoPickCallback ? onVideoPickCallback ,
MediaPickSettingSelector ? mediaPickSettingSelector ,
FilePickImpl ? filePickImpl ,
FilePickImpl ? filePickImpl ,
WebImagePickImpl ? webImagePickImpl ,
WebImagePickImpl ? webImagePickImpl ,
WebVideoPickImpl ? webVideoPickImpl ,
WebVideoPickImpl ? webVideoPickImpl ,
@ -169,7 +176,7 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
iconSize: toolbarIconSize ,
iconSize: toolbarIconSize ,
controller: controller ,
controller: controller ,
) ,
) ,
if ( onImagePickCallback ! = null )
if ( showImageButton )
ImageButton (
ImageButton (
icon: Icons . image ,
icon: Icons . image ,
iconSize: toolbarIconSize ,
iconSize: toolbarIconSize ,
@ -177,8 +184,9 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
onImagePickCallback: onImagePickCallback ,
onImagePickCallback: onImagePickCallback ,
filePickImpl: filePickImpl ,
filePickImpl: filePickImpl ,
webImagePickImpl: webImagePickImpl ,
webImagePickImpl: webImagePickImpl ,
mediaPickSettingSelector: mediaPickSettingSelector ,
) ,
) ,
if ( onVideoPickCallback ! = null )
if ( showVideoButton )
VideoButton (
VideoButton (
icon: Icons . movie_creation ,
icon: Icons . movie_creation ,
iconSize: toolbarIconSize ,
iconSize: toolbarIconSize ,
@ -186,9 +194,10 @@ class QuillToolbar extends StatelessWidget implements PreferredSizeWidget {
onVideoPickCallback: onVideoPickCallback ,
onVideoPickCallback: onVideoPickCallback ,
filePickImpl: filePickImpl ,
filePickImpl: filePickImpl ,
webVideoPickImpl: webImagePickImpl ,
webVideoPickImpl: webImagePickImpl ,
mediaPickSettingSelector: mediaPickSettingSelector ,
) ,
) ,
if ( ( onImagePickCallback ! = null | | onVideoPickCallback ! = null ) & &
if ( ( onImagePickCallback ! = null | | onVideoPickCallback ! = null ) & &
showCamera )
showCameraButton )
CameraButton (
CameraButton (
icon: Icons . photo_camera ,
icon: Icons . photo_camera ,
iconSize: toolbarIconSize ,
iconSize: toolbarIconSize ,