Avoid void async

When declaring an async method or function which does not return
a value, declare that it returns Future and not just void.
pull/145/head
Till Friebe 4 years ago
parent 6c31fb1bc3
commit 0a136edb86
  1. 3
      analysis_options.yaml
  2. 2
      lib/widgets/editor.dart
  3. 4
      lib/widgets/raw_editor.dart

@ -13,6 +13,8 @@ linter:
- avoid_escaping_inner_quotes - avoid_escaping_inner_quotes
- avoid_print - avoid_print
- avoid_redundant_argument_values - avoid_redundant_argument_values
- avoid_types_on_closure_parameters
- avoid_void_async
- directives_ordering - directives_ordering
- omit_local_variable_types - omit_local_variable_types
- prefer_const_constructors - prefer_const_constructors
@ -24,4 +26,3 @@ linter:
- prefer_relative_imports - prefer_relative_imports
- prefer_single_quotes - prefer_single_quotes
- unnecessary_parenthesis - unnecessary_parenthesis
- avoid_types_on_closure_parameters

@ -427,7 +427,7 @@ class _QuillEditorSelectionGestureDetectorBuilder
return true; return true;
} }
void _launchUrl(String url) async { Future<void> _launchUrl(String url) async {
await launch(url); await launch(url);
} }

@ -806,7 +806,7 @@ class RawEditorState extends EditorState
); );
} }
void handleShortcut(InputShortcut? shortcut) async { Future<void> handleShortcut(InputShortcut? shortcut) async {
final selection = widget.controller.selection; final selection = widget.controller.selection;
final plainText = textEditingValue.text; final plainText = textEditingValue.text;
if (shortcut == InputShortcut.COPY) { if (shortcut == InputShortcut.COPY) {
@ -1058,7 +1058,7 @@ class RawEditorState extends EditorState
} }
} }
void __setEditingValue(TextEditingValue value) async { Future<void> __setEditingValue(TextEditingValue value) async {
if (await __isItCut(value)) { if (await __isItCut(value)) {
widget.controller.replaceText( widget.controller.replaceText(
textEditingValue.selection.start, textEditingValue.selection.start,

Loading…
Cancel
Save