From 4ce8c94e0d07b797c3498a41df75859184658ba5 Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Fri, 18 Aug 2017 13:37:31 -0700 Subject: [PATCH] Use the phrase "must not be null" everywhere instead of "cannot be null" (#11683) when describing non-nullable method arguments. --- .../flutter/lib/src/animation/animation_controller.dart | 4 ++-- packages/flutter/lib/src/material/data_table.dart | 2 +- packages/flutter/lib/src/material/date_picker.dart | 4 ++-- packages/flutter/lib/src/material/tab_controller.dart | 4 ++-- packages/flutter/lib/src/material/tabs.dart | 8 ++++---- packages/flutter/lib/src/material/tooltip.dart | 2 +- packages/flutter/lib/src/services/image_cache.dart | 2 +- packages/flutter/lib/src/widgets/transitions.dart | 2 +- packages/flutter/lib/src/widgets/unique_widget.dart | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart index ca04cef9d8..46c01899a6 100644 --- a/packages/flutter/lib/src/animation/animation_controller.dart +++ b/packages/flutter/lib/src/animation/animation_controller.dart @@ -112,7 +112,7 @@ class AnimationController extends Animation /// null. /// /// * `vsync` is the [TickerProvider] for the current context. It can be - /// changed by calling [resync]. It is required and cannot be null. See + /// changed by calling [resync]. It is required and must not be null. See /// [TickerProvider] for advice on obtaining a ticker provider. AnimationController({ double value, @@ -140,7 +140,7 @@ class AnimationController extends Animation /// debugging (used by [toString]). /// /// * `vsync` is the [TickerProvider] for the current context. It can be - /// changed by calling [resync]. It is required and cannot be null. See + /// changed by calling [resync]. It is required and must not be null. See /// [TickerProvider] for advice on obtaining a ticker provider. /// /// This constructor is most useful for animations that will be driven using a diff --git a/packages/flutter/lib/src/material/data_table.dart b/packages/flutter/lib/src/material/data_table.dart index 040d0dcfcf..2d0398fdc4 100644 --- a/packages/flutter/lib/src/material/data_table.dart +++ b/packages/flutter/lib/src/material/data_table.dart @@ -233,7 +233,7 @@ class DataTable extends StatelessWidget { /// The [columns] argument must be a list of as many [DataColumn] /// objects as the table is to have columns, ignoring the leading /// checkbox column if any. The [columns] argument must have a - /// length greater than zero and cannot be null. + /// length greater than zero and must not be null. /// /// The [rows] argument must be a list of as many [DataRow] objects /// as the table is to have rows, ignoring the leading heading row diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index 02223ca9ca..5cce813c38 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -851,7 +851,7 @@ typedef bool SelectableDayPredicate(DateTime day); /// /// An optional [initialDatePickerMode] argument can be used to display the /// date picker initially in the year or month+day picker mode. It defaults -/// to month+day, but cannot be null. +/// to month+day, but must not be null. /// /// See also: /// @@ -872,7 +872,7 @@ Future showDatePicker({ selectableDayPredicate == null || selectableDayPredicate(initialDate), 'Provided initialDate must satisfy provided selectableDayPredicate' ); - assert(initialDatePickerMode != null, 'initialDatePickerMode cannot be null'); + assert(initialDatePickerMode != null, 'initialDatePickerMode must not be null'); return await showDialog( context: context, child: new _DatePickerDialog( diff --git a/packages/flutter/lib/src/material/tab_controller.dart b/packages/flutter/lib/src/material/tab_controller.dart index 1c7b8eb10e..37bcc43b31 100644 --- a/packages/flutter/lib/src/material/tab_controller.dart +++ b/packages/flutter/lib/src/material/tab_controller.dart @@ -73,10 +73,10 @@ import 'constants.dart'; class TabController extends ChangeNotifier { /// Creates an object that manages the state required by [TabBar] and a [TabBarView]. /// - /// The [length] cannot be null or negative. Typically its a value greater than one, i.e. + /// The [length] must not be null or negative. Typically its a value greater than one, i.e. /// typically there are two or more tabs. /// - /// The `initialIndex` must be valid given [length] and cannot be null. If [length] is + /// The `initialIndex` must be valid given [length] and must not be null. If [length] is /// zero, then `initialIndex` must be 0 (the default). TabController({ int initialIndex: 0, @required this.length, @required TickerProvider vsync }) : assert(length != null && length >= 0), diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index 9f846a2595..7968a850ac 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -402,15 +402,15 @@ class _TabBarScrollController extends ScrollController { class TabBar extends StatefulWidget implements PreferredSizeWidget { /// Creates a material design tab bar. /// - /// The [tabs] argument cannot be null and its length must match the [controller]'s + /// The [tabs] argument must not be null and its length must match the [controller]'s /// [TabController.length]. /// /// If a [TabController] is not provided, then there must be a /// [DefaultTabController] ancestor. /// - /// The [indicatorWeight] parameter defaults to 2, and cannot be null. + /// The [indicatorWeight] parameter defaults to 2, and must not be null. /// - /// The [indicatorPadding] parameter defaults to [EdgeInsets.zero], and cannot be null. + /// The [indicatorPadding] parameter defaults to [EdgeInsets.zero], and must not be null. TabBar({ Key key, @required this.tabs, @@ -980,7 +980,7 @@ class _TabBarViewState extends State { class TabPageSelectorIndicator extends StatelessWidget { /// Creates an indicator used by [TabPageSelector]. /// - /// The [backgroundColor], [borderColor], and [size] parameters cannot be null. + /// The [backgroundColor], [borderColor], and [size] parameters must not be null. const TabPageSelectorIndicator({ Key key, @required this.backgroundColor, diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index a155fcb546..1d91b5e79b 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -41,7 +41,7 @@ class Tooltip extends StatefulWidget { /// By default, tooltips prefer to appear below the [child] widget when the /// user long presses on the widget. /// - /// The [message] argument cannot be null. + /// The [message] argument must not be null. const Tooltip({ Key key, @required this.message, diff --git a/packages/flutter/lib/src/services/image_cache.dart b/packages/flutter/lib/src/services/image_cache.dart index cc0f7b7cbd..763067f93b 100644 --- a/packages/flutter/lib/src/services/image_cache.dart +++ b/packages/flutter/lib/src/services/image_cache.dart @@ -67,7 +67,7 @@ class ImageCache { /// if not, calls the given callback to obtain it first. In either case, the /// key is moved to the "most recently used" position. /// - /// The arguments cannot be null. The `loader` cannot return null. + /// The arguments must not be null. The `loader` cannot return null. ImageStreamCompleter putIfAbsent(Object key, ImageStreamCompleter loader()) { assert(key != null); assert(loader != null); diff --git a/packages/flutter/lib/src/widgets/transitions.dart b/packages/flutter/lib/src/widgets/transitions.dart index ec567f21c1..6c4736fcc8 100644 --- a/packages/flutter/lib/src/widgets/transitions.dart +++ b/packages/flutter/lib/src/widgets/transitions.dart @@ -403,7 +403,7 @@ class DecoratedBoxTransition extends AnimatedWidget { /// Creates an animated [DecoratedBox] whose [Decoration] animation updates /// the widget. /// - /// The [decoration] and [position] cannot be null. + /// The [decoration] and [position] must not be null. /// /// See also: /// diff --git a/packages/flutter/lib/src/widgets/unique_widget.dart b/packages/flutter/lib/src/widgets/unique_widget.dart index 606b7c9006..ce7733e837 100644 --- a/packages/flutter/lib/src/widgets/unique_widget.dart +++ b/packages/flutter/lib/src/widgets/unique_widget.dart @@ -22,7 +22,7 @@ import 'framework.dart'; abstract class UniqueWidget> extends StatefulWidget { /// Creates a widget that has exactly one inflated instance in the tree. /// - /// The [key] argument cannot be null because it identifies the unique + /// The [key] argument must not be null because it identifies the unique /// inflated instance of this widget. const UniqueWidget({ @required GlobalKey key,