From 49c784590787e4beb0dd11d47bec267a733e9291 Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Sat, 21 Dec 2019 20:53:14 +0100 Subject: [PATCH] fix analysis (#47594) --- examples/flutter_gallery/lib/gallery/scales.dart | 5 +++-- examples/flutter_gallery/test/drawer_test.dart | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/flutter_gallery/lib/gallery/scales.dart b/examples/flutter_gallery/lib/gallery/scales.dart index 55ad8863e3..b25b2c313f 100644 --- a/examples/flutter_gallery/lib/gallery/scales.dart +++ b/examples/flutter_gallery/lib/gallery/scales.dart @@ -47,8 +47,9 @@ class GalleryVisualDensityValue { bool operator ==(dynamic other) { if (runtimeType != other.runtimeType) return false; - final GalleryVisualDensityValue typedOther = other; - return visualDensity == typedOther.visualDensity && label == typedOther.label; + return other is GalleryVisualDensityValue + && visualDensity == other.visualDensity + && label == other.label; } @override diff --git a/examples/flutter_gallery/test/drawer_test.dart b/examples/flutter_gallery/test/drawer_test.dart index 585f10ebd7..d45c97501c 100644 --- a/examples/flutter_gallery/test/drawer_test.dart +++ b/examples/flutter_gallery/test/drawer_test.dart @@ -70,7 +70,7 @@ void main() { await tester.pumpAndSettle(); await tester.tap(find.text('Compact')); await tester.pumpAndSettle(); - app = find.byType(MaterialApp).evaluate().first.widget; + app = find.byType(MaterialApp).evaluate().first.widget as MaterialApp; expect(app.theme.visualDensity, equals(VisualDensity.compact)); await tester.tap(find.byIcon(Icons.arrow_drop_down).at(2)); @@ -80,7 +80,7 @@ void main() { matching: find.text('System Default') )); await tester.pumpAndSettle(); - app = find.byType(MaterialApp).evaluate().first.widget; + app = find.byType(MaterialApp).evaluate().first.widget as MaterialApp; expect(app.theme.visualDensity, equals(const VisualDensity())); // Verify platform settings