diff --git a/examples/catalog/lib/animated_list.dart b/examples/catalog/lib/animated_list.dart index 5742ed511a..6fcba2eddd 100644 --- a/examples/catalog/lib/animated_list.dart +++ b/examples/catalog/lib/animated_list.dart @@ -117,10 +117,9 @@ class ListModel { @required this.listKey, @required this.removedItemBuilder, Iterable initialItems, - }) : _items = new List.from(initialItems ?? []) { - assert(listKey != null); - assert(removedItemBuilder != null); - } + }) : assert(listKey != null), + assert(removedItemBuilder != null), + _items = new List.from(initialItems ?? []); final GlobalKey listKey; final dynamic removedItemBuilder; @@ -159,11 +158,10 @@ class CardItem extends StatelessWidget { this.onTap, @required this.item, this.selected: false - }) : super(key: key) { - assert(animation != null); - assert(item != null && item >= 0); - assert(selected != null); - } + }) : assert(animation != null), + assert(item != null && item >= 0), + assert(selected != null), + super(key: key); final Animation animation; final VoidCallback onTap; diff --git a/examples/flutter_gallery/lib/demo/animation/home.dart b/examples/flutter_gallery/lib/demo/animation/home.dart index e617c8411d..e01e158d1b 100644 --- a/examples/flutter_gallery/lib/demo/animation/home.dart +++ b/examples/flutter_gallery/lib/demo/animation/home.dart @@ -35,10 +35,10 @@ class _RenderStatusBarPaddingSliver extends RenderSliver { _RenderStatusBarPaddingSliver({ @required double maxHeight, @required double scrollFactor, - }) : _maxHeight = maxHeight, _scrollFactor = scrollFactor { - assert(maxHeight != null && maxHeight >= 0.0); - assert(scrollFactor != null && scrollFactor >= 1.0); - } + }) : assert(maxHeight != null && maxHeight >= 0.0), + assert(scrollFactor != null && scrollFactor >= 1.0), + _maxHeight = maxHeight, + _scrollFactor = scrollFactor; // The height of the status bar double get maxHeight => _maxHeight; @@ -79,10 +79,9 @@ class _StatusBarPaddingSliver extends SingleChildRenderObjectWidget { Key key, @required this.maxHeight, this.scrollFactor: 5.0, - }) : super(key: key) { - assert(maxHeight != null && maxHeight >= 0.0); - assert(scrollFactor != null && scrollFactor >= 1.0); - } + }) : assert(maxHeight != null && maxHeight >= 0.0), + assert(scrollFactor != null && scrollFactor >= 1.0), + super(key: key); final double maxHeight; final double scrollFactor; @@ -272,14 +271,13 @@ class _AllSectionsView extends AnimatedWidget { this.midHeight, this.maxHeight, this.sectionCards: const [], - }) : super(key: key, listenable: selectedIndex) { - assert(sections != null); - assert(sectionCards != null); - assert(sectionCards.length == sections.length); - assert(sectionIndex >= 0 && sectionIndex < sections.length); - assert(selectedIndex != null); - assert(selectedIndex.value >= 0.0 && selectedIndex.value < sections.length.toDouble()); - } + }) : assert(sections != null), + assert(sectionCards != null), + assert(sectionCards.length == sections.length), + assert(sectionIndex >= 0 && sectionIndex < sections.length), + assert(selectedIndex != null), + assert(selectedIndex.value >= 0.0 && selectedIndex.value < sections.length.toDouble()), + super(key: key, listenable: selectedIndex); final int sectionIndex; final List
sections; diff --git a/examples/flutter_gallery/lib/demo/animation/widgets.dart b/examples/flutter_gallery/lib/demo/animation/widgets.dart index bc0d8c6222..c00945010e 100644 --- a/examples/flutter_gallery/lib/demo/animation/widgets.dart +++ b/examples/flutter_gallery/lib/demo/animation/widgets.dart @@ -11,9 +11,9 @@ const double kSectionIndicatorWidth = 32.0; // The card for a single section. Displays the section's gradient and background image. class SectionCard extends StatelessWidget { - SectionCard({ Key key, @required this.section }) : super(key: key) { - assert(section != null); - } + SectionCard({ Key key, @required this.section }) + : assert(section != null), + super(key: key); final Section section; @@ -65,11 +65,10 @@ class SectionTitle extends StatelessWidget { @required this.section, @required this.scale, @required this.opacity, - }) : super(key: key) { - assert(section != null); - assert(scale != null); - assert(opacity != null && opacity >= 0.0 && opacity <= 1.0); - } + }) : assert(section != null), + assert(scale != null), + assert(opacity != null && opacity >= 0.0 && opacity <= 1.0), + super(key: key); final Section section; final double scale; @@ -118,10 +117,10 @@ class SectionIndicator extends StatelessWidget { // Display a single SectionDetail. class SectionDetailView extends StatelessWidget { - SectionDetailView({ Key key, @required this.detail }) : super(key: key) { - assert(detail != null && detail.imageAsset != null); - assert((detail.imageAsset ?? detail.title) != null); - } + SectionDetailView({ Key key, @required this.detail }) + : assert(detail != null && detail.imageAsset != null), + assert((detail.imageAsset ?? detail.title) != null), + super(key: key); final SectionDetail detail; diff --git a/examples/flutter_gallery/lib/demo/colors_demo.dart b/examples/flutter_gallery/lib/demo/colors_demo.dart index b84f0e673f..f76eae777f 100644 --- a/examples/flutter_gallery/lib/demo/colors_demo.dart +++ b/examples/flutter_gallery/lib/demo/colors_demo.dart @@ -47,11 +47,10 @@ class ColorItem extends StatelessWidget { @required this.index, @required this.color, this.prefix: '', - }) : super(key: key) { - assert(index != null); - assert(color != null); - assert(prefix != null); - } + }) : assert(index != null), + assert(color != null), + assert(prefix != null), + super(key: key); final int index; final Color color; @@ -84,9 +83,8 @@ class PaletteTabView extends StatelessWidget { PaletteTabView({ Key key, @required this.colors, - }) : super(key: key) { - assert(colors != null && colors.isValid); - } + }) : assert(colors != null && colors.isValid), + super(key: key); final Palette colors; diff --git a/examples/flutter_gallery/lib/demo/contacts_demo.dart b/examples/flutter_gallery/lib/demo/contacts_demo.dart index 5a34a34472..3cd48317ff 100644 --- a/examples/flutter_gallery/lib/demo/contacts_demo.dart +++ b/examples/flutter_gallery/lib/demo/contacts_demo.dart @@ -37,9 +37,9 @@ class _ContactCategory extends StatelessWidget { } class _ContactItem extends StatelessWidget { - _ContactItem({ Key key, this.icon, this.lines, this.tooltip, this.onPressed }) : super(key: key) { - assert(lines.length > 1); - } + _ContactItem({ Key key, this.icon, this.lines, this.tooltip, this.onPressed }) + : assert(lines.length > 1), + super(key: key); final IconData icon; final List lines; diff --git a/examples/flutter_gallery/lib/demo/material/cards_demo.dart b/examples/flutter_gallery/lib/demo/material/cards_demo.dart index b02b0ee46a..4beaacb78c 100644 --- a/examples/flutter_gallery/lib/demo/material/cards_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/cards_demo.dart @@ -37,9 +37,9 @@ final List destinations = [ ]; class TravelDestinationItem extends StatelessWidget { - TravelDestinationItem({ Key key, @required this.destination }) : super(key: key) { - assert(destination != null && destination.isValid); - } + TravelDestinationItem({ Key key, @required this.destination }) + : assert(destination != null && destination.isValid), + super(key: key); static final double height = 366.0; final TravelDestination destination; diff --git a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart index 1709e99a06..e2876e3f74 100644 --- a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart @@ -19,11 +19,10 @@ enum DismissDialogAction { class DateTimeItem extends StatelessWidget { 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), - super(key: key) { - assert(onChanged != null); - } + super(key: key); final DateTime date; final TimeOfDay time; diff --git a/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart b/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart index 87bba38463..fe06de7782 100644 --- a/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/grid_list_demo.dart @@ -143,11 +143,10 @@ class GridDemoPhotoItem extends StatelessWidget { @required this.photo, @required this.tileStyle, @required this.onBannerTap - }) : super(key: key) { - assert(photo != null && photo.isValid); - assert(tileStyle != null); - assert(onBannerTap != null); - } + }) : assert(photo != null && photo.isValid), + assert(tileStyle != null), + assert(onBannerTap != null), + super(key: key); final Photo photo; final GridDemoTileStyle tileStyle; diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart index a61ee5c902..c4b035e891 100644 --- a/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart +++ b/examples/flutter_gallery/lib/demo/shrine/shrine_home.dart @@ -116,9 +116,9 @@ class _ShrineGridDelegate extends SliverGridDelegate { // Displays the Vendor's name and avatar. class _VendorItem extends StatelessWidget { - _VendorItem({ Key key, @required this.vendor }) : super(key: key) { - assert(vendor != null); - } + _VendorItem({ Key key, @required this.vendor }) + : assert(vendor != null), + super(key: key); final Vendor vendor; @@ -240,11 +240,11 @@ class _HeadingLayout extends MultiChildLayoutDelegate { // A card that highlights the "featured" catalog item. class _Heading extends StatelessWidget { - _Heading({ Key key, @required this.product }) : super(key: key) { - assert(product != null); - assert(product.featureTitle != null); - assert(product.featureDescription != null); - } + _Heading({ Key key, @required this.product }) + : assert(product != null), + assert(product.featureTitle != null), + assert(product.featureDescription != null), + super(key: key); final Product product; @@ -294,9 +294,9 @@ class _Heading extends StatelessWidget { // A card that displays a product's image, price, and vendor. The _ProductItem // cards appear in a grid below the heading. class _ProductItem extends StatelessWidget { - _ProductItem({ Key key, @required this.product, this.onPressed }) : super(key: key) { - assert(product != null); - } + _ProductItem({ Key key, @required this.product, this.onPressed }) + : assert(product != null), + super(key: key); final Product product; final VoidCallback onPressed; diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart index 052bfa0ccd..a8c373914e 100644 --- a/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart +++ b/examples/flutter_gallery/lib/demo/shrine/shrine_order.dart @@ -17,11 +17,10 @@ class _ProductItem extends StatelessWidget { @required this.product, @required this.quantity, @required this.onChanged, - }) : super(key: key) { - assert(product != null); - assert(quantity != null); - assert(onChanged != null); - } + }) : assert(product != null), + assert(quantity != null), + assert(onChanged != null), + super(key: key); final Product product; final int quantity; @@ -70,9 +69,9 @@ class _ProductItem extends StatelessWidget { // Vendor name and description class _VendorItem extends StatelessWidget { - _VendorItem({ Key key, @required this.vendor }) : super(key: key) { - assert(vendor != null); - } + _VendorItem({ Key key, @required this.vendor }) + : assert(vendor != null), + super(key: key); final Vendor vendor; @@ -146,10 +145,9 @@ class _Heading extends StatelessWidget { @required this.product, @required this.quantity, this.quantityChanged, - }) : super(key: key) { - assert(product != null); - assert(quantity != null && quantity >= 0 && quantity <= 5); - } + }) : assert(product != null), + assert(quantity != null && quantity >= 0 && quantity <= 5), + super(key: key); final Product product; final int quantity; @@ -213,11 +211,10 @@ class OrderPage extends StatefulWidget { @required this.order, @required this.products, @required this.shoppingCart, - }) : super(key: key) { - assert(order != null); - assert(products != null && products.isNotEmpty); - assert(shoppingCart != null); - } + }) : assert(order != null), + assert(products != null && products.isNotEmpty), + assert(shoppingCart != null), + super(key: key); final Order order; final List products; @@ -328,9 +325,8 @@ class ShrineOrderRoute extends ShrinePageRoute { @required this.order, WidgetBuilder builder, RouteSettings settings: const RouteSettings(), - }) : super(builder: builder, settings: settings) { - assert(order != null); - } + }) : assert(order != null), + super(builder: builder, settings: settings); Order order; diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart index eb073feda3..908a8375c9 100644 --- a/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart +++ b/examples/flutter_gallery/lib/demo/shrine/shrine_page.dart @@ -22,10 +22,9 @@ class ShrinePage extends StatefulWidget { this.floatingActionButton, this.products, this.shoppingCart - }) : super(key: key) { - assert(body != null); - assert(scaffoldKey != null); - } + }) : assert(body != null), + assert(scaffoldKey != null), + super(key: key); final GlobalKey scaffoldKey; final Widget body; diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_theme.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_theme.dart index e51bbb7430..8dc5cf5e73 100644 --- a/examples/flutter_gallery/lib/demo/shrine/shrine_theme.dart +++ b/examples/flutter_gallery/lib/demo/shrine/shrine_theme.dart @@ -27,9 +27,9 @@ TextStyle abrilFatfaceRegular34(Color color) => new ShrineStyle.abrilFatface(34. /// InheritedWidget is shared by all of the routes and widgets created for /// the Shrine app. class ShrineTheme extends InheritedWidget { - ShrineTheme({ Key key, @required Widget child }) : super(key: key, child: child) { - assert(child != null); - } + ShrineTheme({ Key key, @required Widget child }) + : assert(child != null), + super(key: key, child: child); final Color cardBackgroundColor = Colors.white; final Color appBarBackgroundColor = Colors.white; diff --git a/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart b/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart index 13673f85f3..42827d0f13 100644 --- a/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart +++ b/examples/flutter_gallery/lib/demo/shrine/shrine_types.dart @@ -66,11 +66,10 @@ class Product { } class Order { - Order({ @required this.product, this.quantity: 1, this.inCart: false }) { - assert(product != null); - assert(quantity != null && quantity >= 0); - assert(inCart != null); - } + Order({ @required this.product, this.quantity: 1, this.inCart: false }) + : assert(product != null), + assert(quantity != null && quantity >= 0), + assert(inCart != null); final Product product; final int quantity; diff --git a/examples/flutter_gallery/lib/demo/typography_demo.dart b/examples/flutter_gallery/lib/demo/typography_demo.dart index da6e34f5d6..9dd9181da7 100644 --- a/examples/flutter_gallery/lib/demo/typography_demo.dart +++ b/examples/flutter_gallery/lib/demo/typography_demo.dart @@ -11,11 +11,10 @@ class TextStyleItem extends StatelessWidget { @required this.name, @required this.style, @required this.text, - }) : super(key: key) { - assert(name != null); - assert(style != null); - assert(text != null); - } + }) : assert(name != null), + assert(style != null), + assert(text != null), + super(key: key); final String name; final TextStyle style; diff --git a/examples/flutter_gallery/lib/gallery/drawer.dart b/examples/flutter_gallery/lib/gallery/drawer.dart index e0ff3e3e6a..8a5f2ef27e 100644 --- a/examples/flutter_gallery/lib/gallery/drawer.dart +++ b/examples/flutter_gallery/lib/gallery/drawer.dart @@ -102,10 +102,9 @@ class GalleryDrawer extends StatelessWidget { this.onCheckerboardOffscreenLayersChanged, this.onPlatformChanged, this.onSendFeedback, - }) : super(key: key) { - assert(onThemeChanged != null); - assert(onTimeDilationChanged != null); - } + }) : assert(onThemeChanged != null), + assert(onTimeDilationChanged != null), + super(key: key); final bool useLightTheme; final ValueChanged onThemeChanged; diff --git a/examples/flutter_gallery/lib/gallery/home.dart b/examples/flutter_gallery/lib/gallery/home.dart index 76f9994e8a..9f1ebb2241 100644 --- a/examples/flutter_gallery/lib/gallery/home.dart +++ b/examples/flutter_gallery/lib/gallery/home.dart @@ -80,10 +80,9 @@ class GalleryHome extends StatefulWidget { this.onCheckerboardOffscreenLayersChanged, this.onPlatformChanged, this.onSendFeedback, - }) : super(key: key) { - assert(onThemeChanged != null); - assert(onTimeDilationChanged != null); - } + }) : assert(onThemeChanged != null), + assert(onTimeDilationChanged != null), + super(key: key); final bool useLightTheme; final ValueChanged onThemeChanged; diff --git a/examples/flutter_gallery/lib/gallery/item.dart b/examples/flutter_gallery/lib/gallery/item.dart index aa9b74dd4a..fe118fd3cf 100644 --- a/examples/flutter_gallery/lib/gallery/item.dart +++ b/examples/flutter_gallery/lib/gallery/item.dart @@ -18,12 +18,10 @@ class GalleryItem extends StatelessWidget { @required this.category, @required this.routeName, @required this.buildRoute, - }) { - assert(title != null); - assert(category != null); - assert(routeName != null); - assert(buildRoute != null); - } + }) : assert(title != null), + assert(category != null), + assert(routeName != null), + assert(buildRoute != null); final String title; final String subtitle; diff --git a/examples/flutter_gallery/lib/gallery/updates.dart b/examples/flutter_gallery/lib/gallery/updates.dart index 021dd3db21..e100fa53e5 100644 --- a/examples/flutter_gallery/lib/gallery/updates.dart +++ b/examples/flutter_gallery/lib/gallery/updates.dart @@ -12,9 +12,9 @@ import 'package:url_launcher/url_launcher.dart'; typedef Future UpdateUrlFetcher(); class Updater extends StatefulWidget { - Updater({ @required this.updateUrlFetcher, this.child, Key key }) : super(key: key) { - assert(updateUrlFetcher != null); - } + Updater({ @required this.updateUrlFetcher, this.child, Key key }) + : assert(updateUrlFetcher != null), + super(key: key); final UpdateUrlFetcher updateUrlFetcher; final Widget child; diff --git a/examples/layers/services/isolate.dart b/examples/layers/services/isolate.dart index b325d7d913..395875780f 100644 --- a/examples/layers/services/isolate.dart +++ b/examples/layers/services/isolate.dart @@ -18,12 +18,11 @@ typedef void OnResultListener(String result); // in real-world applications. class Calculator { Calculator({ @required this.onProgressListener, @required this.onResultListener, String data }) - // In order to keep the example files smaller, we "cheat" a little and - // replicate our small json string into a 10,000-element array. - : _data = _replicateJson(data, 10000) { - assert(onProgressListener != null); - assert(onResultListener != null); - } + : assert(onProgressListener != null), + assert(onResultListener != null), + // In order to keep the example files smaller, we "cheat" a little and + // replicate our small json string into a 10,000-element array. + _data = _replicateJson(data, 10000); final OnProgressListener onProgressListener; final OnResultListener onResultListener; @@ -87,9 +86,9 @@ class CalculationMessage { // progress of the background computation. class CalculationManager { CalculationManager({ @required this.onProgressListener, @required this.onResultListener }) - : _receivePort = new ReceivePort() { - assert(onProgressListener != null); - assert(onResultListener != null); + : assert(onProgressListener != null), + assert(onResultListener != null), + _receivePort = new ReceivePort() { _receivePort.listen(_handleMessage); } diff --git a/examples/stocks/lib/stock_types.dart b/examples/stocks/lib/stock_types.dart index f3d356b406..163628e7a8 100644 --- a/examples/stocks/lib/stock_types.dart +++ b/examples/stocks/lib/stock_types.dart @@ -19,18 +19,16 @@ class StockConfiguration { @required this.debugShowRainbow, @required this.showPerformanceOverlay, @required this.showSemanticsDebugger - }) { - assert(stockMode != null); - assert(backupMode != null); - assert(debugShowGrid != null); - assert(debugShowSizes != null); - assert(debugShowBaselines != null); - assert(debugShowLayers != null); - assert(debugShowPointers != null); - assert(debugShowRainbow != null); - assert(showPerformanceOverlay != null); - assert(showSemanticsDebugger != null); - } + }) : assert(stockMode != null), + assert(backupMode != null), + assert(debugShowGrid != null), + assert(debugShowSizes != null), + assert(debugShowBaselines != null), + assert(debugShowLayers != null), + assert(debugShowPointers != null), + assert(debugShowRainbow != null), + assert(showPerformanceOverlay != null), + assert(showSemanticsDebugger != null); final StockMode stockMode; final BackupMode backupMode; diff --git a/packages/flutter/lib/src/foundation/basic_types.dart b/packages/flutter/lib/src/foundation/basic_types.dart index 5d63bf244f..7e0fe50260 100644 --- a/packages/flutter/lib/src/foundation/basic_types.dart +++ b/packages/flutter/lib/src/foundation/basic_types.dart @@ -79,9 +79,9 @@ class BitField { /// Creates a bit field of all zeros. /// /// The given length must be at most 62. - BitField(this._length) : _bits = _kAllZeros { - assert(_length <= _kSMIBits); - } + BitField(this._length) + : assert(_length <= _kSMIBits), + _bits = _kAllZeros; /// Creates a bit field filled with a particular value. /// @@ -89,9 +89,10 @@ class BitField { /// the bits are filled with zeros. /// /// The given length must be at most 62. - BitField.filled(this._length, bool value) : _bits = value ? _kAllOnes : _kAllZeros { - assert(_length <= _kSMIBits); - } + BitField.filled(this._length, bool value) + : assert(_length <= _kSMIBits), + _bits = value ? _kAllOnes : _kAllZeros; + final int _length; int _bits; diff --git a/packages/flutter/lib/src/widgets/scroll_simulation.dart b/packages/flutter/lib/src/widgets/scroll_simulation.dart index a462a79ad4..33d8514019 100644 --- a/packages/flutter/lib/src/widgets/scroll_simulation.dart +++ b/packages/flutter/lib/src/widgets/scroll_simulation.dart @@ -135,8 +135,8 @@ class ClampingScrollSimulation extends Simulation { @required this.velocity, this.friction: 0.015, Tolerance tolerance: Tolerance.defaultTolerance, - }) : super(tolerance: tolerance) { - assert(_flingVelocityPenetration(0.0) == _kInitialVelocityPenetration); + }) : assert(_flingVelocityPenetration(0.0) == _kInitialVelocityPenetration), + super(tolerance: tolerance) { _duration = _flingDuration(velocity); _distance = (velocity * _duration / _kInitialVelocityPenetration).abs(); } diff --git a/packages/flutter/test/widgets/layout_builder_mutations_test.dart b/packages/flutter/test/widgets/layout_builder_mutations_test.dart index e6014f2481..79a09b5ef9 100644 --- a/packages/flutter/test/widgets/layout_builder_mutations_test.dart +++ b/packages/flutter/test/widgets/layout_builder_mutations_test.dart @@ -12,9 +12,8 @@ class Wrapper extends StatelessWidget { Wrapper({ Key key, @required this.child - }) : super(key: key) { - assert(child != null); - } + }) : assert(child != null), + super(key: key); final Widget child; diff --git a/packages/flutter/test/widgets/linked_scroll_view_test.dart b/packages/flutter/test/widgets/linked_scroll_view_test.dart index ea044b4b43..05bd566dff 100644 --- a/packages/flutter/test/widgets/linked_scroll_view_test.dart +++ b/packages/flutter/test/widgets/linked_scroll_view_test.dart @@ -113,14 +113,13 @@ class LinkedScrollPosition extends ScrollPositionWithSingleContext { ScrollContext context, double initialPixels, ScrollPosition oldPosition, - }) : super( - physics: physics, - context: context, - initialPixels: initialPixels, - oldPosition: oldPosition, - ) { - assert(owner != null); - } + }) : assert(owner != null), + super( + physics: physics, + context: context, + initialPixels: initialPixels, + oldPosition: oldPosition, + ); final LinkedScrollController owner; @@ -547,4 +546,4 @@ void main() { await tester.pump(const Duration(seconds: 1)); await tester.pump(const Duration(seconds: 60)); }); -} \ No newline at end of file +} diff --git a/packages/flutter_driver/lib/src/health.dart b/packages/flutter_driver/lib/src/health.dart index da10a27e89..52c998d6a8 100644 --- a/packages/flutter_driver/lib/src/health.dart +++ b/packages/flutter_driver/lib/src/health.dart @@ -29,9 +29,8 @@ final EnumIndex _healthStatusIndex = class Health extends Result { /// Creates a [Health] object with the given [status]. - Health(this.status) { - assert(status != null); - } + Health(this.status) + : assert(status != null); /// Deserializes the result from JSON. static Health fromJson(Map json) {