diff --git a/app/lib/pages/home_page.dart b/app/lib/pages/home_page.dart index 35e05acc..a1b2137a 100644 --- a/app/lib/pages/home_page.dart +++ b/app/lib/pages/home_page.dart @@ -1,4 +1,6 @@ +import 'dart:async'; import 'dart:convert'; +import 'dart:io'; import 'package:app/pages/read_only_page.dart'; import 'package:flutter/material.dart'; @@ -67,7 +69,9 @@ class _HomePageState extends State { Widget _buildWelcomeEditor(BuildContext context) { return Column( children: [ - QuillToolbar.basic(controller: _controller), + QuillToolbar.basic( + controller: _controller, + uploadFileCallback: _fakeUploadImageCallBack), Divider(height: 1, thickness: 1, color: Colors.grey.shade200), Expanded( child: Container( @@ -90,6 +94,14 @@ class _HomePageState extends State { ); } + Future _fakeUploadImageCallBack(File file) async { + print(file); + var completer = new Completer(); + completer.complete( + 'https://user-images.githubusercontent.com/122956/72955931-ccc07900-3d52-11ea-89b1-d468a6e2aa2b.png'); + return completer.future; + } + Widget _buildMenuBar(BuildContext context) { final itemStyle = TextStyle(color: Colors.white); return ListView( diff --git a/lib/widgets/toolbar.dart b/lib/widgets/toolbar.dart index 6fd35e86..8abc2c37 100644 --- a/lib/widgets/toolbar.dart +++ b/lib/widgets/toolbar.dart @@ -635,6 +635,7 @@ class QuillToolbar extends StatefulWidget implements PreferredSizeWidget { icon: Icons.image, controller: controller, imageSource: ImageSource.gallery, + uploadFileCallback: uploadFileCallback, ), ), SizedBox(width: 1), @@ -644,6 +645,7 @@ class QuillToolbar extends StatefulWidget implements PreferredSizeWidget { icon: Icons.photo_camera, controller: controller, imageSource: ImageSource.camera, + uploadFileCallback: uploadFileCallback, ), ), Visibility(