From c32fa70d9dbf7909224debbae35eb78ac60eb42b Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 6 Feb 2017 14:50:26 -0800 Subject: [PATCH] Add missing `@required` (#7904) These arguments are actually required because we assert that they're not null. --- packages/flutter/lib/src/widgets/text.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/flutter/lib/src/widgets/text.dart b/packages/flutter/lib/src/widgets/text.dart index fb7d082e24e..9872686f2b4 100644 --- a/packages/flutter/lib/src/widgets/text.dart +++ b/packages/flutter/lib/src/widgets/text.dart @@ -13,7 +13,7 @@ class DefaultTextStyle extends InheritedWidget { /// Creates a default text style for the given subtree. /// /// Consider using [DefaultTextStyle.merge] to inherit styling information - /// from a the current default text style for a given [BuildContext]. + /// from the current default text style for a given [BuildContext]. DefaultTextStyle({ Key key, @required this.style, @@ -21,7 +21,7 @@ class DefaultTextStyle extends InheritedWidget { this.softWrap: true, this.overflow: TextOverflow.clip, this.maxLines, - Widget child + @required Widget child, }) : super(key: key, child: child) { assert(style != null); assert(softWrap != null); @@ -32,6 +32,9 @@ class DefaultTextStyle extends InheritedWidget { /// A const-constructible default text style that provides fallback values. /// /// Returned from [of] when the given [BuildContext] doesn't have an enclosing default text style. + /// + /// This constructor creates a [DefaultTextStyle] that lacks a [child], which + /// means the constructed value cannot be incorporated into the tree. const DefaultTextStyle.fallback() : style = const TextStyle(), textAlign = null, @@ -53,7 +56,7 @@ class DefaultTextStyle extends InheritedWidget { bool softWrap, TextOverflow overflow, int maxLines, - Widget child + @required Widget child, }) { assert(context != null); assert(child != null);