Unverified Commit d2d0c73f authored by Justin McCandless's avatar Justin McCandless Committed by GitHub

Migrated docs to nnbd (#72307)

parent 34d4c7fe
...@@ -69,7 +69,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -69,7 +69,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// [fieldViewBuilder] parameter. The options to be displayed are determined /// [fieldViewBuilder] parameter. The options to be displayed are determined
/// using [optionsBuilder] and rendered with [optionsViewBuilder]. /// using [optionsBuilder] and rendered with [optionsViewBuilder].
/// ///
/// {@tool dartpad --template=freeform_no_null_safety} /// {@tool dartpad --template=freeform}
/// This example shows how to create a very basic autocomplete widget using the /// This example shows how to create a very basic autocomplete widget using the
/// [fieldViewBuilder] and [optionsViewBuilder] parameters. /// [fieldViewBuilder] and [optionsViewBuilder] parameters.
/// ///
...@@ -80,7 +80,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -80,7 +80,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// ///
/// ```dart /// ```dart
/// class AutocompleteBasicExample extends StatelessWidget { /// class AutocompleteBasicExample extends StatelessWidget {
/// AutocompleteBasicExample({Key key}) : super(key: key); /// AutocompleteBasicExample({Key? key}) : super(key: key);
/// ///
/// static final List<String> _options = <String>[ /// static final List<String> _options = <String>[
/// 'aardvark', /// 'aardvark',
...@@ -143,7 +143,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -143,7 +143,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// Options will be compared using `==`, so it may be beneficial to override /// Options will be compared using `==`, so it may be beneficial to override
/// [Object.==] and [Object.hashCode] for custom types. /// [Object.==] and [Object.hashCode] for custom types.
/// ///
/// {@tool dartpad --template=freeform_no_null_safety} /// {@tool dartpad --template=freeform}
/// This example is similar to the previous example, but it uses a custom T data /// This example is similar to the previous example, but it uses a custom T data
/// type instead of directly using String. /// type instead of directly using String.
/// ///
...@@ -156,8 +156,8 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -156,8 +156,8 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// // An example of a type that someone might want to autocomplete a list of. /// // An example of a type that someone might want to autocomplete a list of.
/// class User { /// class User {
/// const User({ /// const User({
/// this.email, /// required this.email,
/// this.name, /// required this.name,
/// }); /// });
/// ///
/// final String email; /// final String email;
...@@ -182,7 +182,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -182,7 +182,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// } /// }
/// ///
/// class AutocompleteCustomTypeExample extends StatelessWidget { /// class AutocompleteCustomTypeExample extends StatelessWidget {
/// AutocompleteCustomTypeExample({Key key}); /// AutocompleteCustomTypeExample({Key? key}) : super(key: key);
/// ///
/// static final List<User> _userOptions = <User>[ /// static final List<User> _userOptions = <User>[
/// User(name: 'Alice', email: 'alice@example.com'), /// User(name: 'Alice', email: 'alice@example.com'),
...@@ -244,7 +244,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -244,7 +244,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
/// ///
/// {@tool dartpad --template=freeform_no_null_safety} /// {@tool dartpad --template=freeform}
/// This example shows the use of RawAutocomplete in a form. /// This example shows the use of RawAutocomplete in a form.
/// ///
/// ```dart imports /// ```dart imports
...@@ -254,7 +254,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -254,7 +254,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// ///
/// ```dart /// ```dart
/// class AutocompleteFormExamplePage extends StatefulWidget { /// class AutocompleteFormExamplePage extends StatefulWidget {
/// AutocompleteFormExamplePage({Key key}) : super(key: key); /// AutocompleteFormExamplePage({Key? key}) : super(key: key);
/// ///
/// @override /// @override
/// AutocompleteFormExample createState() => AutocompleteFormExample(); /// AutocompleteFormExample createState() => AutocompleteFormExample();
...@@ -263,8 +263,8 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -263,8 +263,8 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// class AutocompleteFormExample extends State<AutocompleteFormExamplePage> { /// class AutocompleteFormExample extends State<AutocompleteFormExamplePage> {
/// final _formKey = GlobalKey<FormState>(); /// final _formKey = GlobalKey<FormState>();
/// final TextEditingController _textEditingController = TextEditingController(); /// final TextEditingController _textEditingController = TextEditingController();
/// String _dropdownValue; /// String? _dropdownValue;
/// String _autocompleteSelection; /// String? _autocompleteSelection;
/// ///
/// final List<String> _options = <String>[ /// final List<String> _options = <String>[
/// 'aardvark', /// 'aardvark',
...@@ -290,7 +290,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -290,7 +290,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// iconSize: 24, /// iconSize: 24,
/// elevation: 16, /// elevation: 16,
/// style: TextStyle(color: Colors.deepPurple), /// style: TextStyle(color: Colors.deepPurple),
/// onChanged: (String newValue) { /// onChanged: (String? newValue) {
/// setState(() { /// setState(() {
/// _dropdownValue = newValue; /// _dropdownValue = newValue;
/// }); /// });
...@@ -302,7 +302,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -302,7 +302,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// child: Text(value), /// child: Text(value),
/// ); /// );
/// }).toList(), /// }).toList(),
/// validator: (String value) { /// validator: (String? value) {
/// if (value == null) { /// if (value == null) {
/// return 'Must make a selection.'; /// return 'Must make a selection.';
/// } /// }
...@@ -314,8 +314,8 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -314,8 +314,8 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// decoration: InputDecoration( /// decoration: InputDecoration(
/// hintText: 'This is a regular TextFormField', /// hintText: 'This is a regular TextFormField',
/// ), /// ),
/// validator: (String value) { /// validator: (String? value) {
/// if (value.isEmpty) { /// if (value == null || value.isEmpty) {
/// return 'Can\'t be empty.'; /// return 'Can\'t be empty.';
/// } /// }
/// return null; /// return null;
...@@ -342,7 +342,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -342,7 +342,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// onFieldSubmitted: (String value) { /// onFieldSubmitted: (String value) {
/// onFieldSubmitted(); /// onFieldSubmitted();
/// }, /// },
/// validator: (String value) { /// validator: (String? value) {
/// if (!_options.contains(value)) { /// if (!_options.contains(value)) {
/// return 'Nothing selected.'; /// return 'Nothing selected.';
/// } /// }
...@@ -380,7 +380,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option) ...@@ -380,7 +380,7 @@ typedef AutocompleteOptionToString<T extends Object> = String Function(T option)
/// ElevatedButton( /// ElevatedButton(
/// onPressed: () { /// onPressed: () {
/// FocusScope.of(context).requestFocus(new FocusNode()); /// FocusScope.of(context).requestFocus(new FocusNode());
/// if (!_formKey.currentState.validate()) { /// if (!_formKey.currentState!.validate()) {
/// return; /// return;
/// } /// }
/// showDialog<void>( /// showDialog<void>(
......
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