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
f5a4e632
Commit
f5a4e632
authored
Jun 14, 2016
by
pq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added asserts.
parent
7a955487
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
50 additions
and
8 deletions
+50
-8
logic.dart
examples/flutter_gallery/lib/demo/calculator/logic.dart
+1
-0
grid_list_demo.dart
examples/flutter_gallery/lib/demo/grid_list_demo.dart
+2
-1
main.dart
examples/stocks/lib/main.dart
+1
-0
animations.dart
packages/flutter/lib/src/animation/animations.dart
+2
-1
button.dart
packages/flutter/lib/src/material/button.dart
+1
-0
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+3
-1
drawer_item.dart
packages/flutter/lib/src/material/drawer_item.dart
+2
-1
icon.dart
packages/flutter/lib/src/material/icon.dart
+2
-1
raised_button.dart
packages/flutter/lib/src/material/raised_button.dart
+2
-0
text_selection.dart
packages/flutter/lib/src/material/text_selection.dart
+1
-0
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+1
-0
text_painter.dart
packages/flutter/lib/src/painting/text_painter.dart
+2
-0
list.dart
packages/flutter/lib/src/rendering/list.dart
+3
-0
viewport.dart
packages/flutter/lib/src/rendering/viewport.dart
+3
-0
banner.dart
packages/flutter/lib/src/widgets/banner.dart
+5
-0
lazy_block.dart
packages/flutter/lib/src/widgets/lazy_block.dart
+4
-1
pageable_list.dart
packages/flutter/lib/src/widgets/pageable_list.dart
+5
-0
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-0
scrollable_list.dart
packages/flutter/lib/src/widgets/scrollable_list.dart
+1
-0
text_selection.dart
packages/flutter/lib/src/widgets/text_selection.dart
+1
-0
virtual_viewport.dart
packages/flutter/lib/src/widgets/virtual_viewport.dart
+2
-1
render_object_widget_test.dart
packages/flutter/test/widget/render_object_widget_test.dart
+3
-1
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+1
-0
build_info.dart
packages/flutter_tools/lib/src/build_info.dart
+1
-0
No files found.
examples/flutter_gallery/lib/demo/calculator/logic.dart
View file @
f5a4e632
...
...
@@ -83,6 +83,7 @@ class OperationToken extends ExpressionToken {
case
Operation
.
Division
:
return
'
\
u00F7 '
;
}
assert
(
operation
!=
null
);
return
null
;
}
}
...
...
examples/flutter_gallery/lib/demo/grid_list_demo.dart
View file @
f5a4e632
...
...
@@ -46,7 +46,7 @@ class GridDemoPhotoItem extends StatelessWidget {
}
final
Photo
photo
;
final
GridDemoTileStyle
tileStyle
;
final
GridDemoTileStyle
tileStyle
;
final
BannerTapCallback
onBannerTap
;
// User taps on the photo's header or footer.
void
showPhoto
(
BuildContext
context
)
{
...
...
@@ -130,6 +130,7 @@ class GridDemoPhotoItem extends StatelessWidget {
child:
image
);
}
assert
(
tileStyle
!=
null
);
return
null
;
}
}
...
...
examples/stocks/lib/main.dart
View file @
f5a4e632
...
...
@@ -75,6 +75,7 @@ class StocksAppState extends State<StocksApp> {
accentColor:
Colors
.
redAccent
[
200
]
);
}
assert
(
_configuration
.
stockMode
!=
null
);
return
null
;
}
...
...
packages/flutter/lib/src/animation/animations.dart
View file @
f5a4e632
...
...
@@ -287,7 +287,8 @@ class ReverseAnimation extends Animation<double>
case
AnimationStatus
.
completed
:
return
AnimationStatus
.
dismissed
;
case
AnimationStatus
.
dismissed
:
return
AnimationStatus
.
completed
;
}
return
null
;
assert
(
status
!=
null
);
return
null
;
}
@override
...
...
packages/flutter/lib/src/material/button.dart
View file @
f5a4e632
...
...
@@ -227,6 +227,7 @@ class _MaterialButtonState extends State<MaterialButton> {
return
Colors
.
white30
;
}
}
assert
(
_colorBrightness
!=
null
);
return
null
;
}
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
f5a4e632
...
...
@@ -57,12 +57,14 @@ class Dialog extends StatelessWidget {
final
List
<
Widget
>
actions
;
Color
_getColor
(
BuildContext
context
)
{
switch
(
Theme
.
of
(
context
).
brightness
)
{
Brightness
brightness
=
Theme
.
of
(
context
).
brightness
;
switch
(
brightness
)
{
case
Brightness
.
light
:
return
Colors
.
white
;
case
Brightness
.
dark
:
return
Colors
.
grey
[
800
];
}
assert
(
brightness
!=
null
);
return
null
;
}
...
...
packages/flutter/lib/src/material/drawer_item.dart
View file @
f5a4e632
...
...
@@ -67,7 +67,8 @@ class DrawerItem extends StatelessWidget {
return
Colors
.
white30
;
return
null
;
// use default icon theme colour unmodified
}
return
null
;
assert
(
themeData
.
brightness
!=
null
);
return
null
;
}
TextStyle
_getTextStyle
(
ThemeData
themeData
)
{
...
...
packages/flutter/lib/src/material/icon.dart
View file @
f5a4e632
...
...
@@ -65,7 +65,8 @@ class Icon extends StatelessWidget {
case
Brightness
.
light
:
return
Colors
.
black
;
}
return
null
;
assert
(
brightness
!=
null
);
return
null
;
}
Color
_getDefaultColor
(
BuildContext
context
)
{
...
...
packages/flutter/lib/src/material/raised_button.dart
View file @
f5a4e632
...
...
@@ -98,12 +98,14 @@ class RaisedButton extends StatelessWidget {
}
else
{
if
(
disabledColor
!=
null
)
return
disabledColor
;
Brightness
brightness
=
Theme
.
of
(
context
).
brightness
;
switch
(
Theme
.
of
(
context
).
brightness
)
{
case
Brightness
.
light
:
return
Colors
.
black12
;
case
Brightness
.
dark
:
return
Colors
.
white12
;
}
assert
(
brightness
!=
null
);
return
null
;
}
}
...
...
packages/flutter/lib/src/material/text_selection.dart
View file @
f5a4e632
...
...
@@ -186,5 +186,6 @@ Widget buildTextSelectionHandle(
child:
handle
);
}
assert
(
type
!=
null
);
return
null
;
}
packages/flutter/lib/src/painting/box_painter.dart
View file @
f5a4e632
...
...
@@ -1353,6 +1353,7 @@ class BoxDecoration extends Decoration {
double
distance
=
(
position
-
center
).
distance
;
return
distance
<=
math
.
min
(
size
.
width
,
size
.
height
)
/
2.0
;
}
assert
(
shape
!=
null
);
return
null
;
}
...
...
packages/flutter/lib/src/painting/text_painter.dart
View file @
f5a4e632
...
...
@@ -125,6 +125,7 @@ class TextPainter {
case
TextBaseline
.
ideographic
:
return
_paragraph
.
ideographicBaseline
;
}
assert
(
baseline
!=
null
);
return
null
;
}
...
...
@@ -212,6 +213,7 @@ class TextPainter {
??
_getOffsetFromUpstream
(
offset
,
caretPrototype
)
??
emptyOffset
;
}
assert
(
position
.
affinity
!=
null
);
return
null
;
}
...
...
packages/flutter/lib/src/rendering/list.dart
View file @
f5a4e632
...
...
@@ -82,6 +82,7 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
case
Axis
.
horizontal
:
return
padding
.
horizontal
;
}
assert
(
mainAxis
!=
null
);
return
null
;
}
...
...
@@ -109,6 +110,8 @@ class RenderList extends RenderVirtualViewport<ListParentData> {
assert
(
debugThrowIfNotCheckingIntrinsics
());
return
0.0
;
}
assert
(
mainAxis
!=
null
);
return
null
;
}
@override
...
...
packages/flutter/lib/src/rendering/viewport.dart
View file @
f5a4e632
...
...
@@ -57,6 +57,7 @@ class ViewportDimensions {
case
ViewportAnchor
.
end
:
return
paintOffset
+
(
containerSize
-
contentSize
);
}
assert
(
anchor
!=
null
);
return
null
;
}
...
...
@@ -109,6 +110,8 @@ class RenderViewportBase extends RenderBox {
case
Axis
.
vertical
:
return
offset
.
dx
==
0.0
;
}
assert
(
direction
!=
null
);
return
null
;
}
/// The offset at which to paint the child.
...
...
packages/flutter/lib/src/widgets/banner.dart
View file @
f5a4e632
...
...
@@ -90,6 +90,8 @@ class BannerPainter extends CustomPainter {
case
BannerLocation
.
topLeft
:
return
0.0
;
}
assert
(
location
!=
null
);
return
null
;
}
double
_translationY
(
double
height
)
{
...
...
@@ -101,6 +103,8 @@ class BannerPainter extends CustomPainter {
case
BannerLocation
.
topLeft
:
return
0.0
;
}
assert
(
location
!=
null
);
return
null
;
}
double
get
_rotation
{
...
...
@@ -112,6 +116,7 @@ class BannerPainter extends CustomPainter {
case
BannerLocation
.
topLeft
:
return
-
math
.
PI
/
4.0
;
}
assert
(
location
!=
null
);
return
null
;
}
}
...
...
packages/flutter/lib/src/widgets/lazy_block.dart
View file @
f5a4e632
...
...
@@ -731,6 +731,8 @@ class _LazyBlockElement extends RenderObjectElement {
case
Axis
.
vertical
:
return
size
.
height
;
}
assert
(
widget
.
mainAxis
!=
null
);
return
null
;
}
Offset
_getMainAxisOffsetForSize
(
Size
size
)
{
...
...
@@ -740,7 +742,8 @@ class _LazyBlockElement extends RenderObjectElement {
case
Axis
.
vertical
:
return
new
Offset
(
0.0
,
size
.
height
);
}
return
null
;
assert
(
widget
.
mainAxis
!=
null
);
return
null
;
}
static
RenderBox
_getNextWithin
(
_RenderLazyBlock
block
,
RenderBox
child
)
{
...
...
packages/flutter/lib/src/widgets/pageable_list.dart
View file @
f5a4e632
...
...
@@ -224,6 +224,7 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
case
Axis
.
vertical
:
return
box
.
size
.
height
;
}
assert
(
config
.
scrollDirection
!=
null
);
return
null
;
}
...
...
@@ -249,6 +250,8 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
case
ViewportAnchor
.
end
:
return
(
_itemCount
-
scrollIndex
-
1
)
%
itemCount
;
}
assert
(
config
.
scrollAnchor
!=
null
);
return
null
;
}
@override
...
...
@@ -325,6 +328,8 @@ abstract class PageableState<T extends Pageable> extends ScrollableState<T> {
case
PageableListFlingBehavior
.
stopAtNextPage
:
return
_flingToAdjacentItem
(
scrollVelocity
);
}
assert
(
config
.
itemsSnapAlignment
!=
null
);
return
null
;
}
@override
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
f5a4e632
...
...
@@ -285,6 +285,7 @@ class ScrollableState<T extends Scrollable> extends State<T> {
case
ViewportAnchor
.
end
:
return
pixelOffset
;
}
assert
(
config
.
scrollAnchor
!=
null
);
return
null
;
}
...
...
packages/flutter/lib/src/widgets/scrollable_list.dart
View file @
f5a4e632
...
...
@@ -239,6 +239,7 @@ class _VirtualListViewport extends VirtualViewport {
}
break
;
}
assert
(
mainAxis
!=
null
);
return
null
;
}
...
...
packages/flutter/lib/src/widgets/text_selection.dart
View file @
f5a4e632
...
...
@@ -294,6 +294,7 @@ class _TextSelectionHandleOverlayState extends State<_TextSelectionHandleOverlay
case
TextDirection
.
rtl
:
return
rtlType
;
}
assert
(
endpoint
.
direction
!=
null
);
return
null
;
}
}
packages/flutter/lib/src/widgets/virtual_viewport.dart
View file @
f5a4e632
...
...
@@ -70,7 +70,8 @@ abstract class VirtualViewportElement extends RenderObjectElement {
case
ViewportAnchor
.
end
:
return
scrollOffset
;
}
return
null
;
assert
(
renderObject
.
anchor
!=
null
);
return
null
;
}
/// Returns a two-dimensional representation of the scroll offset, accounting
...
...
packages/flutter/test/widget/render_object_widget_test.dart
View file @
f5a4e632
...
...
@@ -23,12 +23,14 @@ class TestOrientedBox extends SingleChildRenderObjectWidget {
TestOrientedBox
({
Key
key
,
Widget
child
})
:
super
(
key:
key
,
child:
child
);
Decoration
_getDecoration
(
BuildContext
context
)
{
switch
(
MediaQuery
.
of
(
context
).
orientation
)
{
Orientation
orientation
=
MediaQuery
.
of
(
context
).
orientation
;
switch
(
orientation
)
{
case
Orientation
.
landscape
:
return
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFF00FF00
));
case
Orientation
.
portrait
:
return
new
BoxDecoration
(
backgroundColor:
const
Color
(
0xFF0000FF
));
}
assert
(
orientation
!=
null
);
return
null
;
}
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
f5a4e632
...
...
@@ -134,6 +134,7 @@ ApplicationPackage getApplicationPackageForPlatform(TargetPlatform platform) {
case
TargetPlatform
.
linux_x64
:
return
null
;
}
assert
(
platform
!=
null
);
return
null
;
}
...
...
packages/flutter_tools/lib/src/build_info.dart
View file @
f5a4e632
...
...
@@ -99,6 +99,7 @@ TargetPlatform getTargetPlatformForName(String platform) {
case
'linux-x64'
:
return
TargetPlatform
.
linux_x64
;
}
assert
(
platform
!=
null
);
return
null
;
}
...
...
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