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
2888139c
Commit
2888139c
authored
Feb 20, 2017
by
Alexandre Ardhuin
Committed by
Adam Barth
Feb 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefer const constructor (#8292)
parent
8b820ccc
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
34 additions
and
34 deletions
+34
-34
positioned_test.dart
packages/flutter/test/widgets/positioned_test.dart
+1
-1
markdown_raw.dart
packages/flutter_markdown/lib/src/markdown_raw.dart
+3
-3
markdown_style.dart
packages/flutter_markdown/lib/src/markdown_style.dart
+4
-4
fuchsia_builder.dart
packages/flutter_tools/bin/fuchsia_builder.dart
+3
-3
executable.dart
packages/flutter_tools/lib/executable.dart
+3
-3
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+1
-1
config.dart
packages/flutter_tools/lib/src/base/config.dart
+1
-1
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+1
-1
process_manager.dart
packages/flutter_tools/lib/src/base/process_manager.dart
+1
-1
utils.dart
packages/flutter_tools/lib/src/base/utils.dart
+1
-1
daemon.dart
packages/flutter_tools/lib/src/commands/daemon.dart
+1
-1
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+1
-1
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+1
-1
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+2
-2
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+1
-1
usage.dart
packages/flutter_tools/lib/src/usage.dart
+1
-1
asset_bundle_test.dart
packages/flutter_tools/test/asset_bundle_test.dart
+1
-1
daemon_test.dart
packages/flutter_tools/test/daemon_test.dart
+1
-1
dependency_checker_test.dart
packages/flutter_tools/test/dependency_checker_test.dart
+1
-1
devfs_test.dart
packages/flutter_tools/test/devfs_test.dart
+2
-2
context.dart
packages/flutter_tools/test/src/context.dart
+3
-3
No files found.
packages/flutter/test/widgets/positioned_test.dart
View file @
2888139c
...
...
@@ -40,7 +40,7 @@ void main() {
expect
(
b
.
width
,
100.0
);
expect
(
b
.
height
,
200.0
);
Positioned
c
=
new
Positioned
.
fromRelativeRect
(
rect:
new
RelativeRect
.
fromLTRB
(
rect:
const
RelativeRect
.
fromLTRB
(
103.0
,
303.0
,
203.0
,
...
...
packages/flutter_markdown/lib/src/markdown_raw.dart
View file @
2888139c
...
...
@@ -249,7 +249,7 @@ class _Renderer implements md.NodeVisitor {
linkInfo
=
_linkHandler
.
createLinkInfo
(
element
.
attributes
[
'href'
]);
}
TextStyle
style
=
_markdownStyle
.
styles
[
element
.
tag
]
??
new
TextStyle
();
TextStyle
style
=
_markdownStyle
.
styles
[
element
.
tag
]
??
const
TextStyle
();
List
<
_MarkdownNode
>
styleElement
=
<
_MarkdownNode
>[
new
_MarkdownNodeTextStyle
(
style
,
linkInfo
)];
_currentBlock
.
stack
.
add
(
new
_MarkdownNodeList
(
styleElement
));
}
...
...
@@ -338,7 +338,7 @@ class _Block {
_Block
(
this
.
tag
,
this
.
attributes
,
this
.
markdownStyle
,
this
.
listIndents
,
this
.
blockPosition
)
{
TextStyle
style
=
markdownStyle
.
styles
[
tag
];
if
(
style
==
null
)
style
=
new
TextStyle
(
color:
const
Color
(
0xffff0000
));
style
=
const
TextStyle
(
color:
const
Color
(
0xffff0000
));
stack
=
<
_MarkdownNode
>[
new
_MarkdownNodeList
(<
_MarkdownNode
>[
new
_MarkdownNodeTextStyle
(
style
)])];
subBlocks
=
<
_Block
>[];
...
...
@@ -398,7 +398,7 @@ class _Block {
}
else
{
bullet
=
new
Padding
(
padding:
new
EdgeInsets
.
only
(
right:
5.0
),
padding:
const
EdgeInsets
.
only
(
right:
5.0
),
child:
new
Text
(
"
${blockPosition + 1}
."
,
textAlign:
TextAlign
.
right
...
...
packages/flutter_markdown/lib/src/markdown_style.dart
View file @
2888139c
...
...
@@ -25,8 +25,8 @@ class MarkdownStyle extends MarkdownStyleRaw{
h4:
theme
.
textTheme
.
body2
,
h5:
theme
.
textTheme
.
body2
,
h6:
theme
.
textTheme
.
body2
,
em:
new
TextStyle
(
fontStyle:
FontStyle
.
italic
),
strong:
new
TextStyle
(
fontWeight:
FontWeight
.
bold
),
em:
const
TextStyle
(
fontStyle:
FontStyle
.
italic
),
strong:
const
TextStyle
(
fontWeight:
FontWeight
.
bold
),
blockquote:
theme
.
textTheme
.
body1
,
blockSpacing:
8.0
,
listIndent:
32.0
,
...
...
@@ -59,8 +59,8 @@ class MarkdownStyle extends MarkdownStyleRaw{
h4:
theme
.
textTheme
.
headline
,
h5:
theme
.
textTheme
.
title
,
h6:
theme
.
textTheme
.
subhead
,
em:
new
TextStyle
(
fontStyle:
FontStyle
.
italic
),
strong:
new
TextStyle
(
fontWeight:
FontWeight
.
bold
),
em:
const
TextStyle
(
fontStyle:
FontStyle
.
italic
),
strong:
const
TextStyle
(
fontWeight:
FontWeight
.
bold
),
blockquote:
theme
.
textTheme
.
body1
,
blockSpacing:
8.0
,
listIndent:
32.0
,
...
...
packages/flutter_tools/bin/fuchsia_builder.dart
View file @
2888139c
...
...
@@ -39,9 +39,9 @@ Future<Null> main(List<String> args) async {
executableContext
.
setVariable
(
Logger
,
new
StdoutLogger
());
executableContext
.
runInZone
(()
{
// Initialize the context with some defaults.
context
.
putIfAbsent
(
Platform
,
()
=>
new
LocalPlatform
());
context
.
putIfAbsent
(
FileSystem
,
()
=>
new
LocalFileSystem
());
context
.
putIfAbsent
(
ProcessManager
,
()
=>
new
LocalProcessManager
());
context
.
putIfAbsent
(
Platform
,
()
=>
const
LocalPlatform
());
context
.
putIfAbsent
(
FileSystem
,
()
=>
const
LocalFileSystem
());
context
.
putIfAbsent
(
ProcessManager
,
()
=>
const
LocalProcessManager
());
context
.
putIfAbsent
(
Logger
,
()
=>
new
StdoutLogger
());
context
.
putIfAbsent
(
Cache
,
()
=>
new
Cache
());
context
.
putIfAbsent
(
Config
,
()
=>
new
Config
());
...
...
packages/flutter_tools/lib/executable.dart
View file @
2888139c
...
...
@@ -102,9 +102,9 @@ Future<Null> main(List<String> args) async {
// in those locations as well to see if you need a similar update there.
// Seed these context entries first since others depend on them
context
.
putIfAbsent
(
Platform
,
()
=>
new
LocalPlatform
());
context
.
putIfAbsent
(
FileSystem
,
()
=>
new
LocalFileSystem
());
context
.
putIfAbsent
(
ProcessManager
,
()
=>
new
LocalProcessManager
());
context
.
putIfAbsent
(
Platform
,
()
=>
const
LocalPlatform
());
context
.
putIfAbsent
(
FileSystem
,
()
=>
const
LocalFileSystem
());
context
.
putIfAbsent
(
ProcessManager
,
()
=>
const
LocalProcessManager
());
context
.
putIfAbsent
(
Logger
,
()
=>
platform
.
isWindows
?
new
WindowsStdoutLogger
()
:
new
StdoutLogger
());
context
.
putIfAbsent
(
Config
,
()
=>
new
Config
());
...
...
packages/flutter_tools/lib/src/android/android_device.dart
View file @
2888139c
...
...
@@ -459,7 +459,7 @@ class AndroidDevice extends Device {
'shell'
,
'am'
,
'broadcast'
,
'-a'
,
'io.flutter.view.DISCOVER'
]));
return
new
Future
<
List
<
DiscoveredApp
>>.
delayed
(
new
Duration
(
seconds:
1
),
()
{
return
new
Future
<
List
<
DiscoveredApp
>>.
delayed
(
const
Duration
(
seconds:
1
),
()
{
logs
.
cancel
();
return
result
;
});
...
...
packages/flutter_tools/lib/src/base/config.dart
View file @
2888139c
...
...
@@ -37,7 +37,7 @@ class Config {
}
void
_flushValues
()
{
String
json
=
new
JsonEncoder
.
withIndent
(
' '
).
convert
(
_values
);
String
json
=
const
JsonEncoder
.
withIndent
(
' '
).
convert
(
_values
);
json
=
'
$json
\n
'
;
_configFile
.
writeAsStringSync
(
json
);
}
...
...
packages/flutter_tools/lib/src/base/logger.dart
View file @
2888139c
...
...
@@ -295,7 +295,7 @@ class _AnsiStatus extends Status {
stdout
.
write
(
'
${message.padRight(52)}
'
);
stdout
.
write
(
'
${_progress[0]}
'
);
timer
=
new
Timer
.
periodic
(
new
Duration
(
milliseconds:
100
),
_callback
);
timer
=
new
Timer
.
periodic
(
const
Duration
(
milliseconds:
100
),
_callback
);
}
static
final
List
<
String
>
_progress
=
<
String
>[
'-'
,
r'\'
,
'|'
,
r'/'
,
'-'
,
r'\'
,
'|'
,
'/'
];
...
...
packages/flutter_tools/lib/src/base/process_manager.dart
View file @
2888139c
...
...
@@ -29,7 +29,7 @@ ProcessManager get processManager => context[ProcessManager];
/// subdirectory.
void
enableRecordingProcessManager
(
String
location
)
{
Directory
dir
=
getRecordingSink
(
location
,
_kRecordingType
);
ProcessManager
delegate
=
new
LocalProcessManager
();
ProcessManager
delegate
=
const
LocalProcessManager
();
RecordingProcessManager
manager
=
new
RecordingProcessManager
(
delegate
,
dir
);
addShutdownHook
(()
=>
manager
.
flush
(
finishRunningProcesses:
true
));
context
.
setVariable
(
ProcessManager
,
manager
);
...
...
packages/flutter_tools/lib/src/base/utils.dart
View file @
2888139c
...
...
@@ -73,7 +73,7 @@ File getUniqueFile(Directory dir, String baseName, String ext) {
}
String
toPrettyJson
(
Object
jsonable
)
{
return
new
JsonEncoder
.
withIndent
(
' '
).
convert
(
jsonable
)
+
'
\n
'
;
return
const
JsonEncoder
.
withIndent
(
' '
).
convert
(
jsonable
)
+
'
\n
'
;
}
/// Return a String - with units - for the size in MB of the given number of bytes.
...
...
packages/flutter_tools/lib/src/commands/daemon.dart
View file @
2888139c
...
...
@@ -464,7 +464,7 @@ class AppDomain extends Domain {
if
(
app
==
null
)
throw
"app '
$appId
' not found"
;
return
app
.
stop
().
timeout
(
new
Duration
(
seconds:
5
)).
then
<
bool
>((
_
)
{
return
app
.
stop
().
timeout
(
const
Duration
(
seconds:
5
)).
then
<
bool
>((
_
)
{
return
true
;
}).
catchError
((
dynamic
error
)
{
_sendAppEvent
(
app
,
'log'
,
<
String
,
dynamic
>{
'log'
:
'
$error
'
,
'error'
:
true
});
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
2888139c
...
...
@@ -97,7 +97,7 @@ class TestCommand extends FlutterCommand {
Future
<
bool
>
_collectCoverageData
(
CoverageCollector
collector
,
{
bool
mergeCoverageData:
false
})
async
{
Status
status
=
logger
.
startProgress
(
'Collecting coverage information...'
);
String
coverageData
=
await
collector
.
finalizeCoverage
(
timeout:
new
Duration
(
seconds:
30
),
timeout:
const
Duration
(
seconds:
30
),
);
status
.
stop
();
printTrace
(
'coverage information collection complete'
);
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
2888139c
...
...
@@ -83,7 +83,7 @@ class SimControl {
connected
=
_isAnyConnected
();
if
(!
connected
)
{
printStatus
(
'Still waiting for iOS Simulator to boot...'
);
await
new
Future
<
Null
>.
delayed
(
new
Duration
(
seconds:
1
));
await
new
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
}
attempted
++;
}
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
2888139c
...
...
@@ -218,7 +218,7 @@ abstract class ResidentRunner {
for
(
int
i
=
0
;
vmService
.
vm
.
mainView
==
null
&&
i
<
5
;
i
++)
{
// If the VM doesn't yet have a view, wait for one to show up.
printTrace
(
'Waiting for Flutter view'
);
await
new
Future
<
Null
>.
delayed
(
new
Duration
(
seconds:
1
));
await
new
Future
<
Null
>.
delayed
(
const
Duration
(
seconds:
1
));
await
vmService
.
vm
.
refreshViews
();
}
currentView
=
vmService
.
vm
.
mainView
;
...
...
@@ -354,7 +354,7 @@ abstract class ResidentRunner {
if
((
currentView
!=
null
)
&&
(
currentView
.
uiIsolate
!=
null
))
{
// TODO(johnmccutchan): Wait for the exit command to complete.
currentView
.
uiIsolate
.
flutterExit
();
await
new
Future
<
Null
>.
delayed
(
new
Duration
(
milliseconds:
100
));
await
new
Future
<
Null
>.
delayed
(
const
Duration
(
milliseconds:
100
));
}
}
appFinished
();
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
2888139c
...
...
@@ -314,7 +314,7 @@ class HotRunner extends ResidentRunner {
if
(
_devFS
!=
null
)
{
// Cleanup the devFS; don't wait indefinitely, and ignore any errors.
await
_devFS
.
destroy
()
.
timeout
(
new
Duration
(
milliseconds:
250
))
.
timeout
(
const
Duration
(
milliseconds:
250
))
.
catchError
((
dynamic
error
)
{
printTrace
(
'
$error
'
);
});
...
...
packages/flutter_tools/lib/src/usage.dart
View file @
2888139c
...
...
@@ -96,7 +96,7 @@ class Usage {
// TODO(devoncarew): This may delay tool exit and could cause some analytics
// events to not be reported. Perhaps we could send the analytics pings
// out-of-process from flutter_tools?
await
_analytics
.
waitForLastPing
(
timeout:
new
Duration
(
milliseconds:
250
));
await
_analytics
.
waitForLastPing
(
timeout:
const
Duration
(
milliseconds:
250
));
}
void
printUsage
()
{
...
...
packages/flutter_tools/test/asset_bundle_test.dart
View file @
2888139c
...
...
@@ -10,7 +10,7 @@ import 'package:test/test.dart';
void
main
(
)
{
// Create a temporary directory and write a single file into it.
FileSystem
fs
=
new
LocalFileSystem
();
FileSystem
fs
=
const
LocalFileSystem
();
Directory
tempDir
=
fs
.
systemTempDirectory
.
createTempSync
();
String
projectRoot
=
tempDir
.
path
;
String
assetPath
=
'banana.txt'
;
...
...
packages/flutter_tools/test/daemon_test.dart
View file @
2888139c
...
...
@@ -32,7 +32,7 @@ void main() {
setUp
(()
{
appContext
=
new
AppContext
();
notifyingLogger
=
new
NotifyingLogger
();
appContext
.
setVariable
(
Platform
,
new
LocalPlatform
());
appContext
.
setVariable
(
Platform
,
const
LocalPlatform
());
appContext
.
setVariable
(
Logger
,
notifyingLogger
);
appContext
.
setVariable
(
Doctor
,
new
Doctor
());
if
(
platform
.
isMacOS
)
...
...
packages/flutter_tools/test/dependency_checker_test.dart
View file @
2888139c
...
...
@@ -88,7 +88,7 @@ void main() {
String
destinationPath
=
'/some/test/location'
;
// Copy the golden input and let the test run in an isolated temporary in-memory file system.
copyDirectorySync
(
new
LocalFileSystem
().
directory
(
fs
.
path
.
join
(
dataPath
,
'changed_sdk_location'
)),
const
LocalFileSystem
().
directory
(
fs
.
path
.
join
(
dataPath
,
'changed_sdk_location'
)),
fs
.
directory
(
destinationPath
));
fs
.
currentDirectory
=
destinationPath
;
...
...
packages/flutter_tools/test/devfs_test.dart
View file @
2888139c
...
...
@@ -236,7 +236,7 @@ void main() {
]);
expect
(
devFS
.
assetPathsToEvict
,
isEmpty
);
expect
(
bytes
,
31
);
},
timeout:
new
Timeout
(
new
Duration
(
seconds:
5
)));
},
timeout:
const
Timeout
(
const
Duration
(
seconds:
5
)));
testUsingContext
(
'delete dev file system'
,
()
async
{
await
devFS
.
destroy
();
...
...
@@ -340,4 +340,4 @@ Future<Null> _createPackage(String pkgName, String pkgFileName) async {
fs
.
file
(
fs
.
path
.
join
(
_tempDirs
[
0
].
path
,
'.packages'
)).
writeAsStringSync
(
sb
.
toString
());
}
String
_inAssetBuildDirectory
(
String
filename
)
=>
fs
.
path
.
join
(
getAssetBuildDirectory
(),
filename
);
\ No newline at end of file
String
_inAssetBuildDirectory
(
String
filename
)
=>
fs
.
path
.
join
(
getAssetBuildDirectory
(),
filename
);
packages/flutter_tools/test/src/context.dart
View file @
2888139c
...
...
@@ -42,9 +42,9 @@ void testUsingContext(String description, dynamic testMethod(), {
// Initialize the test context with some default mocks.
// Seed these context entries first since others depend on them
testContext
.
putIfAbsent
(
Platform
,
()
=>
new
LocalPlatform
());
testContext
.
putIfAbsent
(
FileSystem
,
()
=>
new
LocalFileSystem
());
testContext
.
putIfAbsent
(
ProcessManager
,
()
=>
new
LocalProcessManager
());
testContext
.
putIfAbsent
(
Platform
,
()
=>
const
LocalPlatform
());
testContext
.
putIfAbsent
(
FileSystem
,
()
=>
const
LocalFileSystem
());
testContext
.
putIfAbsent
(
ProcessManager
,
()
=>
const
LocalProcessManager
());
testContext
.
putIfAbsent
(
Logger
,
()
=>
new
BufferLogger
());
testContext
.
putIfAbsent
(
Config
,
()
=>
new
Config
());
...
...
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