Commit 7d713263 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

apply prefer_asserts_in_initializer_list lint (#10540)

parent 3e645ee2
...@@ -117,10 +117,9 @@ class ListModel<E> { ...@@ -117,10 +117,9 @@ class ListModel<E> {
@required this.listKey, @required this.listKey,
@required this.removedItemBuilder, @required this.removedItemBuilder,
Iterable<E> initialItems, Iterable<E> initialItems,
}) : _items = new List<E>.from(initialItems ?? <E>[]) { }) : assert(listKey != null),
assert(listKey != null); assert(removedItemBuilder != null),
assert(removedItemBuilder != null); _items = new List<E>.from(initialItems ?? <E>[]);
}
final GlobalKey<AnimatedListState> listKey; final GlobalKey<AnimatedListState> listKey;
final dynamic removedItemBuilder; final dynamic removedItemBuilder;
...@@ -159,11 +158,10 @@ class CardItem extends StatelessWidget { ...@@ -159,11 +158,10 @@ class CardItem extends StatelessWidget {
this.onTap, this.onTap,
@required this.item, @required this.item,
this.selected: false this.selected: false
}) : super(key: key) { }) : assert(animation != null),
assert(animation != null); assert(item != null && item >= 0),
assert(item != null && item >= 0); assert(selected != null),
assert(selected != null); super(key: key);
}
final Animation<double> animation; final Animation<double> animation;
final VoidCallback onTap; final VoidCallback onTap;
......
...@@ -35,10 +35,10 @@ class _RenderStatusBarPaddingSliver extends RenderSliver { ...@@ -35,10 +35,10 @@ class _RenderStatusBarPaddingSliver extends RenderSliver {
_RenderStatusBarPaddingSliver({ _RenderStatusBarPaddingSliver({
@required double maxHeight, @required double maxHeight,
@required double scrollFactor, @required double 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); _maxHeight = maxHeight,
} _scrollFactor = scrollFactor;
// The height of the status bar // The height of the status bar
double get maxHeight => _maxHeight; double get maxHeight => _maxHeight;
...@@ -79,10 +79,9 @@ class _StatusBarPaddingSliver extends SingleChildRenderObjectWidget { ...@@ -79,10 +79,9 @@ class _StatusBarPaddingSliver extends SingleChildRenderObjectWidget {
Key key, Key key,
@required this.maxHeight, @required this.maxHeight,
this.scrollFactor: 5.0, this.scrollFactor: 5.0,
}) : super(key: key) { }) : assert(maxHeight != null && maxHeight >= 0.0),
assert(maxHeight != null && maxHeight >= 0.0); assert(scrollFactor != null && scrollFactor >= 1.0),
assert(scrollFactor != null && scrollFactor >= 1.0); super(key: key);
}
final double maxHeight; final double maxHeight;
final double scrollFactor; final double scrollFactor;
...@@ -272,14 +271,13 @@ class _AllSectionsView extends AnimatedWidget { ...@@ -272,14 +271,13 @@ class _AllSectionsView extends AnimatedWidget {
this.midHeight, this.midHeight,
this.maxHeight, this.maxHeight,
this.sectionCards: const <Widget>[], this.sectionCards: const <Widget>[],
}) : super(key: key, listenable: selectedIndex) { }) : assert(sections != null),
assert(sections != null); assert(sectionCards != null),
assert(sectionCards != null); assert(sectionCards.length == sections.length),
assert(sectionCards.length == sections.length); assert(sectionIndex >= 0 && sectionIndex < sections.length),
assert(sectionIndex >= 0 && sectionIndex < sections.length); assert(selectedIndex != null),
assert(selectedIndex != null); assert(selectedIndex.value >= 0.0 && selectedIndex.value < sections.length.toDouble()),
assert(selectedIndex.value >= 0.0 && selectedIndex.value < sections.length.toDouble()); super(key: key, listenable: selectedIndex);
}
final int sectionIndex; final int sectionIndex;
final List<Section> sections; final List<Section> sections;
......
...@@ -11,9 +11,9 @@ const double kSectionIndicatorWidth = 32.0; ...@@ -11,9 +11,9 @@ 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, @required this.section }) : super(key: key) { SectionCard({ Key key, @required this.section })
assert(section != null); : assert(section != null),
} super(key: key);
final Section section; final Section section;
...@@ -65,11 +65,10 @@ class SectionTitle extends StatelessWidget { ...@@ -65,11 +65,10 @@ class SectionTitle extends StatelessWidget {
@required this.section, @required this.section,
@required this.scale, @required this.scale,
@required this.opacity, @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); super(key: key);
}
final Section section; final Section section;
final double scale; final double scale;
...@@ -118,10 +117,10 @@ class SectionIndicator extends StatelessWidget { ...@@ -118,10 +117,10 @@ class SectionIndicator extends StatelessWidget {
// Display a single SectionDetail. // Display a single SectionDetail.
class SectionDetailView extends StatelessWidget { class SectionDetailView extends StatelessWidget {
SectionDetailView({ Key key, @required this.detail }) : super(key: key) { SectionDetailView({ Key key, @required this.detail })
assert(detail != null && detail.imageAsset != null); : assert(detail != null && detail.imageAsset != null),
assert((detail.imageAsset ?? detail.title) != null); assert((detail.imageAsset ?? detail.title) != null),
} super(key: key);
final SectionDetail detail; final SectionDetail detail;
......
...@@ -47,11 +47,10 @@ class ColorItem extends StatelessWidget { ...@@ -47,11 +47,10 @@ class ColorItem extends StatelessWidget {
@required this.index, @required this.index,
@required this.color, @required this.color,
this.prefix: '', this.prefix: '',
}) : super(key: key) { }) : assert(index != null),
assert(index != null); assert(color != null),
assert(color != null); assert(prefix != null),
assert(prefix != null); super(key: key);
}
final int index; final int index;
final Color color; final Color color;
...@@ -84,9 +83,8 @@ class PaletteTabView extends StatelessWidget { ...@@ -84,9 +83,8 @@ class PaletteTabView extends StatelessWidget {
PaletteTabView({ PaletteTabView({
Key key, Key key,
@required this.colors, @required this.colors,
}) : super(key: key) { }) : assert(colors != null && colors.isValid),
assert(colors != null && colors.isValid); super(key: key);
}
final Palette colors; final Palette colors;
......
...@@ -37,9 +37,9 @@ class _ContactCategory extends StatelessWidget { ...@@ -37,9 +37,9 @@ class _ContactCategory extends StatelessWidget {
} }
class _ContactItem extends StatelessWidget { class _ContactItem extends StatelessWidget {
_ContactItem({ Key key, this.icon, this.lines, this.tooltip, this.onPressed }) : super(key: key) { _ContactItem({ Key key, this.icon, this.lines, this.tooltip, this.onPressed })
assert(lines.length > 1); : assert(lines.length > 1),
} super(key: key);
final IconData icon; final IconData icon;
final List<String> lines; final List<String> lines;
......
...@@ -37,9 +37,9 @@ final List<TravelDestination> destinations = <TravelDestination>[ ...@@ -37,9 +37,9 @@ final List<TravelDestination> destinations = <TravelDestination>[
]; ];
class TravelDestinationItem extends StatelessWidget { class TravelDestinationItem extends StatelessWidget {
TravelDestinationItem({ Key key, @required this.destination }) : super(key: key) { TravelDestinationItem({ Key key, @required this.destination })
assert(destination != null && destination.isValid); : assert(destination != null && destination.isValid),
} super(key: key);
static final double height = 366.0; static final double height = 366.0;
final TravelDestination destination; final TravelDestination destination;
......
...@@ -19,11 +19,10 @@ enum DismissDialogAction { ...@@ -19,11 +19,10 @@ enum DismissDialogAction {
class DateTimeItem extends StatelessWidget { class DateTimeItem extends StatelessWidget {
DateTimeItem({ Key key, DateTime dateTime, @required this.onChanged }) DateTimeItem({ Key key, DateTime dateTime, @required this.onChanged })
: date = new DateTime(dateTime.year, dateTime.month, dateTime.day), : assert(onChanged != null),
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);
assert(onChanged != null);
}
final DateTime date; final DateTime date;
final TimeOfDay time; final TimeOfDay time;
......
...@@ -143,11 +143,10 @@ class GridDemoPhotoItem extends StatelessWidget { ...@@ -143,11 +143,10 @@ class GridDemoPhotoItem extends StatelessWidget {
@required this.photo, @required this.photo,
@required this.tileStyle, @required this.tileStyle,
@required this.onBannerTap @required this.onBannerTap
}) : super(key: key) { }) : assert(photo != null && photo.isValid),
assert(photo != null && photo.isValid); assert(tileStyle != null),
assert(tileStyle != null); assert(onBannerTap != null),
assert(onBannerTap != null); super(key: key);
}
final Photo photo; final Photo photo;
final GridDemoTileStyle tileStyle; final GridDemoTileStyle tileStyle;
......
...@@ -116,9 +116,9 @@ class _ShrineGridDelegate extends SliverGridDelegate { ...@@ -116,9 +116,9 @@ 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, @required this.vendor }) : super(key: key) { _VendorItem({ Key key, @required this.vendor })
assert(vendor != null); : assert(vendor != null),
} super(key: key);
final Vendor vendor; final Vendor vendor;
...@@ -240,11 +240,11 @@ class _HeadingLayout extends MultiChildLayoutDelegate { ...@@ -240,11 +240,11 @@ 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, @required this.product }) : super(key: key) { _Heading({ Key key, @required this.product })
assert(product != null); : assert(product != null),
assert(product.featureTitle != null); assert(product.featureTitle != null),
assert(product.featureDescription != null); assert(product.featureDescription != null),
} super(key: key);
final Product product; final Product product;
...@@ -294,9 +294,9 @@ class _Heading extends StatelessWidget { ...@@ -294,9 +294,9 @@ 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, @required this.product, this.onPressed }) : super(key: key) { _ProductItem({ Key key, @required this.product, this.onPressed })
assert(product != null); : assert(product != null),
} super(key: key);
final Product product; final Product product;
final VoidCallback onPressed; final VoidCallback onPressed;
......
...@@ -17,11 +17,10 @@ class _ProductItem extends StatelessWidget { ...@@ -17,11 +17,10 @@ class _ProductItem extends StatelessWidget {
@required this.product, @required this.product,
@required this.quantity, @required this.quantity,
@required this.onChanged, @required this.onChanged,
}) : super(key: key) { }) : assert(product != null),
assert(product != null); assert(quantity != null),
assert(quantity != null); assert(onChanged != null),
assert(onChanged != null); super(key: key);
}
final Product product; final Product product;
final int quantity; final int quantity;
...@@ -70,9 +69,9 @@ class _ProductItem extends StatelessWidget { ...@@ -70,9 +69,9 @@ class _ProductItem extends StatelessWidget {
// Vendor name and description // Vendor name and description
class _VendorItem extends StatelessWidget { class _VendorItem extends StatelessWidget {
_VendorItem({ Key key, @required this.vendor }) : super(key: key) { _VendorItem({ Key key, @required this.vendor })
assert(vendor != null); : assert(vendor != null),
} super(key: key);
final Vendor vendor; final Vendor vendor;
...@@ -146,10 +145,9 @@ class _Heading extends StatelessWidget { ...@@ -146,10 +145,9 @@ class _Heading extends StatelessWidget {
@required this.product, @required this.product,
@required this.quantity, @required this.quantity,
this.quantityChanged, 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); super(key: key);
}
final Product product; final Product product;
final int quantity; final int quantity;
...@@ -213,11 +211,10 @@ class OrderPage extends StatefulWidget { ...@@ -213,11 +211,10 @@ class OrderPage extends StatefulWidget {
@required this.order, @required this.order,
@required this.products, @required this.products,
@required this.shoppingCart, @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); super(key: key);
}
final Order order; final Order order;
final List<Product> products; final List<Product> products;
...@@ -328,9 +325,8 @@ class ShrineOrderRoute extends ShrinePageRoute<Order> { ...@@ -328,9 +325,8 @@ class ShrineOrderRoute extends ShrinePageRoute<Order> {
@required this.order, @required this.order,
WidgetBuilder builder, WidgetBuilder builder,
RouteSettings settings: const RouteSettings(), RouteSettings settings: const RouteSettings(),
}) : super(builder: builder, settings: settings) { }) : assert(order != null),
assert(order != null); super(builder: builder, settings: settings);
}
Order order; Order order;
......
...@@ -22,10 +22,9 @@ class ShrinePage extends StatefulWidget { ...@@ -22,10 +22,9 @@ class ShrinePage extends StatefulWidget {
this.floatingActionButton, this.floatingActionButton,
this.products, this.products,
this.shoppingCart this.shoppingCart
}) : super(key: key) { }) : assert(body != null),
assert(body != null); assert(scaffoldKey != null),
assert(scaffoldKey != null); super(key: key);
}
final GlobalKey<ScaffoldState> scaffoldKey; final GlobalKey<ScaffoldState> scaffoldKey;
final Widget body; final Widget body;
......
...@@ -27,9 +27,9 @@ TextStyle abrilFatfaceRegular34(Color color) => new ShrineStyle.abrilFatface(34. ...@@ -27,9 +27,9 @@ 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, @required Widget child }) : super(key: key, child: child) { ShrineTheme({ Key key, @required Widget child })
assert(child != null); : assert(child != null),
} super(key: key, child: child);
final Color cardBackgroundColor = Colors.white; final Color cardBackgroundColor = Colors.white;
final Color appBarBackgroundColor = Colors.white; final Color appBarBackgroundColor = Colors.white;
......
...@@ -66,11 +66,10 @@ class Product { ...@@ -66,11 +66,10 @@ class Product {
} }
class Order { class Order {
Order({ @required 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);
}
final Product product; final Product product;
final int quantity; final int quantity;
......
...@@ -11,11 +11,10 @@ class TextStyleItem extends StatelessWidget { ...@@ -11,11 +11,10 @@ class TextStyleItem extends StatelessWidget {
@required this.name, @required this.name,
@required this.style, @required this.style,
@required this.text, @required this.text,
}) : super(key: key) { }) : assert(name != null),
assert(name != null); assert(style != null),
assert(style != null); assert(text != null),
assert(text != null); super(key: key);
}
final String name; final String name;
final TextStyle style; final TextStyle style;
......
...@@ -102,10 +102,9 @@ class GalleryDrawer extends StatelessWidget { ...@@ -102,10 +102,9 @@ class GalleryDrawer extends StatelessWidget {
this.onCheckerboardOffscreenLayersChanged, this.onCheckerboardOffscreenLayersChanged,
this.onPlatformChanged, this.onPlatformChanged,
this.onSendFeedback, this.onSendFeedback,
}) : super(key: key) { }) : assert(onThemeChanged != null),
assert(onThemeChanged != null); assert(onTimeDilationChanged != null),
assert(onTimeDilationChanged != null); super(key: key);
}
final bool useLightTheme; final bool useLightTheme;
final ValueChanged<bool> onThemeChanged; final ValueChanged<bool> onThemeChanged;
......
...@@ -80,10 +80,9 @@ class GalleryHome extends StatefulWidget { ...@@ -80,10 +80,9 @@ class GalleryHome extends StatefulWidget {
this.onCheckerboardOffscreenLayersChanged, this.onCheckerboardOffscreenLayersChanged,
this.onPlatformChanged, this.onPlatformChanged,
this.onSendFeedback, this.onSendFeedback,
}) : super(key: key) { }) : assert(onThemeChanged != null),
assert(onThemeChanged != null); assert(onTimeDilationChanged != null),
assert(onTimeDilationChanged != null); super(key: key);
}
final bool useLightTheme; final bool useLightTheme;
final ValueChanged<bool> onThemeChanged; final ValueChanged<bool> onThemeChanged;
......
...@@ -18,12 +18,10 @@ class GalleryItem extends StatelessWidget { ...@@ -18,12 +18,10 @@ class GalleryItem extends StatelessWidget {
@required this.category, @required this.category,
@required this.routeName, @required this.routeName,
@required this.buildRoute, @required this.buildRoute,
}) { }) : assert(title != null),
assert(title != null); assert(category != null),
assert(category != null); assert(routeName != null),
assert(routeName != null); assert(buildRoute != null);
assert(buildRoute != null);
}
final String title; final String title;
final String subtitle; final String subtitle;
......
...@@ -12,9 +12,9 @@ import 'package:url_launcher/url_launcher.dart'; ...@@ -12,9 +12,9 @@ import 'package:url_launcher/url_launcher.dart';
typedef Future<String> UpdateUrlFetcher(); typedef Future<String> UpdateUrlFetcher();
class Updater extends StatefulWidget { class Updater extends StatefulWidget {
Updater({ @required this.updateUrlFetcher, this.child, Key key }) : super(key: key) { Updater({ @required this.updateUrlFetcher, this.child, Key key })
assert(updateUrlFetcher != null); : assert(updateUrlFetcher != null),
} super(key: key);
final UpdateUrlFetcher updateUrlFetcher; final UpdateUrlFetcher updateUrlFetcher;
final Widget child; final Widget child;
......
...@@ -18,12 +18,11 @@ typedef void OnResultListener(String result); ...@@ -18,12 +18,11 @@ typedef void OnResultListener(String result);
// in real-world applications. // in real-world applications.
class Calculator { class Calculator {
Calculator({ @required this.onProgressListener, @required 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 : assert(onProgressListener != null),
// replicate our small json string into a 10,000-element array. assert(onResultListener != null),
: _data = _replicateJson(data, 10000) { // In order to keep the example files smaller, we "cheat" a little and
assert(onProgressListener != null); // replicate our small json string into a 10,000-element array.
assert(onResultListener != null); _data = _replicateJson(data, 10000);
}
final OnProgressListener onProgressListener; final OnProgressListener onProgressListener;
final OnResultListener onResultListener; final OnResultListener onResultListener;
...@@ -87,9 +86,9 @@ class CalculationMessage { ...@@ -87,9 +86,9 @@ class CalculationMessage {
// progress of the background computation. // progress of the background computation.
class CalculationManager { class CalculationManager {
CalculationManager({ @required this.onProgressListener, @required this.onResultListener }) CalculationManager({ @required this.onProgressListener, @required this.onResultListener })
: _receivePort = new ReceivePort() { : assert(onProgressListener != null),
assert(onProgressListener != null); assert(onResultListener != null),
assert(onResultListener != null); _receivePort = new ReceivePort() {
_receivePort.listen(_handleMessage); _receivePort.listen(_handleMessage);
} }
......
...@@ -19,18 +19,16 @@ class StockConfiguration { ...@@ -19,18 +19,16 @@ class StockConfiguration {
@required this.debugShowRainbow, @required this.debugShowRainbow,
@required this.showPerformanceOverlay, @required this.showPerformanceOverlay,
@required this.showSemanticsDebugger @required this.showSemanticsDebugger
}) { }) : assert(stockMode != null),
assert(stockMode != null); assert(backupMode != null),
assert(backupMode != null); assert(debugShowGrid != null),
assert(debugShowGrid != null); assert(debugShowSizes != null),
assert(debugShowSizes != null); assert(debugShowBaselines != null),
assert(debugShowBaselines != null); assert(debugShowLayers != null),
assert(debugShowLayers != null); assert(debugShowPointers != null),
assert(debugShowPointers != null); assert(debugShowRainbow != null),
assert(debugShowRainbow != null); assert(showPerformanceOverlay != null),
assert(showPerformanceOverlay != null); assert(showSemanticsDebugger != null);
assert(showSemanticsDebugger != null);
}
final StockMode stockMode; final StockMode stockMode;
final BackupMode backupMode; final BackupMode backupMode;
......
...@@ -79,9 +79,9 @@ class BitField<T extends dynamic> { ...@@ -79,9 +79,9 @@ class BitField<T extends dynamic> {
/// Creates a bit field of all zeros. /// Creates a bit field of all zeros.
/// ///
/// The given length must be at most 62. /// The given length must be at most 62.
BitField(this._length) : _bits = _kAllZeros { BitField(this._length)
assert(_length <= _kSMIBits); : assert(_length <= _kSMIBits),
} _bits = _kAllZeros;
/// Creates a bit field filled with a particular value. /// Creates a bit field filled with a particular value.
/// ///
...@@ -89,9 +89,10 @@ class BitField<T extends dynamic> { ...@@ -89,9 +89,10 @@ class BitField<T extends dynamic> {
/// the bits are filled with zeros. /// the bits are filled with zeros.
/// ///
/// The given length must be at most 62. /// The given length must be at most 62.
BitField.filled(this._length, bool value) : _bits = value ? _kAllOnes : _kAllZeros { BitField.filled(this._length, bool value)
assert(_length <= _kSMIBits); : assert(_length <= _kSMIBits),
} _bits = value ? _kAllOnes : _kAllZeros;
final int _length; final int _length;
int _bits; int _bits;
......
...@@ -135,8 +135,8 @@ class ClampingScrollSimulation extends Simulation { ...@@ -135,8 +135,8 @@ class ClampingScrollSimulation extends Simulation {
@required this.velocity, @required this.velocity,
this.friction: 0.015, this.friction: 0.015,
Tolerance tolerance: Tolerance.defaultTolerance, Tolerance tolerance: Tolerance.defaultTolerance,
}) : super(tolerance: tolerance) { }) : assert(_flingVelocityPenetration(0.0) == _kInitialVelocityPenetration),
assert(_flingVelocityPenetration(0.0) == _kInitialVelocityPenetration); super(tolerance: tolerance) {
_duration = _flingDuration(velocity); _duration = _flingDuration(velocity);
_distance = (velocity * _duration / _kInitialVelocityPenetration).abs(); _distance = (velocity * _duration / _kInitialVelocityPenetration).abs();
} }
......
...@@ -12,9 +12,8 @@ class Wrapper extends StatelessWidget { ...@@ -12,9 +12,8 @@ class Wrapper extends StatelessWidget {
Wrapper({ Wrapper({
Key key, Key key,
@required this.child @required this.child
}) : super(key: key) { }) : assert(child != null),
assert(child != null); super(key: key);
}
final Widget child; final Widget child;
......
...@@ -113,14 +113,13 @@ class LinkedScrollPosition extends ScrollPositionWithSingleContext { ...@@ -113,14 +113,13 @@ class LinkedScrollPosition extends ScrollPositionWithSingleContext {
ScrollContext context, ScrollContext context,
double initialPixels, double initialPixels,
ScrollPosition oldPosition, ScrollPosition oldPosition,
}) : super( }) : assert(owner != null),
physics: physics, super(
context: context, physics: physics,
initialPixels: initialPixels, context: context,
oldPosition: oldPosition, initialPixels: initialPixels,
) { oldPosition: oldPosition,
assert(owner != null); );
}
final LinkedScrollController owner; final LinkedScrollController owner;
...@@ -547,4 +546,4 @@ void main() { ...@@ -547,4 +546,4 @@ void main() {
await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 1));
await tester.pump(const Duration(seconds: 60)); await tester.pump(const Duration(seconds: 60));
}); });
} }
\ No newline at end of file
...@@ -29,9 +29,8 @@ final EnumIndex<HealthStatus> _healthStatusIndex = ...@@ -29,9 +29,8 @@ final EnumIndex<HealthStatus> _healthStatusIndex =
class Health extends Result { class Health extends Result {
/// Creates a [Health] object with the given [status]. /// Creates a [Health] object with the given [status].
Health(this.status) { Health(this.status)
assert(status != null); : assert(status != null);
}
/// Deserializes the result from JSON. /// Deserializes the result from JSON.
static Health fromJson(Map<String, dynamic> json) { static Health fromJson(Map<String, dynamic> json) {
......
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