Reland "Migrate android_semantics_testing to null safety (#111420)" (#111487)

This commit is contained in:
chunhtai
2022-09-13 09:59:29 -07:00
committed by GitHub
parent 26a76fe3a0
commit ca75e66b75
10 changed files with 115 additions and 96 deletions

View File

@@ -9,7 +9,7 @@ export 'controls_constants.dart';
/// A test page with a checkbox, three radio buttons, and a switch.
class SelectionControlsPage extends StatefulWidget {
const SelectionControlsPage({Key key}) : super(key: key);
const SelectionControlsPage({super.key});
@override
State<StatefulWidget> createState() => _SelectionControlsPageState();
@@ -28,15 +28,15 @@ class _SelectionControlsPageState extends State<SelectionControlsPage> {
bool _isLabeledOn = false;
int _radio = 0;
void _updateCheckbox(bool newValue) {
void _updateCheckbox(bool? newValue) {
setState(() {
_isChecked = newValue;
_isChecked = newValue!;
});
}
void _updateRadio(int newValue) {
void _updateRadio(int? newValue) {
setState(() {
_radio = newValue;
_radio = newValue!;
});
}

View File

@@ -9,7 +9,7 @@ export 'headings_constants.dart';
/// A test page with an app bar and some body text for testing heading flags.
class HeadingsPage extends StatelessWidget {
const HeadingsPage({Key key}) : super(key: key);
const HeadingsPage({super.key});
static const ValueKey<String> _appBarTitleKey = ValueKey<String>(appBarTitleKeyValue);
static const ValueKey<String> _bodyTextKey = ValueKey<String>(bodyTextKeyValue);

View File

@@ -10,7 +10,7 @@ export 'popup_constants.dart';
/// A page with a popup menu, a dropdown menu, and a modal alert.
class PopupControlsPage extends StatefulWidget {
const PopupControlsPage({Key key}) : super(key: key);
const PopupControlsPage({super.key});
@override
State<StatefulWidget> createState() => _PopupControlsPageState();
@@ -60,9 +60,9 @@ class _PopupControlsPageState extends State<PopupControlsPage> {
child: Text(item),
);
}).toList(),
onChanged: (String value) {
onChanged: (String? value) {
setState(() {
dropdownValue = value;
dropdownValue = value!;
});
},
),

View File

@@ -10,7 +10,7 @@ export 'text_field_constants.dart';
/// A page with a normal text field and a password field.
class TextFieldPage extends StatefulWidget {
const TextFieldPage({Key key}) : super(key: key);
const TextFieldPage({super.key});
@override
State<StatefulWidget> createState() => _TextFieldPageState();