Update outdated example

pull/1530/head
Ellet 1 year ago
parent e729683abe
commit dfbb696e9b
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 23
      example/lib/pages/home_page.dart

@ -506,7 +506,12 @@ class _HomePageState extends State<HomePage> {
if (newImage == null) {
return;
}
controller.insertImageBlock(imageSource: newImage);
if (!isWeb()) {
controller.insertImageBlock(imageSource: newImage);
return;
}
final newSavedImage = await _onImagePickCallback(File(newImage));
controller.insertImageBlock(imageSource: newSavedImage);
};
}
@ -539,9 +544,7 @@ class _HomePageState extends State<HomePage> {
cameraButtonOptions: const QuillToolbarCameraButtonOptions(),
imageButtonOptions: QuillToolbarImageButtonOptions(
imageButtonConfigurations: QuillToolbarImageConfigurations(
onImageInsertedCallback: (image) async {
_onImagePickCallback(File(image));
},
onImageInsertedCallback: (image) async {},
onImageInsertCallback: onImageInsert,
),
),
@ -563,7 +566,11 @@ class _HomePageState extends State<HomePage> {
imageButtonOptions: QuillToolbarImageButtonOptions(
imageButtonConfigurations: QuillToolbarImageConfigurations(
onImageInsertedCallback: (image) async {
_onImagePickCallback(File(image));
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Image inserted'),
),
);
},
),
),
@ -592,7 +599,11 @@ class _HomePageState extends State<HomePage> {
imageButtonConfigurations: QuillToolbarImageConfigurations(
onImageInsertCallback: onImageInsert,
onImageInsertedCallback: (image) async {
_onImagePickCallback(File(image));
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Image inserted'),
),
);
},
),
// provide a callback to enable picking images from device.

Loading…
Cancel
Save