Update example

pull/13/head
singerdmx 4 years ago
parent c4d6edc60e
commit e34e0c7660
  1. 23
      example/main.dart
  2. 6
      lib/widgets/editor.dart

@ -18,16 +18,19 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
QuillToolbar.basic(
controller: _controller, uploadFileCallback: _uploadImageCallBack),
Expanded(
child: Container(
child: QuillEditor.basic(_controller),
),
)
],
));
children: [
QuillToolbar.basic(
controller: _controller, uploadFileCallback: _uploadImageCallBack),
Expanded(
child: Container(
child: QuillEditor.basic(
controller: _controller,
readOnly: false, // change to true to be view only mode
),
),
)
],
));
}
Future<String> _uploadImageCallBack(File file) async {

@ -137,15 +137,15 @@ class QuillEditor extends StatefulWidget {
assert(readOnly != null),
assert(embedBuilder != null);
factory QuillEditor.basic(QuillController controller) {
factory QuillEditor.basic(
{@required QuillController controller, bool readOnly}) {
return QuillEditor(
controller: controller,
scrollController: ScrollController(),
scrollable: true,
focusNode: FocusNode(),
autoFocus: true,
readOnly: false,
// change to true to be view only mode
readOnly: readOnly,
enableInteractiveSelection: true,
expands: false,
padding: EdgeInsets.zero);

Loading…
Cancel
Save