Commit d7b523e0 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Apply @required according to the rules, for all of material/* (#7732)

parent 0400107c
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'colors.dart'; import 'colors.dart';
...@@ -42,8 +43,8 @@ class Chip extends StatelessWidget { ...@@ -42,8 +43,8 @@ class Chip extends StatelessWidget {
const Chip({ const Chip({
Key key, Key key,
this.avatar, this.avatar,
this.label, @required this.label,
this.onDeleted this.onDeleted,
}) : super(key: key); }) : super(key: key);
/// A widget to display prior to the chip's label. /// A widget to display prior to the chip's label.
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
...@@ -34,7 +35,7 @@ class DataColumn { ...@@ -34,7 +35,7 @@ class DataColumn {
/// ///
/// The [label] argument must not be null. /// The [label] argument must not be null.
const DataColumn({ const DataColumn({
this.label, @required this.label,
this.tooltip, this.tooltip,
this.numeric: false, this.numeric: false,
this.onSort this.onSort
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'debug.dart'; import 'debug.dart';
...@@ -35,7 +36,7 @@ class DrawerHeader extends StatelessWidget { ...@@ -35,7 +36,7 @@ class DrawerHeader extends StatelessWidget {
this.padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0), this.padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 8.0),
this.duration: const Duration(milliseconds: 250), this.duration: const Duration(milliseconds: 250),
this.curve: Curves.fastOutSlowIn, this.curve: Curves.fastOutSlowIn,
this.child @required this.child,
}) : super(key: key); }) : super(key: key);
/// Decoration for the main drawer header [Container]; useful for applying /// Decoration for the main drawer header [Container]; useful for applying
...@@ -61,6 +62,9 @@ class DrawerHeader extends StatelessWidget { ...@@ -61,6 +62,9 @@ class DrawerHeader extends StatelessWidget {
final Curve curve; final Curve curve;
/// A widget to be placed inside the drawer header, inset by the [padding]. /// A widget to be placed inside the drawer header, inset by the [padding].
///
/// This widget will be sized to the size of the header. To position the child
/// precisely, consider using an [Align] or [Center] widget.
final Widget child; final Widget child;
@override @override
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'colors.dart'; import 'colors.dart';
...@@ -33,7 +34,7 @@ class DrawerItem extends StatelessWidget { ...@@ -33,7 +34,7 @@ class DrawerItem extends StatelessWidget {
const DrawerItem({ const DrawerItem({
Key key, Key key,
this.icon: const Icon(null), this.icon: const Icon(null),
this.child, @required this.child,
this.onPressed, this.onPressed,
this.selected: false this.selected: false
}) : super(key: key); }) : super(key: key);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
/// A tile in a material design grid list. /// A tile in a material design grid list.
...@@ -19,7 +20,7 @@ class GridTile extends StatelessWidget { ...@@ -19,7 +20,7 @@ class GridTile extends StatelessWidget {
/// Creates a grid tile. /// Creates a grid tile.
/// ///
/// Must have a child. Does not typically have both a header and a footer. /// Must have a child. Does not typically have both a header and a footer.
GridTile({ Key key, this.header, this.footer, this.child }) : super(key: key) { GridTile({ Key key, this.header, this.footer, @required this.child }) : super(key: key) {
assert(child != null); assert(child != null);
} }
......
...@@ -237,6 +237,7 @@ class InputContainer extends StatefulWidget { ...@@ -237,6 +237,7 @@ class InputContainer extends StatefulWidget {
/// Defaults to true. /// Defaults to true.
final bool showDivider; final bool showDivider;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -35,7 +35,7 @@ class MaterialSlice extends MergeableMaterialItem { ...@@ -35,7 +35,7 @@ class MaterialSlice extends MergeableMaterialItem {
/// [MergeableMaterial]. /// [MergeableMaterial].
MaterialSlice({ MaterialSlice({
@required LocalKey key, @required LocalKey key,
this.child @required this.child,
}) : super(key) { }) : super(key) {
assert(key != null); assert(key != null);
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
import 'dart:async' show Timer; import 'dart:async' show Timer;
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'theme.dart'; import 'theme.dart';
...@@ -100,7 +101,7 @@ class OverscrollIndicator extends StatefulWidget { ...@@ -100,7 +101,7 @@ class OverscrollIndicator extends StatefulWidget {
Key key, Key key,
this.scrollableKey, this.scrollableKey,
this.edge: ScrollableEdge.both, this.edge: ScrollableEdge.both,
this.child @required this.child,
}) : super(key: key) { }) : super(key: key) {
assert(child != null); assert(child != null);
assert(edge != null); assert(edge != null);
......
...@@ -20,7 +20,7 @@ class _MountainViewPageTransition extends AnimatedWidget { ...@@ -20,7 +20,7 @@ class _MountainViewPageTransition extends AnimatedWidget {
_MountainViewPageTransition({ _MountainViewPageTransition({
Key key, Key key,
Animation<double> animation, Animation<double> animation,
this.child this.child,
}) : super( }) : super(
key: key, key: key,
animation: _kTween.animate(new CurvedAnimation( animation: _kTween.animate(new CurvedAnimation(
......
...@@ -115,7 +115,7 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> { ...@@ -115,7 +115,7 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> {
Key key, Key key,
this.value, this.value,
this.enabled: true, this.enabled: true,
this.child @required this.child,
}) : super(key: key); }) : super(key: key);
@override @override
......
...@@ -132,7 +132,7 @@ class RaisedButton extends StatelessWidget { ...@@ -132,7 +132,7 @@ class RaisedButton extends StatelessWidget {
elevation: enabled ? elevation : disabledElevation, elevation: enabled ? elevation : disabledElevation,
highlightElevation: enabled ? highlightElevation : disabledElevation, highlightElevation: enabled ? highlightElevation : disabledElevation,
colorBrightness: colorBrightness, colorBrightness: colorBrightness,
child: child child: child,
); );
} }
} }
...@@ -172,7 +172,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate { ...@@ -172,7 +172,7 @@ class _ScaffoldLayout extends MultiChildLayoutDelegate {
class _FloatingActionButtonTransition extends StatefulWidget { class _FloatingActionButtonTransition extends StatefulWidget {
_FloatingActionButtonTransition({ _FloatingActionButtonTransition({
Key key, Key key,
this.child this.child,
}) : super(key: key); }) : super(key: key);
final Widget child; final Widget child;
...@@ -266,7 +266,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr ...@@ -266,7 +266,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
if (_previousAnimation.status != AnimationStatus.dismissed) { if (_previousAnimation.status != AnimationStatus.dismissed) {
children.add(new ScaleTransition( children.add(new ScaleTransition(
scale: _previousAnimation, scale: _previousAnimation,
child: _previousChild child: _previousChild,
)); ));
} }
if (_currentAnimation.status != AnimationStatus.dismissed) { if (_currentAnimation.status != AnimationStatus.dismissed) {
...@@ -274,7 +274,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr ...@@ -274,7 +274,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
scale: _currentAnimation, scale: _currentAnimation,
child: new RotationTransition( child: new RotationTransition(
turns: _kFloatingActionButtonTurnTween.animate(_currentAnimation), turns: _kFloatingActionButtonTurnTween.animate(_currentAnimation),
child: config.child child: config.child,
) )
)); ));
} }
......
...@@ -147,11 +147,11 @@ class SnackBar extends StatelessWidget { ...@@ -147,11 +147,11 @@ class SnackBar extends StatelessWidget {
/// The [content] argument must be non-null. /// The [content] argument must be non-null.
SnackBar({ SnackBar({
Key key, Key key,
this.content, @required this.content,
this.backgroundColor, this.backgroundColor,
this.action, this.action,
this.duration: _kSnackBarDisplayDuration, this.duration: _kSnackBarDisplayDuration,
this.animation this.animation,
}) : super(key: key) { }) : super(key: key) {
assert(content != null); assert(content != null);
} }
...@@ -203,7 +203,7 @@ class SnackBar extends StatelessWidget { ...@@ -203,7 +203,7 @@ class SnackBar extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: _kSingleLineVerticalPadding), padding: const EdgeInsets.symmetric(vertical: _kSingleLineVerticalPadding),
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: darkTheme.textTheme.subhead, style: darkTheme.textTheme.subhead,
child: content child: content,
) )
) )
) )
......
...@@ -144,7 +144,7 @@ class DefaultTabController extends StatefulWidget { ...@@ -144,7 +144,7 @@ class DefaultTabController extends StatefulWidget {
Key key, Key key,
@required this.length, @required this.length,
this.initialIndex: 0, this.initialIndex: 0,
this.child @required this.child,
}) : super(key: key); }) : super(key: key);
/// The total number of tabs. Must be greater than one. /// The total number of tabs. Must be greater than one.
......
...@@ -109,7 +109,7 @@ class _TabStyle extends AnimatedWidget { ...@@ -109,7 +109,7 @@ class _TabStyle extends AnimatedWidget {
this.selected, this.selected,
this.labelColor, this.labelColor,
this.unselectedLabelColor, this.unselectedLabelColor,
this.child @required this.child,
}) : super(key: key, animation: animation); }) : super(key: key, animation: animation);
final bool selected; final bool selected;
......
...@@ -160,7 +160,7 @@ class AnimatedTheme extends ImplicitlyAnimatedWidget { ...@@ -160,7 +160,7 @@ class AnimatedTheme extends ImplicitlyAnimatedWidget {
this.isMaterialAppTheme: false, this.isMaterialAppTheme: false,
Curve curve: Curves.linear, Curve curve: Curves.linear,
Duration duration: kThemeAnimationDuration, Duration duration: kThemeAnimationDuration,
this.child @required this.child,
}) : super(key: key, curve: curve, duration: duration) { }) : super(key: key, curve: curve, duration: duration) {
assert(child != null); assert(child != null);
assert(data != null); assert(data != null);
......
...@@ -47,7 +47,7 @@ class Tooltip extends StatefulWidget { ...@@ -47,7 +47,7 @@ class Tooltip extends StatefulWidget {
this.padding: const EdgeInsets.symmetric(horizontal: 16.0), this.padding: const EdgeInsets.symmetric(horizontal: 16.0),
this.verticalOffset: 24.0, this.verticalOffset: 24.0,
this.preferBelow: true, this.preferBelow: true,
this.child this.child,
}) : super(key: key) { }) : super(key: key) {
assert(message != null); assert(message != null);
assert(height != null); assert(height != null);
...@@ -181,7 +181,7 @@ class _TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin { ...@@ -181,7 +181,7 @@ class _TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
excludeFromSemantics: true, excludeFromSemantics: true,
child: new Semantics( child: new Semantics(
label: config.message, label: config.message,
child: config.child child: config.child,
) )
); );
} }
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'debug.dart'; import 'debug.dart';
...@@ -50,8 +51,8 @@ class _AccountPictures extends StatelessWidget { ...@@ -50,8 +51,8 @@ class _AccountPictures extends StatelessWidget {
class _AccountDetails extends StatelessWidget { class _AccountDetails extends StatelessWidget {
_AccountDetails({ _AccountDetails({
Key key, Key key,
this.accountName, @required this.accountName,
this.accountEmail, @required this.accountEmail,
this.onTap, this.onTap,
this.isOpen, this.isOpen,
}) : super(key: key); }) : super(key: key);
...@@ -136,8 +137,8 @@ class UserAccountsDrawerHeader extends StatefulWidget { ...@@ -136,8 +137,8 @@ class UserAccountsDrawerHeader extends StatefulWidget {
this.decoration, this.decoration,
this.currentAccountPicture, this.currentAccountPicture,
this.otherAccountsPictures, this.otherAccountsPictures,
this.accountName, @required this.accountName,
this.accountEmail, @required this.accountEmail,
this.onDetailsPressed this.onDetailsPressed
}) : super(key: key); }) : super(key: key);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment