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
0bde67e7
Unverified
Commit
0bde67e7
authored
Mar 23, 2021
by
Jenn Magder
Committed by
GitHub
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate flutter_tool tool helper files to null safety (#78845)
parent
b921a244
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
18 additions
and
47 deletions
+18
-47
adb.dart
packages/flutter_tools/lib/src/android/adb.dart
+0
-2
android.dart
packages/flutter_tools/lib/src/android/android.dart
+0
-2
template.dart
packages/flutter_tools/lib/src/base/template.dart
+0
-2
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+1
-3
hash.dart
packages/flutter_tools/lib/src/build_system/hash.dart
+1
-3
mustache_template.dart
...ges/flutter_tools/lib/src/isolated/mustache_template.dart
+0
-2
gen_l10n_templates.dart
...utter_tools/lib/src/localizations/gen_l10n_templates.dart
+0
-2
language_subtag_registry.dart
...tools/lib/src/localizations/language_subtag_registry.dart
+0
-2
test_device.dart
packages/flutter_tools/lib/src/test/test_device.dart
+0
-2
watcher.dart
packages/flutter_tools/lib/src/test/watcher.dart
+0
-2
bootstrap.dart
packages/flutter_tools/lib/src/web/bootstrap.dart
+9
-12
daemon_client.dart
packages/flutter_tools/tool/daemon_client.dart
+2
-4
global_count.dart
packages/flutter_tools/tool/global_count.dart
+1
-3
unit_coverage.dart
packages/flutter_tools/tool/unit_coverage.dart
+4
-6
No files found.
packages/flutter_tools/lib/src/android/adb.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
final
RegExp
_whitespace
=
RegExp
(
r'\s+'
);
final
RegExp
_whitespace
=
RegExp
(
r'\s+'
);
/// Convert adb device names into more human readable descriptions.
/// Convert adb device names into more human readable descriptions.
...
...
packages/flutter_tools/lib/src/android/android.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
const
int
minApiLevel
=
16
;
const
int
minApiLevel
=
16
;
const
String
minVersionName
=
'Jelly Bean'
;
const
String
minVersionName
=
'Jelly Bean'
;
const
String
minVersionText
=
'4.1.x'
;
const
String
minVersionText
=
'4.1.x'
;
packages/flutter_tools/lib/src/base/template.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
/// An indirection around our mustache templating system to avoid a
/// An indirection around our mustache templating system to avoid a
/// dependency on mustache..
/// dependency on mustache..
abstract
class
TemplateRenderer
{
abstract
class
TemplateRenderer
{
...
...
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'context.dart'
;
import
'context.dart'
;
import
'platform.dart'
;
import
'platform.dart'
;
...
@@ -16,7 +14,7 @@ class UserMessages {
...
@@ -16,7 +14,7 @@ class UserMessages {
'Please report a bug at https://github.com/flutter/flutter/issues.'
;
'Please report a bug at https://github.com/flutter/flutter/issues.'
;
// Messages used in FlutterValidator
// Messages used in FlutterValidator
String
flutterStatusInfo
(
String
channel
,
String
version
,
String
os
,
String
locale
)
=>
String
flutterStatusInfo
(
String
?
channel
,
String
?
version
,
String
os
,
String
locale
)
=>
'Channel
${channel ?? 'unknown'}
,
${version ?? 'Unknown'}
, on
$os
, locale
$locale
'
;
'Channel
${channel ?? 'unknown'}
,
${version ?? 'Unknown'}
, on
$os
, locale
$locale
'
;
String
flutterVersion
(
String
version
,
String
flutterRoot
)
=>
String
flutterVersion
(
String
version
,
String
flutterRoot
)
=>
'Flutter version
$version
at
$flutterRoot
'
;
'Flutter version
$version
at
$flutterRoot
'
;
...
...
packages/flutter_tools/lib/src/build_system/hash.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:typed_data'
;
import
'dart:typed_data'
;
/// Data from a non-linear mathematical function that functions as
/// Data from a non-linear mathematical function that functions as
...
@@ -51,7 +49,7 @@ class Md5Hash {
...
@@ -51,7 +49,7 @@ class Md5Hash {
int
_remainingLength
=
0
;
int
_remainingLength
=
0
;
int
_contentLength
=
0
;
int
_contentLength
=
0
;
void
addChunk
(
Uint8List
data
,
[
int
stop
])
{
void
addChunk
(
Uint8List
data
,
[
int
?
stop
])
{
assert
(
_remainingLength
==
0
);
assert
(
_remainingLength
==
0
);
stop
??=
data
.
length
;
stop
??=
data
.
length
;
int
i
=
0
;
int
i
=
0
;
...
...
packages/flutter_tools/lib/src/isolated/mustache_template.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:mustache_template/mustache_template.dart'
;
import
'package:mustache_template/mustache_template.dart'
;
import
'../base/template.dart'
;
import
'../base/template.dart'
;
...
...
packages/flutter_tools/lib/src/localizations/gen_l10n_templates.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
const
String
emptyPubspecTemplate
=
'''
const
String
emptyPubspecTemplate
=
'''
# Generated by the flutter tool
# Generated by the flutter tool
name: synthetic_package
name: synthetic_package
...
...
packages/flutter_tools/lib/src/localizations/language_subtag_registry.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
/// Cache of https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
/// Cache of https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
const
String
languageSubtagRegistry
=
'''
const
String
languageSubtagRegistry
=
'''
File-Date: 2020-03-16
File-Date: 2020-03-16
...
...
packages/flutter_tools/lib/src/test/test_device.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:async'
;
import
'dart:async'
;
import
'package:meta/meta.dart'
;
import
'package:meta/meta.dart'
;
...
...
packages/flutter_tools/lib/src/test/watcher.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'test_device.dart'
;
import
'test_device.dart'
;
/// Callbacks for reporting progress while running tests.
/// Callbacks for reporting progress while running tests.
...
...
packages/flutter_tools/lib/src/web/bootstrap.dart
View file @
0bde67e7
...
@@ -2,9 +2,6 @@
...
@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:meta/meta.dart'
;
import
'package:package_config/package_config.dart'
;
import
'package:package_config/package_config.dart'
;
/// The JavaScript bootstrap script to support in-browser hot restart.
/// The JavaScript bootstrap script to support in-browser hot restart.
...
@@ -17,8 +14,8 @@ import 'package:package_config/package_config.dart';
...
@@ -17,8 +14,8 @@ import 'package:package_config/package_config.dart';
/// and is responsible for bootstrapping the RequireJS modules and attaching
/// and is responsible for bootstrapping the RequireJS modules and attaching
/// the hot reload hooks.
/// the hot reload hooks.
String
generateBootstrapScript
(
{
String
generateBootstrapScript
(
{
@
required
String
requireUrl
,
required
String
requireUrl
,
@
required
String
mapperUrl
,
required
String
mapperUrl
,
})
{
})
{
return
'''
return
'''
"use strict";
"use strict";
...
@@ -54,9 +51,9 @@ document.head.appendChild(requireEl);
...
@@ -54,9 +51,9 @@ document.head.appendChild(requireEl);
/// `foo__bar__baz`. Rather than attempt to guess, we assume the first property of
/// `foo__bar__baz`. Rather than attempt to guess, we assume the first property of
/// this object is the module.
/// this object is the module.
String
generateMainModule
(
{
String
generateMainModule
(
{
@
required
String
entrypoint
,
required
String
entrypoint
,
@
required
bool
nullAssertions
,
required
bool
nullAssertions
,
@
required
bool
nativeNullAssertions
,
required
bool
nativeNullAssertions
,
String
bootstrapModule
=
'main_module.bootstrap'
,
String
bootstrapModule
=
'main_module.bootstrap'
,
})
{
})
{
// TODO(jonahwilliams): fix typo in dwds and update.
// TODO(jonahwilliams): fix typo in dwds and update.
...
@@ -102,10 +99,10 @@ define("$bootstrapModule", ["$entrypoint", "dart_sdk"], function(app, dart_sdk)
...
@@ -102,10 +99,10 @@ define("$bootstrapModule", ["$entrypoint", "dart_sdk"], function(app, dart_sdk)
///
///
/// This hard-codes the device pixel ratio to 3.0 and a 2400 x 1800 window size.
/// This hard-codes the device pixel ratio to 3.0 and a 2400 x 1800 window size.
String generateTestEntrypoint({
String generateTestEntrypoint({
@
required String relativeTestPath,
required String relativeTestPath,
@
required String absolutePath,
required String absolutePath,
@
required String testConfigPath,
required String testConfigPath,
@
required LanguageVersion languageVersion,
required LanguageVersion languageVersion,
}) {
}) {
return '''
return '''
// @dart = ${languageVersion.major}.${languageVersion.minor}
// @dart = ${languageVersion.major}.${languageVersion.minor}
...
...
packages/flutter_tools/tool/daemon_client.dart
View file @
0bde67e7
...
@@ -2,14 +2,12 @@
...
@@ -2,14 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:convert'
;
import
'dart:convert'
;
import
'dart:io'
;
import
'dart:io'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
Process
daemon
;
late
Process
daemon
;
// To use, start from the console and enter:
// To use, start from the console and enter:
// version: print version
// version: print version
...
@@ -85,7 +83,7 @@ Future<void> main() async {
...
@@ -85,7 +83,7 @@ Future<void> main() async {
});
});
// Print in the callback can't fail.
// Print in the callback can't fail.
unawaited
(
daemon
.
exitCode
.
then
<
void
>((
int
code
)
{
unawaited
(
daemon
.
exitCode
.
then
<
int
>((
int
code
)
{
print
(
'daemon exiting (
$code
)'
);
print
(
'daemon exiting (
$code
)'
);
exit
(
code
);
exit
(
code
);
}));
}));
...
...
packages/flutter_tools/tool/global_count.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:io'
;
import
'dart:io'
;
import
'package:path/path.dart'
as
path
;
import
'package:path/path.dart'
as
path
;
...
@@ -27,7 +25,7 @@ int countGlobalImports(Directory directory) {
...
@@ -27,7 +25,7 @@ int countGlobalImports(Directory directory) {
if
(!
file
.
path
.
endsWith
(
'.dart'
)
||
file
is
!
File
)
{
if
(!
file
.
path
.
endsWith
(
'.dart'
)
||
file
is
!
File
)
{
continue
;
continue
;
}
}
final
bool
hasImport
=
(
file
as
File
)
.
readAsLinesSync
().
any
((
String
line
)
{
final
bool
hasImport
=
file
.
readAsLinesSync
().
any
((
String
line
)
{
return
globalImport
.
hasMatch
(
line
);
return
globalImport
.
hasMatch
(
line
);
});
});
if
(
hasImport
)
{
if
(
hasImport
)
{
...
...
packages/flutter_tools/tool/unit_coverage.dart
View file @
0bde67e7
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:io'
;
import
'dart:io'
;
/// Produces a per-library coverage summary when fed an lcov file, sorted by
/// Produces a per-library coverage summary when fed an lcov file, sorted by
...
@@ -17,7 +15,7 @@ void main(List<String> args) {
...
@@ -17,7 +15,7 @@ void main(List<String> args) {
}
}
final
List
<
String
>
lines
=
File
(
args
.
single
).
readAsLinesSync
();
final
List
<
String
>
lines
=
File
(
args
.
single
).
readAsLinesSync
();
final
List
<
Coverage
>
coverages
=
<
Coverage
>[];
final
List
<
Coverage
>
coverages
=
<
Coverage
>[];
Coverage
currentCoverage
;
Coverage
?
currentCoverage
;
for
(
final
String
line
in
lines
)
{
for
(
final
String
line
in
lines
)
{
if
(
line
.
startsWith
(
'SF:'
))
{
if
(
line
.
startsWith
(
'SF:'
))
{
...
@@ -26,9 +24,9 @@ void main(List<String> args) {
...
@@ -26,9 +24,9 @@ void main(List<String> args) {
coverages
.
add
(
currentCoverage
);
coverages
.
add
(
currentCoverage
);
}
}
if
(
line
.
startsWith
(
'DA'
))
{
if
(
line
.
startsWith
(
'DA'
))
{
currentCoverage
.
totalLines
+=
1
;
currentCoverage
?
.
totalLines
+=
1
;
if
(!
line
.
endsWith
(
',0'
))
{
if
(!
line
.
endsWith
(
',0'
))
{
currentCoverage
.
testedLines
+=
1
;
currentCoverage
?
.
testedLines
+=
1
;
}
}
}
}
if
(
line
==
'end_of_record'
)
{
if
(
line
==
'end_of_record'
)
{
...
@@ -53,7 +51,7 @@ void main(List<String> args) {
...
@@ -53,7 +51,7 @@ void main(List<String> args) {
}
}
class
Coverage
{
class
Coverage
{
String
library
;
String
?
library
;
int
totalLines
=
0
;
int
totalLines
=
0
;
int
testedLines
=
0
;
int
testedLines
=
0
;
}
}
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