diff --git a/dev/integration_tests/web_e2e_tests/lib/text_editing_main.dart b/dev/integration_tests/web_e2e_tests/lib/text_editing_main.dart index a19902fb93b..45a6f972d73 100644 --- a/dev/integration_tests/web_e2e_tests/lib/text_editing_main.dart +++ b/dev/integration_tests/web_e2e_tests/lib/text_editing_main.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { - const MyApp({Key key}) : super(key: key); + const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -20,9 +20,9 @@ class MyApp extends StatelessWidget { } class MyHomePage extends StatefulWidget { - const MyHomePage({Key key, this.title}) : super(key: key); + const MyHomePage({Key? key, this.title}) : super(key: key); - final String title; + final String? title; @override _MyHomePageState createState() => _MyHomePageState(); @@ -44,7 +44,7 @@ class _MyHomePageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text(widget.title), + title: Text(widget.title ?? ''), ), body: Center( child: Column( diff --git a/dev/integration_tests/web_e2e_tests/pubspec.yaml b/dev/integration_tests/web_e2e_tests/pubspec.yaml index 445e2f545c9..13a2417d9b6 100644 --- a/dev/integration_tests/web_e2e_tests/pubspec.yaml +++ b/dev/integration_tests/web_e2e_tests/pubspec.yaml @@ -2,7 +2,7 @@ name: web_e2e_tests publish_to: none environment: - sdk: ">=2.2.2 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: diff --git a/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart b/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart index 8afd7524dee..ef84b1b3a38 100644 --- a/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart +++ b/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'dart:html'; import 'dart:js_util' as js_util; @@ -39,7 +38,7 @@ void main() { // Change the value of the TextFormField. final TextFormField textFormField = tester.widget(finder); - textFormField.controller.text = 'New Value'; + textFormField.controller?.text = 'New Value'; // DOM element's value also changes. expect(input.value, 'New Value'); }); @@ -67,7 +66,7 @@ void main() { // Change the value of the TextFormField. final TextFormField textFormField = tester.widget(finder); - textFormField.controller.text = 'New Value'; + textFormField.controller?.text = 'New Value'; // DOM element's value also changes. expect(input.value, 'New Value'); }); @@ -225,8 +224,8 @@ void main() { expect(input.hasAttribute('readonly'), isTrue); // Make sure the entire text is selected. - TextRange range = - TextRange(start: input.selectionStart, end: input.selectionEnd); + TextRange? range = + TextRange(start: input.selectionStart!, end: input.selectionEnd!); expect(range.textInside(text), text); // Double tap to select the first word. @@ -239,7 +238,7 @@ void main() { await gesture.up(); await gesture.down(firstWordOffset); await gesture.up(); - range = TextRange(start: input.selectionStart, end: input.selectionEnd); + range = TextRange(start: input.selectionStart!, end: input.selectionEnd!); expect(range.textInside(text), 'Lorem'); // Double tap to select the last word. @@ -252,14 +251,14 @@ void main() { await gesture.up(); await gesture.down(lastWordOffset); await gesture.up(); - range = TextRange(start: input.selectionStart, end: input.selectionEnd); + range = TextRange(start: input.selectionStart!, end: input.selectionEnd!); expect(range.textInside(text), 'amet'); }); } KeyboardEvent dispatchKeyboardEvent( EventTarget target, String type, Map args) { - final dynamic jsKeyboardEvent = js_util.getProperty(window, 'KeyboardEvent'); + final Object jsKeyboardEvent = js_util.getProperty(window, 'KeyboardEvent') as Object; final List eventArgs = [ type, args, diff --git a/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration_test.dart b/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration_test.dart index 94f99381578..b2d2a1770b2 100644 --- a/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration_test.dart +++ b/dev/integration_tests/web_e2e_tests/test_driver/text_editing_integration_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// @dart = 2.9 import 'package:integration_test/integration_test_driver.dart' as test; Future main() async => test.integrationDriver();