diff --git a/dev/bots/test.dart b/dev/bots/test.dart index c568e1341e..8d8a04ddf9 100644 --- a/dev/bots/test.dart +++ b/dev/bots/test.dart @@ -538,7 +538,7 @@ Future _runAddToAppLifeCycleTests() async { Future _runFrameworkTests() async { final bq.BigqueryApi bigqueryApi = await _getBigqueryApi(); - final List nullSafetyOptions = ['--enable-experiment=non-nullable']; + final List nullSafetyOptions = ['--enable-experiment=non-nullable', '--null-assertions']; final List trackWidgetCreationAlternatives = ['--track-widget-creation', '--no-track-widget-creation']; Future runWidgets() async { diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index b83f1b1054..1b098ab8ef 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -3624,7 +3624,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox { RenderSemanticsAnnotations({ RenderBox child, bool container = false, - bool explicitChildNodes, + bool explicitChildNodes = false, bool excludeSemantics = false, bool enabled, bool checked, diff --git a/packages/flutter/lib/src/services/raw_keyboard_web.dart b/packages/flutter/lib/src/services/raw_keyboard_web.dart index c933b7bade..77b399efcd 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_web.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_web.dart @@ -36,7 +36,7 @@ class RawKeyEventDataWeb extends RawKeyEventData { /// /// See /// for more information. - final String key; + final String? key; /// The modifiers that were present when the key event occurred. /// @@ -56,7 +56,7 @@ class RawKeyEventDataWeb extends RawKeyEventData { final int metaState; @override - String get keyLabel => key; + String? get keyLabel => key; @override PhysicalKeyboardKey get physicalKey { diff --git a/packages/flutter/test/painting/text_painter_test.dart b/packages/flutter/test/painting/text_painter_test.dart index 3eafef984f..5d106213c0 100644 --- a/packages/flutter/test/painting/text_painter_test.dart +++ b/packages/flutter/test/painting/text_painter_test.dart @@ -149,7 +149,7 @@ void main() { test('TextPainter error test', () { final TextPainter painter = TextPainter(textDirection: TextDirection.ltr); - expect(() { painter.paint(null, Offset.zero); }, throwsFlutterError); + expect(() { painter.paint(null, Offset.zero); }, anyOf(throwsFlutterError, throwsAssertionError)); }); test('TextPainter requires textDirection', () { diff --git a/packages/flutter/test/painting/text_span_test.dart b/packages/flutter/test/painting/text_span_test.dart index 039dcbcbf9..66bd8e092b 100644 --- a/packages/flutter/test/painting/text_span_test.dart +++ b/packages/flutter/test/painting/text_span_test.dart @@ -6,8 +6,7 @@ import 'package:flutter/painting.dart'; import 'package:flutter/widgets.dart'; - -import '../flutter_test_alternative.dart'; +import 'package:flutter_test/flutter_test.dart'; void main() { test('TextSpan equals', () { @@ -44,7 +43,6 @@ void main() { TextSpan(), ], ), - null, TextSpan( text: 'c', ), @@ -59,7 +57,6 @@ void main() { ' "b"\n' ' TextSpan:\n' ' (empty)\n' - ' \n' ' TextSpan:\n' ' "c"\n' )); @@ -245,21 +242,7 @@ void main() { null, ], ); - FlutterError error; - try { - text.computeToPlainText(StringBuffer()); - } on FlutterError catch (e) { - error = e; - } - expect(error, isNotNull); - expect(error.toStringDeep(), - 'FlutterError\n' - ' TextSpan contains a null child.\n' - ' A TextSpan object with a non-null child list should not have any\n' - ' nulls in its child list.\n' - ' The full text in question was:\n' - ' TextSpan("foo bar")\n' - ); + expect(() => text.computeToPlainText(StringBuffer()), anyOf(throwsFlutterError, throwsAssertionError)); }); }