Fix static analysis issues in example/ (#217)
diff --git a/README.md b/README.md
index 77fbcec..5b70df8 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,8 @@
class Cat {
String sound() => "Meow";
bool eatFood(String food, {bool hungry}) => true;
- int walk(List<String> places);
+ Future<void> chew() async => print("Chewing...");
+ int walk(List<String> places) => 7;
void sleep() {}
void hunt(String place, String prey) {}
int lives = 9;
@@ -287,7 +288,7 @@
void main() {
// Create a new fake Cat at runtime.
- var cat = new FakeCat();
+ var cat = FakeCat();
cat.eatFood("Milk"); // Prints 'Fake eat Milk'.
cat.sleep(); // Throws.
diff --git a/analysis_options.yaml b/analysis_options.yaml
index bbe63be..969b271 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -5,6 +5,7 @@
implicit-dynamic: false
errors:
# These are for 2.5.0-dev.2.0 and after
+ implicit_dynamic_function: ignore
implicit_dynamic_list_literal: ignore
implicit_dynamic_map_literal: ignore
implicit_dynamic_parameter: ignore
diff --git a/example/example.dart b/example/example.dart
index b4439fb..9742c3a 100644
--- a/example/example.dart
+++ b/example/example.dart
@@ -1,3 +1,5 @@
+// ignore_for_file: sdk_version_async_exported_from_core
+// ignore_for_file: unawaited_futures
import 'package:mockito/mockito.dart';
import 'package:test/test.dart';
@@ -5,8 +7,8 @@
class Cat {
String sound() => "Meow";
bool eatFood(String food, {bool hungry}) => true;
- Future<void> chew() {}
- int walk(List<String> places) {}
+ Future<void> chew() async => print("Chewing...");
+ int walk(List<String> places) => 7;
void sleep() {}
void hunt(String place, String prey) {}
int lives = 9;
@@ -181,7 +183,7 @@
test("Fake class", () {
// Create a new fake Cat at runtime.
- var cat = new FakeCat();
+ var cat = FakeCat();
cat.eatFood("Milk"); // Prints 'Fake eat Milk'.
expect(() => cat.sleep(), throwsUnimplementedError);