mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Add missing @required (#7904)
These arguments are actually required because we assert that they're not null.
This commit is contained in:
parent
e46f6e76b3
commit
c32fa70d9d
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user