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
69b6bb87
Commit
69b6bb87
authored
Mar 02, 2017
by
Alexandre Ardhuin
Committed by
Adam Barth
Mar 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefer_is_empty and prefer_is_not_empty (#8474)
parent
2f002885
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
20 additions
and
20 deletions
+20
-20
adb.dart
dev/devicelab/lib/framework/adb.dart
+1
-1
home.dart
examples/flutter_gallery/lib/demo/calculator/home.dart
+1
-1
logic.dart
examples/flutter_gallery/lib/demo/calculator/logic.dart
+3
-3
shrine_order.dart
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
+1
-1
shrine_types.dart
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
+1
-1
syntax_highlighter.dart
examples/flutter_gallery/lib/gallery/syntax_highlighter.dart
+1
-1
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+1
-1
driver.dart
packages/flutter_driver/lib/src/driver.dart
+1
-1
markdown_raw.dart
packages/flutter_markdown/lib/src/markdown_raw.dart
+5
-5
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+3
-3
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+1
-1
devfs_test.dart
packages/flutter_tools/test/devfs_test.dart
+1
-1
No files found.
dev/devicelab/lib/framework/adb.dart
View file @
69b6bb87
...
@@ -299,7 +299,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
...
@@ -299,7 +299,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
.
map
((
String
id
)
=>
new
IosDevice
(
deviceId:
id
))
.
map
((
String
id
)
=>
new
IosDevice
(
deviceId:
id
))
.
toList
();
.
toList
();
if
(
allDevices
.
length
==
0
)
if
(
allDevices
.
isEmpty
)
throw
'No iOS devices detected'
;
throw
'No iOS devices detected'
;
// TODO(yjbanov): filter out and warn about those with low battery level
// TODO(yjbanov): filter out and warn about those with low battery level
...
...
examples/flutter_gallery/lib/demo/calculator/home.dart
View file @
69b6bb87
...
@@ -29,7 +29,7 @@ class _CalculatorState extends State<Calculator> {
...
@@ -29,7 +29,7 @@ class _CalculatorState extends State<Calculator> {
/// Pop the top expression off of the stack and make it the current expression.
/// Pop the top expression off of the stack and make it the current expression.
void
popCalcExpression
()
{
void
popCalcExpression
()
{
if
(
_expressionStack
.
length
>
0
)
{
if
(
_expressionStack
.
isNotEmpty
)
{
_expression
=
_expressionStack
.
removeLast
();
_expression
=
_expressionStack
.
removeLast
();
}
else
{
}
else
{
_expression
=
new
CalcExpression
.
Empty
();
_expression
=
new
CalcExpression
.
Empty
();
...
...
examples/flutter_gallery/lib/demo/calculator/logic.dart
View file @
69b6bb87
...
@@ -287,7 +287,7 @@ class CalcExpression {
...
@@ -287,7 +287,7 @@ class CalcExpression {
// where a "term" is defined to be a sequence of numbers separated by
// where a "term" is defined to be a sequence of numbers separated by
// multiplcation or division symbols.
// multiplcation or division symbols.
num
currentTermValue
=
removeNextTerm
(
list
);
num
currentTermValue
=
removeNextTerm
(
list
);
while
(
list
.
length
>
0
)
{
while
(
list
.
isNotEmpty
)
{
OperationToken
opToken
=
list
.
removeAt
(
0
);
OperationToken
opToken
=
list
.
removeAt
(
0
);
num
nextTermValue
=
removeNextTerm
(
list
);
num
nextTermValue
=
removeNextTerm
(
list
);
switch
(
opToken
.
operation
)
{
switch
(
opToken
.
operation
)
{
...
@@ -312,10 +312,10 @@ class CalcExpression {
...
@@ -312,10 +312,10 @@ class CalcExpression {
/// A "term" is a sequence of number tokens separated by multiplication
/// A "term" is a sequence of number tokens separated by multiplication
/// and division symbols.
/// and division symbols.
static
num
removeNextTerm
(
List
<
ExpressionToken
>
list
)
{
static
num
removeNextTerm
(
List
<
ExpressionToken
>
list
)
{
assert
(
list
!=
null
&&
list
.
length
>=
1
);
assert
(
list
!=
null
&&
list
.
isNotEmpty
);
final
NumberToken
firstNumToken
=
list
.
removeAt
(
0
);
final
NumberToken
firstNumToken
=
list
.
removeAt
(
0
);
num
currentValue
=
firstNumToken
.
number
;
num
currentValue
=
firstNumToken
.
number
;
while
(
list
.
length
>
0
)
{
while
(
list
.
isNotEmpty
)
{
bool
isDivision
=
false
;
bool
isDivision
=
false
;
OperationToken
nextOpToken
=
list
.
first
;
OperationToken
nextOpToken
=
list
.
first
;
switch
(
nextOpToken
.
operation
)
{
switch
(
nextOpToken
.
operation
)
{
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
View file @
69b6bb87
...
@@ -118,7 +118,7 @@ class OrderItem extends StatelessWidget {
...
@@ -118,7 +118,7 @@ class OrderItem extends StatelessWidget {
class
OrderPage
extends
StatefulWidget
{
class
OrderPage
extends
StatefulWidget
{
OrderPage
({
Key
key
,
this
.
order
,
this
.
products
,
this
.
shoppingCart
})
:
super
(
key:
key
)
{
OrderPage
({
Key
key
,
this
.
order
,
this
.
products
,
this
.
shoppingCart
})
:
super
(
key:
key
)
{
assert
(
order
!=
null
);
assert
(
order
!=
null
);
assert
(
products
!=
null
&&
products
.
length
>
0
);
assert
(
products
!=
null
&&
products
.
isNotEmpty
);
assert
(
shoppingCart
!=
null
);
assert
(
shoppingCart
!=
null
);
}
}
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_types.dart
View file @
69b6bb87
...
@@ -54,7 +54,7 @@ class Product {
...
@@ -54,7 +54,7 @@ class Product {
description
!=
null
&&
description
!=
null
&&
imageAsset
!=
null
&&
imageAsset
!=
null
&&
categories
!=
null
&&
categories
!=
null
&&
categories
.
length
>
0
&&
categories
.
isNotEmpty
&&
price
!=
null
&&
price
!=
null
&&
vendor
.
isValid
();
vendor
.
isValid
();
}
}
...
...
examples/flutter_gallery/lib/gallery/syntax_highlighter.dart
View file @
69b6bb87
...
@@ -309,7 +309,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
...
@@ -309,7 +309,7 @@ class DartSyntaxHighlighter extends SyntaxHighlighter {
}
}
bool
_firstLetterIsUpperCase
(
String
str
)
{
bool
_firstLetterIsUpperCase
(
String
str
)
{
if
(
str
.
length
>
0
)
{
if
(
str
.
isNotEmpty
)
{
String
first
=
str
.
substring
(
0
,
1
);
String
first
=
str
.
substring
(
0
,
1
);
return
first
==
first
.
toUpperCase
();
return
first
==
first
.
toUpperCase
();
}
}
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
69b6bb87
...
@@ -775,7 +775,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
...
@@ -775,7 +775,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
/// * [removeScopedWillPopCallback], which removes a callback.
/// * [removeScopedWillPopCallback], which removes a callback.
@protected
@protected
bool
get
hasScopedWillPopCallback
{
bool
get
hasScopedWillPopCallback
{
return
_scopeKey
.
currentState
==
null
||
_scopeKey
.
currentState
.
_willPopCallbacks
.
length
>
0
;
return
_scopeKey
.
currentState
==
null
||
_scopeKey
.
currentState
.
_willPopCallbacks
.
isNotEmpty
;
}
}
@override
@override
...
...
packages/flutter_driver/lib/src/driver.dart
View file @
69b6bb87
...
@@ -408,7 +408,7 @@ class FlutterDriver {
...
@@ -408,7 +408,7 @@ class FlutterDriver {
/// Starts recording performance traces.
/// Starts recording performance traces.
Future
<
Null
>
startTracing
({
List
<
TimelineStream
>
streams:
_defaultStreams
})
async
{
Future
<
Null
>
startTracing
({
List
<
TimelineStream
>
streams:
_defaultStreams
})
async
{
assert
(
streams
!=
null
&&
streams
.
length
>
0
);
assert
(
streams
!=
null
&&
streams
.
isNotEmpty
);
try
{
try
{
await
_peer
.
sendRequest
(
_kSetVMTimelineFlagsMethod
,
<
String
,
String
>{
await
_peer
.
sendRequest
(
_kSetVMTimelineFlagsMethod
,
<
String
,
String
>{
'recordedStreams'
:
_timelineStreamsToString
(
streams
)
'recordedStreams'
:
_timelineStreamsToString
(
streams
)
...
...
packages/flutter_markdown/lib/src/markdown_raw.dart
View file @
69b6bb87
...
@@ -264,7 +264,7 @@ class _Renderer implements md.NodeVisitor {
...
@@ -264,7 +264,7 @@ class _Renderer implements md.NodeVisitor {
_listIndents
.
removeLast
();
_listIndents
.
removeLast
();
if
(
_isBlockTag
(
element
.
tag
))
{
if
(
_isBlockTag
(
element
.
tag
))
{
if
(
_currentBlock
.
stack
.
length
>
0
)
{
if
(
_currentBlock
.
stack
.
isNotEmpty
)
{
_MarkdownNodeList
stackList
=
_currentBlock
.
stack
.
first
;
_MarkdownNodeList
stackList
=
_currentBlock
.
stack
.
first
;
_currentBlock
.
stack
=
stackList
.
list
;
_currentBlock
.
stack
=
stackList
.
list
;
_currentBlock
.
open
=
false
;
_currentBlock
.
open
=
false
;
...
@@ -358,7 +358,7 @@ class _Block {
...
@@ -358,7 +358,7 @@ class _Block {
bool
get
open
=>
_open
;
bool
get
open
=>
_open
;
set
open
(
bool
open
)
{
set
open
(
bool
open
)
{
_open
=
open
;
_open
=
open
;
if
(!
open
&&
subBlocks
.
length
>
0
)
if
(!
open
&&
subBlocks
.
isNotEmpty
)
subBlocks
.
last
.
isLast
=
true
;
subBlocks
.
last
.
isLast
=
true
;
}
}
...
@@ -376,7 +376,7 @@ class _Block {
...
@@ -376,7 +376,7 @@ class _Block {
Widget
contents
;
Widget
contents
;
if
(
subBlocks
.
length
>
0
)
{
if
(
subBlocks
.
isNotEmpty
)
{
List
<
Widget
>
subWidgets
=
<
Widget
>[];
List
<
Widget
>
subWidgets
=
<
Widget
>[];
for
(
_Block
subBlock
in
subBlocks
)
{
for
(
_Block
subBlock
in
subBlocks
)
{
subWidgets
.
add
(
subBlock
.
build
(
context
));
subWidgets
.
add
(
subBlock
.
build
(
context
));
...
@@ -390,7 +390,7 @@ class _Block {
...
@@ -390,7 +390,7 @@ class _Block {
TextSpan
span
=
_stackToTextSpan
(
new
_MarkdownNodeList
(
stack
));
TextSpan
span
=
_stackToTextSpan
(
new
_MarkdownNodeList
(
stack
));
contents
=
new
RichText
(
text:
span
);
contents
=
new
RichText
(
text:
span
);
if
(
listIndents
.
length
>
0
)
{
if
(
listIndents
.
isNotEmpty
)
{
Widget
bullet
;
Widget
bullet
;
if
(
listIndents
.
last
==
'ul'
)
{
if
(
listIndents
.
last
==
'ul'
)
{
bullet
=
new
Text
(
bullet
=
new
Text
(
...
@@ -479,7 +479,7 @@ class _Block {
...
@@ -479,7 +479,7 @@ class _Block {
Widget
_buildImage
(
BuildContext
context
,
String
src
)
{
Widget
_buildImage
(
BuildContext
context
,
String
src
)
{
List
<
String
>
parts
=
src
.
split
(
'#'
);
List
<
String
>
parts
=
src
.
split
(
'#'
);
if
(
parts
.
length
==
0
)
return
new
Container
();
if
(
parts
.
isEmpty
)
return
new
Container
();
String
path
=
parts
.
first
;
String
path
=
parts
.
first
;
double
width
;
double
width
;
...
...
packages/flutter_tools/lib/src/devfs.dart
View file @
69b6bb87
...
@@ -247,7 +247,7 @@ class _DevFSHttpWriter {
...
@@ -247,7 +247,7 @@ class _DevFSHttpWriter {
void
_scheduleWrites
(
DevFSProgressReporter
progressReporter
)
{
void
_scheduleWrites
(
DevFSProgressReporter
progressReporter
)
{
while
(
_inFlight
<
kMaxInFlight
)
{
while
(
_inFlight
<
kMaxInFlight
)
{
if
(
_outstanding
.
length
==
0
)
{
if
(
_outstanding
.
isEmpty
)
{
// Finished.
// Finished.
break
;
break
;
}
}
...
@@ -289,7 +289,7 @@ class _DevFSHttpWriter {
...
@@ -289,7 +289,7 @@ class _DevFSHttpWriter {
progressReporter
(
_done
,
_max
);
progressReporter
(
_done
,
_max
);
}
}
_inFlight
--;
_inFlight
--;
if
((
_outstanding
.
length
==
0
)
&&
(
_inFlight
==
0
))
{
if
((
_outstanding
.
isEmpty
)
&&
(
_inFlight
==
0
))
{
_completer
.
complete
(
null
);
_completer
.
complete
(
null
);
}
else
{
}
else
{
_scheduleWrites
(
progressReporter
);
_scheduleWrites
(
progressReporter
);
...
@@ -411,7 +411,7 @@ class DevFS {
...
@@ -411,7 +411,7 @@ class DevFS {
assetPathsToEvict
.
add
(
archivePath
);
assetPathsToEvict
.
add
(
archivePath
);
}
}
});
});
if
(
dirtyEntries
.
length
>
0
)
{
if
(
dirtyEntries
.
isNotEmpty
)
{
printTrace
(
'Updating files'
);
printTrace
(
'Updating files'
);
if
(
_httpWriter
!=
null
)
{
if
(
_httpWriter
!=
null
)
{
try
{
try
{
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
69b6bb87
...
@@ -251,7 +251,7 @@ class IOSDevice extends Device {
...
@@ -251,7 +251,7 @@ class IOSDevice extends Device {
'--justlaunch'
,
'--justlaunch'
,
];
];
if
(
launchArguments
.
length
>
0
)
{
if
(
launchArguments
.
isNotEmpty
)
{
launchCommand
.
add
(
'--args'
);
launchCommand
.
add
(
'--args'
);
launchCommand
.
add
(
'
${launchArguments.join(" ")}
'
);
launchCommand
.
add
(
'
${launchArguments.join(" ")}
'
);
}
}
...
...
packages/flutter_tools/test/devfs_test.dart
View file @
69b6bb87
...
@@ -329,7 +329,7 @@ Directory _newTempDir() {
...
@@ -329,7 +329,7 @@ Directory _newTempDir() {
}
}
void
_cleanupTempDirs
(
)
{
void
_cleanupTempDirs
(
)
{
while
(
_tempDirs
.
length
>
0
)
{
while
(
_tempDirs
.
isNotEmpty
)
{
_tempDirs
.
removeLast
().
deleteSync
(
recursive:
true
);
_tempDirs
.
removeLast
().
deleteSync
(
recursive:
true
);
}
}
}
}
...
...
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