Fix warnings in example

pull/132/head
Xin Yao 4 years ago
parent 2e87ac922a
commit 7791364c5a
  1. 8
      example/lib/widgets/demo_scaffold.dart

@ -19,12 +19,12 @@ class DemoScaffold extends StatefulWidget {
final bool showToolbar; final bool showToolbar;
const DemoScaffold({ const DemoScaffold({
Key? key,
required this.documentFilename, required this.documentFilename,
required this.builder, required this.builder,
this.actions, this.actions,
this.showToolbar = true, this.showToolbar = true,
this.floatingActionButton, this.floatingActionButton,
Key? key,
}) : super(key: key); }) : super(key: key);
@override @override
@ -59,14 +59,14 @@ class _DemoScaffoldState extends State<DemoScaffold> {
final doc = Document.fromJson(jsonDecode(result)); final doc = Document.fromJson(jsonDecode(result));
setState(() { setState(() {
_controller = QuillController( _controller = QuillController(
document: doc, selection: TextSelection.collapsed(offset: 0)); document: doc, selection: const TextSelection.collapsed(offset: 0));
_loading = false; _loading = false;
}); });
} catch (error) { } catch (error) {
final doc = Document()..insert(0, 'Empty asset'); final doc = Document()..insert(0, 'Empty asset');
setState(() { setState(() {
_controller = QuillController( _controller = QuillController(
document: doc, selection: TextSelection.collapsed(offset: 0)); document: doc, selection: const TextSelection.collapsed(offset: 0));
_loading = false; _loading = false;
}); });
} }
@ -97,7 +97,7 @@ class _DemoScaffoldState extends State<DemoScaffold> {
), ),
floatingActionButton: widget.floatingActionButton, floatingActionButton: widget.floatingActionButton,
body: _loading body: _loading
? Center(child: Text('Loading...')) ? const Center(child: Text('Loading...'))
: widget.builder(context, _controller), : widget.builder(context, _controller),
); );
} }

Loading…
Cancel
Save