Prefer void to null (#22977)

* Future<void> main

* Future<void>.delayed

* prefer_void_to_Null

* address review comments
This commit is contained in:
Alexandre Ardhuin
2018-10-16 22:03:06 +02:00
committed by GitHub
parent 5efe095895
commit 0fb84e96c7
139 changed files with 373 additions and 385 deletions

View File

@@ -138,7 +138,7 @@ class FullScreenCodeDialogState extends State<FullScreenCodeDialog> {
@override
void didChangeDependencies() {
getExampleCode(widget.exampleCodeTag, DefaultAssetBundle.of(context)).then<Null>((String code) {
getExampleCode(widget.exampleCodeTag, DefaultAssetBundle.of(context)).then<void>((String code) {
if (mounted) {
setState(() {
_exampleCode = code ?? 'Example code not found';

View File

@@ -17,7 +17,7 @@ Future<String> getExampleCode(String tag, AssetBundle bundle) async {
return _exampleCode[tag];
}
Future<Null> _parseExampleCode(AssetBundle bundle) async {
Future<void> _parseExampleCode(AssetBundle bundle) async {
final String code = await bundle.loadString('lib/gallery/example_code.dart') ??
'// lib/gallery/example_code.dart not found\n';
_exampleCode = <String, String>{};