Migrated some cupertino doc comments to null safety. (#72766)

This commit is contained in:
Darren Austin 2020-12-22 10:24:08 -08:00 committed by GitHub
parent 620a8284f8
commit d622e5de4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 27 deletions

View File

@ -13,9 +13,6 @@ import 'localizations.dart';
import 'route.dart';
import 'theme.dart';
// Examples can assume:
// // @dart = 2.9
/// An application that uses Cupertino design.
///
/// A convenience widget that wraps a number of widgets that are commonly
@ -277,7 +274,7 @@ class CupertinoApp extends StatefulWidget {
/// LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
/// },
/// color: const Color(0xFFFF0000),
/// builder: (BuildContext context, Widget child) {
/// builder: (BuildContext context, Widget? child) {
/// return const Placeholder();
/// },
/// );
@ -310,7 +307,7 @@ class CupertinoApp extends StatefulWidget {
/// ),
/// },
/// color: const Color(0xFFFF0000),
/// builder: (BuildContext context, Widget child) {
/// builder: (BuildContext context, Widget? child) {
/// return const Placeholder();
/// },
/// );

View File

@ -75,7 +75,7 @@ enum _ContextMenuLocation {
/// child's corners and allowing its aspect ratio to expand, similar to the
/// Photos app on iOS.
///
/// {@tool dartpad --template=stateless_widget_material_no_null_safety}
/// {@tool dartpad --template=stateless_widget_material}
///
/// This sample shows a very simple CupertinoContextMenu for an empty red
/// 100x100 Container. Simply long press on it to open.

View File

@ -12,9 +12,6 @@ import 'icons.dart';
import 'localizations.dart';
import 'text_field.dart';
// Examples can assume:
// // @dart = 2.9
/// A [CupertinoTextField] that mimics the look and behavior of UIKit's
/// `UISearchTextField`.
///
@ -35,7 +32,7 @@ import 'text_field.dart';
/// }
///
/// class _MyPrefilledSearchState extends State<MyPrefilledSearch> {
/// TextEditingController _textController;
/// late TextEditingController _textController;
///
/// @override
/// void initState() {

View File

@ -14,7 +14,6 @@ import 'theme.dart';
import 'thumb_painter.dart';
// Examples can assume:
// // @dart = 2.9
// int _cupertinoSliderValue = 1;
// void setState(VoidCallback fn) { }

View File

@ -12,9 +12,6 @@ import 'package:flutter/widgets.dart';
import 'colors.dart';
// Examples can assume:
// // @dart = 2.9
// Extracted from https://developer.apple.com/design/resources/.
// Minimum padding from edges of the segmented control to edges of
@ -197,14 +194,14 @@ class CupertinoSlidingSegmentedControl<T> extends StatefulWidget {
/// 1: Text('Child 2'),
/// };
///
/// int currentValue;
/// int? currentValue;
///
/// @override
/// Widget build(BuildContext context) {
/// return Container(
/// child: CupertinoSlidingSegmentedControl<int>(
/// children: children,
/// onValueChanged: (int newValue) {
/// onValueChanged: (int? newValue) {
/// setState(() {
/// currentValue = newValue;
/// });

View File

@ -14,8 +14,7 @@ import 'colors.dart';
import 'thumb_painter.dart';
// Examples can assume:
// // @dart = 2.9
// bool _lights;
// bool _lights = false;
// void setState(VoidCallback fn) { }
/// An iOS-style switch.

View File

@ -11,9 +11,6 @@ import 'form_row.dart';
import 'text_field.dart';
import 'theme.dart';
// Examples can assume:
// // @dart = 2.9
/// Creates a [CupertinoFormRow] containing a [FormField] that wraps
/// a [CupertinoTextField].
///
@ -64,18 +61,18 @@ import 'theme.dart';
/// ```dart
/// CupertinoTextFormFieldRow(
/// prefix: Text('Username'),
/// onSaved: (String value) {
/// onSaved: (String? value) {
/// // This optional block of code can be used to run
/// // code when the user saves the form.
/// },
/// validator: (String value) {
/// return value.contains('@') ? 'Do not use the @ char.' : null;
/// validator: (String? value) {
/// return (value != null && value.contains('@')) ? 'Do not use the @ char.' : null;
/// },
/// )
/// ```
/// {@end-tool}
///
/// {@tool dartpad --template=stateful_widget_material_no_null_safety}
/// {@tool dartpad --template=stateful_widget_material}
/// This example shows how to move the focus to the next field when the user
/// presses the SPACE key.
///
@ -90,7 +87,7 @@ import 'theme.dart';
/// child: Form(
/// autovalidateMode: AutovalidateMode.always,
/// onChanged: () {
/// Form.of(primaryFocus.context).save();
/// Form.of(primaryFocus!.context!)?.save();
/// },
/// child: CupertinoFormSection.insetGrouped(
/// header: Text('SECTION 1'),
@ -99,7 +96,7 @@ import 'theme.dart';
/// prefix: Text('Enter text'),
/// placeholder: 'Enter text',
/// validator: (value) {
/// if (value.isEmpty) {
/// if (value == null || value.isEmpty) {
/// return 'Please enter a value';
/// }
/// return null;