Migrate flutter_tool tool helper files to null safety (#78845)

This commit is contained in:
Jenn Magder
2021-03-23 10:02:59 -07:00
committed by GitHub
parent b921a2443f
commit 0bde67e734
14 changed files with 18 additions and 47 deletions

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
final RegExp _whitespace = RegExp(r'\s+');
/// Convert adb device names into more human readable descriptions.

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
const int minApiLevel = 16;
const String minVersionName = 'Jelly Bean';
const String minVersionText = '4.1.x';

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
/// An indirection around our mustache templating system to avoid a
/// dependency on mustache..
abstract class TemplateRenderer {

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'context.dart';
import 'platform.dart';
@@ -16,7 +14,7 @@ class UserMessages {
'Please report a bug at https://github.com/flutter/flutter/issues.';
// 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';
String flutterVersion(String version, String flutterRoot) =>
'Flutter version $version at $flutterRoot';

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'dart:typed_data';
/// Data from a non-linear mathematical function that functions as
@@ -51,7 +49,7 @@ class Md5Hash {
int _remainingLength = 0;
int _contentLength = 0;
void addChunk(Uint8List data, [int stop]) {
void addChunk(Uint8List data, [int? stop]) {
assert(_remainingLength == 0);
stop ??= data.length;
int i = 0;

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:mustache_template/mustache_template.dart';
import '../base/template.dart';

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
const String emptyPubspecTemplate = '''
# Generated by the flutter tool
name: synthetic_package

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
/// Cache of https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry.
const String languageSubtagRegistry = '''
File-Date: 2020-03-16

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'dart:async';
import 'package:meta/meta.dart';

View File

@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'test_device.dart';
/// Callbacks for reporting progress while running tests.

View File

@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:meta/meta.dart';
import 'package:package_config/package_config.dart';
/// The JavaScript bootstrap script to support in-browser hot restart.
@@ -17,8 +14,8 @@ import 'package:package_config/package_config.dart';
/// and is responsible for bootstrapping the RequireJS modules and attaching
/// the hot reload hooks.
String generateBootstrapScript({
@required String requireUrl,
@required String mapperUrl,
required String requireUrl,
required String mapperUrl,
}) {
return '''
"use strict";
@@ -54,9 +51,9 @@ document.head.appendChild(requireEl);
/// `foo__bar__baz`. Rather than attempt to guess, we assume the first property of
/// this object is the module.
String generateMainModule({
@required String entrypoint,
@required bool nullAssertions,
@required bool nativeNullAssertions,
required String entrypoint,
required bool nullAssertions,
required bool nativeNullAssertions,
String bootstrapModule = 'main_module.bootstrap',
}) {
// TODO(jonahwilliams): fix typo in dwds and update.
@@ -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.
String generateTestEntrypoint({
@required String relativeTestPath,
@required String absolutePath,
@required String testConfigPath,
@required LanguageVersion languageVersion,
required String relativeTestPath,
required String absolutePath,
required String testConfigPath,
required LanguageVersion languageVersion,
}) {
return '''
// @dart = ${languageVersion.major}.${languageVersion.minor}