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
9eaaa91d
Commit
9eaaa91d
authored
Dec 09, 2016
by
Alexandre Ardhuin
Committed by
Ian Hickson
Dec 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use isEmpty and isNotEmpty (#7207)
parent
778b30ac
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
32 additions
and
32 deletions
+32
-32
expression.dart
packages/flutter/lib/src/cassowary/expression.dart
+1
-1
solver.dart
packages/flutter/lib/src/cassowary/solver.dart
+1
-1
print.dart
packages/flutter/lib/src/foundation/print.dart
+2
-2
data_table.dart
packages/flutter/lib/src/material/data_table.dart
+1
-1
icon_theme_data.dart
packages/flutter/lib/src/material/icon_theme_data.dart
+1
-1
paginated_data_table.dart
packages/flutter/lib/src/material/paginated_data_table.dart
+1
-1
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+1
-1
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+1
-1
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+3
-3
box.dart
packages/flutter/lib/src/rendering/box.dart
+1
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-1
table.dart
packages/flutter/lib/src/rendering/table.dart
+6
-6
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+3
-3
heroes.dart
packages/flutter/lib/src/widgets/heroes.dart
+1
-1
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+1
-1
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+2
-2
table.dart
packages/flutter/lib/src/widgets/table.dart
+5
-5
No files found.
packages/flutter/lib/src/cassowary/expression.dart
View file @
9eaaa91d
...
...
@@ -39,7 +39,7 @@ class Expression extends EquationMember {
Expression
asExpression
()
=>
this
;
@override
bool
get
isConstant
=>
terms
.
length
==
0
;
bool
get
isConstant
=>
terms
.
isEmpty
;
@override
double
get
value
=>
terms
.
fold
(
constant
,
(
double
value
,
Term
term
)
=>
value
+
term
.
value
);
...
...
packages/flutter/lib/src/cassowary/solver.dart
View file @
9eaaa91d
...
...
@@ -773,7 +773,7 @@ class Solver {
}
Result
_dualOptimize
()
{
while
(
_infeasibleRows
.
length
!=
0
)
{
while
(
_infeasibleRows
.
isNotEmpty
)
{
_Symbol
leaving
=
_infeasibleRows
.
removeLast
();
_Row
row
=
_rows
[
leaving
];
...
...
packages/flutter/lib/src/foundation/print.dart
View file @
9eaaa91d
...
...
@@ -62,12 +62,12 @@ void _debugPrintTask() {
_debugPrintStopwatch
.
reset
();
_debugPrintedCharacters
=
0
;
}
while
(
_debugPrintedCharacters
<
_kDebugPrintCapacity
&&
_debugPrintBuffer
.
length
>
0
)
{
while
(
_debugPrintedCharacters
<
_kDebugPrintCapacity
&&
_debugPrintBuffer
.
isNotEmpty
)
{
String
line
=
_debugPrintBuffer
.
removeFirst
();
_debugPrintedCharacters
+=
line
.
length
;
// TODO(ianh): Use the UTF-8 byte length instead
print
(
line
);
}
if
(
_debugPrintBuffer
.
length
>
0
)
{
if
(
_debugPrintBuffer
.
isNotEmpty
)
{
_debugPrintScheduled
=
true
;
_debugPrintedCharacters
=
0
;
new
Timer
(
_kDebugPrintPauseTime
,
_debugPrintTask
);
...
...
packages/flutter/lib/src/material/data_table.dart
View file @
9eaaa91d
...
...
@@ -259,7 +259,7 @@ class DataTable extends StatelessWidget {
})
:
columns
=
columns
,
_onlyTextColumn
=
_initOnlyTextColumn
(
columns
),
super
(
key:
key
)
{
assert
(
columns
!=
null
);
assert
(
columns
.
length
>
0
);
assert
(
columns
.
isNotEmpty
);
assert
(
sortColumnIndex
==
null
||
(
sortColumnIndex
>=
0
&&
sortColumnIndex
<
columns
.
length
));
assert
(
sortAscending
!=
null
);
assert
(
rows
!=
null
);
...
...
packages/flutter/lib/src/material/icon_theme_data.dart
View file @
9eaaa91d
...
...
@@ -100,7 +100,7 @@ class IconThemeData {
result
.
add
(
'opacity:
$_opacity
'
);
if
(
size
!=
null
)
result
.
add
(
'size:
$size
'
);
if
(
result
.
length
==
0
)
if
(
result
.
isEmpty
)
return
'<no theme>'
;
return
result
.
join
(
', '
);
}
...
...
packages/flutter/lib/src/material/paginated_data_table.dart
View file @
9eaaa91d
...
...
@@ -69,7 +69,7 @@ class PaginatedDataTable extends StatefulWidget {
})
:
super
(
key:
key
)
{
assert
(
header
!=
null
);
assert
(
columns
!=
null
);
assert
(
columns
.
length
>
0
);
assert
(
columns
.
isNotEmpty
);
assert
(
sortColumnIndex
==
null
||
(
sortColumnIndex
>=
0
&&
sortColumnIndex
<
columns
.
length
));
assert
(
sortAscending
!=
null
);
assert
(
rowsPerPage
!=
null
);
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
9eaaa91d
...
...
@@ -445,7 +445,7 @@ Future<dynamic/*=T*/> showMenu/*<T>*/({
int
elevation:
8
})
{
assert
(
context
!=
null
);
assert
(
items
!=
null
&&
items
.
length
>
0
);
assert
(
items
!=
null
&&
items
.
isNotEmpty
);
return
Navigator
.
push
(
context
,
new
_PopupMenuRoute
<
dynamic
/*=T*/
>(
position:
position
,
items:
items
,
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
9eaaa91d
...
...
@@ -930,7 +930,7 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
if
(!
config
.
resizeToAvoidBottomPadding
)
padding
=
new
EdgeInsets
.
fromLTRB
(
padding
.
left
,
padding
.
top
,
padding
.
right
,
0.0
);
if
(
_snackBars
.
length
>
0
)
{
if
(
_snackBars
.
isNotEmpty
)
{
final
ModalRoute
<
dynamic
>
route
=
ModalRoute
.
of
(
context
);
if
(
route
==
null
||
route
.
isCurrent
)
{
if
(
_snackBarController
.
isCompleted
&&
_snackBarTimer
==
null
)
...
...
packages/flutter/lib/src/material/tabs.dart
View file @
9eaaa91d
...
...
@@ -476,7 +476,7 @@ class TabBarSelection<T> extends StatefulWidget {
this
.
onChanged
,
@required
this
.
child
})
:
super
(
key:
key
)
{
assert
(
values
!=
null
&&
values
.
length
>
0
);
assert
(
values
!=
null
&&
values
.
isNotEmpty
);
assert
(
new
Set
<
T
>.
from
(
values
).
length
==
values
.
length
);
assert
(
value
==
null
?
true
:
values
.
where
((
T
e
)
=>
e
==
value
).
length
==
1
);
assert
(
child
!=
null
);
...
...
@@ -847,7 +847,7 @@ class _TabBarState<T> extends ScrollableState<TabBar<T>> implements TabBarSelect
@override
void
handleStatusChange
(
AnimationStatus
status
)
{
if
(
config
.
labels
.
length
==
0
)
if
(
config
.
labels
.
isEmpty
)
return
;
if
(
_valueIsChanging
&&
status
==
AnimationStatus
.
completed
)
{
...
...
@@ -861,7 +861,7 @@ class _TabBarState<T> extends ScrollableState<TabBar<T>> implements TabBarSelect
@override
void
handleProgressChange
()
{
if
(
config
.
labels
.
length
==
0
||
_selection
==
null
)
if
(
config
.
labels
.
isEmpty
||
_selection
==
null
)
return
;
if
(
_lastSelectedIndex
!=
_selection
.
index
)
{
...
...
packages/flutter/lib/src/rendering/box.dart
View file @
9eaaa91d
...
...
@@ -380,7 +380,7 @@ class BoxConstraints extends Constraints {
affectedFieldsList
.
add
(
'minHeight'
);
if
(
maxHeight
.
isNaN
)
affectedFieldsList
.
add
(
'maxHeight'
);
assert
(
affectedFieldsList
.
length
>
0
);
assert
(
affectedFieldsList
.
isNotEmpty
);
if
(
affectedFieldsList
.
length
>
1
)
affectedFieldsList
.
add
(
'and
${affectedFieldsList.removeLast()}
'
);
String
whichFields
=
''
;
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
9eaaa91d
...
...
@@ -1022,7 +1022,7 @@ class PipelineOwner {
if
(
node
.
_needsPaint
&&
node
.
owner
==
this
)
PaintingContext
.
repaintCompositedChild
(
node
);
}
assert
(
_nodesNeedingPaint
.
length
==
0
);
assert
(
_nodesNeedingPaint
.
isEmpty
);
}
finally
{
_debugDoingPaint
=
false
;
Timeline
.
finishSync
();
...
...
packages/flutter/lib/src/rendering/table.dart
View file @
9eaaa91d
...
...
@@ -492,7 +492,7 @@ class RenderTable extends RenderBox {
assert
(
rows
==
null
||
children
==
null
);
assert
(
defaultColumnWidth
!=
null
);
assert
(
configuration
!=
null
);
_columns
=
columns
??
(
children
!=
null
&&
children
.
length
>
0
?
children
.
first
.
length
:
0
);
_columns
=
columns
??
(
children
!=
null
&&
children
.
isNotEmpty
?
children
.
first
.
length
:
0
);
_rows
=
rows
??
0
;
_children
=
new
List
<
RenderBox
>()..
length
=
_columns
*
_rows
;
_columnWidths
=
columnWidths
??
new
HashMap
<
int
,
TableColumnWidth
>();
...
...
@@ -691,10 +691,10 @@ class RenderTable extends RenderBox {
return
;
assert
(
columns
>=
0
);
// consider the case of a newly empty table
if
(
columns
==
0
||
cells
.
length
==
0
)
{
assert
(
cells
==
null
||
cells
.
length
==
0
);
if
(
columns
==
0
||
cells
.
isEmpty
)
{
assert
(
cells
==
null
||
cells
.
isEmpty
);
_columns
=
columns
;
if
(
_children
.
length
==
0
)
{
if
(
_children
.
isEmpty
)
{
assert
(
_rows
==
0
);
return
;
}
...
...
@@ -757,7 +757,7 @@ class RenderTable extends RenderBox {
dropChild
(
oldChild
);
}
_children
.
clear
();
_columns
=
cells
.
length
>
0
?
cells
.
first
.
length
:
0
;
_columns
=
cells
.
isNotEmpty
?
cells
.
first
.
length
:
0
;
_rows
=
0
;
for
(
List
<
RenderBox
>
row
in
cells
)
addRow
(
row
);
...
...
@@ -1282,7 +1282,7 @@ class RenderTable extends RenderBox {
super
.
debugFillDescription
(
description
);
if
(
border
!=
null
)
description
.
add
(
'border:
$border
'
);
if
(
_columnWidths
.
length
>
0
)
if
(
_columnWidths
.
isNotEmpty
)
description
.
add
(
'specified column widths:
$_columnWidths
'
);
description
.
add
(
'default column width:
$defaultColumnWidth
'
);
description
.
add
(
'table size:
$columns
\
u00D7
$rows
'
);
...
...
packages/flutter/lib/src/widgets/framework.dart
View file @
9eaaa91d
...
...
@@ -2365,7 +2365,7 @@ abstract class Element implements BuildContext {
assert
(
widget
!=
null
);
assert
(
depth
!=
null
);
assert
(
_active
);
if
(
_dependencies
!=
null
&&
_dependencies
.
length
>
0
)
{
if
(
_dependencies
!=
null
&&
_dependencies
.
isNotEmpty
)
{
for
(
InheritedElement
dependency
in
_dependencies
)
dependency
.
_dependents
.
remove
(
this
);
// For expediency, we don't actually clear the list here, even though it's
...
...
@@ -2629,7 +2629,7 @@ abstract class Element implements BuildContext {
String
result
=
'
$prefixLineOne$this
\n
'
;
List
<
Element
>
children
=
<
Element
>[];
visitChildren
(
children
.
add
);
if
(
children
.
length
>
0
)
{
if
(
children
.
isNotEmpty
)
{
Element
last
=
children
.
removeLast
();
for
(
Element
child
in
children
)
result
+=
'
${child.toStringDeep("$prefixOtherLines\u251C", "$prefixOtherLines\u2502")}
'
;
...
...
@@ -2803,7 +2803,7 @@ abstract class BuildableElement extends Element {
@override
void
activate
()
{
final
bool
hadDependencies
=
((
_dependencies
!=
null
&&
_dependencies
.
length
>
0
)
||
_hadUnsatisfiedDependencies
);
final
bool
hadDependencies
=
((
_dependencies
!=
null
&&
_dependencies
.
isNotEmpty
)
||
_hadUnsatisfiedDependencies
);
super
.
activate
();
// clears _dependencies, and sets active to true
if
(
_dirty
)
{
if
(
_inDirtyList
)
{
...
...
packages/flutter/lib/src/widgets/heroes.dart
View file @
9eaaa91d
...
...
@@ -432,7 +432,7 @@ class _HeroParty {
}
void
setAnimation
(
Animation
<
double
>
animation
)
{
assert
(
animation
!=
null
||
_heroes
.
length
==
0
);
assert
(
animation
!=
null
||
_heroes
.
isEmpty
);
if
(
animation
!=
_currentAnimation
)
{
_clearCurrentAnimation
();
_currentAnimation
=
animation
;
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
9eaaa91d
...
...
@@ -644,7 +644,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin {
/// The only route that cannot be popped off the navigator is the initial
/// route.
bool
canPop
()
{
assert
(
_history
.
length
>
0
);
assert
(
_history
.
isNotEmpty
);
return
_history
.
length
>
1
||
_history
[
0
].
willHandlePopInternally
;
}
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
9eaaa91d
...
...
@@ -319,7 +319,7 @@ abstract class LocalHistoryRoute<T> extends Route<T> {
@override
bool
didPop
(
T
result
)
{
if
(
_localHistory
!=
null
&&
_localHistory
.
length
>
0
)
{
if
(
_localHistory
!=
null
&&
_localHistory
.
isNotEmpty
)
{
LocalHistoryEntry
entry
=
_localHistory
.
removeLast
();
assert
(
entry
.
_owner
==
this
);
entry
.
_owner
=
null
;
...
...
@@ -331,7 +331,7 @@ abstract class LocalHistoryRoute<T> extends Route<T> {
@override
bool
get
willHandlePopInternally
{
return
_localHistory
!=
null
&&
_localHistory
.
length
>
0
;
return
_localHistory
!=
null
&&
_localHistory
.
isNotEmpty
;
}
}
...
...
packages/flutter/lib/src/widgets/table.dart
View file @
9eaaa91d
...
...
@@ -59,7 +59,7 @@ class TableRow {
result
.
write
(
'
$decoration
, '
);
if
(
children
==
null
)
{
result
.
write
(
'child list is null'
);
}
else
if
(
children
.
length
==
0
)
{
}
else
if
(
children
.
isEmpty
)
{
result
.
write
(
'no children'
);
}
else
{
result
.
write
(
'
$children
'
);
...
...
@@ -137,7 +137,7 @@ class Table extends RenderObjectWidget {
return
true
;
});
assert
(()
{
if
(
children
.
length
>
0
)
{
if
(
children
.
isNotEmpty
)
{
final
int
cellCount
=
children
.
first
.
children
.
length
;
if
(
children
.
any
((
TableRow
row
)
=>
row
.
children
.
length
!=
cellCount
))
{
throw
new
FlutterError
(
...
...
@@ -195,7 +195,7 @@ class Table extends RenderObjectWidget {
@override
RenderTable
createRenderObject
(
BuildContext
context
)
{
return
new
RenderTable
(
columns:
children
.
length
>
0
?
children
[
0
].
children
.
length
:
0
,
columns:
children
.
isNotEmpty
?
children
[
0
].
children
.
length
:
0
,
rows:
children
.
length
,
columnWidths:
columnWidths
,
defaultColumnWidth:
defaultColumnWidth
,
...
...
@@ -209,7 +209,7 @@ class Table extends RenderObjectWidget {
@override
void
updateRenderObject
(
BuildContext
context
,
RenderTable
renderObject
)
{
assert
(
renderObject
.
columns
==
(
children
.
length
>
0
?
children
[
0
].
children
.
length
:
0
));
assert
(
renderObject
.
columns
==
(
children
.
isNotEmpty
?
children
[
0
].
children
.
length
:
0
));
assert
(
renderObject
.
rows
==
children
.
length
);
renderObject
..
columnWidths
=
columnWidths
...
...
@@ -318,7 +318,7 @@ class _TableElement extends RenderObjectElement {
void
_updateRenderObjectChildren
()
{
assert
(
renderObject
!=
null
);
renderObject
.
setFlatChildren
(
_children
.
length
>
0
?
_children
[
0
].
children
.
length
:
0
,
_children
.
isNotEmpty
?
_children
[
0
].
children
.
length
:
0
,
_children
.
expand
((
_TableElementRow
row
)
=>
row
.
children
.
map
((
Element
child
)
=>
child
.
renderObject
)).
toList
()
);
}
...
...
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