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
8bcf302e
Commit
8bcf302e
authored
Apr 07, 2017
by
Alexandre Ardhuin
Committed by
GitHub
Apr 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use conditional assignment (#9252)
parent
3eb87830
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
30 additions
and
84 deletions
+30
-84
syntax_highlighter.dart
examples/flutter_gallery/lib/gallery/syntax_highlighter.dart
+1
-3
spinning_mixed.dart
examples/layers/widgets/spinning_mixed.dart
+1
-2
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+2
-4
box.dart
packages/flutter/lib/src/rendering/box.dart
+1
-2
layer.dart
packages/flutter/lib/src/rendering/layer.dart
+1
-2
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-2
ticker.dart
packages/flutter/lib/src/scheduler/ticker.dart
+1
-2
focus_manager.dart
packages/flutter/lib/src/widgets/focus_manager.dart
+1
-2
gesture_binding_test.dart
packages/flutter/test/gestures/gesture_binding_test.dart
+1
-2
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+1
-6
os.dart
packages/flutter_tools/lib/src/base/os.dart
+1
-2
cache.dart
packages/flutter_tools/lib/src/cache.dart
+1
-6
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+1
-2
pub.dart
packages/flutter_tools/lib/src/dart/pub.dart
+1
-2
device.dart
packages/flutter_tools/lib/src/device.dart
+4
-8
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+1
-6
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+1
-6
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+1
-2
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+2
-4
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+3
-5
vmservice_record_replay.dart
packages/flutter_tools/lib/src/vmservice_record_replay.dart
+3
-14
No files found.
examples/flutter_gallery/lib/gallery/syntax_highlighter.dart
View file @
8bcf302e
...
...
@@ -60,9 +60,7 @@ abstract class SyntaxHighlighter { // ignore: one_member_abstracts
class
DartSyntaxHighlighter
extends
SyntaxHighlighter
{
DartSyntaxHighlighter
([
this
.
_style
])
{
_spans
=
<
_HighlightSpan
>[];
if
(
_style
==
null
)
_style
=
SyntaxHighlighterStyle
.
darkThemeStyle
();
_style
??=
SyntaxHighlighterStyle
.
darkThemeStyle
();
}
SyntaxHighlighterStyle
_style
;
...
...
examples/layers/widgets/spinning_mixed.dart
View file @
8bcf302e
...
...
@@ -78,8 +78,7 @@ Duration timeBase;
RenderTransform
transformBox
;
void
rotate
(
Duration
timeStamp
)
{
if
(
timeBase
==
null
)
timeBase
=
timeStamp
;
timeBase
??=
timeStamp
;
final
double
delta
=
(
timeStamp
-
timeBase
).
inMicroseconds
.
toDouble
()
/
Duration
.
MICROSECONDS_PER_SECOND
;
// radians
transformBox
.
setIdentity
();
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
8bcf302e
...
...
@@ -577,10 +577,8 @@ class BoxShadow {
static
List
<
BoxShadow
>
lerpList
(
List
<
BoxShadow
>
a
,
List
<
BoxShadow
>
b
,
double
t
)
{
if
(
a
==
null
&&
b
==
null
)
return
null
;
if
(
a
==
null
)
a
=
<
BoxShadow
>[];
if
(
b
==
null
)
b
=
<
BoxShadow
>[];
a
??=
<
BoxShadow
>[];
b
??=
<
BoxShadow
>[];
final
List
<
BoxShadow
>
result
=
<
BoxShadow
>[];
final
int
commonLength
=
math
.
min
(
a
.
length
,
b
.
length
);
for
(
int
i
=
0
;
i
<
commonLength
;
++
i
)
...
...
packages/flutter/lib/src/rendering/box.dart
View file @
8bcf302e
...
...
@@ -1482,8 +1482,7 @@ abstract class RenderBox extends RenderObject {
@mustCallSuper
double
getDistanceToActualBaseline
(
TextBaseline
baseline
)
{
assert
(
_debugDoingBaseline
);
if
(
_cachedBaselines
==
null
)
_cachedBaselines
=
<
TextBaseline
,
double
>{};
_cachedBaselines
??=
<
TextBaseline
,
double
>{};
_cachedBaselines
.
putIfAbsent
(
baseline
,
()
=>
computeDistanceToActualBaseline
(
baseline
));
return
_cachedBaselines
[
baseline
];
}
...
...
packages/flutter/lib/src/rendering/layer.dart
View file @
8bcf302e
...
...
@@ -203,8 +203,7 @@ class ContainerLayer extends Layer {
if
(
_lastChild
!=
null
)
_lastChild
.
_nextSibling
=
child
;
_lastChild
=
child
;
if
(
_firstChild
==
null
)
_firstChild
=
child
;
_firstChild
??=
child
;
}
void
_remove
(
Layer
child
)
{
...
...
packages/flutter/lib/src/rendering/object.dart
View file @
8bcf302e
...
...
@@ -2697,8 +2697,7 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent
_firstChildParentData
.
previousSibling
=
child
;
}
_firstChild
=
child
;
if
(
_lastChild
==
null
)
_lastChild
=
child
;
_lastChild
??=
child
;
}
else
{
assert
(
_firstChild
!=
null
);
assert
(
_lastChild
!=
null
);
...
...
packages/flutter/lib/src/scheduler/ticker.dart
View file @
8bcf302e
...
...
@@ -199,8 +199,7 @@ class Ticker {
assert
(
scheduled
);
_animationId
=
null
;
if
(
_startTime
==
null
)
_startTime
=
timeStamp
;
_startTime
??=
timeStamp
;
_onTick
(
timeStamp
-
_startTime
);
...
...
packages/flutter/lib/src/widgets/focus_manager.dart
View file @
8bcf302e
...
...
@@ -132,8 +132,7 @@ class FocusScopeNode extends Object with TreeDiagnosticsMixin {
if
(
_firstChild
!=
null
)
_firstChild
.
_previousSibling
=
child
;
_firstChild
=
child
;
if
(
_lastChild
==
null
)
_lastChild
=
child
;
_lastChild
??=
child
;
child
.
_updateManager
(
_manager
);
}
...
...
packages/flutter/test/gestures/gesture_binding_test.dart
View file @
8bcf302e
...
...
@@ -24,8 +24,7 @@ class TestGestureFlutterBinding extends BindingBase with GestureBinding {
TestGestureFlutterBinding
_binding
=
new
TestGestureFlutterBinding
();
void
ensureTestGestureBinding
(
)
{
if
(
_binding
==
null
)
_binding
=
new
TestGestureFlutterBinding
();
_binding
??=
new
TestGestureFlutterBinding
();
assert
(
GestureBinding
.
instance
!=
null
);
}
...
...
packages/flutter_tools/lib/src/android/android_device.dart
View file @
8bcf302e
...
...
@@ -430,12 +430,7 @@ class AndroidDevice extends Device {
}
@override
DevicePortForwarder
get
portForwarder
{
if
(
_portForwarder
==
null
)
_portForwarder
=
new
_AndroidDevicePortForwarder
(
this
);
return
_portForwarder
;
}
DevicePortForwarder
get
portForwarder
=>
_portForwarder
??=
new
_AndroidDevicePortForwarder
(
this
);
static
final
RegExp
_timeRegExp
=
new
RegExp
(
r'^\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}'
,
multiLine:
true
);
...
...
packages/flutter_tools/lib/src/base/os.dart
View file @
8bcf302e
...
...
@@ -116,8 +116,7 @@ class _PosixUtils extends OperatingSystemUtils {
.trim()}
${results[2].stdout.trim()}
"
;
}
}
if
(
_name
==
null
)
_name
=
super
.
name
;
_name
??=
super
.
name
;
}
return
_name
;
}
...
...
packages/flutter_tools/lib/src/cache.dart
View file @
8bcf302e
...
...
@@ -86,12 +86,7 @@ class Cache {
static
String
_dartSdkVersion
;
static
String
get
dartSdkVersion
{
if
(
_dartSdkVersion
==
null
)
{
_dartSdkVersion
=
platform
.
version
;
}
return
_dartSdkVersion
;
}
static
String
get
dartSdkVersion
=>
_dartSdkVersion
??=
platform
.
version
;
static
String
_engineRevision
;
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
8bcf302e
...
...
@@ -724,8 +724,7 @@ class AppInstance {
}
dynamic
_runInZone
(
AppDomain
domain
,
dynamic
method
())
{
if
(
_logger
==
null
)
_logger
=
new
_AppRunLogger
(
domain
,
this
,
logToStdout:
logToStdout
);
_logger
??=
new
_AppRunLogger
(
domain
,
this
,
logToStdout:
logToStdout
);
final
AppContext
appContext
=
new
AppContext
();
appContext
.
setVariable
(
Logger
,
_logger
);
...
...
packages/flutter_tools/lib/src/dart/pub.dart
View file @
8bcf302e
...
...
@@ -34,8 +34,7 @@ Future<Null> pubGet({
bool
offline:
false
,
bool
checkLastModified:
true
})
async
{
if
(
directory
==
null
)
directory
=
fs
.
currentDirectory
.
path
;
directory
??=
fs
.
currentDirectory
.
path
;
final
File
pubSpecYaml
=
fs
.
file
(
fs
.
path
.
join
(
directory
,
'pubspec.yaml'
));
final
File
dotPackages
=
fs
.
file
(
fs
.
path
.
join
(
directory
,
'.packages'
));
...
...
packages/flutter_tools/lib/src/device.dart
View file @
8bcf302e
...
...
@@ -97,8 +97,7 @@ abstract class PollingDeviceDiscovery extends DeviceDiscovery {
void
startPolling
()
{
if
(
_timer
==
null
)
{
if
(
_items
==
null
)
_items
=
new
ItemListNotifier
<
Device
>();
_items
??=
new
ItemListNotifier
<
Device
>();
_timer
=
new
Timer
.
periodic
(
_pollingDuration
,
(
Timer
timer
)
{
_items
.
updateWithNewList
(
pollingGetDevices
());
});
...
...
@@ -112,20 +111,17 @@ abstract class PollingDeviceDiscovery extends DeviceDiscovery {
@override
List
<
Device
>
get
devices
{
if
(
_items
==
null
)
_items
=
new
ItemListNotifier
<
Device
>.
from
(
pollingGetDevices
());
_items
??=
new
ItemListNotifier
<
Device
>.
from
(
pollingGetDevices
());
return
_items
.
items
;
}
Stream
<
Device
>
get
onAdded
{
if
(
_items
==
null
)
_items
=
new
ItemListNotifier
<
Device
>();
_items
??=
new
ItemListNotifier
<
Device
>();
return
_items
.
onAdded
;
}
Stream
<
Device
>
get
onRemoved
{
if
(
_items
==
null
)
_items
=
new
ItemListNotifier
<
Device
>();
_items
??=
new
ItemListNotifier
<
Device
>();
return
_items
.
onRemoved
;
}
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
8bcf302e
...
...
@@ -357,12 +357,7 @@ class IOSDevice extends Device {
}
@override
DevicePortForwarder
get
portForwarder
{
if
(
_portForwarder
==
null
)
_portForwarder
=
new
_IOSDevicePortForwarder
(
this
);
return
_portForwarder
;
}
DevicePortForwarder
get
portForwarder
=>
_portForwarder
??=
new
_IOSDevicePortForwarder
(
this
);
@override
void
clearLogs
()
{
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
8bcf302e
...
...
@@ -565,12 +565,7 @@ class IOSSimulator extends Device {
}
@override
DevicePortForwarder
get
portForwarder
{
if
(
_portForwarder
==
null
)
_portForwarder
=
new
_IOSSimulatorDevicePortForwarder
(
this
);
return
_portForwarder
;
}
DevicePortForwarder
get
portForwarder
=>
_portForwarder
??=
new
_IOSSimulatorDevicePortForwarder
(
this
);
@override
void
clearLogs
()
{
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
8bcf302e
...
...
@@ -406,8 +406,7 @@ class OperationResult {
/// Given the value of the --target option, return the path of the Dart file
/// where the app's main function should be.
String
findMainDartFile
(
[
String
target
])
{
if
(
target
==
null
)
target
=
''
;
target
??=
''
;
final
String
targetPath
=
fs
.
path
.
absolute
(
target
);
if
(
fs
.
isDirectorySync
(
targetPath
))
return
fs
.
path
.
join
(
targetPath
,
'lib'
,
'main.dart'
);
...
...
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
8bcf302e
...
...
@@ -286,8 +286,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
engineSourcePath
=
null
;
}
if
(
engineSourcePath
==
null
)
engineSourcePath
=
_tryEnginePath
(
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'../engine/src'
));
engineSourcePath
??=
_tryEnginePath
(
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'../engine/src'
));
if
(
engineSourcePath
==
null
)
{
printError
(
'Unable to detect local Flutter engine build directory.
\n
'
...
...
@@ -327,8 +326,7 @@ class FlutterCommandRunner extends CommandRunner<Null> {
}
static
void
initFlutterRoot
()
{
if
(
Cache
.
flutterRoot
==
null
)
Cache
.
flutterRoot
=
_defaultFlutterRoot
;
Cache
.
flutterRoot
??=
_defaultFlutterRoot
;
}
/// Get all pub packages in the Flutter repo.
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
8bcf302e
...
...
@@ -266,11 +266,9 @@ abstract class ServiceObject {
serviceObject
=
new
Isolate
.
_empty
(
owner
.
vm
);
break
;
}
if
(
serviceObject
==
null
)
{
// If we don't have a model object for this service object type, as a
// fallback return a ServiceMap object.
serviceObject
=
new
ServiceMap
.
_empty
(
owner
);
}
// If we don't have a model object for this service object type, as a
// fallback return a ServiceMap object.
serviceObject
??=
new
ServiceMap
.
_empty
(
owner
);
// We have now constructed an emtpy service object, call update to
// populate it.
serviceObject
.
update
(
map
);
...
...
packages/flutter_tools/lib/src/vmservice_record_replay.dart
View file @
8bcf302e
...
...
@@ -43,19 +43,12 @@ class RecordingVMServiceChannel extends DelegatingStreamChannel<String> {
@override
Stream
<
String
>
get
stream
{
if
(
_streamRecorder
==
null
)
{
_streamRecorder
=
new
_RecordingStream
(
super
.
stream
,
_messages
);
}
_streamRecorder
??=
new
_RecordingStream
(
super
.
stream
,
_messages
);
return
_streamRecorder
.
stream
;
}
@override
StreamSink
<
String
>
get
sink
{
if
(
_sinkRecorder
==
null
)
{
_sinkRecorder
=
new
_RecordingSink
(
super
.
sink
,
_messages
);
}
return
_sinkRecorder
;
}
StreamSink
<
String
>
get
sink
=>
_sinkRecorder
??=
new
_RecordingSink
(
super
.
sink
,
_messages
);
}
/// Base class for request and response JSON-rpc messages.
...
...
@@ -250,11 +243,7 @@ class ReplayVMServiceChannel extends StreamChannelMixin<String> {
}
@override
StreamSink
<
String
>
get
sink
{
if
(
_replaySink
==
null
)
_replaySink
=
new
_ReplaySink
(
this
);
return
_replaySink
;
}
StreamSink
<
String
>
get
sink
=>
_replaySink
??=
new
_ReplaySink
(
this
);
@override
Stream
<
String
>
get
stream
=>
_controller
.
stream
;
...
...
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