diff --git a/packages/flutter/test/material/inherited_theme_test.dart b/packages/flutter/test/material/inherited_theme_test.dart index 83e7953e3b..bc1a328aec 100644 --- a/packages/flutter/test/material/inherited_theme_test.dart +++ b/packages/flutter/test/material/inherited_theme_test.dart @@ -316,7 +316,7 @@ void main() { BorderSide dividerBorder() { final BoxDecoration decoration = tester.widget( find.descendant(of: find.byType(Divider), matching: find.byType(Container)).first, - ).decoration as BoxDecoration; + ).decoration! as BoxDecoration; return decoration.border!.bottom; } diff --git a/packages/flutter/test/material/ink_paint_test.dart b/packages/flutter/test/material/ink_paint_test.dart index 01689c16fb..b653429461 100644 --- a/packages/flutter/test/material/ink_paint_test.dart +++ b/packages/flutter/test/material/ink_paint_test.dart @@ -66,7 +66,7 @@ void main() { await tester.pump(); // start gesture await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way - final RenderBox box = Material.of(tester.element(find.byType(InkWell))) as RenderBox; + final RenderBox box = Material.of(tester.element(find.byType(InkWell)))! as RenderBox; expect( box, paints @@ -118,7 +118,7 @@ void main() { await tester.tapAt(tapDownOffset); await tester.pump(); // start gesture - final RenderBox box = Material.of(tester.element(find.byType(InkWell))) as RenderBox; + final RenderBox box = Material.of(tester.element(find.byType(InkWell)))! as RenderBox; bool offsetsAreClose(Offset a, Offset b) => (a - b).distance < 1.0; bool radiiAreClose(double a, double b) => (a - b).abs() < 1.0; @@ -194,7 +194,7 @@ void main() { await tester.pump(); // start gesture await tester.pump(const Duration(milliseconds: 200)); // wait for splash to be well under way - final RenderBox box = Material.of(tester.element(find.byType(InkWell))) as RenderBox; + final RenderBox box = Material.of(tester.element(find.byType(InkWell)))! as RenderBox; expect( box, paints @@ -326,7 +326,7 @@ void main() { await tester.sendKeyEvent(LogicalKeyboardKey.space); await tester.pump(); - final RenderBox box = Material.of(tester.element(find.byType(InkWell))) as RenderBox; + final RenderBox box = Material.of(tester.element(find.byType(InkWell)))! as RenderBox; // ripplePattern always add a translation of topLeft. expect(box, ripplePattern(30.0, 0)); @@ -422,7 +422,7 @@ void main() { await gesture.moveTo(const Offset(0.0, 0.0)); await gesture.up(); // generates a tap cancel - final RenderBox box = Material.of(tester.element(find.byType(InkWell))) as RenderBox; + final RenderBox box = Material.of(tester.element(find.byType(InkWell)))! as RenderBox; expect(box, paints..everything((Symbol method, List arguments) { if (method != #drawCircle) return true;