From 8cda3bea23a5e29236f048ced85416f19945c0cb Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Wed, 20 Sep 2023 08:44:49 -0700 Subject: [PATCH] Remove 'must not be null' comments from various libraries. (#134984) ## Description This removes all of the comments that are of the form "so-and-so (must not be null|can ?not be null|must be non-null)" from the cases where those values are defines as non-nullable values. This PR removes them from the animation, cupertino, foundation, gestures, semantics, and services libraries. Each of them only had a few, so I lumped them together. This was done by hand, since it really didn't lend itself to scripting, so it needs to be more than just spot-checked, I think. I was careful to leave any comment that referred to parameters that were nullable, but I may have missed some. In addition to being no longer relevant after null safety has been made the default, these comments were largely fragile, in that it was easy for them to get out of date, and not be accurate anymore anyhow. This did create a number of constructor comments which basically say "Creates a [Foo].", but I don't really know how to avoid that in a large scale change, since there's not much you can really say in a lot of cases. I think we might consider some leniency for constructors to the "Comment must be meaningful" style guidance (which we de facto have already, since there are a bunch of these). ## Related PRs - https://github.com/flutter/flutter/pull/134991 - https://github.com/flutter/flutter/pull/134992 - https://github.com/flutter/flutter/pull/134993 - https://github.com/flutter/flutter/pull/134994 ## Tests - Documentation only change. --- .../src/animation/animation_controller.dart | 12 +-- .../flutter/lib/src/animation/animations.dart | 17 ++-- .../flutter/lib/src/animation/curves.dart | 17 +--- packages/flutter/lib/src/animation/tween.dart | 2 - .../lib/src/animation/tween_sequence.dart | 2 +- .../lib/src/cupertino/activity_indicator.dart | 4 +- packages/flutter/lib/src/cupertino/app.dart | 2 - .../lib/src/cupertino/bottom_tab_bar.dart | 11 +-- .../flutter/lib/src/cupertino/button.dart | 2 +- .../flutter/lib/src/cupertino/checkbox.dart | 2 - .../flutter/lib/src/cupertino/colors.dart | 12 +-- .../lib/src/cupertino/context_menu.dart | 10 +-- .../lib/src/cupertino/date_picker.dart | 29 +++--- ...desktop_text_selection_toolbar_button.dart | 4 - .../flutter/lib/src/cupertino/dialog.dart | 10 +-- .../lib/src/cupertino/form_section.dart | 2 +- .../flutter/lib/src/cupertino/nav_bar.dart | 17 ++-- .../lib/src/cupertino/page_scaffold.dart | 2 +- .../flutter/lib/src/cupertino/picker.dart | 18 ++-- .../flutter/lib/src/cupertino/refresh.dart | 12 +-- packages/flutter/lib/src/cupertino/route.dart | 2 - .../lib/src/cupertino/search_field.dart | 34 +++---- .../lib/src/cupertino/segmented_control.dart | 8 +- .../flutter/lib/src/cupertino/slider.dart | 2 - .../cupertino/sliding_segmented_control.dart | 10 +-- .../flutter/lib/src/cupertino/switch.dart | 5 +- .../lib/src/cupertino/tab_scaffold.dart | 16 ++-- .../flutter/lib/src/cupertino/text_field.dart | 17 ++-- .../text_selection_toolbar_button.dart | 4 - .../flutter/lib/src/cupertino/text_theme.dart | 2 +- packages/flutter/lib/src/cupertino/theme.dart | 2 - .../lib/src/cupertino/thumb_painter.dart | 2 - .../lib/src/foundation/assertions.dart | 6 +- .../lib/src/foundation/basic_types.dart | 7 +- .../lib/src/foundation/diagnostics.dart | 35 +------- .../lib/src/foundation/stack_frame.dart | 4 +- .../lib/src/gestures/drag_details.dart | 10 --- packages/flutter/lib/src/gestures/events.dart | 30 ------- .../flutter/lib/src/gestures/force_press.dart | 2 - .../flutter/lib/src/gestures/long_press.dart | 8 -- .../flutter/lib/src/gestures/lsq_solver.dart | 2 - .../flutter/lib/src/gestures/monodrag.dart | 2 - .../flutter/lib/src/gestures/multidrag.dart | 2 - packages/flutter/lib/src/gestures/scale.dart | 9 +- packages/flutter/lib/src/gestures/tap.dart | 4 +- .../lib/src/gestures/tap_and_drag.dart | 18 ---- .../lib/src/gestures/velocity_tracker.dart | 6 +- .../lib/src/rendering/table_border.dart | 3 + .../flutter/lib/src/semantics/semantics.dart | 8 +- .../lib/src/semantics/semantics_event.dart | 4 - .../flutter/lib/src/services/autofill.dart | 6 +- .../lib/src/services/mouse_cursor.dart | 4 +- .../lib/src/services/mouse_tracking.dart | 2 - .../lib/src/services/platform_channel.dart | 11 +-- .../lib/src/services/platform_views.dart | 88 ++++++++++--------- .../src/services/raw_keyboard_android.dart | 3 - .../src/services/raw_keyboard_fuchsia.dart | 2 - .../lib/src/services/raw_keyboard_ios.dart | 3 - .../lib/src/services/raw_keyboard_linux.dart | 3 - .../lib/src/services/raw_keyboard_macos.dart | 3 - .../lib/src/services/raw_keyboard_web.dart | 2 - .../src/services/raw_keyboard_windows.dart | 3 - .../flutter/lib/src/services/restoration.dart | 6 -- .../lib/src/services/text_editing.dart | 4 - .../lib/src/services/text_editing_delta.dart | 12 --- .../lib/src/services/text_formatter.dart | 9 -- .../flutter/lib/src/services/text_input.dart | 15 ++-- .../flutter_driver/lib/src/common/wait.dart | 2 - .../flutter_goldens/lib/flutter_goldens.dart | 6 +- packages/flutter_test/lib/src/goldens.dart | 2 - 70 files changed, 176 insertions(+), 461 deletions(-) diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart index 24df24fb8cb..2a5f7e9850f 100644 --- a/packages/flutter/lib/src/animation/animation_controller.dart +++ b/packages/flutter/lib/src/animation/animation_controller.dart @@ -230,9 +230,9 @@ class AnimationController extends Animation /// value at which this animation is deemed to be completed. It cannot be /// null. /// - /// * `vsync` is the [TickerProvider] for the current context. It can be - /// changed by calling [resync]. It is required and must not be null. See - /// [TickerProvider] for advice on obtaining a ticker provider. + /// * `vsync` is the required [TickerProvider] for the current context. It can + /// be changed by calling [resync]. See [TickerProvider] for advice on + /// obtaining a ticker provider. AnimationController({ double? value, this.duration, @@ -258,9 +258,9 @@ class AnimationController extends Animation /// * [debugLabel] is a string to help identify this animation during /// debugging (used by [toString]). /// - /// * `vsync` is the [TickerProvider] for the current context. It can be - /// changed by calling [resync]. It is required and must not be null. See - /// [TickerProvider] for advice on obtaining a ticker provider. + /// * `vsync` is the required [TickerProvider] for the current context. It can + /// be changed by calling [resync]. See [TickerProvider] for advice on + /// obtaining a ticker provider. /// /// This constructor is most useful for animations that will be driven using a /// physics simulation, especially when the physics simulation has no diff --git a/packages/flutter/lib/src/animation/animations.dart b/packages/flutter/lib/src/animation/animations.dart index de2f7c04fb7..4fb2d6732fd 100644 --- a/packages/flutter/lib/src/animation/animations.dart +++ b/packages/flutter/lib/src/animation/animations.dart @@ -269,8 +269,6 @@ class ReverseAnimation extends Animation with AnimationLazyListenerMixin, AnimationLocalStatusListenersMixin { /// Creates a reverse animation. - /// - /// The parent argument must not be null. ReverseAnimation(this.parent); /// The animation whose value and direction this animation is reversing. @@ -376,8 +374,6 @@ class ReverseAnimation extends Animation /// [Curve]. class CurvedAnimation extends Animation with AnimationWithParentMixin { /// Creates a curved animation. - /// - /// The parent and curve arguments must not be null. CurvedAnimation({ required this.parent, required this.curve, @@ -631,8 +627,9 @@ class TrainHoppingAnimation extends Animation /// animation otherwise. abstract class CompoundAnimation extends Animation with AnimationLazyListenerMixin, AnimationLocalListenersMixin, AnimationLocalStatusListenersMixin { - /// Creates a CompoundAnimation. Both arguments must be non-null. Either can - /// be a CompoundAnimation itself to combine multiple animations. + /// Creates a [CompoundAnimation]. + /// + /// Either argument can be a [CompoundAnimation] itself to combine multiple animations. CompoundAnimation({ required this.first, required this.next, @@ -720,8 +717,8 @@ class AnimationMean extends CompoundAnimation { class AnimationMax extends CompoundAnimation { /// Creates an [AnimationMax]. /// - /// Both arguments must be non-null. Either can be an [AnimationMax] itself - /// to combine multiple animations. + /// Either argument can be an [AnimationMax] itself to combine multiple + /// animations. AnimationMax(Animation first, Animation next) : super(first: first, next: next); @override @@ -735,8 +732,8 @@ class AnimationMax extends CompoundAnimation { class AnimationMin extends CompoundAnimation { /// Creates an [AnimationMin]. /// - /// Both arguments must be non-null. Either can be an [AnimationMin] itself - /// to combine multiple animations. + /// Either argument can be an [AnimationMin] itself to combine multiple + /// animations. AnimationMin(Animation first, Animation next) : super(first: first, next: next); @override diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index 0c54a653f03..aaa09951ab2 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -127,8 +127,6 @@ class _Linear extends Curve { /// {@animation 464 192 https://flutter.github.io/assets-for-api-docs/assets/animation/curve_sawtooth.mp4} class SawTooth extends Curve { /// Creates a sawtooth curve. - /// - /// The [count] argument must not be null. const SawTooth(this.count); /// The number of repetitions of the sawtooth pattern in the unit interval. @@ -157,8 +155,6 @@ class SawTooth extends Curve { /// {@animation 464 192 https://flutter.github.io/assets-for-api-docs/assets/animation/curve_interval.mp4} class Interval extends Curve { /// Creates an interval curve. - /// - /// The arguments must not be null. const Interval(this.begin, this.end, { this.curve = Curves.linear }); /// The largest value for which this interval is 0.0. @@ -202,8 +198,6 @@ class Interval extends Curve { /// {@animation 464 192 https://flutter.github.io/assets-for-api-docs/assets/animation/curve_threshold.mp4} class Threshold extends Curve { /// Creates a threshold curve. - /// - /// The [threshold] argument must not be null. const Threshold(this.threshold); /// The value before which the curve is 0.0 and after which the curve is 1.0. @@ -302,8 +296,6 @@ class Cubic extends Curve { /// /// Rather than creating a new instance, consider using one of the common /// cubic curves in [Curves]. - /// - /// The [a] (x1), [b] (y1), [c] (x2) and [d] (y2) arguments must not be null. const Cubic(this.a, this.b, this.c, this.d); /// The x coordinate of the first control point. @@ -599,8 +591,6 @@ abstract class Curve2D extends ParametricCurve { /// * [Curve2D], a parametric curve that maps a double parameter to a 2D location. class Curve2DSample { /// Creates an object that holds a sample; used with [Curve2D] subclasses. - /// - /// All arguments must not be null. const Curve2DSample(this.t, this.value); /// The parametric location of this sample point along the curve. @@ -659,8 +649,7 @@ class CatmullRomSpline extends Curve2D { /// control point. The default is chosen so that the slope of the line at the /// ends matches that of the first or last line segment in the control points. /// - /// The `tension` and `controlPoints` arguments must not be null, and the - /// `controlPoints` list must contain at least four control points to + /// The `controlPoints` list must contain at least four control points to /// interpolate. /// /// The internal curve data structures are lazily computed the first time @@ -860,8 +849,6 @@ class CatmullRomCurve extends Curve { /// [transform] is called. If you would rather pre-compute the curve, use /// [CatmullRomCurve.precompute] instead. /// - /// All of the arguments must not be null. - /// /// See also: /// /// * This [paper on using Catmull-Rom splines](http://faculty.cs.tamu.edu/schaefer/research/cr_cad.pdf). @@ -1144,8 +1131,6 @@ class CatmullRomCurve extends Curve { /// * [CurvedAnimation], which can take a separate curve and reverse curve. class FlippedCurve extends Curve { /// Creates a flipped curve. - /// - /// The [curve] argument must not be null. const FlippedCurve(this.curve); /// The curve that is being flipped. diff --git a/packages/flutter/lib/src/animation/tween.dart b/packages/flutter/lib/src/animation/tween.dart index 1f0bb5d387a..14cb5f0d77b 100644 --- a/packages/flutter/lib/src/animation/tween.dart +++ b/packages/flutter/lib/src/animation/tween.dart @@ -547,8 +547,6 @@ class ConstantTween extends Tween { /// [AnimationController]. class CurveTween extends Animatable { /// Creates a curve tween. - /// - /// The [curve] argument must not be null. CurveTween({ required this.curve }); /// The curve to use when transforming the value of the animation. diff --git a/packages/flutter/lib/src/animation/tween_sequence.dart b/packages/flutter/lib/src/animation/tween_sequence.dart index a8e3208a595..8600ea836db 100644 --- a/packages/flutter/lib/src/animation/tween_sequence.dart +++ b/packages/flutter/lib/src/animation/tween_sequence.dart @@ -122,7 +122,7 @@ class FlippedTweenSequence extends TweenSequence { class TweenSequenceItem { /// Construct a TweenSequenceItem. /// - /// The [tween] must not be null and [weight] must be greater than 0.0. + /// The [weight] must be greater than 0.0. const TweenSequenceItem({ required this.tween, required this.weight, diff --git a/packages/flutter/lib/src/cupertino/activity_indicator.dart b/packages/flutter/lib/src/cupertino/activity_indicator.dart index bd5bacf6b76..b1c2e5ce62d 100644 --- a/packages/flutter/lib/src/cupertino/activity_indicator.dart +++ b/packages/flutter/lib/src/cupertino/activity_indicator.dart @@ -67,7 +67,7 @@ class CupertinoActivityIndicator extends StatefulWidget { /// Radius of the spinner widget. /// - /// Defaults to 10px. Must be positive and cannot be null. + /// Defaults to 10 pixels. Must be positive. final double radius; /// Determines the percentage of spinner ticks that will be shown. Typical usage would @@ -75,7 +75,7 @@ class CupertinoActivityIndicator extends StatefulWidget { /// during pull-to-refresh when the drag-down action shows one tick at a time as /// the user continues to drag down. /// - /// Defaults to 1.0. Must be between 0.0 and 1.0 inclusive, and cannot be null. + /// Defaults to one. Must be between zero and one, inclusive. final double progress; @override diff --git a/packages/flutter/lib/src/cupertino/app.dart b/packages/flutter/lib/src/cupertino/app.dart index b4b0b818fa6..f68ffc92bcd 100644 --- a/packages/flutter/lib/src/cupertino/app.dart +++ b/packages/flutter/lib/src/cupertino/app.dart @@ -145,8 +145,6 @@ class CupertinoApp extends StatefulWidget { /// unsupported route. /// /// This class creates an instance of [WidgetsApp]. - /// - /// The boolean arguments, [routes], and [navigatorObservers], must not be null. const CupertinoApp({ super.key, this.navigatorKey, diff --git a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart index 6d920abff92..6dd1bf37864 100644 --- a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart +++ b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart @@ -79,8 +79,6 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { assert(height >= 0.0); /// The interactive items laid out within the bottom navigation bar. - /// - /// Must not be null. final List items; /// The callback that is called when a item is tapped. @@ -92,8 +90,7 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { /// The index into [items] of the current active item. /// - /// Must not be null and must inclusively be between 0 and the number of tabs - /// minus 1. + /// Must be between 0 and the number of tabs minus 1, inclusive. final int currentIndex; /// The background color of the tab bar. If it contains transparency, the @@ -113,7 +110,7 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { /// in the unselected state. /// /// Defaults to a [CupertinoDynamicColor] that matches the disabled foreground - /// color of the native `UITabBar` component. Cannot be null. + /// color of the native `UITabBar` component. final Color inactiveColor; /// The size of all of the [BottomNavigationBarItem] icons. @@ -121,13 +118,11 @@ class CupertinoTabBar extends StatelessWidget implements PreferredSizeWidget { /// This value is used to configure the [IconTheme] for the navigation bar. /// When a [BottomNavigationBarItem.icon] widget is not an [Icon] the widget /// should configure itself to match the icon theme's size and color. - /// - /// Must not be null. final double iconSize; /// The height of the [CupertinoTabBar]. /// - /// Defaults to 50.0. Must not be null. + /// Defaults to 50. final double height; /// The border of the [CupertinoTabBar]. diff --git a/packages/flutter/lib/src/cupertino/button.dart b/packages/flutter/lib/src/cupertino/button.dart index b5f71d54b9b..73c90d01f1c 100644 --- a/packages/flutter/lib/src/cupertino/button.dart +++ b/packages/flutter/lib/src/cupertino/button.dart @@ -95,7 +95,7 @@ class CupertinoButton extends StatefulWidget { /// Ignored if the [CupertinoButton] doesn't also have a [color]. /// /// Defaults to [CupertinoColors.quaternarySystemFill] when [color] is - /// specified. Must not be null. + /// specified. final Color disabledColor; /// The callback that is called when the button is tapped or otherwise activated. diff --git a/packages/flutter/lib/src/cupertino/checkbox.dart b/packages/flutter/lib/src/cupertino/checkbox.dart index 9d37c7af9c0..6df97362b2d 100644 --- a/packages/flutter/lib/src/cupertino/checkbox.dart +++ b/packages/flutter/lib/src/cupertino/checkbox.dart @@ -57,8 +57,6 @@ class CupertinoCheckbox extends StatefulWidget { /// can only be null if [tristate] is true. /// * [onChanged], which is called when the value of the checkbox should /// change. It can be set to null to disable the checkbox. - /// - /// The values of [tristate] and [autofocus] must not be null. const CupertinoCheckbox({ super.key, required this.value, diff --git a/packages/flutter/lib/src/cupertino/colors.dart b/packages/flutter/lib/src/cupertino/colors.dart index 8d57221c643..7db9b9a4899 100644 --- a/packages/flutter/lib/src/cupertino/colors.dart +++ b/packages/flutter/lib/src/cupertino/colors.dart @@ -738,8 +738,6 @@ abstract final class CupertinoColors { class CupertinoDynamicColor extends Color with Diagnosticable { /// Creates an adaptive [Color] that changes its effective color based on the /// [BuildContext] given. The default effective color is [color]. - /// - /// All the colors must not be null. const CupertinoDynamicColor({ String? debugLabel, required Color color, @@ -768,8 +766,6 @@ class CupertinoDynamicColor extends Color with Diagnosticable { /// given [BuildContext]'s brightness (from [MediaQueryData.platformBrightness] /// or [CupertinoThemeData.brightness]) and accessibility contrast setting /// ([MediaQueryData.highContrast]). The default effective color is [color]. - /// - /// All the colors must not be null. const CupertinoDynamicColor.withBrightnessAndContrast({ String? debugLabel, required Color color, @@ -791,8 +787,6 @@ class CupertinoDynamicColor extends Color with Diagnosticable { /// Creates an adaptive [Color] that changes its effective color based on the given /// [BuildContext]'s brightness (from [MediaQueryData.platformBrightness] or /// [CupertinoThemeData.brightness]). The default effective color is [color]. - /// - /// All the colors must not be null. const CupertinoDynamicColor.withBrightness({ String? debugLabel, required Color color, @@ -828,8 +822,8 @@ class CupertinoDynamicColor extends Color with Diagnosticable { /// The current effective color. /// - /// Must not be null. Defaults to [color] if this [CupertinoDynamicColor] has - /// never been resolved. + /// Defaults to [color] if this [CupertinoDynamicColor] has never been + /// resolved. final Color _effectiveColor; @override @@ -1158,8 +1152,6 @@ class CupertinoDynamicColor extends Color with Diagnosticable { } /// Creates a diagnostics property for [CupertinoDynamicColor]. -/// -/// The [showName], [style], and [level] arguments must not be null. DiagnosticsProperty createCupertinoColorProperty( String name, Color? value, { diff --git a/packages/flutter/lib/src/cupertino/context_menu.dart b/packages/flutter/lib/src/cupertino/context_menu.dart index 113e923ab30..385bae14fbb 100644 --- a/packages/flutter/lib/src/cupertino/context_menu.dart +++ b/packages/flutter/lib/src/cupertino/context_menu.dart @@ -132,9 +132,7 @@ enum _ContextMenuLocation { class CupertinoContextMenu extends StatefulWidget { /// Create a context menu. /// - /// [actions] is required and cannot be null or empty. - /// - /// [child] is required and cannot be null. + /// The [actions] parameter cannot be empty. CupertinoContextMenu({ super.key, required this.actions, @@ -153,9 +151,7 @@ class CupertinoContextMenu extends StatefulWidget { /// Use instead of the default constructor when it is needed to have a more /// custom animation. /// - /// [actions] is required and cannot be null or empty. - /// - /// [builder] is required. + /// The [actions] parameter cannot be empty. CupertinoContextMenu.builder({ super.key, required this.actions, @@ -389,7 +385,7 @@ class CupertinoContextMenu extends StatefulWidget { /// /// These actions are typically [CupertinoContextMenuAction]s. /// - /// This parameter cannot be null or empty. + /// This parameter must not be empty. final List actions; /// If true, clicking on the [CupertinoContextMenuAction]s will diff --git a/packages/flutter/lib/src/cupertino/date_picker.dart b/packages/flutter/lib/src/cupertino/date_picker.dart index afc938624e9..dc15ea3e35d 100644 --- a/packages/flutter/lib/src/cupertino/date_picker.dart +++ b/packages/flutter/lib/src/cupertino/date_picker.dart @@ -237,17 +237,16 @@ class CupertinoDatePicker extends StatefulWidget { /// to [CupertinoDatePickerMode.dateAndTime]. /// /// [onDateTimeChanged] is the callback called when the selected date or time - /// changes and must not be null. When in [CupertinoDatePickerMode.time] mode, - /// the year, month and day will be the same as [initialDateTime]. When in + /// changes. When in [CupertinoDatePickerMode.time] mode, the year, month and + /// day will be the same as [initialDateTime]. When in /// [CupertinoDatePickerMode.date] mode, this callback will always report the /// start time of the currently selected day. When in /// [CupertinoDatePickerMode.monthYear] mode, the day and time will be the /// start time of the first day of the month. /// /// [initialDateTime] is the initial date time of the picker. Defaults to the - /// present date and time and must not be null. The present must conform to - /// the intervals set in [minimumDate], [maximumDate], [minimumYear], and - /// [maximumYear]. + /// present date and time. The present must conform to the intervals set in + /// [minimumDate], [maximumDate], [minimumYear], and [maximumYear]. /// /// [minimumDate] is the minimum selectable [DateTime] of the picker. When set /// to null, the picker does not limit the minimum [DateTime] the user can pick. @@ -262,7 +261,7 @@ class CupertinoDatePicker extends StatefulWidget { /// maximum time the user can pick if it's set to a date later than that. /// /// [minimumYear] is the minimum year that the picker can be scrolled to in - /// [CupertinoDatePickerMode.date] mode. Defaults to 1 and must not be null. + /// [CupertinoDatePickerMode.date] mode. Defaults to 1. /// /// [maximumYear] is the maximum year that the picker can be scrolled to in /// [CupertinoDatePickerMode.date] mode. Null if there's no limit. @@ -331,14 +330,14 @@ class CupertinoDatePicker extends StatefulWidget { ); } - /// The mode of the date picker as one of [CupertinoDatePickerMode]. - /// Defaults to [CupertinoDatePickerMode.dateAndTime]. Cannot be null and - /// value cannot change after initial build. + /// The mode of the date picker as one of [CupertinoDatePickerMode]. Defaults + /// to [CupertinoDatePickerMode.dateAndTime]. Value cannot change after + /// initial build. final CupertinoDatePickerMode mode; /// The initial date and/or time of the picker. Defaults to the present date - /// and time and must not be null. The present must conform to the intervals - /// set in [minimumDate], [maximumDate], [minimumYear], and [maximumYear]. + /// and time. The present must conform to the intervals set in [minimumDate], + /// [maximumDate], [minimumYear], and [maximumYear]. /// /// Changing this value after the initial build will not affect the currently /// selected date time. @@ -375,7 +374,7 @@ class CupertinoDatePicker extends StatefulWidget { final DateTime? maximumDate; /// Minimum year that the picker can be scrolled to in - /// [CupertinoDatePickerMode.date] mode. Defaults to 1 and must not be null. + /// [CupertinoDatePickerMode.date] mode. Defaults to 1. final int minimumYear; /// Maximum year that the picker can be scrolled to in @@ -399,8 +398,6 @@ class CupertinoDatePicker extends StatefulWidget { /// Callback called when the selected date and/or time changes. If the new /// selected [DateTime] is not valid, or is not in the [minimumDate] through /// [maximumDate] range, this callback will not be called. - /// - /// Must not be null. final ValueChanged onDateTimeChanged; /// Background color of date picker. @@ -1890,7 +1887,7 @@ class CupertinoTimerPicker extends StatefulWidget { /// defaults to [CupertinoTimerPickerMode.hms]. /// /// [onTimerDurationChanged] is the callback called when the selected duration - /// changes and must not be null. + /// changes. /// /// [initialTimerDuration] defaults to 0 second and is limited from 0 second /// to 23 hours 59 minutes 59 seconds. @@ -1940,7 +1937,7 @@ class CupertinoTimerPicker extends StatefulWidget { /// Defines how the timer picker should be positioned within its parent. /// - /// This property must not be null. It defaults to [Alignment.center]. + /// Defaults to [Alignment.center]. final AlignmentGeometry alignment; /// Background color of timer picker. diff --git a/packages/flutter/lib/src/cupertino/desktop_text_selection_toolbar_button.dart b/packages/flutter/lib/src/cupertino/desktop_text_selection_toolbar_button.dart index 20f6d3a8eb2..07c41c3cea2 100644 --- a/packages/flutter/lib/src/cupertino/desktop_text_selection_toolbar_button.dart +++ b/packages/flutter/lib/src/cupertino/desktop_text_selection_toolbar_button.dart @@ -31,8 +31,6 @@ const EdgeInsets _kToolbarButtonPadding = EdgeInsets.fromLTRB( /// A button in the style of the Mac context menu buttons. class CupertinoDesktopTextSelectionToolbarButton extends StatefulWidget { /// Creates an instance of CupertinoDesktopTextSelectionToolbarButton. - /// - /// [child] cannot be null. const CupertinoDesktopTextSelectionToolbarButton({ super.key, required this.onPressed, @@ -51,8 +49,6 @@ class CupertinoDesktopTextSelectionToolbarButton extends StatefulWidget { /// Create an instance of [CupertinoDesktopTextSelectionToolbarButton] from /// the given [ContextMenuButtonItem]. - /// - /// [buttonItem] cannot be null. CupertinoDesktopTextSelectionToolbarButton.buttonItem({ super.key, required ContextMenuButtonItem this.buttonItem, diff --git a/packages/flutter/lib/src/cupertino/dialog.dart b/packages/flutter/lib/src/cupertino/dialog.dart index 7adfe82eb6a..a5b586c5ca6 100644 --- a/packages/flutter/lib/src/cupertino/dialog.dart +++ b/packages/flutter/lib/src/cupertino/dialog.dart @@ -190,8 +190,6 @@ bool _isInAccessibilityMode(BuildContext context) { /// * class CupertinoAlertDialog extends StatefulWidget { /// Creates an iOS-style alert dialog. - /// - /// The [actions] must not be null. const CupertinoAlertDialog({ super.key, this.title, @@ -686,8 +684,6 @@ class _CupertinoActionSheetState extends State { /// more choices related to the current context. class CupertinoActionSheetAction extends StatelessWidget { /// Creates an action for an iOS-style action sheet. - /// - /// The [child] and [onPressed] arguments must not be null. const CupertinoActionSheetAction({ super.key, required this.onPressed, @@ -697,8 +693,6 @@ class CupertinoActionSheetAction extends StatelessWidget { }); /// The callback that is called when the button is tapped. - /// - /// This attribute must not be null. final VoidCallback onPressed; /// Whether this action is the default choice in the action sheet. @@ -1632,14 +1626,14 @@ class CupertinoDialogAction extends StatelessWidget { /// but more than one action can have this attribute set to true in the same /// [CupertinoAlertDialog]. /// - /// This parameters defaults to false and cannot be null. + /// This parameters defaults to false. final bool isDefaultAction; /// Whether this action destroys an object. /// /// For example, an action that deletes an email is destructive. /// - /// Defaults to false and cannot be null. + /// Defaults to false. final bool isDestructiveAction; /// [TextStyle] to apply to any text that appears in this button. diff --git a/packages/flutter/lib/src/cupertino/form_section.dart b/packages/flutter/lib/src/cupertino/form_section.dart index 6bd9fd4c104..a381775ff9b 100644 --- a/packages/flutter/lib/src/cupertino/form_section.dart +++ b/packages/flutter/lib/src/cupertino/form_section.dart @@ -193,7 +193,7 @@ class CupertinoFormSection extends StatelessWidget { /// {@macro flutter.material.Material.clipBehavior} /// - /// Defaults to [Clip.none], and must not be null. + /// Defaults to [Clip.none]. final Clip clipBehavior; @override diff --git a/packages/flutter/lib/src/cupertino/nav_bar.dart b/packages/flutter/lib/src/cupertino/nav_bar.dart index 9c2d472f15f..665da8b7257 100644 --- a/packages/flutter/lib/src/cupertino/nav_bar.dart +++ b/packages/flutter/lib/src/cupertino/nav_bar.dart @@ -293,8 +293,6 @@ class CupertinoNavigationBar extends StatefulWidget implements ObstructingPrefer /// 3. Show a back chevron with the previous route's `title` if the current /// route is a [CupertinoPageRoute] and the previous route is also a /// [CupertinoPageRoute]. - /// - /// This value cannot be null. /// {@endtemplate} final bool automaticallyImplyLeading; @@ -303,8 +301,6 @@ class CupertinoNavigationBar extends StatefulWidget implements ObstructingPrefer /// If true and [middle] is null, automatically fill in a [Text] widget with /// the current route's `title` if the route is a [CupertinoPageRoute]. /// If [middle] widget is not null, this parameter has no effect. - /// - /// This value cannot be null. final bool automaticallyImplyMiddle; /// {@template flutter.cupertino.CupertinoNavigationBar.previousPageTitle} @@ -395,7 +391,7 @@ class CupertinoNavigationBar extends StatefulWidget implements ObstructingPrefer /// When set to true, only one navigation bar can be present per route unless /// [heroTag] is also set. /// - /// This value defaults to true and cannot be null. + /// This value defaults to true. /// {@endtemplate} final bool transitionBetweenRoutes; @@ -411,8 +407,8 @@ class CupertinoNavigationBar extends StatefulWidget implements ObstructingPrefer /// navigation bars per route or to transition between multiple /// [Navigator]s. /// - /// Cannot be null. To disable Hero transitions for this navigation bar, - /// set [transitionBetweenRoutes] to false. + /// To disable Hero transitions for this navigation bar, set + /// [transitionBetweenRoutes] to false. /// {@endtemplate} final Object heroTag; @@ -577,7 +573,8 @@ class _CupertinoNavigationBarState extends State { class CupertinoSliverNavigationBar extends StatefulWidget { /// Creates a navigation bar for scrolling lists. /// - /// The [largeTitle] argument is required and must not be null. + /// If [automaticallyImplyTitle] is false, then the [largeTitle] argument is + /// required. const CupertinoSliverNavigationBar({ super.key, this.largeTitle, @@ -638,8 +635,6 @@ class CupertinoSliverNavigationBar extends StatefulWidget { /// If true and [largeTitle] is null, automatically fill in a [Text] widget /// with the current route's `title` if the route is a [CupertinoPageRoute]. /// If [largeTitle] widget is not null, this parameter has no effect. - /// - /// This value cannot be null. final bool automaticallyImplyTitle; /// Controls whether [middle] widget should always be visible (even in @@ -1402,8 +1397,6 @@ class _NavigationBarStaticComponents { class CupertinoNavigationBarBackButton extends StatelessWidget { /// Construct a [CupertinoNavigationBarBackButton] that can be used to pop /// the current route. - /// - /// The [color] parameter must not be null. const CupertinoNavigationBarBackButton({ super.key, this.color, diff --git a/packages/flutter/lib/src/cupertino/page_scaffold.dart b/packages/flutter/lib/src/cupertino/page_scaffold.dart index 1789ca624b0..ea34f255655 100644 --- a/packages/flutter/lib/src/cupertino/page_scaffold.dart +++ b/packages/flutter/lib/src/cupertino/page_scaffold.dart @@ -75,7 +75,7 @@ class CupertinoPageScaffold extends StatefulWidget { /// scaffold, the body can be resized to avoid overlapping the keyboard, which /// prevents widgets inside the body from being obscured by the keyboard. /// - /// Defaults to true and cannot be null. + /// Defaults to true. final bool resizeToAvoidBottomInset; @override diff --git a/packages/flutter/lib/src/cupertino/picker.dart b/packages/flutter/lib/src/cupertino/picker.dart index 11f032b4497..ecbce297b91 100644 --- a/packages/flutter/lib/src/cupertino/picker.dart +++ b/packages/flutter/lib/src/cupertino/picker.dart @@ -53,8 +53,7 @@ const double _kOverAndUnderCenterOpacity = 0.447; class CupertinoPicker extends StatefulWidget { /// Creates a picker from a concrete list of children. /// - /// The [diameterRatio] and [itemExtent] arguments must not be null. The - /// [itemExtent] must be greater than zero. + /// The [itemExtent] must be greater than zero. /// /// The [backgroundColor] defaults to null, which disables background painting entirely. /// (i.e. the picker is going to have a completely transparent background), to match @@ -99,11 +98,11 @@ class CupertinoPicker extends StatefulWidget { /// normally the builder is only called once for each index (except when /// rebuilding - the cache is cleared). /// - /// The [itemBuilder] argument must not be null. The [childCount] argument - /// reflects the number of children that will be provided by the [itemBuilder]. + /// The [childCount] argument reflects the number of children that will be + /// provided by the [itemBuilder]. /// {@macro flutter.widgets.ListWheelChildBuilderDelegate.childCount} /// - /// The [itemExtent] argument must be non-null and positive. + /// The [itemExtent] argument must be positive. /// /// The [backgroundColor] defaults to null, which disables background painting entirely. /// (i.e. the picker is going to have a completely transparent background), to match @@ -134,7 +133,7 @@ class CupertinoPicker extends StatefulWidget { /// /// For more details, see [ListWheelScrollView.diameterRatio]. /// - /// Must not be null and defaults to `1.1` to visually mimic iOS. + /// Defaults to 1.1 to visually mimic iOS. final double diameterRatio; /// Background color behind the children. @@ -334,13 +333,12 @@ class CupertinoPickerDefaultSelectionOverlay extends StatelessWidget { /// area (or the currently selected item, depending on how you described it /// elsewhere) of a [CupertinoPicker]. /// - /// The [background] argument default value is [CupertinoColors.tertiarySystemFill]. - /// It must be non-null. + /// The [background] argument default value is + /// [CupertinoColors.tertiarySystemFill]. /// /// The [capStartEdge] and [capEndEdge] arguments decide whether to add a /// default margin and use rounded corners on the left and right side of the - /// rectangular overlay. - /// Default to true and must not be null. + /// rectangular overlay, and they both default to true. const CupertinoPickerDefaultSelectionOverlay({ super.key, this.background = CupertinoColors.tertiarySystemFill, diff --git a/packages/flutter/lib/src/cupertino/refresh.dart b/packages/flutter/lib/src/cupertino/refresh.dart index 4d32e614842..c4e1852e610 100644 --- a/packages/flutter/lib/src/cupertino/refresh.dart +++ b/packages/flutter/lib/src/cupertino/refresh.dart @@ -283,7 +283,7 @@ class CupertinoSliverRefreshControl extends StatefulWidget { /// Create a new refresh control for inserting into a list of slivers. /// /// The [refreshTriggerPullDistance] and [refreshIndicatorExtent] arguments - /// must not be null and must be >= 0. + /// must be greater than or equal to 0. /// /// The [builder] argument may be null, in which case no indicator UI will be /// shown but the [onRefresh] will still be invoked. By default, [builder] @@ -307,8 +307,8 @@ class CupertinoSliverRefreshControl extends StatefulWidget { /// The amount of overscroll the scrollable must be dragged to trigger a reload. /// - /// Must not be null, must be larger than 0.0 and larger than - /// [refreshIndicatorExtent]. Defaults to 100px when not specified. + /// Must be larger than zero and larger than [refreshIndicatorExtent]. + /// Defaults to 100 pixels when not specified. /// /// When overscrolled past this distance, [onRefresh] will be called if not /// null and the [builder] will build in the [RefreshIndicatorMode.armed] state. @@ -317,9 +317,9 @@ class CupertinoSliverRefreshControl extends StatefulWidget { /// The amount of space the refresh indicator sliver will keep holding while /// [onRefresh]'s [Future] is still running. /// - /// Must not be null and must be positive, but can be 0.0, in which case the - /// sliver will start retracting back to 0.0 as soon as the refresh is started. - /// Defaults to 60px when not specified. + /// Must be a positive number, but can be zero, in which case the sliver will + /// start retracting back to zero as soon as the refresh is started. Defaults + /// to 60 pixels when not specified. /// /// Must be smaller than [refreshTriggerPullDistance], since the sliver /// shouldn't grow further after triggering the refresh. diff --git a/packages/flutter/lib/src/cupertino/route.dart b/packages/flutter/lib/src/cupertino/route.dart index 0c1d5262658..d0c6be160d6 100644 --- a/packages/flutter/lib/src/cupertino/route.dart +++ b/packages/flutter/lib/src/cupertino/route.dart @@ -713,8 +713,6 @@ class _CupertinoBackGestureDetectorState extends State<_CupertinoBackGestureD /// detector controller is associated. class _CupertinoBackGestureController { /// Creates a controller for an iOS-style back gesture. - /// - /// The [navigator] and [controller] arguments must not be null. _CupertinoBackGestureController({ required this.navigator, required this.controller, diff --git a/packages/flutter/lib/src/cupertino/search_field.dart b/packages/flutter/lib/src/cupertino/search_field.dart index a5ffc2c5c49..f8ec3713dcc 100644 --- a/packages/flutter/lib/src/cupertino/search_field.dart +++ b/packages/flutter/lib/src/cupertino/search_field.dart @@ -197,51 +197,51 @@ class CupertinoSearchTextField extends StatefulWidget { /// Sets the padding insets for the text and placeholder. /// - /// Cannot be null. Defaults to padding that replicates the - /// `UISearchTextField` look. The inset values were determined using the - /// comparison tool in https://github.com/flutter/platform_tests/. + /// Defaults to padding that replicates the `UISearchTextField` look. The + /// inset values were determined using the comparison tool in + /// https://github.com/flutter/platform_tests/. final EdgeInsetsGeometry padding; /// Sets the color for the suffix and prefix icons. /// - /// Cannot be null. Defaults to [CupertinoColors.secondaryLabel]. + /// Defaults to [CupertinoColors.secondaryLabel]. final Color itemColor; /// Sets the base icon size for the suffix and prefix icons. /// - /// Cannot be null. The size of the icon is scaled using the accessibility - /// font scale settings. Defaults to `20.0`. + /// The size of the icon is scaled using the accessibility font scale + /// settings. Defaults to `20.0`. final double itemSize; /// Sets the padding insets for the suffix. /// - /// Cannot be null. Defaults to padding that replicates the - /// `UISearchTextField` suffix look. The inset values were determined using - /// the comparison tool in https://github.com/flutter/platform_tests/. + /// Defaults to padding that replicates the `UISearchTextField` suffix look. + /// The inset values were determined using the comparison tool in + /// https://github.com/flutter/platform_tests/. final EdgeInsetsGeometry prefixInsets; /// Sets a prefix widget. /// - /// Cannot be null. Defaults to an [Icon] widget with the [CupertinoIcons.search] icon. + /// Defaults to an [Icon] widget with the [CupertinoIcons.search] icon. final Widget prefixIcon; /// Sets the padding insets for the prefix. /// - /// Cannot be null. Defaults to padding that replicates the - /// `UISearchTextField` prefix look. The inset values were determined using - /// the comparison tool in https://github.com/flutter/platform_tests/. + /// Defaults to padding that replicates the `UISearchTextField` prefix look. + /// The inset values were determined using the comparison tool in + /// https://github.com/flutter/platform_tests/. final EdgeInsetsGeometry suffixInsets; /// Sets the suffix widget's icon. /// - /// Cannot be null. Defaults to the X-Mark [CupertinoIcons.xmark_circle_fill]. - /// "To change the functionality of the suffix icon, provide a custom - /// onSuffixTap callback and specify an intuitive suffixIcon. + /// Defaults to the X-Mark [CupertinoIcons.xmark_circle_fill]. "To change the + /// functionality of the suffix icon, provide a custom onSuffixTap callback + /// and specify an intuitive suffixIcon. final Icon suffixIcon; /// Dictates when the X-Mark (suffix) should be visible. /// - /// Cannot be null. Defaults to only on when editing. + /// Defaults to only on when editing. final OverlayVisibilityMode suffixMode; /// Sets the X-Mark (suffix) action. diff --git a/packages/flutter/lib/src/cupertino/segmented_control.dart b/packages/flutter/lib/src/cupertino/segmented_control.dart index e1012fa8f54..dcb0cde6604 100644 --- a/packages/flutter/lib/src/cupertino/segmented_control.dart +++ b/packages/flutter/lib/src/cupertino/segmented_control.dart @@ -76,9 +76,9 @@ const Duration _kFadeDuration = Duration(milliseconds: 165); class CupertinoSegmentedControl extends StatefulWidget { /// Creates an iOS-style segmented control bar. /// - /// The [children] and [onValueChanged] arguments must not be null. The - /// [children] argument must be an ordered [Map] such as a [LinkedHashMap]. - /// Further, the length of the [children] list must be greater than one. + /// The [children] argument must be an ordered [Map] such as a + /// [LinkedHashMap]. Further, the length of the [children] list must be + /// greater than one. /// /// Each widget value in the map of [children] must have an associated key /// that uniquely identifies this widget. This key is what will be returned @@ -120,8 +120,6 @@ class CupertinoSegmentedControl extends StatefulWidget { /// The callback that is called when a new option is tapped. /// - /// This attribute must not be null. - /// /// The segmented control passes the newly selected widget's associated key /// to the callback but does not actually change state until the parent /// widget rebuilds the segmented control with the new [groupValue]. diff --git a/packages/flutter/lib/src/cupertino/slider.dart b/packages/flutter/lib/src/cupertino/slider.dart index 006a9625145..50a6d29e4bc 100644 --- a/packages/flutter/lib/src/cupertino/slider.dart +++ b/packages/flutter/lib/src/cupertino/slider.dart @@ -202,8 +202,6 @@ class CupertinoSlider extends StatefulWidget { /// The color to use for the thumb of the slider. /// - /// Thumb color must not be null. - /// /// Defaults to [CupertinoColors.white]. final Color thumbColor; diff --git a/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart b/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart index 2a9d12d3a02..884e86d5ab9 100644 --- a/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart +++ b/packages/flutter/lib/src/cupertino/sliding_segmented_control.dart @@ -299,9 +299,9 @@ class _SegmentSeparatorState extends State<_SegmentSeparator> with TickerProvide class CupertinoSlidingSegmentedControl extends StatefulWidget { /// Creates an iOS-style segmented control bar. /// - /// The [children] and [onValueChanged] arguments must not be null. The - /// [children] argument must be an ordered [Map] such as a [LinkedHashMap]. - /// Further, the length of the [children] list must be greater than one. + /// The [children] argument must be an ordered [Map] such as a + /// [LinkedHashMap]. Further, the length of the [children] list must be + /// greater than one. /// /// Each widget value in the map of [children] must have an associated key /// that uniquely identifies this widget. This key is what will be returned @@ -343,8 +343,6 @@ class CupertinoSlidingSegmentedControl extends StatefulWidget { /// The callback that is called when a new option is tapped. /// - /// This attribute must not be null. - /// /// The segmented control passes the newly selected widget's associated key /// to the callback but does not actually change state until the parent /// widget rebuilds the segmented control with the new [groupValue]. @@ -403,7 +401,7 @@ class CupertinoSlidingSegmentedControl extends StatefulWidget { /// The amount of space by which to inset the [children]. /// - /// Must not be null. Defaults to EdgeInsets.symmetric(vertical: 2, horizontal: 3). + /// Defaults to `EdgeInsets.symmetric(vertical: 2, horizontal: 3)`. final EdgeInsetsGeometry padding; @override diff --git a/packages/flutter/lib/src/cupertino/switch.dart b/packages/flutter/lib/src/cupertino/switch.dart index 75518bcdec8..7c0a1957f3d 100644 --- a/packages/flutter/lib/src/cupertino/switch.dart +++ b/packages/flutter/lib/src/cupertino/switch.dart @@ -64,8 +64,7 @@ import 'thumb_painter.dart'; class CupertinoSwitch extends StatefulWidget { /// Creates an iOS-style switch. /// - /// The [value] parameter must not be null. - /// The [dragStartBehavior] parameter defaults to [DragStartBehavior.start] and must not be null. + /// The [dragStartBehavior] parameter defaults to [DragStartBehavior.start]. const CupertinoSwitch({ super.key, required this.value, @@ -84,8 +83,6 @@ class CupertinoSwitch extends StatefulWidget { }); /// Whether this switch is on or off. - /// - /// Must not be null. final bool value; /// Called when the user toggles with switch on or off. diff --git a/packages/flutter/lib/src/cupertino/tab_scaffold.dart b/packages/flutter/lib/src/cupertino/tab_scaffold.dart index 8bd129a7eb7..8995abfe5d4 100644 --- a/packages/flutter/lib/src/cupertino/tab_scaffold.dart +++ b/packages/flutter/lib/src/cupertino/tab_scaffold.dart @@ -32,8 +32,8 @@ class CupertinoTabController extends ChangeNotifier { /// Creates a [CupertinoTabController] to control the tab index of [CupertinoTabScaffold] /// and [CupertinoTabBar]. /// - /// The [initialIndex] must not be null and defaults to 0. The value must be - /// greater than or equal to 0, and less than the total number of tabs. + /// The [initialIndex] defaults to 0. The value must be greater than or equal + /// to 0, and less than the total number of tabs. CupertinoTabController({ int initialIndex = 0 }) : _index = initialIndex, assert(initialIndex >= 0); @@ -123,8 +123,6 @@ class CupertinoTabController extends ChangeNotifier { /// * [iOS human interface guidelines](https://developer.apple.com/design/human-interface-guidelines/ios/bars/tab-bars/). class CupertinoTabScaffold extends StatefulWidget { /// Creates a layout for applications with a tab bar at the bottom. - /// - /// The [tabBar] and [tabBuilder] arguments must not be null. CupertinoTabScaffold({ super.key, required this.tabBar, @@ -161,8 +159,6 @@ class CupertinoTabScaffold extends StatefulWidget { /// By default [tabBar] disables text scaling to match the native iOS behavior. /// To override this behavior, wrap each of the [tabBar]'s items inside a /// [MediaQuery] with the desired [TextScaler]. - /// - /// Must not be null. final CupertinoTabBar tabBar; /// Controls the currently selected tab index of the [tabBar], as well as the @@ -186,8 +182,6 @@ class CupertinoTabScaffold extends StatefulWidget { /// In that case, the child's [BuildContext]'s [MediaQuery] will have a /// bottom padding indicating the area of obstructing overlap from the /// [tabBar]. - /// - /// Must not be null. final IndexedWidgetBuilder tabBuilder; /// The color of the widget that underlies the entire scaffold. @@ -201,7 +195,7 @@ class CupertinoTabScaffold extends StatefulWidget { /// scaffold, the body can be resized to avoid overlapping the keyboard, which /// prevents widgets inside the body from being obscured by the keyboard. /// - /// Defaults to true and cannot be null. + /// Defaults to true. final bool resizeToAvoidBottomInset; /// Restoration ID to save and restore the state of the [CupertinoTabScaffold]. @@ -514,8 +508,8 @@ class RestorableCupertinoTabController extends RestorableChangeNotifier= 0), _initialIndex = initialIndex; diff --git a/packages/flutter/lib/src/cupertino/text_field.dart b/packages/flutter/lib/src/cupertino/text_field.dart index bda1ad6aecc..824f3cb0262 100644 --- a/packages/flutter/lib/src/cupertino/text_field.dart +++ b/packages/flutter/lib/src/cupertino/text_field.dart @@ -194,8 +194,7 @@ class CupertinoTextField extends StatefulWidget { /// /// The [selectionHeightStyle] and [selectionWidthStyle] properties allow /// changing the shape of the selection highlighting. These properties default - /// to [ui.BoxHeightStyle.tight] and [ui.BoxWidthStyle.tight] respectively and - /// must not be null. + /// to [ui.BoxHeightStyle.tight] and [ui.BoxWidthStyle.tight], respectively. /// /// The [autocorrect], [autofocus], [clearButtonMode], [dragStartBehavior], /// [expands], [obscureText], [prefixMode], [readOnly], [scrollPadding], @@ -332,13 +331,7 @@ class CupertinoTextField extends StatefulWidget { /// /// The [selectionHeightStyle] and [selectionWidthStyle] properties allow /// changing the shape of the selection highlighting. These properties default - /// to [ui.BoxHeightStyle.tight] and [ui.BoxWidthStyle.tight] respectively and - /// must not be null. - /// - /// The [autocorrect], [autofocus], [clearButtonMode], [dragStartBehavior], - /// [expands], [obscureText], [prefixMode], [readOnly], [scrollPadding], - /// [suffixMode], [textAlign], [selectionHeightStyle], [selectionWidthStyle], - /// and [enableSuggestions] properties must not be null. + /// to [ui.BoxHeightStyle.tight] and [ui.BoxWidthStyle.tight] respectively. /// /// See also: /// @@ -489,7 +482,7 @@ class CupertinoTextField extends StatefulWidget { /// Controls the visibility of the [prefix] widget based on the state of /// text entry when the [prefix] argument is not null. /// - /// Defaults to [OverlayVisibilityMode.always] and cannot be null. + /// Defaults to [OverlayVisibilityMode.always]. /// /// Has no effect when [prefix] is null. final OverlayVisibilityMode prefixMode; @@ -500,7 +493,7 @@ class CupertinoTextField extends StatefulWidget { /// Controls the visibility of the [suffix] widget based on the state of /// text entry when the [suffix] argument is not null. /// - /// Defaults to [OverlayVisibilityMode.always] and cannot be null. + /// Defaults to [OverlayVisibilityMode.always]. /// /// Has no effect when [suffix] is null. final OverlayVisibilityMode suffixMode; @@ -512,7 +505,7 @@ class CupertinoTextField extends StatefulWidget { /// /// Will only appear if no [suffix] widget is appearing. /// - /// Defaults to never appearing and cannot be null. + /// Defaults to [OverlayVisibilityMode.never]. final OverlayVisibilityMode clearButtonMode; /// {@macro flutter.widgets.editableText.keyboardType} diff --git a/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart b/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart index 140cd216135..cc991db20d6 100644 --- a/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart +++ b/packages/flutter/lib/src/cupertino/text_selection_toolbar_button.dart @@ -34,8 +34,6 @@ const EdgeInsets _kToolbarButtonPadding = EdgeInsets.symmetric(vertical: 18.0, h /// A button in the style of the iOS text selection toolbar buttons. class CupertinoTextSelectionToolbarButton extends StatefulWidget { /// Create an instance of [CupertinoTextSelectionToolbarButton]. - /// - /// [child] cannot be null. const CupertinoTextSelectionToolbarButton({ super.key, this.onPressed, @@ -54,8 +52,6 @@ class CupertinoTextSelectionToolbarButton extends StatefulWidget { /// Create an instance of [CupertinoTextSelectionToolbarButton] from the given /// [ContextMenuButtonItem]. - /// - /// [buttonItem] cannot be null. CupertinoTextSelectionToolbarButton.buttonItem({ super.key, required ContextMenuButtonItem this.buttonItem, diff --git a/packages/flutter/lib/src/cupertino/text_theme.dart b/packages/flutter/lib/src/cupertino/text_theme.dart index d6ee4d136eb..b8ef784561f 100644 --- a/packages/flutter/lib/src/cupertino/text_theme.dart +++ b/packages/flutter/lib/src/cupertino/text_theme.dart @@ -116,7 +116,7 @@ class CupertinoTextThemeData with Diagnosticable { /// Create a [CupertinoTextThemeData]. /// /// The [primaryColor] is used to derive TextStyle defaults of other attributes - /// such as [navActionTextStyle] and [actionTextStyle], it must not be null when + /// such as [navActionTextStyle] and [actionTextStyle]. It must not be null when /// either [navActionTextStyle] or [actionTextStyle] is null. Defaults to /// [CupertinoColors.systemBlue]. /// diff --git a/packages/flutter/lib/src/cupertino/theme.dart b/packages/flutter/lib/src/cupertino/theme.dart index 05a572eb636..b4daa961c13 100644 --- a/packages/flutter/lib/src/cupertino/theme.dart +++ b/packages/flutter/lib/src/cupertino/theme.dart @@ -47,8 +47,6 @@ const _CupertinoThemeDefaults _kDefaultTheme = _CupertinoThemeDefaults( /// with a [CupertinoThemeData] derived from the Material [ThemeData]. class CupertinoTheme extends StatelessWidget { /// Creates a [CupertinoTheme] to change descendant Cupertino widgets' styling. - /// - /// The [data] and [child] parameters must not be null. const CupertinoTheme({ super.key, required this.data, diff --git a/packages/flutter/lib/src/cupertino/thumb_painter.dart b/packages/flutter/lib/src/cupertino/thumb_painter.dart index 319c6a00e96..08f43f63ba8 100644 --- a/packages/flutter/lib/src/cupertino/thumb_painter.dart +++ b/packages/flutter/lib/src/cupertino/thumb_painter.dart @@ -59,8 +59,6 @@ class CupertinoThumbPainter { final Color color; /// The list of [BoxShadow] to paint below the thumb. - /// - /// Must not be null. final List shadows; /// Half the default diameter of the thumb. diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index 3cc1c3ba948..a914609f89e 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -48,8 +48,7 @@ typedef StackTraceDemangler = StackTrace Function(StackTrace details); /// * [RepetitiveStackFrameFilter], which uses this class to compare against [StackFrame]s. @immutable class PartialStackFrame { - /// Creates a new [PartialStackFrame] instance. All arguments are required and - /// must not be null. + /// Creates a new [PartialStackFrame] instance. const PartialStackFrame({ required this.package, required this.className, @@ -397,9 +396,6 @@ class FlutterErrorDetails with Diagnosticable { /// /// The framework calls this constructor when catching an exception that will /// subsequently be reported using [FlutterError.onError]. - /// - /// The [exception] must not be null; other arguments can be left to - /// their default values. const FlutterErrorDetails({ required this.exception, this.stack, diff --git a/packages/flutter/lib/src/foundation/basic_types.dart b/packages/flutter/lib/src/foundation/basic_types.dart index 9bc8c6aa6e7..27c9bc92229 100644 --- a/packages/flutter/lib/src/foundation/basic_types.dart +++ b/packages/flutter/lib/src/foundation/basic_types.dart @@ -102,9 +102,8 @@ typedef AsyncValueGetter = Future Function(); /// also applies to any iterables derived from this one, e.g. as /// returned by `where`. class CachingIterable extends IterableBase { - /// Creates a CachingIterable using the given [Iterator] as the - /// source of data. The iterator must be non-null and must not throw - /// exceptions. + /// Creates a [CachingIterable] using the given [Iterator] as the source of + /// data. The iterator must not throw exceptions. /// /// Since the argument is an [Iterator], not an [Iterable], it is /// guaranteed that the underlying data set will only be walked @@ -229,8 +228,6 @@ class _LazyListIterator implements Iterator { /// A factory interface that also reports the type of the created objects. class Factory { /// Creates a new factory. - /// - /// The `constructor` parameter must not be null. const Factory(this.constructor); /// Creates a new object of type T. diff --git a/packages/flutter/lib/src/foundation/diagnostics.dart b/packages/flutter/lib/src/foundation/diagnostics.dart index 04317cf19de..4f14a3b4da0 100644 --- a/packages/flutter/lib/src/foundation/diagnostics.dart +++ b/packages/flutter/lib/src/foundation/diagnostics.dart @@ -226,8 +226,6 @@ enum DiagnosticsTreeStyle { /// to render text art for arbitrary trees of [DiagnosticsNode] objects. class TextTreeConfiguration { /// Create a configuration object describing how to render a tree as text. - /// - /// All of the arguments must not be null. TextTreeConfiguration({ required this.prefixLineOne, required this.prefixOtherLines, @@ -1451,8 +1449,6 @@ abstract class DiagnosticsNode { /// Diagnostics containing just a string `message` and not a concrete name or /// value. /// - /// The [style] and [level] arguments must not be null. - /// /// See also: /// /// * [MessageProperty], which is better suited to messages that are to be @@ -1829,8 +1825,6 @@ class MessageProperty extends DiagnosticsProperty { /// /// Messages have no concrete [value] (so [value] will return null). The /// message is stored as the description. - /// - /// The [name], `message`, and [level] arguments must not be null. MessageProperty( String name, String message, { @@ -1847,8 +1841,6 @@ class MessageProperty extends DiagnosticsProperty { /// instead of describing a property with a string value. class StringProperty extends DiagnosticsProperty { /// Create a diagnostics property for strings. - /// - /// The [showName], [quoted], [style], and [level] arguments must not be null. StringProperty( String super.name, super.value, { @@ -1956,8 +1948,6 @@ abstract class _NumProperty extends DiagnosticsProperty { /// Numeric formatting is optimized for debug message readability. class DoubleProperty extends _NumProperty { /// If specified, [unit] describes the unit for the [value] (e.g. px). - /// - /// The [showName], [style], and [level] arguments must not be null. DoubleProperty( super.name, super.value, { @@ -1974,8 +1964,6 @@ class DoubleProperty extends _NumProperty { /// /// Use if computing the property [value] may throw an exception or is /// expensive. - /// - /// The [showName] and [level] arguments must not be null. DoubleProperty.lazy( super.name, super.computeValue, { @@ -1996,8 +1984,6 @@ class DoubleProperty extends _NumProperty { /// Examples of units include 'px' and 'ms'. class IntProperty extends _NumProperty { /// Create a diagnostics property for integers. - /// - /// The [showName], [style], and [level] arguments must not be null. IntProperty( super.name, super.value, { @@ -2022,8 +2008,6 @@ class PercentProperty extends DoubleProperty { /// Setting [showName] to false is often reasonable for [PercentProperty] /// objects, as the fact that the property is shown as a percentage tends to /// be sufficient to disambiguate its meaning. - /// - /// The [showName] and [level] arguments must not be null. PercentProperty( super.name, super.fraction, { @@ -2096,8 +2080,6 @@ class FlagProperty extends DiagnosticsProperty { /// /// [showName] defaults to false as typically [ifTrue] and [ifFalse] should /// be descriptions that make the property name redundant. - /// - /// The [showName] and [level] arguments must not be null. FlagProperty( String name, { required bool? value, @@ -2196,8 +2178,6 @@ class IterableProperty extends DiagnosticsProperty> { /// empty iterable [value] is not interesting to display similar to how /// [defaultValue] is used to indicate that a specific concrete value is not /// interesting to display. - /// - /// The [style], [showName], [showSeparator], and [level] arguments must not be null. IterableProperty( String super.name, super.value, { @@ -2322,8 +2302,7 @@ class ObjectFlagProperty extends DiagnosticsProperty { /// absent (null), but for which the exact value's [Object.toString] /// representation is not very transparent (e.g. a callback). /// - /// The [showName] and [level] arguments must not be null. Additionally, at - /// least one of [ifPresent] and [ifNull] must not be null. + /// At least one of [ifPresent] or [ifNull] must be non-null. ObjectFlagProperty( String super.name, super.value, { @@ -2337,8 +2316,6 @@ class ObjectFlagProperty extends DiagnosticsProperty { /// /// Only use if prefixing the property name with the word 'has' is a good /// flag name. - /// - /// The [name] and [level] arguments must not be null. ObjectFlagProperty.has( String super.name, super.value, { @@ -2515,9 +2492,6 @@ typedef ComputePropertyValueCallback = T? Function(); class DiagnosticsProperty extends DiagnosticsNode { /// Create a diagnostics property. /// - /// The [showName], [showSeparator], [style], [missingIfNull], and [level] - /// arguments must not be null. - /// /// The [level] argument is just a suggestion and can be overridden if /// something else about the property causes it to have a lower or higher /// level. For example, if the property value is null and [missingIfNull] is @@ -2554,9 +2528,6 @@ class DiagnosticsProperty extends DiagnosticsNode { /// Use if computing the property [value] may throw an exception or is /// expensive. /// - /// The [showName], [showSeparator], [style], [missingIfNull], and [level] - /// arguments must not be null. - /// /// The [level] argument is just a suggestion and can be overridden /// if something else about the property causes it to have a lower or higher /// level. For example, if calling `computeValue` throws an exception, [level] @@ -2694,8 +2665,6 @@ class DiagnosticsProperty extends DiagnosticsNode { /// If a [tooltip] is specified, add the tooltip it to the end of `text` /// enclosing it parenthesis to disambiguate the tooltip from the rest of /// the text. - /// - /// `text` must not be null. String _addTooltip(String text) { return tooltip == null ? text : '$text ($tooltip)'; } @@ -2863,8 +2832,6 @@ class DiagnosticsProperty extends DiagnosticsNode { /// to implement [getChildren] and [getProperties]. class DiagnosticableNode extends DiagnosticsNode { /// Create a diagnostics describing a [Diagnosticable] value. - /// - /// The [value] argument must not be null. DiagnosticableNode({ super.name, required this.value, diff --git a/packages/flutter/lib/src/foundation/stack_frame.dart b/packages/flutter/lib/src/foundation/stack_frame.dart index 8a2f0d61945..b45c82fb731 100644 --- a/packages/flutter/lib/src/foundation/stack_frame.dart +++ b/packages/flutter/lib/src/foundation/stack_frame.dart @@ -22,8 +22,8 @@ import 'object.dart'; class StackFrame { /// Creates a new StackFrame instance. /// - /// All parameters must not be null. The [className] may be the empty string - /// if there is no class (e.g. for a top level library method). + /// The [className] may be the empty string if there is no class (e.g. for a + /// top level library method). const StackFrame({ required this.number, required this.column, diff --git a/packages/flutter/lib/src/gestures/drag_details.dart b/packages/flutter/lib/src/gestures/drag_details.dart index f519c090971..bcf91c3e884 100644 --- a/packages/flutter/lib/src/gestures/drag_details.dart +++ b/packages/flutter/lib/src/gestures/drag_details.dart @@ -20,8 +20,6 @@ export 'velocity_tracker.dart' show Velocity; /// * [DragEndDetails], the details for [GestureDragEndCallback]. class DragDownDetails { /// Creates details for a [GestureDragDownCallback]. - /// - /// The [globalPosition] argument must not be null. DragDownDetails({ this.globalPosition = Offset.zero, Offset? localPosition, @@ -65,8 +63,6 @@ typedef GestureDragDownCallback = void Function(DragDownDetails details); /// * [DragEndDetails], the details for [GestureDragEndCallback]. class DragStartDetails { /// Creates details for a [GestureDragStartCallback]. - /// - /// The [globalPosition] argument must not be null. DragStartDetails({ this.sourceTimeStamp, this.globalPosition = Offset.zero, @@ -128,12 +124,8 @@ typedef GestureDragStartCallback = void Function(DragStartDetails details); class DragUpdateDetails { /// Creates details for a [GestureDragUpdateCallback]. /// - /// The [delta] argument must not be null. - /// /// If [primaryDelta] is non-null, then its value must match one of the /// coordinates of [delta] and the other coordinate must be zero. - /// - /// The [globalPosition] argument must be provided and must not be null. DragUpdateDetails({ this.sourceTimeStamp, this.delta = Offset.zero, @@ -219,8 +211,6 @@ class DragEndDetails { /// If [primaryVelocity] is non-null, its value must match one of the /// coordinates of `velocity.pixelsPerSecond` and the other coordinate /// must be zero. - /// - /// The [velocity] argument must not be null. DragEndDetails({ this.velocity = Velocity.zero, this.primaryVelocity, diff --git a/packages/flutter/lib/src/gestures/events.dart b/packages/flutter/lib/src/gestures/events.dart index be147d6d154..c78f324e723 100644 --- a/packages/flutter/lib/src/gestures/events.dart +++ b/packages/flutter/lib/src/gestures/events.dart @@ -819,8 +819,6 @@ mixin _CopyPointerAddedEvent on PointerEvent { /// made contact with the surface of the device. class PointerAddedEvent extends PointerEvent with _PointerEventDescription, _CopyPointerAddedEvent { /// Creates a pointer added event. - /// - /// All of the arguments must be non-null. const PointerAddedEvent({ super.viewId, super.timeStamp, @@ -914,8 +912,6 @@ mixin _CopyPointerRemovedEvent on PointerEvent { /// detection range or might have been disconnected from the system entirely. class PointerRemovedEvent extends PointerEvent with _PointerEventDescription, _CopyPointerRemovedEvent { /// Creates a pointer removed event. - /// - /// All of the arguments must be non-null. const PointerRemovedEvent({ super.viewId, super.timeStamp, @@ -1024,8 +1020,6 @@ mixin _CopyPointerHoverEvent on PointerEvent { /// events in a widget tree. class PointerHoverEvent extends PointerEvent with _PointerEventDescription, _CopyPointerHoverEvent { /// Creates a pointer hover event. - /// - /// All of the arguments must be non-null. const PointerHoverEvent({ super.viewId, super.timeStamp, @@ -1143,8 +1137,6 @@ mixin _CopyPointerEnterEvent on PointerEvent { /// events in a widget tree. class PointerEnterEvent extends PointerEvent with _PointerEventDescription, _CopyPointerEnterEvent { /// Creates a pointer enter event. - /// - /// All of the arguments must be non-null. const PointerEnterEvent({ super.viewId, super.timeStamp, @@ -1293,8 +1285,6 @@ mixin _CopyPointerExitEvent on PointerEvent { /// events in a widget tree. class PointerExitEvent extends PointerEvent with _PointerEventDescription, _CopyPointerExitEvent { /// Creates a pointer exit event. - /// - /// All of the arguments must be non-null. const PointerExitEvent({ super.viewId, super.timeStamp, @@ -1435,8 +1425,6 @@ mixin _CopyPointerDownEvent on PointerEvent { /// events in a widget tree. class PointerDownEvent extends PointerEvent with _PointerEventDescription, _CopyPointerDownEvent { /// Creates a pointer down event. - /// - /// All of the arguments must be non-null. const PointerDownEvent({ super.viewId, super.timeStamp, @@ -1551,8 +1539,6 @@ mixin _CopyPointerMoveEvent on PointerEvent { /// events in a widget tree. class PointerMoveEvent extends PointerEvent with _PointerEventDescription, _CopyPointerMoveEvent { /// Creates a pointer move event. - /// - /// All of the arguments must be non-null. const PointerMoveEvent({ super.viewId, super.timeStamp, @@ -1668,8 +1654,6 @@ mixin _CopyPointerUpEvent on PointerEvent { /// events in a widget tree. class PointerUpEvent extends PointerEvent with _PointerEventDescription, _CopyPointerUpEvent { /// Creates a pointer up event. - /// - /// All of the arguments must be non-null. const PointerUpEvent({ super.viewId, super.timeStamp, @@ -1802,8 +1786,6 @@ mixin _CopyPointerScrollEvent on PointerEvent { /// participating agents may disambiguate an event's target. class PointerScrollEvent extends PointerSignalEvent with _PointerEventDescription, _CopyPointerScrollEvent { /// Creates a pointer scroll event. - /// - /// All of the arguments must be non-null. const PointerScrollEvent({ super.viewId, super.timeStamp, @@ -1905,8 +1887,6 @@ mixin _CopyPointerScrollInertiaCancelEvent on PointerEvent { /// participating agents may disambiguate an event's target. class PointerScrollInertiaCancelEvent extends PointerSignalEvent with _PointerEventDescription, _CopyPointerScrollInertiaCancelEvent { /// Creates a pointer scroll-inertia cancel event. - /// - /// All of the arguments must be non-null. const PointerScrollInertiaCancelEvent({ super.viewId, super.timeStamp, @@ -1994,8 +1974,6 @@ mixin _CopyPointerScaleEvent on PointerEvent { /// participating agents may disambiguate an event's target. class PointerScaleEvent extends PointerSignalEvent with _PointerEventDescription, _CopyPointerScaleEvent { /// Creates a pointer scale event. - /// - /// All of the arguments must be non-null. const PointerScaleEvent({ super.viewId, super.timeStamp, @@ -2080,8 +2058,6 @@ mixin _CopyPointerPanZoomStartEvent on PointerEvent { /// events in a widget tree. class PointerPanZoomStartEvent extends PointerEvent with _PointerEventDescription, _CopyPointerPanZoomStartEvent { /// Creates a pointer pan/zoom start event. - /// - /// All of the arguments must be non-null. const PointerPanZoomStartEvent({ super.viewId, super.timeStamp, @@ -2183,8 +2159,6 @@ mixin _CopyPointerPanZoomUpdateEvent on PointerEvent { /// events in a widget tree. class PointerPanZoomUpdateEvent extends PointerEvent with _PointerEventDescription, _CopyPointerPanZoomUpdateEvent { /// Creates a pointer pan/zoom update event. - /// - /// All of the arguments must be non-null. const PointerPanZoomUpdateEvent({ super.viewId, super.timeStamp, @@ -2303,8 +2277,6 @@ mixin _CopyPointerPanZoomEndEvent on PointerEvent { /// events in a widget tree. class PointerPanZoomEndEvent extends PointerEvent with _PointerEventDescription, _CopyPointerPanZoomEndEvent { /// Creates a pointer pan/zoom end event. - /// - /// All of the arguments must be non-null. const PointerPanZoomEndEvent({ super.viewId, super.timeStamp, @@ -2397,8 +2369,6 @@ mixin _CopyPointerCancelEvent on PointerEvent { /// events in a widget tree. class PointerCancelEvent extends PointerEvent with _PointerEventDescription, _CopyPointerCancelEvent { /// Creates a pointer cancel event. - /// - /// All of the arguments must be non-null. const PointerCancelEvent({ super.viewId, super.timeStamp, diff --git a/packages/flutter/lib/src/gestures/force_press.dart b/packages/flutter/lib/src/gestures/force_press.dart index dc0d19ff933..d17255a8f19 100644 --- a/packages/flutter/lib/src/gestures/force_press.dart +++ b/packages/flutter/lib/src/gestures/force_press.dart @@ -46,8 +46,6 @@ enum _ForceState { class ForcePressDetails { /// Creates details for a [GestureForcePressStartCallback], /// [GestureForcePressPeakCallback] or [GestureForcePressEndCallback]. - /// - /// The [globalPosition] argument must not be null. ForcePressDetails({ required this.globalPosition, Offset? localPosition, diff --git a/packages/flutter/lib/src/gestures/long_press.dart b/packages/flutter/lib/src/gestures/long_press.dart index 1c759c21612..f5fef32b429 100644 --- a/packages/flutter/lib/src/gestures/long_press.dart +++ b/packages/flutter/lib/src/gestures/long_press.dart @@ -107,8 +107,6 @@ typedef GestureLongPressEndCallback = void Function(LongPressEndDetails details) class LongPressDownDetails { /// Creates the details for a [GestureLongPressDownCallback]. /// - /// The `globalPosition` argument must not be null. - /// /// If the `localPosition` argument is not specified, it will default to the /// global position. const LongPressDownDetails({ @@ -136,8 +134,6 @@ class LongPressDownDetails { /// * [LongPressEndDetails], the details for [GestureLongPressEndCallback]. class LongPressStartDetails { /// Creates the details for a [GestureLongPressStartCallback]. - /// - /// The [globalPosition] argument must not be null. const LongPressStartDetails({ this.globalPosition = Offset.zero, Offset? localPosition, @@ -159,8 +155,6 @@ class LongPressStartDetails { /// * [LongPressStartDetails], the details for [GestureLongPressStartCallback]. class LongPressMoveUpdateDetails { /// Creates the details for a [GestureLongPressMoveUpdateCallback]. - /// - /// The [globalPosition] and [offsetFromOrigin] arguments must not be null. const LongPressMoveUpdateDetails({ this.globalPosition = Offset.zero, Offset? localPosition, @@ -195,8 +189,6 @@ class LongPressMoveUpdateDetails { /// * [LongPressStartDetails], the details for [GestureLongPressStartCallback]. class LongPressEndDetails { /// Creates the details for a [GestureLongPressEndCallback]. - /// - /// The [globalPosition] argument must not be null. const LongPressEndDetails({ this.globalPosition = Offset.zero, Offset? localPosition, diff --git a/packages/flutter/lib/src/gestures/lsq_solver.dart b/packages/flutter/lib/src/gestures/lsq_solver.dart index 46a05d70366..edd2548e9d8 100644 --- a/packages/flutter/lib/src/gestures/lsq_solver.dart +++ b/packages/flutter/lib/src/gestures/lsq_solver.dart @@ -95,8 +95,6 @@ class PolynomialFit { /// Uses the least-squares algorithm to fit a polynomial to a set of data. class LeastSquaresSolver { /// Creates a least-squares solver. - /// - /// The [x], [y], and [w] arguments must not be null. LeastSquaresSolver(this.x, this.y, this.w) : assert(x.length == y.length), assert(y.length == w.length); diff --git a/packages/flutter/lib/src/gestures/monodrag.dart b/packages/flutter/lib/src/gestures/monodrag.dart index 31a2a028486..7904ab2be69 100644 --- a/packages/flutter/lib/src/gestures/monodrag.dart +++ b/packages/flutter/lib/src/gestures/monodrag.dart @@ -70,8 +70,6 @@ typedef GestureVelocityTrackerBuilder = VelocityTracker Function(PointerEvent ev abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer { /// Initialize the object. /// - /// [dragStartBehavior] must not be null. - /// /// {@macro flutter.gestures.GestureRecognizer.supportedDevices} DragGestureRecognizer({ super.debugOwner, diff --git a/packages/flutter/lib/src/gestures/multidrag.dart b/packages/flutter/lib/src/gestures/multidrag.dart index cab4e7948f5..3d850573b52 100644 --- a/packages/flutter/lib/src/gestures/multidrag.dart +++ b/packages/flutter/lib/src/gestures/multidrag.dart @@ -32,8 +32,6 @@ typedef GestureMultiDragStartCallback = Drag? Function(Offset position); /// each pointer is a subclass of [MultiDragPointerState]. abstract class MultiDragPointerState { /// Creates per-pointer state for a [MultiDragGestureRecognizer]. - /// - /// The [initialPosition] argument must not be null. MultiDragPointerState(this.initialPosition, this.kind, this.gestureSettings) : _velocityTracker = VelocityTracker.withKind(kind); diff --git a/packages/flutter/lib/src/gestures/scale.dart b/packages/flutter/lib/src/gestures/scale.dart index 11b53cf52d4..b1dbe36708e 100644 --- a/packages/flutter/lib/src/gestures/scale.dart +++ b/packages/flutter/lib/src/gestures/scale.dart @@ -96,8 +96,6 @@ class _PointerPanZoomData { /// Details for [GestureScaleStartCallback]. class ScaleStartDetails { /// Creates details for [GestureScaleStartCallback]. - /// - /// The [focalPoint] argument must not be null. ScaleStartDetails({ this.focalPoint = Offset.zero, Offset? localFocalPoint, @@ -139,9 +137,8 @@ class ScaleStartDetails { class ScaleUpdateDetails { /// Creates details for [GestureScaleUpdateCallback]. /// - /// The [focalPoint], [scale], [horizontalScale], [verticalScale], [rotation] - /// arguments must not be null. The [scale], [horizontalScale], and [verticalScale] - /// argument must be greater than or equal to zero. + /// The [scale], [horizontalScale], and [verticalScale] arguments must be + /// greater than or equal to zero. ScaleUpdateDetails({ this.focalPoint = Offset.zero, Offset? localFocalPoint, @@ -243,8 +240,6 @@ class ScaleUpdateDetails { /// Details for [GestureScaleEndCallback]. class ScaleEndDetails { /// Creates details for [GestureScaleEndCallback]. - /// - /// The [velocity] argument must not be null. ScaleEndDetails({ this.velocity = Velocity.zero, this.scaleVelocity = 0, this.pointerCount = 0 }); /// The velocity of the last pointer to be lifted off of the screen. diff --git a/packages/flutter/lib/src/gestures/tap.dart b/packages/flutter/lib/src/gestures/tap.dart index 88ea7808fe5..d522c799110 100644 --- a/packages/flutter/lib/src/gestures/tap.dart +++ b/packages/flutter/lib/src/gestures/tap.dart @@ -26,8 +26,6 @@ export 'events.dart' show PointerCancelEvent, PointerDownEvent, PointerEvent, Po /// * [TapGestureRecognizer], which passes this information to one of its callbacks. class TapDownDetails { /// Creates details for a [GestureTapDownCallback]. - /// - /// The [globalPosition] argument must not be null. TapDownDetails({ this.globalPosition = Offset.zero, Offset? localPosition, @@ -65,7 +63,7 @@ typedef GestureTapDownCallback = void Function(TapDownDetails details); /// * [GestureDetector.onTapUp], which receives this information. /// * [TapGestureRecognizer], which passes this information to one of its callbacks. class TapUpDetails { - /// The [globalPosition] argument must not be null. + /// Creates a [TapUpDetails] data object. TapUpDetails({ required this.kind, this.globalPosition = Offset.zero, diff --git a/packages/flutter/lib/src/gestures/tap_and_drag.dart b/packages/flutter/lib/src/gestures/tap_and_drag.dart index 31aa233c804..108beaf024e 100644 --- a/packages/flutter/lib/src/gestures/tap_and_drag.dart +++ b/packages/flutter/lib/src/gestures/tap_and_drag.dart @@ -76,9 +76,6 @@ typedef GestureTapDragDownCallback = void Function(TapDragDownDetails details); /// * [TapDragEndDetails], the details for [GestureTapDragEndCallback]. class TapDragDownDetails with Diagnosticable { /// Creates details for a [GestureTapDragDownCallback]. - /// - /// The [globalPosition], [localPosition], and [consecutiveTapCount] - /// arguments must be provided and must not be null. TapDragDownDetails({ required this.globalPosition, required this.localPosition, @@ -130,9 +127,6 @@ typedef GestureTapDragUpCallback = void Function(TapDragUpDetails details); /// * [TapDragEndDetails], the details for [GestureTapDragEndCallback]. class TapDragUpDetails with Diagnosticable { /// Creates details for a [GestureTapDragUpCallback]. - /// - /// The [kind], [globalPosition], [localPosition], and [consecutiveTapCount] - /// arguments must be provided and must not be null. TapDragUpDetails({ required this.kind, required this.globalPosition, @@ -184,9 +178,6 @@ typedef GestureTapDragStartCallback = void Function(TapDragStartDetails details) /// * [TapDragEndDetails], the details for [GestureTapDragEndCallback]. class TapDragStartDetails with Diagnosticable { /// Creates details for a [GestureTapDragStartCallback]. - /// - /// The [globalPosition], [localPosition], and [consecutiveTapCount] - /// arguments must be provided and must not be null. TapDragStartDetails({ this.sourceTimeStamp, required this.globalPosition, @@ -253,13 +244,8 @@ typedef GestureTapDragUpdateCallback = void Function(TapDragUpdateDetails detail class TapDragUpdateDetails with Diagnosticable { /// Creates details for a [GestureTapDragUpdateCallback]. /// - /// The [delta] argument must not be null. - /// /// If [primaryDelta] is non-null, then its value must match one of the /// coordinates of [delta] and the other coordinate must be zero. - /// - /// The [globalPosition], [localPosition], [offsetFromOrigin], [localOffsetFromOrigin], - /// and [consecutiveTapCount] arguments must be provided and must not be null. TapDragUpdateDetails({ this.sourceTimeStamp, this.delta = Offset.zero, @@ -378,10 +364,6 @@ typedef GestureTapDragEndCallback = void Function(TapDragEndDetails endDetails); /// * [TapDragUpdateDetails], the details for [GestureTapDragUpdateCallback]. class TapDragEndDetails with Diagnosticable { /// Creates details for a [GestureTapDragEndCallback]. - /// - /// The [velocity] argument must not be null. - /// - /// The [consecutiveTapCount] argument must be provided and must not be null. TapDragEndDetails({ this.velocity = Velocity.zero, this.primaryVelocity, diff --git a/packages/flutter/lib/src/gestures/velocity_tracker.dart b/packages/flutter/lib/src/gestures/velocity_tracker.dart index 414eb6cc17e..ca7aa468a01 100644 --- a/packages/flutter/lib/src/gestures/velocity_tracker.dart +++ b/packages/flutter/lib/src/gestures/velocity_tracker.dart @@ -13,9 +13,7 @@ export 'dart:ui' show Offset, PointerDeviceKind; /// A velocity in two dimensions. @immutable class Velocity { - /// Creates a velocity. - /// - /// The [pixelsPerSecond] argument must not be null. + /// Creates a [Velocity]. const Velocity({ required this.pixelsPerSecond, }); @@ -90,8 +88,6 @@ class Velocity { /// useful velocity operations. class VelocityEstimate { /// Creates a dimensional velocity estimate. - /// - /// [pixelsPerSecond], [confidence], [duration], and [offset] must not be null. const VelocityEstimate({ required this.pixelsPerSecond, required this.confidence, diff --git a/packages/flutter/lib/src/rendering/table_border.dart b/packages/flutter/lib/src/rendering/table_border.dart index a5fbf5a94e8..97f2c6b9e47 100644 --- a/packages/flutter/lib/src/rendering/table_border.dart +++ b/packages/flutter/lib/src/rendering/table_border.dart @@ -204,6 +204,9 @@ class TableBorder { required Iterable rows, required Iterable columns, }) { + // properties can't be null + + // arguments can't be null assert(rows.isEmpty || (rows.first >= 0.0 && rows.last <= rect.height)); assert(columns.isEmpty || (columns.first >= 0.0 && columns.last <= rect.width)); diff --git a/packages/flutter/lib/src/semantics/semantics.dart b/packages/flutter/lib/src/semantics/semantics.dart index 21e14f3d188..29f87d6f943 100644 --- a/packages/flutter/lib/src/semantics/semantics.dart +++ b/packages/flutter/lib/src/semantics/semantics.dart @@ -211,7 +211,7 @@ class ChildSemanticsConfigurationsResultBuilder { class CustomSemanticsAction { /// Creates a new [CustomSemanticsAction]. /// - /// The [label] must not be null or the empty string. + /// The [label] must not be empty. const CustomSemanticsAction({required String this.label}) : assert(label != ''), hint = null, @@ -220,7 +220,7 @@ class CustomSemanticsAction { /// Creates a new [CustomSemanticsAction] that overrides a standard semantics /// action. /// - /// The [hint] must not be null or the empty string. + /// The [hint] must not be empty. const CustomSemanticsAction.overridingAction({required String this.hint, required SemanticsAction this.action}) : assert(hint != ''), label = null; @@ -411,8 +411,6 @@ class AttributedStringProperty extends DiagnosticsProperty { class SemanticsData with Diagnosticable { /// Creates a semantics data object. /// - /// The [flags], [actions], [label], and [Rect] arguments must not be null. - /// /// If [label] is not empty, then [textDirection] must also not be null. SemanticsData({ required this.flags, @@ -4994,7 +4992,7 @@ abstract class SemanticsSortKey with Diagnosticable implements Comparable class BasicMessageChannel { - /// Creates a [BasicMessageChannel] with the specified [name], [codec] and [binaryMessenger]. + /// Creates a [BasicMessageChannel] with the specified [name], [codec] and + /// [binaryMessenger]. /// - /// The [name] and [codec] arguments cannot be null. The default [ServicesBinding.defaultBinaryMessenger] - /// instance is used if [binaryMessenger] is null. + /// The default [ServicesBinding.defaultBinaryMessenger] instance is used if + /// [binaryMessenger] is null. const BasicMessageChannel(this.name, this.codec, { BinaryMessenger? binaryMessenger }) : _binaryMessenger = binaryMessenger; @@ -253,8 +254,8 @@ class MethodChannel { /// The [codec] used will be [StandardMethodCodec], unless otherwise /// specified. /// - /// The [name] and [codec] arguments cannot be null. The default [ServicesBinding.defaultBinaryMessenger] - /// instance is used if [binaryMessenger] is null. + /// The default [ServicesBinding.defaultBinaryMessenger] instance is used if + /// [binaryMessenger] is null. const MethodChannel(this.name, [this.codec = const StandardMethodCodec(), BinaryMessenger? binaryMessenger ]) : _binaryMessenger = binaryMessenger; diff --git a/packages/flutter/lib/src/services/platform_views.dart b/packages/flutter/lib/src/services/platform_views.dart index c1774998ff6..0fb11448382 100644 --- a/packages/flutter/lib/src/services/platform_views.dart +++ b/packages/flutter/lib/src/services/platform_views.dart @@ -58,7 +58,7 @@ class PlatformViewsRegistry { /// Callback signature for when a platform view was created. /// -/// `id` is the platform view's unique identifier. +/// The `id` parameter is the platform view's unique identifier. typedef PlatformViewCreatedCallback = void Function(int id); /// Provides access to the platform views service. @@ -92,28 +92,33 @@ class PlatformViewsService { /// {@template flutter.services.PlatformViewsService.initAndroidView} /// Creates a controller for a new Android view. /// - /// `id` is an unused unique identifier generated with [platformViewsRegistry]. + /// The `id` argument is an unused unique identifier generated with + /// [platformViewsRegistry]. /// - /// `viewType` is the identifier of the Android view type to be created, a - /// factory for this view type must have been registered on the platform side. - /// Platform view factories are typically registered by plugin code. - /// Plugins can register a platform view factory with + /// The `viewType` argument is the identifier of the Android view type to be + /// created, a factory for this view type must have been registered on the + /// platform side. Platform view factories are typically registered by plugin + /// code. Plugins can register a platform view factory with /// [PlatformViewRegistry#registerViewFactory](/javadoc/io/flutter/plugin/platform/PlatformViewRegistry.html#registerViewFactory-java.lang.String-io.flutter.plugin.platform.PlatformViewFactory-). /// - /// `creationParams` will be passed as the args argument of [PlatformViewFactory#create](/javadoc/io/flutter/plugin/platform/PlatformViewFactory.html#create-android.content.Context-int-java.lang.Object-) + /// The `creationParams` argument will be passed as the args argument of + /// [PlatformViewFactory#create](/javadoc/io/flutter/plugin/platform/PlatformViewFactory.html#create-android.content.Context-int-java.lang.Object-) /// - /// `creationParamsCodec` is the codec used to encode `creationParams` before sending it to the - /// platform side. It should match the codec passed to the constructor of [PlatformViewFactory](/javadoc/io/flutter/plugin/platform/PlatformViewFactory.html#PlatformViewFactory-io.flutter.plugin.common.MessageCodec-). - /// This is typically one of: [StandardMessageCodec], [JSONMessageCodec], [StringCodec], or [BinaryCodec]. + /// The `creationParamsCodec` argument is the codec used to encode + /// `creationParams` before sending it to the platform side. It should match + /// the codec passed to the constructor of + /// [PlatformViewFactory](/javadoc/io/flutter/plugin/platform/PlatformViewFactory.html#PlatformViewFactory-io.flutter.plugin.common.MessageCodec-). + /// This is typically one of: [StandardMessageCodec], [JSONMessageCodec], + /// [StringCodec], or [BinaryCodec]. /// - /// `onFocus` is a callback that will be invoked when the Android View asks to get the - /// input focus. + /// The `onFocus` argument is a callback that will be invoked when the Android + /// View asks to get the input focus. /// - /// The Android view will only be created after [AndroidViewController.setSize] is called for the - /// first time. + /// The Android view will only be created after + /// [AndroidViewController.setSize] is called for the first time. /// - /// The `id, `viewType, and `layoutDirection` parameters must not be null. - /// If `creationParams` is non null then `creationParamsCodec` must not be null. + /// If `creationParams` is non null then `creationParamsCodec` must not be + /// null. /// {@endtemplate} /// /// This attempts to use the newest and most efficient platform view @@ -196,19 +201,23 @@ class PlatformViewsService { return controller; } - // TODO(amirh): reference the iOS plugin API for registering a UIView factory once it lands. - /// This is work in progress, not yet ready to be used, and requires a custom engine build. Creates a controller for a new iOS UIView. + // TODO(amirh): reference the iOS plugin API for registering a UIView factory + // once it lands. + + /// This is work in progress, not yet ready to be used, and requires a custom + /// engine build. Creates a controller for a new iOS UIView. /// - /// `id` is an unused unique identifier generated with [platformViewsRegistry]. + /// The `id` parameter is an unused unique identifier generated with + /// [platformViewsRegistry]. /// - /// `viewType` is the identifier of the iOS view type to be created, a - /// factory for this view type must have been registered on the platform side. - /// Platform view factories are typically registered by plugin code. + /// The `viewType` parameter is the identifier of the iOS view type to be + /// created, a factory for this view type must have been registered on the + /// platform side. Platform view factories are typically registered by plugin + /// code. /// - /// `onFocus` is a callback that will be invoked when the UIKit view asks to - /// get the input focus. - /// The `id, `viewType, and `layoutDirection` parameters must not be null. - /// If `creationParams` is non null then `creationParamsCodec` must not be null. + /// The `onFocus` parameter is a callback that will be invoked when the UIKit + /// view asks to get the input focus. If `creationParams` is non null then + /// `creationParamsCodec` must not be null. static Future initUiKitView({ required int id, required String viewType, @@ -242,16 +251,17 @@ class PlatformViewsService { /// Factory method to create an `AppKitView`. /// - /// `id` is an unused unique identifier generated with [platformViewsRegistry]. + /// The `id` parameter is an unused unique identifier generated with + /// [platformViewsRegistry]. /// - /// `viewType` is the identifier of the iOS view type to be created, a - /// factory for this view type must have been registered on the platform side. - /// Platform view factories are typically registered by plugin code. + /// The `viewType` parameter is the identifier of the iOS view type to be + /// created, a factory for this view type must have been registered on the + /// platform side. Platform view factories are typically registered by plugin + /// code. /// - /// `onFocus` is a callback that will be invoked when the UIKit view asks to - /// get the input focus. - /// The `id, `viewType, and `layoutDirection` parameters must not be null. - /// If `creationParams` is non null then `creationParamsCodec` must not be null. + /// The `onFocus` parameter is a callback that will be invoked when the UIKit + /// view asks to get the input focus. If `creationParams` is non null then + /// `creationParamsCodec` must not be null. static Future initAppKitView({ required int id, required String viewType, @@ -289,8 +299,6 @@ class PlatformViewsService { /// A Dart version of Android's [MotionEvent.PointerProperties](https://developer.android.com/reference/android/view/MotionEvent.PointerProperties). class AndroidPointerProperties { /// Creates an [AndroidPointerProperties] object. - /// - /// All parameters must not be null. const AndroidPointerProperties({ required this.id, required this.toolType, @@ -331,8 +339,6 @@ class AndroidPointerProperties { /// A Dart version of Android's [MotionEvent.PointerCoords](https://developer.android.com/reference/android/view/MotionEvent.PointerCoords). class AndroidPointerCoords { /// Creates an AndroidPointerCoords. - /// - /// All parameters must not be null. const AndroidPointerCoords({ required this.orientation, required this.pressure, @@ -413,8 +419,6 @@ class AndroidPointerCoords { /// * [AndroidViewController.sendMotionEvent], which can be used to send an [AndroidMotionEvent] explicitly. class AndroidMotionEvent { /// Creates an AndroidMotionEvent. - /// - /// All parameters must not be null. AndroidMotionEvent({ required this.downTime, required this.eventTime, @@ -807,8 +811,8 @@ abstract class AndroidViewController extends PlatformViewController { /// Sizes the Android View. /// - /// [size] is the view's new size in logical pixel, it must not be null and must - /// be bigger than zero. + /// [size] is the view's new size in logical pixel. It must be greater than + /// zero. /// /// The first time a size is set triggers the creation of the Android view. /// diff --git a/packages/flutter/lib/src/services/raw_keyboard_android.dart b/packages/flutter/lib/src/services/raw_keyboard_android.dart index 4de79dad956..c6f07ed11f3 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_android.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_android.dart @@ -27,9 +27,6 @@ const int _kCombiningCharacterMask = 0x7fffffff; /// * [RawKeyboard], which uses this interface to expose key data. class RawKeyEventDataAndroid extends RawKeyEventData { /// Creates a key event data structure specific for Android. - /// - /// The [flags], [codePoint], [keyCode], [scanCode], and [metaState] arguments - /// must not be null. const RawKeyEventDataAndroid({ this.flags = 0, this.codePoint = 0, diff --git a/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart b/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart index 3f74d084005..3331a78dd70 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_fuchsia.dart @@ -22,8 +22,6 @@ export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; /// * [RawKeyboard], which uses this interface to expose key data. class RawKeyEventDataFuchsia extends RawKeyEventData { /// Creates a key event data structure specific for Fuchsia. - /// - /// The [hidUsage], [codePoint], and [modifiers] arguments must not be null. const RawKeyEventDataFuchsia({ this.hidUsage = 0, this.codePoint = 0, diff --git a/packages/flutter/lib/src/services/raw_keyboard_ios.dart b/packages/flutter/lib/src/services/raw_keyboard_ios.dart index 841d8425b6c..74cded59a6a 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_ios.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_ios.dart @@ -22,9 +22,6 @@ export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; /// * [RawKeyboard], which uses this interface to expose key data. class RawKeyEventDataIos extends RawKeyEventData { /// Creates a key event data structure specific for iOS. - /// - /// The [characters], [charactersIgnoringModifiers], and [modifiers], arguments - /// must not be null. const RawKeyEventDataIos({ this.characters = '', this.charactersIgnoringModifiers = '', diff --git a/packages/flutter/lib/src/services/raw_keyboard_linux.dart b/packages/flutter/lib/src/services/raw_keyboard_linux.dart index 81c128d0a37..d01a9a8e6d1 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_linux.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_linux.dart @@ -22,9 +22,6 @@ export 'raw_keyboard.dart' show KeyboardSide, ModifierKey; /// * [RawKeyboard], which uses this interface to expose key data. class RawKeyEventDataLinux extends RawKeyEventData { /// Creates a key event data structure specific for Linux. - /// - /// The [keyHelper], [scanCode], [unicodeScalarValues], [keyCode], and [modifiers], - /// arguments must not be null. const RawKeyEventDataLinux({ required this.keyHelper, this.unicodeScalarValues = 0, diff --git a/packages/flutter/lib/src/services/raw_keyboard_macos.dart b/packages/flutter/lib/src/services/raw_keyboard_macos.dart index 4f33c8617b8..1d0476d8032 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_macos.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_macos.dart @@ -33,9 +33,6 @@ int runeToLowerCase(int rune) { /// * [RawKeyboard], which uses this interface to expose key data. class RawKeyEventDataMacOs extends RawKeyEventData { /// Creates a key event data structure specific for macOS. - /// - /// The [characters], [charactersIgnoringModifiers], and [modifiers], arguments - /// must not be null. const RawKeyEventDataMacOs({ this.characters = '', this.charactersIgnoringModifiers = '', diff --git a/packages/flutter/lib/src/services/raw_keyboard_web.dart b/packages/flutter/lib/src/services/raw_keyboard_web.dart index 8cc289b79d2..c3d114e706d 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_web.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_web.dart @@ -27,8 +27,6 @@ String? _unicodeChar(String key) { @immutable class RawKeyEventDataWeb extends RawKeyEventData { /// Creates a key event data structure specific for Web. - /// - /// The [code] and [metaState] arguments must not be null. const RawKeyEventDataWeb({ required this.code, required this.key, diff --git a/packages/flutter/lib/src/services/raw_keyboard_windows.dart b/packages/flutter/lib/src/services/raw_keyboard_windows.dart index 2c2376a38ee..3110b5aebcf 100644 --- a/packages/flutter/lib/src/services/raw_keyboard_windows.dart +++ b/packages/flutter/lib/src/services/raw_keyboard_windows.dart @@ -27,9 +27,6 @@ const int _vkProcessKey = 0xe5; /// * [RawKeyboard], which uses this interface to expose key data. class RawKeyEventDataWindows extends RawKeyEventData { /// Creates a key event data structure specific for Windows. - /// - /// The [keyCode], [scanCode], [characterCodePoint], and [modifiers], arguments - /// must not be null. const RawKeyEventDataWindows({ this.keyCode = 0, this.scanCode = 0, diff --git a/packages/flutter/lib/src/services/restoration.dart b/packages/flutter/lib/src/services/restoration.dart index 4bb7811f527..694f2f63ce5 100644 --- a/packages/flutter/lib/src/services/restoration.dart +++ b/packages/flutter/lib/src/services/restoration.dart @@ -495,8 +495,6 @@ class RestorationBucket { /// claiming a child from a parent via [claimChild]. If no parent bucket is /// available, [RestorationManager.rootBucket] may be used as a parent. /// {@endtemplate} - /// - /// The `restorationId` must not be null. RestorationBucket.empty({ required String restorationId, required Object? debugOwner, @@ -529,8 +527,6 @@ class RestorationBucket { /// ``` /// /// {@macro flutter.services.RestorationBucket.empty.bucketCreation} - /// - /// The `manager` argument must not be null. RestorationBucket.root({ required RestorationManager manager, required Map? rawData, @@ -551,8 +547,6 @@ class RestorationBucket { /// [RestorationBucket.empty] and have the parent adopt it via [adoptChild]. /// /// {@macro flutter.services.RestorationBucket.empty.bucketCreation} - /// - /// The `restorationId` and `parent` argument must not be null. RestorationBucket.child({ required String restorationId, required RestorationBucket parent, diff --git a/packages/flutter/lib/src/services/text_editing.dart b/packages/flutter/lib/src/services/text_editing.dart index 6dae30a85f1..d1d91c20ef2 100644 --- a/packages/flutter/lib/src/services/text_editing.dart +++ b/packages/flutter/lib/src/services/text_editing.dart @@ -12,8 +12,6 @@ export 'dart:ui' show TextAffinity, TextPosition; @immutable class TextSelection extends TextRange { /// Creates a text selection. - /// - /// The [baseOffset] and [extentOffset] arguments must not be null. const TextSelection({ required this.baseOffset, required this.extentOffset, @@ -29,8 +27,6 @@ class TextSelection extends TextRange { /// A collapsed selection starts and ends at the same offset, which means it /// contains zero characters but instead serves as an insertion point in the /// text. - /// - /// The [offset] argument must not be null. const TextSelection.collapsed({ required int offset, this.affinity = TextAffinity.downstream, diff --git a/packages/flutter/lib/src/services/text_editing_delta.dart b/packages/flutter/lib/src/services/text_editing_delta.dart index a93c46ad497..aff97541467 100644 --- a/packages/flutter/lib/src/services/text_editing_delta.dart +++ b/packages/flutter/lib/src/services/text_editing_delta.dart @@ -56,10 +56,6 @@ bool _debugTextRangeIsValid(TextRange range, String text) { /// to true. abstract class TextEditingDelta with Diagnosticable { /// Creates a delta for a given change to the editing state. - /// - /// {@template flutter.services.TextEditingDelta} - /// The [oldText], [selection], and [composing] arguments must not be null. - /// {@endtemplate} const TextEditingDelta({ required this.oldText, required this.selection, @@ -251,8 +247,6 @@ abstract class TextEditingDelta with Diagnosticable { class TextEditingDeltaInsertion extends TextEditingDelta { /// Creates an insertion delta for a given change to the editing state. /// - /// {@macro flutter.services.TextEditingDelta} - /// /// {@template flutter.services.TextEditingDelta.optIn} /// See also: /// @@ -304,8 +298,6 @@ class TextEditingDeltaInsertion extends TextEditingDelta { class TextEditingDeltaDeletion extends TextEditingDelta { /// Creates a deletion delta for a given change to the editing state. /// - /// {@macro flutter.services.TextEditingDelta} - /// /// {@macro flutter.services.TextEditingDelta.optIn} const TextEditingDeltaDeletion({ required super.oldText, @@ -356,8 +348,6 @@ class TextEditingDeltaReplacement extends TextEditingDelta { /// A replacement can occur in cases such as auto-correct, suggestions, and /// when a selection is replaced by a single character. /// - /// {@macro flutter.services.TextEditingDelta} - /// /// {@macro flutter.services.TextEditingDelta.optIn} const TextEditingDeltaReplacement({ required super.oldText, @@ -413,8 +403,6 @@ class TextEditingDeltaNonTextUpdate extends TextEditingDelta { /// handles. There are no changes to the text, but there are updates to the selection /// and potentially the composing region as well. /// - /// {@macro flutter.services.TextEditingDelta} - /// /// {@macro flutter.services.TextEditingDelta.optIn} const TextEditingDeltaNonTextUpdate({ required super.oldText, diff --git a/packages/flutter/lib/src/services/text_formatter.dart b/packages/flutter/lib/src/services/text_formatter.dart index d3c205b8489..92d9570a13f 100644 --- a/packages/flutter/lib/src/services/text_formatter.dart +++ b/packages/flutter/lib/src/services/text_formatter.dart @@ -271,9 +271,6 @@ class FilteringTextInputFormatter extends TextInputFormatter { /// If [allow] is false, then the filter pattern is a deny list, /// and characters that match the pattern are rejected. See also /// the [FilteringTextInputFormatter.deny] constructor. - /// - /// The [filterPattern], [allow], and [replacementString] arguments - /// must not be null. FilteringTextInputFormatter( this.filterPattern, { required this.allow, @@ -281,18 +278,12 @@ class FilteringTextInputFormatter extends TextInputFormatter { }); /// Creates a formatter that only allows characters matching a pattern. - /// - /// The [filterPattern] and [replacementString] arguments - /// must not be null. FilteringTextInputFormatter.allow( Pattern filterPattern, { String replacementString = '', }) : this(filterPattern, allow: true, replacementString: replacementString); /// Creates a formatter that blocks characters matching a pattern. - /// - /// The [filterPattern] and [replacementString] arguments - /// must not be null. FilteringTextInputFormatter.deny( Pattern filterPattern, { String replacementString = '', diff --git a/packages/flutter/lib/src/services/text_input.dart b/packages/flutter/lib/src/services/text_input.dart index 29684ccb8d8..ae7efa8ff00 100644 --- a/packages/flutter/lib/src/services/text_input.dart +++ b/packages/flutter/lib/src/services/text_input.dart @@ -566,7 +566,7 @@ class TextInputConfiguration { /// [autocorrect], so that suggestions are only shown when [autocorrect] is /// true. On Android autocorrection and suggestion are controlled separately. /// - /// Defaults to true. Cannot be null. + /// Defaults to true. /// /// See also: /// @@ -580,7 +580,7 @@ class TextInputConfiguration { /// change is sent through semantics actions and is directly disabled from /// the widget side. /// - /// Defaults to true. Cannot be null. + /// Defaults to true. final bool enableInteractiveSelection; /// What text to display in the text input control's action button. @@ -612,7 +612,7 @@ class TextInputConfiguration { /// /// This flag only affects Android. On iOS, there is no equivalent flag. /// - /// Defaults to true. Cannot be null. + /// Defaults to true. /// /// See also: /// @@ -684,7 +684,7 @@ class TextInputConfiguration { /// * If [TextInputClient] is implemented then updates for the editing /// state will come through [TextInputClient.updateEditingValue]. /// - /// Defaults to false. Cannot be null. + /// Defaults to false. final bool enableDeltaModel; /// Returns a representation of this object as a JSON object. @@ -762,9 +762,6 @@ class TextEditingValue { /// The selection and composing range must be within the text. This is not /// checked during construction, and must be guaranteed by the caller. /// - /// The [text], [selection], and [composing] arguments must not be null but - /// each have default values. - /// /// The default value of [selection] is `TextSelection.collapsed(offset: -1)`. /// This indicates that there is no selection at all. const TextEditingValue({ @@ -1398,8 +1395,8 @@ class TextInputConnection { /// Send the smallest rect that covers the text in the client that's currently /// being composed. /// - /// The given `rect` can not be null. If any of the 4 coordinates of the given - /// [Rect] is not finite, a [Rect] of size (-1, -1) will be sent instead. + /// If any of the 4 coordinates of the given [Rect] is not finite, a [Rect] of + /// size (-1, -1) will be sent instead. /// /// This information is used for positioning the IME candidates menu on each /// platform. diff --git a/packages/flutter_driver/lib/src/common/wait.dart b/packages/flutter_driver/lib/src/common/wait.dart index 0c19ce48c68..73a3424e13e 100644 --- a/packages/flutter_driver/lib/src/common/wait.dart +++ b/packages/flutter_driver/lib/src/common/wait.dart @@ -12,8 +12,6 @@ class WaitForCondition extends Command { const WaitForCondition(this.condition, {super.timeout}); /// Deserializes this command from the value generated by [serialize]. - /// - /// The [json] argument cannot be null. WaitForCondition.deserialize(super.json) : condition = _deserialize(json), super.deserialize(); diff --git a/packages/flutter_goldens/lib/flutter_goldens.dart b/packages/flutter_goldens/lib/flutter_goldens.dart index 2e53f34233c..d9b901e2670 100644 --- a/packages/flutter_goldens/lib/flutter_goldens.dart +++ b/packages/flutter_goldens/lib/flutter_goldens.dart @@ -97,11 +97,11 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator { }); /// The directory to which golden file URIs will be resolved in [compare] and - /// [update], cannot be null. + /// [update]. final Uri basedir; /// A client for uploading image tests and making baseline requests to the - /// Flutter Gold Dashboard, cannot be null. + /// Flutter Gold Dashboard. final SkiaGoldClient skiaClient; /// The file system used to perform file access. @@ -378,8 +378,6 @@ class FlutterSkippingFileComparator extends FlutterGoldenFileComparator { }); /// Describes the reason for using the [FlutterSkippingFileComparator]. - /// - /// Cannot be null. final String reason; /// Creates a new [FlutterSkippingFileComparator] that mirrors the diff --git a/packages/flutter_test/lib/src/goldens.dart b/packages/flutter_test/lib/src/goldens.dart index 82259c5879e..edd49d2841b 100644 --- a/packages/flutter_test/lib/src/goldens.dart +++ b/packages/flutter_test/lib/src/goldens.dart @@ -331,8 +331,6 @@ class ComparisonResult { }); /// Indicates whether or not a pixel comparison test has failed. - /// - /// This value cannot be null. final bool passed; /// Error message used to describe the cause of the pixel comparison failure.