Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7d713263
Commit
7d713263
authored
Jun 07, 2017
by
Alexandre Ardhuin
Committed by
GitHub
Jun 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply prefer_asserts_in_initializer_list lint (#10540)
parent
3e645ee2
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
144 additions
and
169 deletions
+144
-169
animated_list.dart
examples/catalog/lib/animated_list.dart
+7
-9
home.dart
examples/flutter_gallery/lib/demo/animation/home.dart
+14
-16
widgets.dart
examples/flutter_gallery/lib/demo/animation/widgets.dart
+11
-12
colors_demo.dart
examples/flutter_gallery/lib/demo/colors_demo.dart
+6
-8
contacts_demo.dart
examples/flutter_gallery/lib/demo/contacts_demo.dart
+3
-3
cards_demo.dart
examples/flutter_gallery/lib/demo/material/cards_demo.dart
+3
-3
full_screen_dialog_demo.dart
...er_gallery/lib/demo/material/full_screen_dialog_demo.dart
+3
-4
grid_list_demo.dart
...les/flutter_gallery/lib/demo/material/grid_list_demo.dart
+4
-5
shrine_home.dart
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+11
-11
shrine_order.dart
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
+16
-20
shrine_page.dart
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
+3
-4
shrine_theme.dart
examples/flutter_gallery/lib/demo/shrine/shrine_theme.dart
+3
-3
shrine_types.dart
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
+4
-5
typography_demo.dart
examples/flutter_gallery/lib/demo/typography_demo.dart
+4
-5
drawer.dart
examples/flutter_gallery/lib/gallery/drawer.dart
+3
-4
home.dart
examples/flutter_gallery/lib/gallery/home.dart
+3
-4
item.dart
examples/flutter_gallery/lib/gallery/item.dart
+4
-6
updates.dart
examples/flutter_gallery/lib/gallery/updates.dart
+3
-3
isolate.dart
examples/layers/services/isolate.dart
+8
-9
stock_types.dart
examples/stocks/lib/stock_types.dart
+10
-12
basic_types.dart
packages/flutter/lib/src/foundation/basic_types.dart
+7
-6
scroll_simulation.dart
packages/flutter/lib/src/widgets/scroll_simulation.dart
+2
-2
layout_builder_mutations_test.dart
...s/flutter/test/widgets/layout_builder_mutations_test.dart
+2
-3
linked_scroll_view_test.dart
packages/flutter/test/widgets/linked_scroll_view_test.dart
+8
-9
health.dart
packages/flutter_driver/lib/src/health.dart
+2
-3
No files found.
examples/catalog/lib/animated_list.dart
View file @
7d713263
...
...
@@ -117,10 +117,9 @@ class ListModel<E> {
@required
this
.
listKey
,
@required
this
.
removedItemBuilder
,
Iterable
<
E
>
initialItems
,
})
:
_items
=
new
List
<
E
>.
from
(
initialItems
??
<
E
>[])
{
assert
(
listKey
!=
null
);
assert
(
removedItemBuilder
!=
null
);
}
})
:
assert
(
listKey
!=
null
),
assert
(
removedItemBuilder
!=
null
),
_items
=
new
List
<
E
>.
from
(
initialItems
??
<
E
>[]);
final
GlobalKey
<
AnimatedListState
>
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
<
double
>
animation
;
final
VoidCallback
onTap
;
...
...
examples/flutter_gallery/lib/demo/animation/home.dart
View file @
7d713263
...
...
@@ -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
<
Widget
>[],
})
:
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
<
Section
>
sections
;
...
...
examples/flutter_gallery/lib/demo/animation/widgets.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/demo/colors_demo.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/demo/contacts_demo.dart
View file @
7d713263
...
...
@@ -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
<
String
>
lines
;
...
...
examples/flutter_gallery/lib/demo/material/cards_demo.dart
View file @
7d713263
...
...
@@ -37,9 +37,9 @@ final List<TravelDestination> destinations = <TravelDestination>[
];
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
;
...
...
examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/demo/material/grid_list_demo.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
View file @
7d713263
...
...
@@ -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
<
Product
>
products
;
...
...
@@ -328,9 +325,8 @@ class ShrineOrderRoute extends ShrinePageRoute<Order> {
@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
;
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_page.dart
View file @
7d713263
...
...
@@ -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
<
ScaffoldState
>
scaffoldKey
;
final
Widget
body
;
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_theme.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/demo/typography_demo.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/gallery/drawer.dart
View file @
7d713263
...
...
@@ -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
<
bool
>
onThemeChanged
;
...
...
examples/flutter_gallery/lib/gallery/home.dart
View file @
7d713263
...
...
@@ -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
<
bool
>
onThemeChanged
;
...
...
examples/flutter_gallery/lib/gallery/item.dart
View file @
7d713263
...
...
@@ -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
;
...
...
examples/flutter_gallery/lib/gallery/updates.dart
View file @
7d713263
...
...
@@ -12,9 +12,9 @@ import 'package:url_launcher/url_launcher.dart';
typedef
Future
<
String
>
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
;
...
...
examples/layers/services/isolate.dart
View file @
7d713263
...
...
@@ -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
);
}
...
...
examples/stocks/lib/stock_types.dart
View file @
7d713263
...
...
@@ -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
;
...
...
packages/flutter/lib/src/foundation/basic_types.dart
View file @
7d713263
...
...
@@ -79,9 +79,9 @@ class BitField<T extends dynamic> {
/// 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<T extends dynamic> {
/// 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
;
...
...
packages/flutter/lib/src/widgets/scroll_simulation.dart
View file @
7d713263
...
...
@@ -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
();
}
...
...
packages/flutter/test/widgets/layout_builder_mutations_test.dart
View file @
7d713263
...
...
@@ -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
;
...
...
packages/flutter/test/widgets/linked_scroll_view_test.dart
View file @
7d713263
...
...
@@ -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
}
packages/flutter_driver/lib/src/health.dart
View file @
7d713263
...
...
@@ -29,9 +29,8 @@ final EnumIndex<HealthStatus> _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
<
String
,
dynamic
>
json
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment