Commit 2de61a08 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

add @required when there's an assert not null (#9124)

* add @required when there's an assert not null

* address review comments
parent 86e9fc1c
...@@ -31,8 +31,8 @@ const double _kAppBarMidHeight = 256.0; ...@@ -31,8 +31,8 @@ const double _kAppBarMidHeight = 256.0;
// TODO(hansmuller): it would be worth adding something like this to the framework. // TODO(hansmuller): it would be worth adding something like this to the framework.
class _RenderStatusBarPaddingSliver extends RenderSliver { class _RenderStatusBarPaddingSliver extends RenderSliver {
_RenderStatusBarPaddingSliver({ _RenderStatusBarPaddingSliver({
double maxHeight, @required double maxHeight,
double scrollFactor, @required double scrollFactor,
}) : _maxHeight = maxHeight, _scrollFactor = scrollFactor { }) : _maxHeight = maxHeight, _scrollFactor = scrollFactor {
assert(maxHeight != null && maxHeight >= 0.0); assert(maxHeight != null && maxHeight >= 0.0);
assert(scrollFactor != null && scrollFactor >= 1.0); assert(scrollFactor != null && scrollFactor >= 1.0);
...@@ -264,8 +264,8 @@ class _AllSectionsView extends AnimatedWidget { ...@@ -264,8 +264,8 @@ class _AllSectionsView extends AnimatedWidget {
_AllSectionsView({ _AllSectionsView({
Key key, Key key,
this.sectionIndex, this.sectionIndex,
this.sections, @required this.sections,
this.selectedIndex, @required this.selectedIndex,
this.minHeight, this.minHeight,
this.midHeight, this.midHeight,
this.maxHeight, this.maxHeight,
......
...@@ -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 'sections.dart'; import 'sections.dart';
...@@ -10,7 +11,7 @@ const double kSectionIndicatorWidth = 32.0; ...@@ -10,7 +11,7 @@ const double kSectionIndicatorWidth = 32.0;
// The card for a single section. Displays the section's gradient and background image. // The card for a single section. Displays the section's gradient and background image.
class SectionCard extends StatelessWidget { class SectionCard extends StatelessWidget {
SectionCard({ Key key, this.section }) : super(key: key) { SectionCard({ Key key, @required this.section }) : super(key: key) {
assert(section != null); assert(section != null);
} }
...@@ -60,7 +61,12 @@ class SectionTitle extends StatelessWidget { ...@@ -60,7 +61,12 @@ class SectionTitle extends StatelessWidget {
color: const Color(0x19000000), color: const Color(0x19000000),
); );
SectionTitle({ Key key, this.section, this.scale, this.opacity }) : super(key: key) { SectionTitle({
Key key,
@required this.section,
@required this.scale,
@required this.opacity,
}) : super(key: key) {
assert(section != null); assert(section != null);
assert(scale != null); assert(scale != null);
assert(opacity != null && opacity >= 0.0 && opacity <= 1.0); assert(opacity != null && opacity >= 0.0 && opacity <= 1.0);
...@@ -115,7 +121,7 @@ class SectionIndicator extends StatelessWidget { ...@@ -115,7 +121,7 @@ class SectionIndicator extends StatelessWidget {
// Display a single SectionDetail. // Display a single SectionDetail.
class SectionDetailView extends StatelessWidget { class SectionDetailView extends StatelessWidget {
SectionDetailView({ Key key, this.detail }) : super(key: key) { SectionDetailView({ Key key, @required this.detail }) : super(key: key) {
assert(detail != null && detail.imageAsset != null); assert(detail != null && detail.imageAsset != null);
assert((detail.imageAsset ?? detail.title) != null); assert((detail.imageAsset ?? detail.title) != null);
} }
......
...@@ -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';
const double kColorItemHeight = 48.0; const double kColorItemHeight = 48.0;
...@@ -41,7 +42,12 @@ final List<Palette> allPalettes = <Palette>[ ...@@ -41,7 +42,12 @@ final List<Palette> allPalettes = <Palette>[
class ColorItem extends StatelessWidget { class ColorItem extends StatelessWidget {
ColorItem({ Key key, this.index, this.color, this.prefix: '' }) : super(key: key) { ColorItem({
Key key,
@required this.index,
@required this.color,
this.prefix: '',
}) : super(key: key) {
assert(index != null); assert(index != null);
assert(color != null); assert(color != null);
assert(prefix != null); assert(prefix != null);
......
...@@ -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';
class TravelDestination { class TravelDestination {
...@@ -36,7 +37,7 @@ final List<TravelDestination> destinations = <TravelDestination>[ ...@@ -36,7 +37,7 @@ final List<TravelDestination> destinations = <TravelDestination>[
]; ];
class TravelDestinationItem extends StatelessWidget { class TravelDestinationItem extends StatelessWidget {
TravelDestinationItem({ Key key, this.destination }) : super(key: key) { TravelDestinationItem({ Key key, @required this.destination }) : super(key: key) {
assert(destination != null && destination.isValid); assert(destination != null && destination.isValid);
} }
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
// 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:intl/intl.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
// This demo is based on // This demo is based on
// https://material.google.com/components/dialogs.html#dialogs-full-screen-dialogs // https://material.google.com/components/dialogs.html#dialogs-full-screen-dialogs
...@@ -15,7 +16,7 @@ enum DismissDialogAction { ...@@ -15,7 +16,7 @@ enum DismissDialogAction {
} }
class DateTimeItem extends StatelessWidget { class DateTimeItem extends StatelessWidget {
DateTimeItem({ Key key, DateTime dateTime, this.onChanged }) DateTimeItem({ Key key, DateTime dateTime, @required this.onChanged })
: date = new DateTime(dateTime.year, dateTime.month, dateTime.day), : date = new DateTime(dateTime.year, dateTime.month, dateTime.day),
time = new TimeOfDay(hour: dateTime.hour, minute: dateTime.minute), time = new TimeOfDay(hour: dateTime.hour, minute: dateTime.minute),
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/material.dart'; import 'package:flutter/material.dart';
enum GridDemoTileStyle { enum GridDemoTileStyle {
...@@ -143,9 +144,9 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv ...@@ -143,9 +144,9 @@ class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProv
class GridDemoPhotoItem extends StatelessWidget { class GridDemoPhotoItem extends StatelessWidget {
GridDemoPhotoItem({ GridDemoPhotoItem({
Key key, Key key,
this.photo, @required this.photo,
this.tileStyle, @required this.tileStyle,
this.onBannerTap @required this.onBannerTap
}) : super(key: key) { }) : super(key: key) {
assert(photo != null && photo.isValid); assert(photo != null && photo.isValid);
assert(tileStyle != null); assert(tileStyle != null);
......
...@@ -116,7 +116,7 @@ class _ShrineGridDelegate extends SliverGridDelegate { ...@@ -116,7 +116,7 @@ class _ShrineGridDelegate extends SliverGridDelegate {
// Displays the Vendor's name and avatar. // Displays the Vendor's name and avatar.
class _VendorItem extends StatelessWidget { class _VendorItem extends StatelessWidget {
_VendorItem({ Key key, this.vendor }) : super(key: key) { _VendorItem({ Key key, @required this.vendor }) : super(key: key) {
assert(vendor != null); assert(vendor != null);
} }
...@@ -148,7 +148,7 @@ class _VendorItem extends StatelessWidget { ...@@ -148,7 +148,7 @@ class _VendorItem extends StatelessWidget {
// Displays the product's price. If the product is in the shopping cart then the // Displays the product's price. If the product is in the shopping cart then the
// background is highlighted. // background is highlighted.
abstract class _PriceItem extends StatelessWidget { abstract class _PriceItem extends StatelessWidget {
_PriceItem({ Key key, this.product }) : super(key: key) { _PriceItem({ Key key, @required this.product }) : super(key: key) {
assert(product != null); assert(product != null);
} }
...@@ -240,7 +240,8 @@ class _HeadingLayout extends MultiChildLayoutDelegate { ...@@ -240,7 +240,8 @@ class _HeadingLayout extends MultiChildLayoutDelegate {
// A card that highlights the "featured" catalog item. // A card that highlights the "featured" catalog item.
class _Heading extends StatelessWidget { class _Heading extends StatelessWidget {
_Heading({ Key key, this.product }) : super(key: key) { _Heading({ Key key, @required this.product }) : super(key: key) {
assert(product != null);
assert(product.featureTitle != null); assert(product.featureTitle != null);
assert(product.featureDescription != null); assert(product.featureDescription != null);
} }
...@@ -293,7 +294,7 @@ class _Heading extends StatelessWidget { ...@@ -293,7 +294,7 @@ class _Heading extends StatelessWidget {
// A card that displays a product's image, price, and vendor. The _ProductItem // A card that displays a product's image, price, and vendor. The _ProductItem
// cards appear in a grid below the heading. // cards appear in a grid below the heading.
class _ProductItem extends StatelessWidget { class _ProductItem extends StatelessWidget {
_ProductItem({ Key key, this.product, this.onPressed }) : super(key: key) { _ProductItem({ Key key, @required this.product, this.onPressed }) : super(key: key) {
assert(product != null); assert(product != null);
} }
......
...@@ -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 '../shrine_demo.dart' show ShrinePageRoute; import '../shrine_demo.dart' show ShrinePageRoute;
...@@ -11,7 +12,12 @@ import 'shrine_types.dart'; ...@@ -11,7 +12,12 @@ import 'shrine_types.dart';
// Displays the product title's, description, and order quantity dropdown. // Displays the product title's, description, and order quantity dropdown.
class _ProductItem extends StatelessWidget { class _ProductItem extends StatelessWidget {
_ProductItem({ Key key, this.product, this.quantity, this.onChanged }) : super(key: key) { _ProductItem({
Key key,
@required this.product,
@required this.quantity,
@required this.onChanged,
}) : super(key: key) {
assert(product != null); assert(product != null);
assert(quantity != null); assert(quantity != null);
assert(onChanged != null); assert(onChanged != null);
...@@ -64,7 +70,7 @@ class _ProductItem extends StatelessWidget { ...@@ -64,7 +70,7 @@ class _ProductItem extends StatelessWidget {
// Vendor name and description // Vendor name and description
class _VendorItem extends StatelessWidget { class _VendorItem extends StatelessWidget {
_VendorItem({ Key key, this.vendor }) : super(key: key) { _VendorItem({ Key key, @required this.vendor }) : super(key: key) {
assert(vendor != null); assert(vendor != null);
} }
...@@ -135,7 +141,12 @@ class _HeadingLayout extends MultiChildLayoutDelegate { ...@@ -135,7 +141,12 @@ class _HeadingLayout extends MultiChildLayoutDelegate {
// Describes a product and vendor in detail, supports specifying // Describes a product and vendor in detail, supports specifying
// a order quantity (0-5). Appears at the top of the OrderPage. // a order quantity (0-5). Appears at the top of the OrderPage.
class _Heading extends StatelessWidget { class _Heading extends StatelessWidget {
_Heading({ Key key, this.product, this.quantity, this.quantityChanged }) : super(key: key) { _Heading({
Key key,
@required this.product,
@required this.quantity,
this.quantityChanged,
}) : super(key: key) {
assert(product != null); assert(product != null);
assert(quantity != null && quantity >= 0 && quantity <= 5); assert(quantity != null && quantity >= 0 && quantity <= 5);
} }
...@@ -197,7 +208,12 @@ class _Heading extends StatelessWidget { ...@@ -197,7 +208,12 @@ class _Heading extends StatelessWidget {
} }
class OrderPage extends StatefulWidget { class OrderPage extends StatefulWidget {
OrderPage({ Key key, this.order, this.products, this.shoppingCart }) : super(key: key) { OrderPage({
Key key,
@required this.order,
@required this.products,
@required this.shoppingCart,
}) : super(key: key) {
assert(order != null); assert(order != null);
assert(products != null && products.isNotEmpty); assert(products != null && products.isNotEmpty);
assert(shoppingCart != null); assert(shoppingCart != null);
......
...@@ -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 'shrine_theme.dart'; import 'shrine_theme.dart';
...@@ -16,8 +17,8 @@ enum ShrineAction { ...@@ -16,8 +17,8 @@ enum ShrineAction {
class ShrinePage extends StatefulWidget { class ShrinePage extends StatefulWidget {
ShrinePage({ ShrinePage({
Key key, Key key,
this.scaffoldKey, @required this.scaffoldKey,
this.body, @required this.body,
this.floatingActionButton, this.floatingActionButton,
this.products, this.products,
this.shoppingCart this.shoppingCart
......
...@@ -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';
class ShrineStyle extends TextStyle { class ShrineStyle extends TextStyle {
...@@ -26,7 +27,7 @@ TextStyle abrilFatfaceRegular34(Color color) => new ShrineStyle.abrilFatface(34. ...@@ -26,7 +27,7 @@ TextStyle abrilFatfaceRegular34(Color color) => new ShrineStyle.abrilFatface(34.
/// InheritedWidget is shared by all of the routes and widgets created for /// InheritedWidget is shared by all of the routes and widgets created for
/// the Shrine app. /// the Shrine app.
class ShrineTheme extends InheritedWidget { class ShrineTheme extends InheritedWidget {
ShrineTheme({ Key key, Widget child }) : super(key: key, child: child) { ShrineTheme({ Key key, @required Widget child }) : super(key: key, child: child) {
assert(child != null); assert(child != null);
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
import 'dart:ui' show hashValues; import 'dart:ui' show hashValues;
import 'package:flutter/foundation.dart';
class Vendor { class Vendor {
const Vendor({ const Vendor({
this.name, this.name,
...@@ -64,7 +66,7 @@ class Product { ...@@ -64,7 +66,7 @@ class Product {
} }
class Order { class Order {
Order({ this.product, this.quantity: 1, this.inCart: false }) { Order({ @required this.product, this.quantity: 1, this.inCart: false }) {
assert(product != null); assert(product != null);
assert(quantity != null && quantity >= 0); assert(quantity != null && quantity >= 0);
assert(inCart != null); assert(inCart != null);
......
...@@ -2,10 +2,16 @@ ...@@ -2,10 +2,16 @@
// 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';
class TextStyleItem extends StatelessWidget { class TextStyleItem extends StatelessWidget {
TextStyleItem({ Key key, this.name, this.style, this.text }) : super(key: key) { TextStyleItem({
Key key,
@required this.name,
@required this.style,
@required this.text,
}) : super(key: key) {
assert(name != null); assert(name != null);
assert(style != null); assert(style != null);
assert(text != null); assert(text != null);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flutter/foundation.dart' show defaultTargetPlatform; import 'package:flutter/foundation.dart' show defaultTargetPlatform, required;
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -90,9 +90,9 @@ class GalleryDrawer extends StatelessWidget { ...@@ -90,9 +90,9 @@ class GalleryDrawer extends StatelessWidget {
GalleryDrawer({ GalleryDrawer({
Key key, Key key,
this.useLightTheme, this.useLightTheme,
this.onThemeChanged, @required this.onThemeChanged,
this.timeDilation, this.timeDilation,
this.onTimeDilationChanged, @required this.onTimeDilationChanged,
this.showPerformanceOverlay, this.showPerformanceOverlay,
this.onShowPerformanceOverlayChanged, this.onShowPerformanceOverlayChanged,
this.checkerboardRasterCacheImages, this.checkerboardRasterCacheImages,
......
...@@ -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 'drawer.dart'; import 'drawer.dart';
...@@ -68,9 +69,9 @@ class GalleryHome extends StatefulWidget { ...@@ -68,9 +69,9 @@ class GalleryHome extends StatefulWidget {
GalleryHome({ GalleryHome({
Key key, Key key,
this.useLightTheme, this.useLightTheme,
this.onThemeChanged, @required this.onThemeChanged,
this.timeDilation, this.timeDilation,
this.onTimeDilationChanged, @required this.onTimeDilationChanged,
this.showPerformanceOverlay, this.showPerformanceOverlay,
this.onShowPerformanceOverlayChanged, this.onShowPerformanceOverlayChanged,
this.checkerboardRasterCacheImages, this.checkerboardRasterCacheImages,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import 'dart:developer'; import 'dart:developer';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../demo/all.dart'; import '../demo/all.dart';
...@@ -11,7 +12,13 @@ import '../demo/all.dart'; ...@@ -11,7 +12,13 @@ import '../demo/all.dart';
typedef Widget GalleryDemoBuilder(); typedef Widget GalleryDemoBuilder();
class GalleryItem extends StatelessWidget { class GalleryItem extends StatelessWidget {
GalleryItem({ this.title, this.subtitle, this.category, this.routeName, this.buildRoute }) { GalleryItem({
@required this.title,
this.subtitle,
@required this.category,
@required this.routeName,
@required this.buildRoute,
}) {
assert(title != null); assert(title != null);
assert(category != null); assert(category != null);
assert(routeName != null); assert(routeName != null);
......
...@@ -4,13 +4,14 @@ ...@@ -4,13 +4,14 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
typedef Future<String> UpdateUrlFetcher(); typedef Future<String> UpdateUrlFetcher();
class Updater extends StatefulWidget { class Updater extends StatefulWidget {
Updater({ this.updateUrlFetcher, this.child, Key key }) : super(key: key) { Updater({ @required this.updateUrlFetcher, this.child, Key key }) : super(key: key) {
assert(updateUrlFetcher != null); assert(updateUrlFetcher != null);
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:isolate'; import 'dart:isolate';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -16,7 +17,7 @@ typedef void OnResultListener(String result); ...@@ -16,7 +17,7 @@ typedef void OnResultListener(String result);
// The choice of JSON parsing here is meant as an example that might surface // The choice of JSON parsing here is meant as an example that might surface
// in real-world applications. // in real-world applications.
class Calculator { class Calculator {
Calculator({ this.onProgressListener, this.onResultListener, String data }) Calculator({ @required this.onProgressListener, @required this.onResultListener, String data })
// In order to keep the example files smaller, we "cheat" a little and // In order to keep the example files smaller, we "cheat" a little and
// replicate our small json string into a 10,000-element array. // replicate our small json string into a 10,000-element array.
: _data = _replicateJson(data, 10000) { : _data = _replicateJson(data, 10000) {
...@@ -85,7 +86,7 @@ class CalculationMessage { ...@@ -85,7 +86,7 @@ class CalculationMessage {
// This class manages these ports and maintains state related to the // This class manages these ports and maintains state related to the
// progress of the background computation. // progress of the background computation.
class CalculationManager { class CalculationManager {
CalculationManager({ this.onProgressListener, this.onResultListener }) CalculationManager({ @required this.onProgressListener, @required this.onResultListener })
: _receivePort = new ReceivePort() { : _receivePort = new ReceivePort() {
assert(onProgressListener != null); assert(onProgressListener != null);
assert(onResultListener != null); assert(onResultListener != null);
......
...@@ -2,21 +2,23 @@ ...@@ -2,21 +2,23 @@
// 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';
enum StockMode { optimistic, pessimistic } enum StockMode { optimistic, pessimistic }
enum BackupMode { enabled, disabled } enum BackupMode { enabled, disabled }
class StockConfiguration { class StockConfiguration {
StockConfiguration({ StockConfiguration({
this.stockMode, @required this.stockMode,
this.backupMode, @required this.backupMode,
this.debugShowGrid, @required this.debugShowGrid,
this.debugShowSizes, @required this.debugShowSizes,
this.debugShowBaselines, @required this.debugShowBaselines,
this.debugShowLayers, @required this.debugShowLayers,
this.debugShowPointers, @required this.debugShowPointers,
this.debugShowRainbow, @required this.debugShowRainbow,
this.showPerformanceOverlay, @required this.showPerformanceOverlay,
this.showSemanticsDebugger @required this.showSemanticsDebugger
}) { }) {
assert(stockMode != null); assert(stockMode != null);
assert(backupMode != null); assert(backupMode != null);
......
...@@ -324,8 +324,8 @@ class CurvedAnimation extends Animation<double> with AnimationWithParentMixin<do ...@@ -324,8 +324,8 @@ class CurvedAnimation extends Animation<double> with AnimationWithParentMixin<do
/// ///
/// The parent and curve arguments must not be null. /// The parent and curve arguments must not be null.
CurvedAnimation({ CurvedAnimation({
this.parent, @required this.parent,
this.curve, @required this.curve,
this.reverseCurve this.reverseCurve
}) { }) {
assert(parent != null); assert(parent != null);
...@@ -546,8 +546,8 @@ abstract class CompoundAnimation<T> extends Animation<T> ...@@ -546,8 +546,8 @@ abstract class CompoundAnimation<T> extends Animation<T>
/// Creates a CompoundAnimation. Both arguments must be non-null. Either can /// Creates a CompoundAnimation. Both arguments must be non-null. Either can
/// be a CompoundAnimation itself to combine multiple animations. /// be a CompoundAnimation itself to combine multiple animations.
CompoundAnimation({ CompoundAnimation({
this.first, @required this.first,
this.next, @required this.next,
}) { }) {
assert(first != null); assert(first != null);
assert(next != null); assert(next != null);
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
import 'dart:ui' show Color, Size, Rect; import 'dart:ui' show Color, Size, Rect;
import 'package:flutter/foundation.dart';
import 'animation.dart'; import 'animation.dart';
import 'animations.dart'; import 'animations.dart';
import 'curves.dart'; import 'curves.dart';
...@@ -231,7 +233,7 @@ class CurveTween extends Animatable<double> { ...@@ -231,7 +233,7 @@ class CurveTween extends Animatable<double> {
/// Creates a curve tween. /// Creates a curve tween.
/// ///
/// The [curve] argument must not be null. /// The [curve] argument must not be null.
CurveTween({ this.curve }) { CurveTween({ @required this.curve }) {
assert(curve != null); assert(curve != null);
} }
......
...@@ -189,7 +189,7 @@ const double _kAdjustmentUnit = 0.1; // Matches iOS implementation of material s ...@@ -189,7 +189,7 @@ const double _kAdjustmentUnit = 0.1; // Matches iOS implementation of material s
class _RenderCupertinoSlider extends RenderConstrainedBox implements SemanticsActionHandler { class _RenderCupertinoSlider extends RenderConstrainedBox implements SemanticsActionHandler {
_RenderCupertinoSlider({ _RenderCupertinoSlider({
double value, @required double value,
int divisions, int divisions,
Color activeColor, Color activeColor,
this.onChanged, this.onChanged,
......
...@@ -135,8 +135,8 @@ const Duration _kToggleDuration = const Duration(milliseconds: 200); ...@@ -135,8 +135,8 @@ const Duration _kToggleDuration = const Duration(milliseconds: 200);
class _RenderCupertinoSwitch extends RenderConstrainedBox implements SemanticsActionHandler { class _RenderCupertinoSwitch extends RenderConstrainedBox implements SemanticsActionHandler {
_RenderCupertinoSwitch({ _RenderCupertinoSwitch({
bool value, @required bool value,
Color activeColor, @required Color activeColor,
ValueChanged<bool> onChanged, ValueChanged<bool> onChanged,
@required TickerProvider vsync, @required TickerProvider vsync,
}) : _value = value, }) : _value = value,
......
...@@ -199,7 +199,7 @@ abstract class BindingBase { ...@@ -199,7 +199,7 @@ abstract class BindingBase {
/// service extension method is called with a new value. /// service extension method is called with a new value.
@protected @protected
void registerBoolServiceExtension({ void registerBoolServiceExtension({
String name, @required String name,
@required AsyncValueGetter<bool> getter, @required AsyncValueGetter<bool> getter,
@required AsyncValueSetter<bool> setter @required AsyncValueSetter<bool> setter
}) { }) {
......
...@@ -487,9 +487,9 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr ...@@ -487,9 +487,9 @@ class _BottomNavigationBarState extends State<BottomNavigationBar> with TickerPr
class _Circle { class _Circle {
_Circle({ _Circle({
this.state, @required this.state,
this.index, @required this.index,
this.color, @required this.color,
@required TickerProvider vsync, @required TickerProvider vsync,
}) { }) {
assert(state != null); assert(state != null);
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'colors.dart'; import 'colors.dart';
...@@ -49,8 +50,8 @@ class BottomSheet extends StatefulWidget { ...@@ -49,8 +50,8 @@ class BottomSheet extends StatefulWidget {
BottomSheet({ BottomSheet({
Key key, Key key,
this.animationController, this.animationController,
this.onClosing, @required this.onClosing,
this.builder @required this.builder
}) : super(key: key) { }) : super(key: key) {
assert(onClosing != null); assert(onClosing != null);
assert(builder != null); assert(builder != null);
...@@ -256,7 +257,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> { ...@@ -256,7 +257,7 @@ class _ModalBottomSheetRoute<T> extends PopupRoute<T> {
/// * [BottomSheet] /// * [BottomSheet]
/// * [Scaffold.showBottomSheet] /// * [Scaffold.showBottomSheet]
/// * <https://material.google.com/components/bottom-sheets.html#bottom-sheets-modal-bottom-sheets> /// * <https://material.google.com/components/bottom-sheets.html#bottom-sheets-modal-bottom-sheets>
Future<T> showModalBottomSheet<T>({ BuildContext context, WidgetBuilder builder }) { Future<T> showModalBottomSheet<T>({ @required BuildContext context, @required WidgetBuilder builder }) {
assert(context != null); assert(context != null);
assert(builder != null); assert(builder != null);
return Navigator.push(context, new _ModalBottomSheetRoute<T>( return Navigator.push(context, new _ModalBottomSheetRoute<T>(
......
...@@ -253,11 +253,11 @@ class DataTable extends StatelessWidget { ...@@ -253,11 +253,11 @@ class DataTable extends StatelessWidget {
/// otherwise it should be false. /// otherwise it should be false.
DataTable({ DataTable({
Key key, Key key,
this.columns, @required this.columns,
this.sortColumnIndex, this.sortColumnIndex,
this.sortAscending: true, this.sortAscending: true,
this.onSelectAll, this.onSelectAll,
this.rows @required this.rows
}) : _onlyTextColumn = _initOnlyTextColumn(columns), super(key: key) { }) : _onlyTextColumn = _initOnlyTextColumn(columns), super(key: key) {
assert(columns != null); assert(columns != null);
assert(columns.isNotEmpty); assert(columns.isNotEmpty);
......
...@@ -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';
...@@ -117,7 +118,7 @@ class DrawerController extends StatefulWidget { ...@@ -117,7 +118,7 @@ class DrawerController extends StatefulWidget {
/// The [child] argument must not be null and is typically a [Drawer]. /// The [child] argument must not be null and is typically a [Drawer].
DrawerController({ DrawerController({
GlobalKey key, GlobalKey key,
this.child @required this.child
}) : super(key: key) { }) : super(key: key) {
assert(child != null); assert(child != null);
} }
......
...@@ -286,7 +286,7 @@ class _DropdownRoute<T> extends PopupRoute<_DropdownRouteResult<T>> { ...@@ -286,7 +286,7 @@ class _DropdownRoute<T> extends PopupRoute<_DropdownRouteResult<T>> {
this.selectedIndex, this.selectedIndex,
this.elevation: 8, this.elevation: 8,
this.theme, this.theme,
this.style, @required this.style,
}) { }) {
assert(style != null); assert(style != null);
} }
...@@ -336,7 +336,7 @@ class DropdownMenuItem<T> extends StatelessWidget { ...@@ -336,7 +336,7 @@ class DropdownMenuItem<T> extends StatelessWidget {
DropdownMenuItem({ DropdownMenuItem({
Key key, Key key,
this.value, this.value,
this.child, @required this.child,
}) : super(key: key) { }) : super(key: key) {
assert(child != null); assert(child != null);
} }
...@@ -372,7 +372,7 @@ class DropdownButtonHideUnderline extends InheritedWidget { ...@@ -372,7 +372,7 @@ class DropdownButtonHideUnderline extends InheritedWidget {
/// be given. /// be given.
DropdownButtonHideUnderline({ DropdownButtonHideUnderline({
Key key, Key key,
Widget child, @required Widget child,
}) : super(key: key, child: child) { }) : super(key: key, child: child) {
assert(child != null); assert(child != null);
} }
......
...@@ -58,7 +58,7 @@ class FlatButton extends StatelessWidget { ...@@ -58,7 +58,7 @@ class FlatButton extends StatelessWidget {
this.disabledColor, this.disabledColor,
this.textTheme, this.textTheme,
this.colorBrightness, this.colorBrightness,
this.child @required this.child
}) : super(key: key) { }) : super(key: key) {
assert(child != null); assert(child != null);
} }
......
...@@ -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/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
...@@ -691,7 +692,7 @@ class _AnimatedLabel extends ImplicitlyAnimatedWidget { ...@@ -691,7 +692,7 @@ class _AnimatedLabel extends ImplicitlyAnimatedWidget {
_AnimatedLabel({ _AnimatedLabel({
Key key, Key key,
this.text, this.text,
this.style, @required this.style,
Curve curve: Curves.linear, Curve curve: Curves.linear,
Duration duration, Duration duration,
}) : super(key: key, curve: curve, duration: duration) { }) : super(key: key, curve: curve, duration: duration) {
......
...@@ -195,7 +195,7 @@ class _CupertinoBackGestureController extends NavigationGestureController { ...@@ -195,7 +195,7 @@ class _CupertinoBackGestureController extends NavigationGestureController {
class MaterialPageRoute<T> extends PageRoute<T> { class MaterialPageRoute<T> extends PageRoute<T> {
/// Creates a page route for use in a material design app. /// Creates a page route for use in a material design app.
MaterialPageRoute({ MaterialPageRoute({
this.builder, @required this.builder,
RouteSettings settings: const RouteSettings(), RouteSettings settings: const RouteSettings(),
this.maintainState: true, this.maintainState: true,
}) : super(settings: settings) { }) : super(settings: settings) {
......
...@@ -66,7 +66,7 @@ class PaginatedDataTable extends StatefulWidget { ...@@ -66,7 +66,7 @@ class PaginatedDataTable extends StatefulWidget {
Key key, Key key,
@required this.header, @required this.header,
this.actions, this.actions,
this.columns, @required this.columns,
this.sortColumnIndex, this.sortColumnIndex,
this.sortAscending: true, this.sortAscending: true,
this.onSelectAll, this.onSelectAll,
......
...@@ -438,9 +438,9 @@ class _PopupMenuRoute<T> extends PopupRoute<T> { ...@@ -438,9 +438,9 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
/// 12, 16, 24. The elevation defaults to 8, the appropriate elevation for popup /// 12, 16, 24. The elevation defaults to 8, the appropriate elevation for popup
/// menus. /// menus.
Future<T> showMenu<T>({ Future<T> showMenu<T>({
BuildContext context, @required BuildContext context,
RelativeRect position, RelativeRect position,
List<PopupMenuEntry<T>> items, @required List<PopupMenuEntry<T>> items,
T initialValue, T initialValue,
int elevation: 8 int elevation: 8
}) { }) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:async'; import 'dart:async';
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 'progress_indicator.dart'; import 'progress_indicator.dart';
...@@ -81,9 +82,9 @@ class RefreshIndicator extends StatefulWidget { ...@@ -81,9 +82,9 @@ class RefreshIndicator extends StatefulWidget {
/// [displacement] is 40.0 logical pixels. /// [displacement] is 40.0 logical pixels.
RefreshIndicator({ RefreshIndicator({
Key key, Key key,
this.child, @required this.child,
this.displacement: 40.0, this.displacement: 40.0,
this.onRefresh, @required this.onRefresh,
this.color, this.color,
this.backgroundColor this.backgroundColor
}) : super(key: key) { }) : super(key: key) {
......
...@@ -261,7 +261,7 @@ BoxConstraints _getAdditionalConstraints(String label) { ...@@ -261,7 +261,7 @@ BoxConstraints _getAdditionalConstraints(String label) {
class _RenderSlider extends RenderConstrainedBox implements SemanticsActionHandler { class _RenderSlider extends RenderConstrainedBox implements SemanticsActionHandler {
_RenderSlider({ _RenderSlider({
double value, @required double value,
int divisions, int divisions,
String label, String label,
Color activeColor, Color activeColor,
......
...@@ -81,7 +81,7 @@ class SnackBarAction extends StatefulWidget { ...@@ -81,7 +81,7 @@ class SnackBarAction extends StatefulWidget {
/// The [label] and [onPressed] arguments must be non-null. /// The [label] and [onPressed] arguments must be non-null.
SnackBarAction({ SnackBarAction({
Key key, Key key,
this.label, @required this.label,
@required this.onPressed @required this.onPressed
}) : super(key: key) { }) : super(key: key) {
assert(label != null); assert(label != null);
......
...@@ -131,7 +131,7 @@ class Stepper extends StatefulWidget { ...@@ -131,7 +131,7 @@ class Stepper extends StatefulWidget {
/// The [steps], [type], and [currentStep] arguments must not be null. /// The [steps], [type], and [currentStep] arguments must not be null.
Stepper({ Stepper({
Key key, Key key,
this.steps, @required this.steps,
this.type: StepperType.vertical, this.type: StepperType.vertical,
this.currentStep: 0, this.currentStep: 0,
this.onStepTapped, this.onStepTapped,
......
...@@ -158,7 +158,7 @@ class _TabLabelBarRenderer extends RenderFlex { ...@@ -158,7 +158,7 @@ class _TabLabelBarRenderer extends RenderFlex {
MainAxisAlignment mainAxisAlignment, MainAxisAlignment mainAxisAlignment,
CrossAxisAlignment crossAxisAlignment, CrossAxisAlignment crossAxisAlignment,
TextBaseline textBaseline, TextBaseline textBaseline,
this.onPerformLayout, @required this.onPerformLayout,
}) : super( }) : super(
children: children, children: children,
direction: direction, direction: direction,
......
...@@ -35,7 +35,7 @@ class Theme extends InheritedWidget { ...@@ -35,7 +35,7 @@ class Theme extends InheritedWidget {
Key key, Key key,
@required this.data, @required this.data,
this.isMaterialAppTheme: false, this.isMaterialAppTheme: false,
Widget child @required Widget child
}) : super(key: key, child: child) { }) : super(key: key, child: child) {
assert(child != null); assert(child != null);
assert(data != null); assert(data != null);
......
...@@ -184,36 +184,36 @@ class ThemeData { ...@@ -184,36 +184,36 @@ class ThemeData {
/// create intermediate themes based on two themes created with the /// create intermediate themes based on two themes created with the
/// [new ThemeData] constructor. /// [new ThemeData] constructor.
ThemeData.raw({ ThemeData.raw({
this.brightness, @required this.brightness,
this.primaryColor, @required this.primaryColor,
this.primaryColorBrightness, @required this.primaryColorBrightness,
this.accentColor, @required this.accentColor,
this.accentColorBrightness, @required this.accentColorBrightness,
this.canvasColor, @required this.canvasColor,
this.scaffoldBackgroundColor, @required this.scaffoldBackgroundColor,
this.cardColor, @required this.cardColor,
this.dividerColor, @required this.dividerColor,
this.highlightColor, @required this.highlightColor,
this.splashColor, @required this.splashColor,
this.selectedRowColor, @required this.selectedRowColor,
this.unselectedWidgetColor, @required this.unselectedWidgetColor,
this.disabledColor, @required this.disabledColor,
this.buttonColor, @required this.buttonColor,
this.secondaryHeaderColor, @required this.secondaryHeaderColor,
this.textSelectionColor, @required this.textSelectionColor,
this.textSelectionHandleColor, @required this.textSelectionHandleColor,
this.backgroundColor, @required this.backgroundColor,
this.dialogBackgroundColor, @required this.dialogBackgroundColor,
this.indicatorColor, @required this.indicatorColor,
this.hintColor, @required this.hintColor,
this.errorColor, @required this.errorColor,
this.textTheme, @required this.textTheme,
this.primaryTextTheme, @required this.primaryTextTheme,
this.accentTextTheme, @required this.accentTextTheme,
this.iconTheme, @required this.iconTheme,
this.primaryIconTheme, @required this.primaryIconTheme,
this.accentIconTheme, @required this.accentIconTheme,
this.platform @required this.platform
}) { }) {
assert(brightness != null); assert(brightness != null);
assert(primaryColor != null); assert(primaryColor != null);
...@@ -222,7 +222,6 @@ class ThemeData { ...@@ -222,7 +222,6 @@ class ThemeData {
assert(accentColorBrightness != null); assert(accentColorBrightness != null);
assert(canvasColor != null); assert(canvasColor != null);
assert(scaffoldBackgroundColor != null); assert(scaffoldBackgroundColor != null);
assert(dialogBackgroundColor != null);
assert(cardColor != null); assert(cardColor != null);
assert(dividerColor != null); assert(dividerColor != null);
assert(highlightColor != null); assert(highlightColor != null);
...@@ -234,7 +233,8 @@ class ThemeData { ...@@ -234,7 +233,8 @@ class ThemeData {
assert(secondaryHeaderColor != null); assert(secondaryHeaderColor != null);
assert(textSelectionColor != null); assert(textSelectionColor != null);
assert(textSelectionHandleColor != null); assert(textSelectionHandleColor != null);
assert(disabledColor != null); assert(backgroundColor != null);
assert(dialogBackgroundColor != null);
assert(indicatorColor != null); assert(indicatorColor != null);
assert(hintColor != null); assert(hintColor != null);
assert(errorColor != null); assert(errorColor != null);
......
...@@ -625,7 +625,7 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin { ...@@ -625,7 +625,7 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin {
class _TimePickerDialog extends StatefulWidget { class _TimePickerDialog extends StatefulWidget {
_TimePickerDialog({ _TimePickerDialog({
Key key, Key key,
this.initialTime @required this.initialTime
}) : super(key: key) { }) : super(key: key) {
assert(initialTime != null); assert(initialTime != null);
} }
...@@ -793,9 +793,10 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -793,9 +793,10 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
/// * [showDatePicker] /// * [showDatePicker]
/// * <https://material.google.com/components/pickers.html#pickers-time-pickers> /// * <https://material.google.com/components/pickers.html#pickers-time-pickers>
Future<TimeOfDay> showTimePicker({ Future<TimeOfDay> showTimePicker({
BuildContext context, @required BuildContext context,
TimeOfDay initialTime @required TimeOfDay initialTime
}) async { }) async {
assert(context != null);
assert(initialTime != null); assert(initialTime != null);
return await showDialog( return await showDialog(
context: context, context: context,
......
...@@ -24,10 +24,10 @@ abstract class RenderToggleable extends RenderConstrainedBox implements Semantic ...@@ -24,10 +24,10 @@ abstract class RenderToggleable extends RenderConstrainedBox implements Semantic
/// The [value], [activeColor], and [inactiveColor] arguments must not be /// The [value], [activeColor], and [inactiveColor] arguments must not be
/// null. /// null.
RenderToggleable({ RenderToggleable({
bool value, @required bool value,
Size size, Size size,
Color activeColor, @required Color activeColor,
Color inactiveColor, @required Color inactiveColor,
ValueChanged<bool> onChanged, ValueChanged<bool> onChanged,
@required TickerProvider vsync, @required TickerProvider vsync,
}) : _value = value, }) : _value = value,
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:math' as math; import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
...@@ -42,12 +43,12 @@ class Tooltip extends StatefulWidget { ...@@ -42,12 +43,12 @@ class Tooltip extends StatefulWidget {
/// The [message] argument cannot be null. /// The [message] argument cannot be null.
Tooltip({ Tooltip({
Key key, Key key,
this.message, @required this.message,
this.height: 32.0, this.height: 32.0,
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, @required this.child,
}) : super(key: key) { }) : super(key: key) {
assert(message != null); assert(message != null);
assert(height != null); assert(height != null);
......
...@@ -1259,7 +1259,7 @@ class BoxDecoration extends Decoration { ...@@ -1259,7 +1259,7 @@ class BoxDecoration extends Decoration {
/// An object that paints a [BoxDecoration] into a canvas. /// An object that paints a [BoxDecoration] into a canvas.
class _BoxDecorationPainter extends BoxPainter { class _BoxDecorationPainter extends BoxPainter {
_BoxDecorationPainter(this._decoration, VoidCallback onChange) : super(onChange) { _BoxDecorationPainter(@required this._decoration, VoidCallback onChange) : super(onChange) {
assert(_decoration != null); assert(_decoration != null);
} }
......
...@@ -267,7 +267,7 @@ class RenderCustomMultiChildLayoutBox extends RenderBox ...@@ -267,7 +267,7 @@ class RenderCustomMultiChildLayoutBox extends RenderBox
/// The [delegate] argument must not be null. /// The [delegate] argument must not be null.
RenderCustomMultiChildLayoutBox({ RenderCustomMultiChildLayoutBox({
List<RenderBox> children, List<RenderBox> children,
MultiChildLayoutDelegate delegate @required MultiChildLayoutDelegate delegate
}) : _delegate = delegate { }) : _delegate = delegate {
assert(delegate != null); assert(delegate != null);
addAll(children); addAll(children);
......
...@@ -180,7 +180,7 @@ class RenderFlow extends RenderBox ...@@ -180,7 +180,7 @@ class RenderFlow extends RenderBox
/// [isRepaintBounday]. /// [isRepaintBounday].
RenderFlow({ RenderFlow({
List<RenderBox> children, List<RenderBox> children,
FlowDelegate delegate @required FlowDelegate delegate
}) : _delegate = delegate { }) : _delegate = delegate {
assert(delegate != null); assert(delegate != null);
addAll(children); addAll(children);
......
...@@ -613,9 +613,14 @@ class _SemanticsGeometry { ...@@ -613,9 +613,14 @@ class _SemanticsGeometry {
parent.applyPaintTransform(child, transform); parent.applyPaintTransform(child, transform);
} }
} }
void updateSemanticsNode({ RenderObject rendering, SemanticsNode semantics, SemanticsNode parentSemantics }) { void updateSemanticsNode({
@required RenderObject rendering,
@required SemanticsNode semantics,
@required SemanticsNode parentSemantics,
}) {
assert(rendering != null); assert(rendering != null);
assert(semantics != null); assert(semantics != null);
assert(parentSemantics != null);
assert(parentSemantics.wasAffectedByClip != null); assert(parentSemantics.wasAffectedByClip != null);
semantics.transform = transform; semantics.transform = transform;
if (clipRect != null) { if (clipRect != null) {
...@@ -630,7 +635,7 @@ class _SemanticsGeometry { ...@@ -630,7 +635,7 @@ class _SemanticsGeometry {
abstract class _SemanticsFragment { abstract class _SemanticsFragment {
_SemanticsFragment({ _SemanticsFragment({
RenderObject renderObjectOwner, @required RenderObject renderObjectOwner,
this.annotator, this.annotator,
List<_SemanticsFragment> children List<_SemanticsFragment> children
}) { }) {
...@@ -670,8 +675,9 @@ abstract class _SemanticsFragment { ...@@ -670,8 +675,9 @@ abstract class _SemanticsFragment {
/// that comes from the (dirty) ancestors.) /// that comes from the (dirty) ancestors.)
class _CleanSemanticsFragment extends _SemanticsFragment { class _CleanSemanticsFragment extends _SemanticsFragment {
_CleanSemanticsFragment({ _CleanSemanticsFragment({
RenderObject renderObjectOwner @required RenderObject renderObjectOwner
}) : super(renderObjectOwner: renderObjectOwner) { }) : super(renderObjectOwner: renderObjectOwner) {
assert(renderObjectOwner != null);
assert(renderObjectOwner._semantics != null); assert(renderObjectOwner._semantics != null);
} }
...@@ -829,14 +835,18 @@ class _ImplicitSemanticsFragment extends _InterestingSemanticsFragment { ...@@ -829,14 +835,18 @@ class _ImplicitSemanticsFragment extends _InterestingSemanticsFragment {
class _ForkingSemanticsFragment extends _SemanticsFragment { class _ForkingSemanticsFragment extends _SemanticsFragment {
_ForkingSemanticsFragment({ _ForkingSemanticsFragment({
RenderObject renderObjectOwner, RenderObject renderObjectOwner,
Iterable<_SemanticsFragment> children @required Iterable<_SemanticsFragment> children
}) : super(renderObjectOwner: renderObjectOwner, children: children) { }) : super(renderObjectOwner: renderObjectOwner, children: children) {
assert(children != null); assert(children != null);
assert(children.length > 1); assert(children.length > 1);
} }
@override @override
Iterable<SemanticsNode> compile({ _SemanticsGeometry geometry, SemanticsNode currentSemantics, SemanticsNode parentSemantics }) sync* { Iterable<SemanticsNode> compile({
@required _SemanticsGeometry geometry,
SemanticsNode currentSemantics,
SemanticsNode parentSemantics
}) sync* {
assert(!_debugCompiled); assert(!_debugCompiled);
assert(() { _debugCompiled = true; return true; }); assert(() { _debugCompiled = true; return true; });
assert(geometry != null); assert(geometry != null);
......
...@@ -835,7 +835,7 @@ class RenderBackdropFilter extends RenderProxyBox { ...@@ -835,7 +835,7 @@ class RenderBackdropFilter extends RenderProxyBox {
/// Creates a backdrop filter. /// Creates a backdrop filter.
/// ///
/// The [filter] argument must not be null. /// The [filter] argument must not be null.
RenderBackdropFilter({ RenderBox child, ui.ImageFilter filter }) RenderBackdropFilter({ RenderBox child, @required ui.ImageFilter filter })
: _filter = filter, super(child) { : _filter = filter, super(child) {
assert(filter != null); assert(filter != null);
} }
...@@ -1426,7 +1426,7 @@ class RenderTransform extends RenderProxyBox { ...@@ -1426,7 +1426,7 @@ class RenderTransform extends RenderProxyBox {
/// ///
/// The [transform] argument must not be null. /// The [transform] argument must not be null.
RenderTransform({ RenderTransform({
Matrix4 transform, @required Matrix4 transform,
Offset origin, Offset origin,
FractionalOffset alignment, FractionalOffset alignment,
this.transformHitTests: true, this.transformHitTests: true,
......
...@@ -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/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
import 'package:vector_math/vector_math_64.dart'; import 'package:vector_math/vector_math_64.dart';
...@@ -23,7 +24,7 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB ...@@ -23,7 +24,7 @@ class RenderRotatedBox extends RenderBox with RenderObjectWithChildMixin<RenderB
/// ///
/// The [quarterTurns] argument must not be null. /// The [quarterTurns] argument must not be null.
RenderRotatedBox({ RenderRotatedBox({
int quarterTurns, @required int quarterTurns,
RenderBox child RenderBox child
}) : _quarterTurns = quarterTurns { }) : _quarterTurns = quarterTurns {
assert(quarterTurns != null); assert(quarterTurns != null);
......
...@@ -93,7 +93,7 @@ class RenderPadding extends RenderShiftedBox { ...@@ -93,7 +93,7 @@ class RenderPadding extends RenderShiftedBox {
/// ///
/// The [padding] argument must not be null and must have non-negative insets. /// The [padding] argument must not be null and must have non-negative insets.
RenderPadding({ RenderPadding({
EdgeInsets padding, @required EdgeInsets padding,
RenderBox child RenderBox child
}) : _padding = padding, super(child) { }) : _padding = padding, super(child) {
assert(padding != null); assert(padding != null);
...@@ -499,7 +499,7 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox { ...@@ -499,7 +499,7 @@ class RenderSizedOverflowBox extends RenderAligningShiftedBox {
/// The [requestedSize] argument must not be null. /// The [requestedSize] argument must not be null.
RenderSizedOverflowBox({ RenderSizedOverflowBox({
RenderBox child, RenderBox child,
Size requestedSize, @required Size requestedSize,
FractionalOffset alignment: FractionalOffset.center FractionalOffset alignment: FractionalOffset.center
}) : _requestedSize = requestedSize, }) : _requestedSize = requestedSize,
super(child: child, alignment: alignment) { super(child: child, alignment: alignment) {
...@@ -792,7 +792,7 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox { ...@@ -792,7 +792,7 @@ class RenderCustomSingleChildLayoutBox extends RenderShiftedBox {
/// The [delegate] argument must not be null. /// The [delegate] argument must not be null.
RenderCustomSingleChildLayoutBox({ RenderCustomSingleChildLayoutBox({
RenderBox child, RenderBox child,
SingleChildLayoutDelegate delegate @required SingleChildLayoutDelegate delegate
}) : _delegate = delegate, super(child) { }) : _delegate = delegate, super(child) {
assert(delegate != null); assert(delegate != null);
} }
...@@ -901,8 +901,8 @@ class RenderBaseline extends RenderShiftedBox { ...@@ -901,8 +901,8 @@ class RenderBaseline extends RenderShiftedBox {
/// The [baseline] and [baselineType] arguments must not be null. /// The [baseline] and [baselineType] arguments must not be null.
RenderBaseline({ RenderBaseline({
RenderBox child, RenderBox child,
double baseline, @required double baseline,
TextBaseline baselineType @required TextBaseline baselineType
}) : _baseline = baseline, }) : _baseline = baseline,
_baselineType = baselineType, _baselineType = baselineType,
super(child) { super(child) {
......
...@@ -29,7 +29,7 @@ class RenderSliverPadding extends RenderSliver with RenderObjectWithChildMixin<R ...@@ -29,7 +29,7 @@ class RenderSliverPadding extends RenderSliver with RenderObjectWithChildMixin<R
/// ///
/// The [padding] argument must not be null and must have non-negative insets. /// The [padding] argument must not be null and must have non-negative insets.
RenderSliverPadding({ RenderSliverPadding({
EdgeInsets padding, @required EdgeInsets padding,
RenderSliver child, RenderSliver child,
}) : _padding = padding { }) : _padding = padding {
assert(padding != null); assert(padding != null);
......
...@@ -489,7 +489,7 @@ class RenderIndexedStack extends RenderStack { ...@@ -489,7 +489,7 @@ class RenderIndexedStack extends RenderStack {
} }
@override @override
bool hitTestChildren(HitTestResult result, { Point position }) { bool hitTestChildren(HitTestResult result, { @required Point position }) {
if (firstChild == null || index == null) if (firstChild == null || index == null)
return false; return false;
assert(position != null); assert(position != null);
......
...@@ -15,7 +15,7 @@ class ImageInfo { ...@@ -15,7 +15,7 @@ class ImageInfo {
/// Creates an [ImageInfo] object for the given image and scale. /// Creates an [ImageInfo] object for the given image and scale.
/// ///
/// Both the image and the scale must not be null. /// Both the image and the scale must not be null.
ImageInfo({ this.image, this.scale: 1.0 }) { ImageInfo({ @required this.image, this.scale: 1.0 }) {
assert(image != null); assert(image != null);
assert(scale != null); assert(scale != null);
} }
......
...@@ -2314,7 +2314,7 @@ class Flow extends MultiChildRenderObjectWidget { ...@@ -2314,7 +2314,7 @@ class Flow extends MultiChildRenderObjectWidget {
/// The [delegate] argument must not be null. /// The [delegate] argument must not be null.
Flow.unwrapped({ Flow.unwrapped({
Key key, Key key,
this.delegate, @required this.delegate,
List<Widget> children: const <Widget>[], List<Widget> children: const <Widget>[],
}) : super(key: key, children: children) { }) : super(key: key, children: children) {
assert(delegate != null); assert(delegate != null);
......
...@@ -128,8 +128,8 @@ class Dismissible extends StatefulWidget { ...@@ -128,8 +128,8 @@ class Dismissible extends StatefulWidget {
class _DismissibleClipper extends CustomClipper<Rect> { class _DismissibleClipper extends CustomClipper<Rect> {
_DismissibleClipper({ _DismissibleClipper({
this.axis, @required this.axis,
this.moveAnimation @required this.moveAnimation
}) : super(reclip: moveAnimation) { }) : super(reclip: moveAnimation) {
assert(axis != null); assert(axis != null);
assert(moveAnimation != null); assert(moveAnimation != null);
......
...@@ -437,7 +437,7 @@ typedef void _OnDragEnd(Velocity velocity, Offset offset, bool wasAccepted); ...@@ -437,7 +437,7 @@ typedef void _OnDragEnd(Velocity velocity, Offset offset, bool wasAccepted);
// eeding this object pointer events even after it has been disposed. // eeding this object pointer events even after it has been disposed.
class _DragAvatar<T> extends Drag { class _DragAvatar<T> extends Drag {
_DragAvatar({ _DragAvatar({
this.overlayState, @required this.overlayState,
this.data, this.data,
Point initialPosition, Point initialPosition,
this.dragStartPoint: Point.origin, this.dragStartPoint: Point.origin,
......
...@@ -21,7 +21,7 @@ class _FocusScope extends InheritedWidget { ...@@ -21,7 +21,7 @@ class _FocusScope extends InheritedWidget {
_FocusScope({ _FocusScope({
Key key, Key key,
this.focusState, this.focusState,
this.scopeFocused, @required this.scopeFocused,
this.focusedScope, this.focusedScope,
this.focusedWidget, this.focusedWidget,
@required Widget child, @required Widget child,
......
...@@ -516,7 +516,7 @@ class AnimatedOpacity extends ImplicitlyAnimatedWidget { ...@@ -516,7 +516,7 @@ class AnimatedOpacity extends ImplicitlyAnimatedWidget {
AnimatedOpacity({ AnimatedOpacity({
Key key, Key key,
this.child, this.child,
this.opacity, @required this.opacity,
Curve curve: Curves.linear, Curve curve: Curves.linear,
@required Duration duration, @required Duration duration,
}) : super(key: key, curve: curve, duration: duration) { }) : super(key: key, curve: curve, duration: duration) {
......
...@@ -825,7 +825,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -825,7 +825,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// ///
/// This can be useful in combination with [removeRouteBelow] when building a /// This can be useful in combination with [removeRouteBelow] when building a
/// non-linear user experience. /// non-linear user experience.
void replace({ Route<dynamic> oldRoute, Route<dynamic> newRoute }) { void replace({ @required Route<dynamic> oldRoute, @required Route<dynamic> newRoute }) {
assert(!_debugLocked); assert(!_debugLocked);
assert(oldRoute != null); assert(oldRoute != null);
assert(newRoute != null); assert(newRoute != null);
...@@ -919,7 +919,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin { ...@@ -919,7 +919,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// route must not be the first route in the history. /// route must not be the first route in the history.
/// ///
/// In every other way, this acts the same as [replace]. /// In every other way, this acts the same as [replace].
void replaceRouteBelow({ Route<dynamic> anchorRoute, Route<dynamic> newRoute }) { void replaceRouteBelow({ @required Route<dynamic> anchorRoute, Route<dynamic> newRoute }) {
assert(anchorRoute != null); assert(anchorRoute != null);
assert(anchorRoute._navigator == this); assert(anchorRoute._navigator == this);
assert(_history.indexOf(anchorRoute) > 0); assert(_history.indexOf(anchorRoute) > 0);
......
...@@ -386,7 +386,7 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin { ...@@ -386,7 +386,7 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin {
class _Theatre extends RenderObjectWidget { class _Theatre extends RenderObjectWidget {
_Theatre({ _Theatre({
this.onstage, this.onstage,
this.offstage, @required this.offstage,
}) { }) {
assert(offstage != null); assert(offstage != null);
assert(!offstage.any((Widget child) => child == null)); assert(!offstage.any((Widget child) => child == null));
......
...@@ -222,7 +222,7 @@ enum _GlowState { idle, absorb, pull, recede } ...@@ -222,7 +222,7 @@ enum _GlowState { idle, absorb, pull, recede }
class _GlowController extends ChangeNotifier { class _GlowController extends ChangeNotifier {
_GlowController({ _GlowController({
TickerProvider vsync, @required TickerProvider vsync,
@required Color color, @required Color color,
@required Axis axis, @required Axis axis,
}) : _color = color, }) : _color = color,
......
// Copyright 2015 The Chromium Authors. All rights reserved. // Copyright 2015 The Chromium Authors. All rights reserved.
// 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 'basic.dart'; import 'basic.dart';
import 'framework.dart'; import 'framework.dart';
...@@ -68,7 +69,7 @@ class PageRouteBuilder<T> extends PageRoute<T> { ...@@ -68,7 +69,7 @@ class PageRouteBuilder<T> extends PageRoute<T> {
/// and [maintainState] arguments must not be null. /// and [maintainState] arguments must not be null.
PageRouteBuilder({ PageRouteBuilder({
RouteSettings settings: const RouteSettings(), RouteSettings settings: const RouteSettings(),
this.pageBuilder, @required this.pageBuilder,
this.transitionsBuilder: _defaultTransitionsBuilder, this.transitionsBuilder: _defaultTransitionsBuilder,
this.transitionDuration: const Duration(milliseconds: 300), this.transitionDuration: const Duration(milliseconds: 300),
this.opaque: true, this.opaque: true,
......
...@@ -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/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
...@@ -56,7 +57,7 @@ class SizeChangedLayoutNotifier extends SingleChildRenderObjectWidget { ...@@ -56,7 +57,7 @@ class SizeChangedLayoutNotifier extends SingleChildRenderObjectWidget {
class _RenderSizeChangedWithCallback extends RenderProxyBox { class _RenderSizeChangedWithCallback extends RenderProxyBox {
_RenderSizeChangedWithCallback({ _RenderSizeChangedWithCallback({
RenderBox child, RenderBox child,
this.onLayoutChangedCallback @required this.onLayoutChangedCallback
}) : super(child) { }) : super(child) {
assert(onLayoutChangedCallback != null); assert(onLayoutChangedCallback != null);
} }
......
...@@ -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/src/widgets/basic.dart'; import 'package:flutter/src/widgets/basic.dart';
import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/src/widgets/layout_builder.dart'; import 'package:flutter/src/widgets/layout_builder.dart';
...@@ -10,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart' hide TypeMatcher; ...@@ -10,7 +11,7 @@ import 'package:flutter_test/flutter_test.dart' hide TypeMatcher;
class Wrapper extends StatelessWidget { class Wrapper extends StatelessWidget {
Wrapper({ Wrapper({
Key key, Key key,
this.child @required this.child
}) : super(key: key) { }) : super(key: key) {
assert(child != null); assert(child != null);
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'test_async_utils.dart'; import 'test_async_utils.dart';
...@@ -135,8 +136,8 @@ class TestGesture { ...@@ -135,8 +136,8 @@ class TestGesture {
/// via the `dispatcher` argument. /// via the `dispatcher` argument.
static Future<TestGesture> down(Point downLocation, { static Future<TestGesture> down(Point downLocation, {
int pointer: 1, int pointer: 1,
HitTester hitTester, @required HitTester hitTester,
EventDispatcher dispatcher @required EventDispatcher dispatcher,
}) async { }) async {
assert(hitTester != null); assert(hitTester != null);
assert(dispatcher != null); assert(dispatcher != null);
......
...@@ -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:meta/meta.dart' show required;
import 'package:xml/xml.dart' as xml; import 'package:xml/xml.dart' as xml;
import 'android/android_sdk.dart'; import 'android/android_sdk.dart';
...@@ -18,7 +19,7 @@ abstract class ApplicationPackage { ...@@ -18,7 +19,7 @@ abstract class ApplicationPackage {
/// Package ID from the Android Manifest or equivalent. /// Package ID from the Android Manifest or equivalent.
final String id; final String id;
ApplicationPackage({ this.id }) { ApplicationPackage({ @required this.id }) {
assert(id != null); assert(id != null);
} }
...@@ -41,8 +42,8 @@ class AndroidApk extends ApplicationPackage { ...@@ -41,8 +42,8 @@ class AndroidApk extends ApplicationPackage {
AndroidApk({ AndroidApk({
String id, String id,
this.apkPath, @required this.apkPath,
this.launchActivity @required this.launchActivity
}) : super(id: id) { }) : super(id: id) {
assert(apkPath != null); assert(apkPath != null);
assert(launchActivity != null); assert(launchActivity != null);
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
import 'dart:async'; import 'dart:async';
import 'package:meta/meta.dart' show required;
import '../android/android_sdk.dart'; import '../android/android_sdk.dart';
import '../android/gradle.dart'; import '../android/gradle.dart';
import '../base/common.dart'; import '../base/common.dart';
...@@ -14,7 +16,7 @@ import 'build.dart'; ...@@ -14,7 +16,7 @@ import 'build.dart';
export '../android/android_device.dart' show AndroidDevice; export '../android/android_device.dart' show AndroidDevice;
class ApkKeystoreInfo { class ApkKeystoreInfo {
ApkKeystoreInfo({ this.keystore, this.password, this.keyAlias, this.keyPassword }) { ApkKeystoreInfo({ this.keystore, this.password, this.keyAlias, @required this.keyPassword }) {
assert(keystore != null); assert(keystore != null);
} }
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
import 'dart:async'; import 'dart:async';
import 'package:meta/meta.dart' show required;
import 'artifacts.dart'; import 'artifacts.dart';
import 'asset.dart'; import 'asset.dart';
import 'base/common.dart'; import 'base/common.dart';
...@@ -27,10 +29,10 @@ const String _kKernelKey = 'kernel_blob.bin'; ...@@ -27,10 +29,10 @@ const String _kKernelKey = 'kernel_blob.bin';
const String _kSnapshotKey = 'snapshot_blob.bin'; const String _kSnapshotKey = 'snapshot_blob.bin';
Future<int> createSnapshot({ Future<int> createSnapshot({
String mainPath, @required String mainPath,
String snapshotPath, @required String snapshotPath,
String depfilePath, String depfilePath,
String packages @required String packages
}) { }) {
assert(mainPath != null); assert(mainPath != null);
assert(snapshotPath != null); assert(snapshotPath != null);
......
...@@ -72,7 +72,7 @@ typedef Future<Null> _Finalizer(); ...@@ -72,7 +72,7 @@ typedef Future<Null> _Finalizer();
class _FlutterPlatform extends PlatformPlugin { class _FlutterPlatform extends PlatformPlugin {
_FlutterPlatform({ _FlutterPlatform({
this.shellPath, @required this.shellPath,
this.collector, this.collector,
this.debuggerMode, this.debuggerMode,
this.explicitObservatoryPort, this.explicitObservatoryPort,
......
...@@ -8,6 +8,7 @@ import 'dart:convert' show BASE64; ...@@ -8,6 +8,7 @@ import 'dart:convert' show BASE64;
import 'package:file/file.dart'; import 'package:file/file.dart';
import 'package:json_rpc_2/error_code.dart' as rpc_error_code; import 'package:json_rpc_2/error_code.dart' as rpc_error_code;
import 'package:json_rpc_2/json_rpc_2.dart' as rpc; import 'package:json_rpc_2/json_rpc_2.dart' as rpc;
import 'package:meta/meta.dart' show required;
import 'package:stream_channel/stream_channel.dart'; import 'package:stream_channel/stream_channel.dart';
import 'package:web_socket_channel/io.dart'; import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/web_socket_channel.dart'; import 'package:web_socket_channel/web_socket_channel.dart';
...@@ -680,8 +681,8 @@ class VM extends ServiceObjectOwner { ...@@ -680,8 +681,8 @@ class VM extends ServiceObjectOwner {
// Write one file into a file system. // Write one file into a file system.
Future<Map<String, dynamic>> writeDevFSFile(String fsName, { Future<Map<String, dynamic>> writeDevFSFile(String fsName, {
String path, @required String path,
List<int> fileContents @required List<int> fileContents
}) { }) {
assert(path != null); assert(path != null);
assert(fileContents != null); assert(fileContents != null);
......
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