Unverified Commit d622e5de authored by Darren Austin's avatar Darren Austin Committed by GitHub

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

parent 620a8284
...@@ -13,9 +13,6 @@ import 'localizations.dart'; ...@@ -13,9 +13,6 @@ import 'localizations.dart';
import 'route.dart'; import 'route.dart';
import 'theme.dart'; import 'theme.dart';
// Examples can assume:
// // @dart = 2.9
/// An application that uses Cupertino design. /// An application that uses Cupertino design.
/// ///
/// A convenience widget that wraps a number of widgets that are commonly /// A convenience widget that wraps a number of widgets that are commonly
...@@ -277,7 +274,7 @@ class CupertinoApp extends StatefulWidget { ...@@ -277,7 +274,7 @@ class CupertinoApp extends StatefulWidget {
/// LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(), /// LogicalKeySet(LogicalKeyboardKey.select): const ActivateIntent(),
/// }, /// },
/// color: const Color(0xFFFF0000), /// color: const Color(0xFFFF0000),
/// builder: (BuildContext context, Widget child) { /// builder: (BuildContext context, Widget? child) {
/// return const Placeholder(); /// return const Placeholder();
/// }, /// },
/// ); /// );
...@@ -310,7 +307,7 @@ class CupertinoApp extends StatefulWidget { ...@@ -310,7 +307,7 @@ class CupertinoApp extends StatefulWidget {
/// ), /// ),
/// }, /// },
/// color: const Color(0xFFFF0000), /// color: const Color(0xFFFF0000),
/// builder: (BuildContext context, Widget child) { /// builder: (BuildContext context, Widget? child) {
/// return const Placeholder(); /// return const Placeholder();
/// }, /// },
/// ); /// );
......
...@@ -75,7 +75,7 @@ enum _ContextMenuLocation { ...@@ -75,7 +75,7 @@ enum _ContextMenuLocation {
/// child's corners and allowing its aspect ratio to expand, similar to the /// child's corners and allowing its aspect ratio to expand, similar to the
/// Photos app on iOS. /// 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 /// This sample shows a very simple CupertinoContextMenu for an empty red
/// 100x100 Container. Simply long press on it to open. /// 100x100 Container. Simply long press on it to open.
......
...@@ -12,9 +12,6 @@ import 'icons.dart'; ...@@ -12,9 +12,6 @@ import 'icons.dart';
import 'localizations.dart'; import 'localizations.dart';
import 'text_field.dart'; import 'text_field.dart';
// Examples can assume:
// // @dart = 2.9
/// A [CupertinoTextField] that mimics the look and behavior of UIKit's /// A [CupertinoTextField] that mimics the look and behavior of UIKit's
/// `UISearchTextField`. /// `UISearchTextField`.
/// ///
...@@ -35,7 +32,7 @@ import 'text_field.dart'; ...@@ -35,7 +32,7 @@ import 'text_field.dart';
/// } /// }
/// ///
/// class _MyPrefilledSearchState extends State<MyPrefilledSearch> { /// class _MyPrefilledSearchState extends State<MyPrefilledSearch> {
/// TextEditingController _textController; /// late TextEditingController _textController;
/// ///
/// @override /// @override
/// void initState() { /// void initState() {
......
...@@ -14,7 +14,6 @@ import 'theme.dart'; ...@@ -14,7 +14,6 @@ import 'theme.dart';
import 'thumb_painter.dart'; import 'thumb_painter.dart';
// Examples can assume: // Examples can assume:
// // @dart = 2.9
// int _cupertinoSliderValue = 1; // int _cupertinoSliderValue = 1;
// void setState(VoidCallback fn) { } // void setState(VoidCallback fn) { }
......
...@@ -12,9 +12,6 @@ import 'package:flutter/widgets.dart'; ...@@ -12,9 +12,6 @@ import 'package:flutter/widgets.dart';
import 'colors.dart'; import 'colors.dart';
// Examples can assume:
// // @dart = 2.9
// Extracted from https://developer.apple.com/design/resources/. // Extracted from https://developer.apple.com/design/resources/.
// Minimum padding from edges of the segmented control to edges of // Minimum padding from edges of the segmented control to edges of
...@@ -197,14 +194,14 @@ class CupertinoSlidingSegmentedControl<T> extends StatefulWidget { ...@@ -197,14 +194,14 @@ class CupertinoSlidingSegmentedControl<T> extends StatefulWidget {
/// 1: Text('Child 2'), /// 1: Text('Child 2'),
/// }; /// };
/// ///
/// int currentValue; /// int? currentValue;
/// ///
/// @override /// @override
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return Container( /// return Container(
/// child: CupertinoSlidingSegmentedControl<int>( /// child: CupertinoSlidingSegmentedControl<int>(
/// children: children, /// children: children,
/// onValueChanged: (int newValue) { /// onValueChanged: (int? newValue) {
/// setState(() { /// setState(() {
/// currentValue = newValue; /// currentValue = newValue;
/// }); /// });
......
...@@ -14,8 +14,7 @@ import 'colors.dart'; ...@@ -14,8 +14,7 @@ import 'colors.dart';
import 'thumb_painter.dart'; import 'thumb_painter.dart';
// Examples can assume: // Examples can assume:
// // @dart = 2.9 // bool _lights = false;
// bool _lights;
// void setState(VoidCallback fn) { } // void setState(VoidCallback fn) { }
/// An iOS-style switch. /// An iOS-style switch.
......
...@@ -11,9 +11,6 @@ import 'form_row.dart'; ...@@ -11,9 +11,6 @@ import 'form_row.dart';
import 'text_field.dart'; import 'text_field.dart';
import 'theme.dart'; import 'theme.dart';
// Examples can assume:
// // @dart = 2.9
/// Creates a [CupertinoFormRow] containing a [FormField] that wraps /// Creates a [CupertinoFormRow] containing a [FormField] that wraps
/// a [CupertinoTextField]. /// a [CupertinoTextField].
/// ///
...@@ -64,18 +61,18 @@ import 'theme.dart'; ...@@ -64,18 +61,18 @@ import 'theme.dart';
/// ```dart /// ```dart
/// CupertinoTextFormFieldRow( /// CupertinoTextFormFieldRow(
/// prefix: Text('Username'), /// prefix: Text('Username'),
/// onSaved: (String value) { /// onSaved: (String? value) {
/// // This optional block of code can be used to run /// // This optional block of code can be used to run
/// // code when the user saves the form. /// // code when the user saves the form.
/// }, /// },
/// validator: (String value) { /// validator: (String? value) {
/// return value.contains('@') ? 'Do not use the @ char.' : null; /// return (value != null && value.contains('@')) ? 'Do not use the @ char.' : null;
/// }, /// },
/// ) /// )
/// ``` /// ```
/// {@end-tool} /// {@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 /// This example shows how to move the focus to the next field when the user
/// presses the SPACE key. /// presses the SPACE key.
/// ///
...@@ -90,7 +87,7 @@ import 'theme.dart'; ...@@ -90,7 +87,7 @@ import 'theme.dart';
/// child: Form( /// child: Form(
/// autovalidateMode: AutovalidateMode.always, /// autovalidateMode: AutovalidateMode.always,
/// onChanged: () { /// onChanged: () {
/// Form.of(primaryFocus.context).save(); /// Form.of(primaryFocus!.context!)?.save();
/// }, /// },
/// child: CupertinoFormSection.insetGrouped( /// child: CupertinoFormSection.insetGrouped(
/// header: Text('SECTION 1'), /// header: Text('SECTION 1'),
...@@ -99,7 +96,7 @@ import 'theme.dart'; ...@@ -99,7 +96,7 @@ import 'theme.dart';
/// prefix: Text('Enter text'), /// prefix: Text('Enter text'),
/// placeholder: 'Enter text', /// placeholder: 'Enter text',
/// validator: (value) { /// validator: (value) {
/// if (value.isEmpty) { /// if (value == null || value.isEmpty) {
/// return 'Please enter a value'; /// return 'Please enter a value';
/// } /// }
/// return null; /// return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment