Enable avoid_redundant_argument_values lint (#91409) (#91462)

This commit is contained in:
Ian Hickson 2021-10-08 09:25:14 -07:00 committed by GitHub
parent ac88d4ba5d
commit 61a0add286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
667 changed files with 1694 additions and 3386 deletions

View file

@ -74,7 +74,7 @@ linter:
# - avoid_positional_boolean_parameters # would have been nice to enable this but by now there's too many places that break it
- avoid_print
# - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356)
# - avoid_redundant_argument_values # not yet tested
- avoid_redundant_argument_values
- avoid_relative_lib_imports
- avoid_renaming_method_parameters
- avoid_return_types_on_setters

View file

@ -370,7 +370,6 @@ class UserHeader extends StatelessWidget {
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
RichText(text: TextSpan(
@ -569,7 +568,6 @@ class BottomBar extends StatelessWidget {
border: Border(
top: BorderSide(
color: Theme.of(context).dividerColor,
width: 1.0,
),
),
),

View file

@ -28,7 +28,6 @@ Future<void> main() async {
},
behavior: HitTestBehavior.opaque,
child: const IgnorePointer(
ignoring: true,
child: ComplexLayoutApp(),
),
));

View file

@ -147,7 +147,6 @@ class _ShadowWidget extends StatelessWidget {
),
size: Size(width, height),
isComplex: true,
willChange: false,
),
);
}

View file

@ -73,7 +73,6 @@ class _FilteredChildAnimationPageState extends State<FilteredChildAnimationPage>
color: Colors.green,
boxShadow: complex ? <BoxShadow>[
const BoxShadow(
color: Colors.black,
blurRadius: 10.0,
),
] : null,

View file

@ -32,7 +32,6 @@ class _MultiWidgetConstructTableState extends State<MultiWidgetConstructTable>
_controller = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 10000),
lowerBound: 0,
upperBound: colorList.length + 1.0,
)..repeat();
}

View file

@ -113,7 +113,7 @@ class _CustomPainter extends CustomPainter {
_textPainter.text = span;
_textPainter.layout(minWidth: 0, maxWidth: width);
_textPainter.layout(maxWidth: width);
_linePainter.style = PaintingStyle.fill;
canvas.drawRect(
Rect.fromLTWH(xPosition, yPosition - viewPadding, width, height),

View file

@ -1833,7 +1833,7 @@ void pathOps78() {
void pathOps79() {
final Path path79 = Path();
path79.addRRect(RRect.fromRectAndCorners(const Rect.fromLTRB(0, 0, 64, 56), topLeft: Radius.zero, topRight: Radius.zero, bottomLeft: const Radius.circular(10), bottomRight: Radius.zero, ));
path79.addRRect(RRect.fromRectAndCorners(const Rect.fromLTRB(0, 0, 64, 56), bottomLeft: const Radius.circular(10), ));
gFillType = path79.fillType;
path80 = path79.shift(const Offset(906, 136));
gFillType = path79.fillType;
@ -5828,7 +5828,7 @@ void pathOps576() {
path576.moveTo(0, 0);
path576.lineTo(220.60000000000002, 0);
path576.quadraticBezierTo(235.60000000000002, 0, 237.569696969697, 7.817946907441011);
path576.arcToPoint(const Offset(299.630303030303, 7.817946907441011), radius: const Radius.circular(32), rotation: 0, largeArc: false, clockwise: false);
path576.arcToPoint(const Offset(299.630303030303, 7.817946907441011), radius: const Radius.circular(32), clockwise: false);
path576.quadraticBezierTo(301.6, 0, 316.6, 0);
path576.lineTo(312.6, 0);
path576.lineTo(312.6, 48);

View file

@ -25,7 +25,6 @@ class BenchSimpleLazyTextScroll extends WidgetRecorder {
child: Row(
children: const <Widget>[
Flexible(
flex: 1,
child: _TestScrollingWidget(
initialScrollOffset: 0,
scrollDistance: 300,
@ -33,7 +32,6 @@ class BenchSimpleLazyTextScroll extends WidgetRecorder {
),
),
Flexible(
flex: 1,
child: _TestScrollingWidget(
initialScrollOffset: 1000,
scrollDistance: 500,
@ -41,7 +39,6 @@ class BenchSimpleLazyTextScroll extends WidgetRecorder {
),
),
Flexible(
flex: 1,
child: _TestScrollingWidget(
initialScrollOffset: 2000,
scrollDistance: 700,

View file

@ -417,7 +417,6 @@ class ColorItem extends StatelessWidget {
bottom: false,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text('$_counter:$prefix$index'),
Text(colorString()),

View file

@ -155,7 +155,6 @@ class ProductOption extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 11, vertical: 5),
decoration: BoxDecoration(
border: Border.all(
width: 1,
color: const Color(0xffebebeb),
),
borderRadius: const BorderRadius.all(Radius.circular(15)),

View file

@ -31,7 +31,7 @@ import 'src/web/recorder.dart';
typedef RecorderFactory = Recorder Function();
const bool isCanvasKit = bool.fromEnvironment('FLUTTER_WEB_USE_SKIA', defaultValue: false);
const bool isCanvasKit = bool.fromEnvironment('FLUTTER_WEB_USE_SKIA');
/// List of all benchmarks that run in the devicelab.
///

View file

@ -31,11 +31,9 @@ void main() {
final List<PointerEventRecord> records = <PointerEventRecord>[
PointerEventRecord(Duration.zero, <PointerEvent>[
PointerAddedEvent(
timeStamp: Duration.zero,
position: location,
),
PointerDownEvent(
timeStamp: Duration.zero,
position: location,
pointer: 1,
),

View file

@ -167,16 +167,16 @@ void main() {
}
runAddListenerBenchmark(_kNumWarmUp, addResult: false);
runAddListenerBenchmark(_kNumIterations, addResult: true);
runAddListenerBenchmark(_kNumIterations);
runNotifyListenerBenchmark(_kNumWarmUp, addResult: false);
runNotifyListenerBenchmark(_kNumIterations, addResult: true);
runNotifyListenerBenchmark(_kNumIterations);
runRemoveListenerBenchmark(_kNumWarmUp, addResult: false);
runRemoveListenerBenchmark(_kNumIterations, addResult: true);
runRemoveListenerBenchmark(_kNumIterations);
runRemoveListenerWhileNotifyingBenchmark(_kNumWarmUp, addResult: false);
runRemoveListenerWhileNotifyingBenchmark(_kNumIterations, addResult: true);
runRemoveListenerWhileNotifyingBenchmark(_kNumIterations);
printer.printToStdout();
}

View file

@ -48,7 +48,7 @@ void main() {
Offset(0.70, 0.04),
Offset(0.78, 0.98),
Offset(0.88, -0.00),
], tension: 0.00);
]);
_testCurve(
catmullRomCurve,
name: 'catmullrom_transform_iteration',

View file

@ -19,7 +19,7 @@ void main() {
for (int i = 0; i < words.length; i++) {
if (i.isEven) {
data.add(
InlineSpanSemanticsInformation(words[i], isPlaceholder: false),
InlineSpanSemanticsInformation(words[i]),
);
} else if (i.isEven) {
data.add(

View file

@ -38,7 +38,6 @@ class AndroidPlatformView extends StatelessWidget {
id: params.id,
viewType: viewType,
layoutDirection: TextDirection.ltr,
creationParams: null,
creationParamsCodec: const StandardMessageCodec(),
)
..addOnPlatformViewCreatedListener(params.onPlatformViewCreated)

View file

@ -30,14 +30,12 @@ Future<void> main(List<String> arguments) async {
final ArgParser argParser = ArgParser();
argParser.addOption(
'temp',
defaultsTo: null,
help: 'A location where temporary files may be written. Defaults to a '
'directory in the system temp folder. If specified, will not be '
'automatically removed at the end of execution.',
);
argParser.addFlag(
'verbose',
defaultsTo: false,
negatable: false,
help: 'Print verbose output for the analysis process.',
);
@ -52,12 +50,10 @@ Future<void> main(List<String> arguments) async {
argParser.addFlag(
'include-dart-ui',
defaultsTo: true,
negatable: true,
help: 'Includes the dart:ui code supplied by the engine in the analysis.',
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);
@ -69,7 +65,6 @@ Future<void> main(List<String> arguments) async {
argParser.addFlag(
'global-activate-snippets',
defaultsTo: true,
negatable: true,
help: 'Whether or not to "pub global activate" the snippets package. If set, will '
'activate version $_snippetsActivateVersion',
);
@ -476,7 +471,6 @@ class SampleChecker {
if (!Platform.environment.containsKey('FLUTTER_ROOT')) 'FLUTTER_ROOT': _flutterRoot,
if (_flutterVersion!.isNotEmpty) 'FLUTTER_VERSION': _flutterVersion!,
},
includeParentEnvironment: true,
);
}
@ -1155,7 +1149,7 @@ class Sample {
final StringBuffer buf = StringBuffer('sample ${args.join(' ')}\n');
int count = start.line;
for (final String line in input) {
buf.writeln(' ${count.toString().padLeft(4, ' ')}: $line');
buf.writeln(' ${count.toString().padLeft(4)}: $line');
count++;
}
return buf.toString();

View file

@ -94,8 +94,6 @@ class AppServer {
debugPort: browserDebugPort,
url: appUrl,
userDataDirectory: userDataDirectory.path,
windowHeight: 1024,
windowWidth: 1024,
), onError: chromeErrorCompleter.complete);
return AppServer._(server, chrome, chromeErrorCompleter.future);
}

View file

@ -687,7 +687,6 @@ class ArchivePublisher {
try {
await _runGsUtil(
<String>['stat', cloudPath],
failOk: false,
);
} on PreparePackageException {
// `gsutil stat gs://path/to/file` will exit with 1 if file does not exist
@ -737,7 +736,6 @@ Future<void> main(List<String> rawArguments) async {
final ArgParser argParser = ArgParser();
argParser.addOption(
'temp_dir',
defaultsTo: null,
help: 'A location where temporary files may be written. Defaults to a '
'directory in the system temp folder. Will write a few GiB of data, '
'so it should have sufficient free space. If a temp_dir is not '
@ -745,18 +743,15 @@ Future<void> main(List<String> rawArguments) async {
'removed automatically.',
);
argParser.addOption('revision',
defaultsTo: null,
help: 'The Flutter git repo revision to build the '
'archive with. Must be the full 40-character hash. Required.');
argParser.addOption(
'branch',
defaultsTo: null,
allowed: Branch.values.map<String>((Branch branch) => getBranchName(branch)),
help: 'The Flutter branch to build the archive with. Required.',
);
argParser.addOption(
'output',
defaultsTo: null,
help: 'The path to the directory where the output archive should be '
'written. If --output is not specified, the archive will be written to '
"the current directory. If the output directory doesn't exist, it, and "
@ -764,7 +759,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'publish',
defaultsTo: false,
help: 'If set, will publish the archive to Google Cloud Storage upon '
'successful creation of the archive. Will publish under this '
'directory: $baseUrl$releaseFolder',
@ -772,18 +766,15 @@ Future<void> main(List<String> rawArguments) async {
argParser.addFlag(
'force',
abbr: 'f',
defaultsTo: false,
help: 'Overwrite a previously uploaded package.',
);
argParser.addFlag(
'dry_run',
defaultsTo: false,
negatable: false,
help: 'Prints gsutil commands instead of executing them.',
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);

View file

@ -645,7 +645,7 @@ Future<void> _runFrameworkTests() async {
Future<void> runLibraries() async {
final List<String> tests = Directory(path.join(flutterRoot, 'packages', 'flutter', 'test'))
.listSync(followLinks: false, recursive: false)
.listSync(followLinks: false)
.whereType<Directory>()
.where((Directory dir) => dir.path.endsWith('widgets') == false)
.map<String>((Directory dir) => path.join('test', path.basename(dir.path)) + path.separator)
@ -1215,7 +1215,7 @@ Future<void> _ensureChromeDriverIsRunning() async {
final Uri chromeDriverUrl = Uri.parse('http://localhost:4444/status');
final HttpClientRequest request = await client.getUrl(chromeDriverUrl);
final HttpClientResponse response = await request.close();
final Map<String, dynamic> webDriverStatus = json.decode(await response.transform(utf8.decoder).join('')) as Map<String, dynamic>;
final Map<String, dynamic> webDriverStatus = json.decode(await response.transform(utf8.decoder).join()) as Map<String, dynamic>;
client.close();
final bool webDriverReady = (webDriverStatus['value'] as Map<String, dynamic>)['ready'] as bool;
if (!webDriverReady) {

View file

@ -193,6 +193,6 @@ void main() {
const Hash256(0xA8100AE6AA1940D0, 0xB663BB31CD466142, 0xEBBDBD5187131B92, 0xD93818987832EB89), // sha256("\xff")
const Hash256(0x155644D3F13D98BF, 0, 0, 0),
},
), exitCode: 0);
));
});
}

View file

@ -266,7 +266,6 @@ void main() {
tempDir,
testRef,
Branch.dev,
strict: true,
processManager: processManager,
subprocessOutput: false,
platform: platform,
@ -495,7 +494,7 @@ void main() {
'$gsutilCall -- stat $gsArchivePath': <ProcessResult>[ProcessResult(0, 0, '', '')],
};
processManager.addCommands(convertResults(calls));
expect(() async => publisher.publishArchive(false), throwsException);
expect(() async => publisher.publishArchive(), throwsException);
});
test('publishArchive does not throw if forceUpload is true and artifact already exists on cloud storage', () async {

View file

@ -401,7 +401,6 @@ Future<void> main(List<String> rawArguments) async {
final ArgParser argParser = ArgParser();
argParser.addOption(
'temp_dir',
defaultsTo: null,
help: 'A location where temporary files may be written. Defaults to a '
'directory in the system temp folder. If a temp_dir is not '
'specified, then by default a generated temporary directory will be '
@ -431,7 +430,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'confirm',
defaultsTo: false,
help: 'If set, will actually remove the archive from Google Cloud Storage '
'upon successful execution of this script. Published archives will be '
'removed from this directory: $baseUrl$releaseFolder. This option '
@ -440,7 +438,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);

View file

@ -496,7 +496,6 @@ class FrameworkRepository extends Repository {
name: RemoteName.upstream,
url: 'file://$upstreamPath/',
),
localUpstream: false,
previousCheckoutLocation: previousCheckoutLocation,
);
}

View file

@ -43,7 +43,6 @@ class RollDevCommand extends Command<void> {
kCandidateBranch,
help: 'Specifies which git branch to roll to the dev branch. Required.',
valueHelp: 'branch',
defaultsTo: null, // This option is required
);
argParser.addFlag(
kForce,

View file

@ -42,10 +42,10 @@ String presentState(pb.ConductorState state) {
buffer.writeln('Conductor version: ${state.conductorVersion}');
buffer.writeln('Release channel: ${state.releaseChannel}');
buffer.writeln('Release version: ${state.releaseVersion}');
buffer.writeln('');
buffer.writeln();
buffer.writeln('Release started at: ${DateTime.fromMillisecondsSinceEpoch(state.createdDate.toInt())}');
buffer.writeln('Last updated at: ${DateTime.fromMillisecondsSinceEpoch(state.lastUpdatedDate.toInt())}');
buffer.writeln('');
buffer.writeln();
buffer.writeln('Engine Repo');
buffer.writeln('\tCandidate branch: ${state.engine.candidateBranch}');
buffer.writeln('\tStarting git HEAD: ${state.engine.startingGitHead}');
@ -77,7 +77,7 @@ String presentState(pb.ConductorState state) {
} else {
buffer.writeln('0 Framework cherrypicks.');
}
buffer.writeln('');
buffer.writeln();
if (state.currentPhase == ReleasePhase.VERIFY_RELEASE) {
buffer.writeln(
'${state.releaseChannel} release ${state.releaseVersion} has been published and verified.\n',
@ -88,7 +88,7 @@ String presentState(pb.ConductorState state) {
buffer.writeln(presentPhases(state.currentPhase));
buffer.writeln(phaseInstructions(state));
buffer.writeln('');
buffer.writeln();
buffer.writeln('Issue `conductor next` when you are ready to proceed.');
return buffer.toString();
}

View file

@ -30,7 +30,6 @@ class StatusCommand extends Command<void> {
argParser.addFlag(
kVerboseFlag,
abbr: 'v',
defaultsTo: false,
help: 'Also print logs.',
);
}

View file

@ -56,7 +56,7 @@ void main() {
'cherry-pick',
'--no-commit',
commit,
], exitCode: 0),
]),
const FakeCommand(command: <String>[
'git',
'reset',

View file

@ -174,7 +174,7 @@ void main() {
),
false,
);
expect(stdio.logs.join('').contains(nextVersion), true);
expect(stdio.logs.join().contains(nextVersion), true);
});
test("exits with exception if --skip-tagging is provided but commit isn't already tagged", () {

View file

@ -53,7 +53,6 @@ class MyApp extends StatelessWidget {
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
const SelectableText(
'Desktop app for managing a release of the Flutter SDK, currently in development',

View file

@ -75,12 +75,7 @@ class MainProgressionState extends State<MainProgression> {
stateFilePath: widget.stateFilePath,
),
Stepper(
controlsBuilder: (BuildContext context, ControlsDetails details) {
return Row(
children: const <Widget>[],
);
},
type: StepperType.vertical,
controlsBuilder: (BuildContext context, ControlsDetails details) => Row(),
physics: const ScrollPhysics(),
currentStep: _completedStep,
onStepContinue: nextStep,
@ -127,9 +122,7 @@ class MainProgressionState extends State<MainProgression> {
),
Step(
title: Text(MainProgression._stepTitles[4]),
content: Column(
children: const <Widget>[],
),
content: Column(),
isActive: true,
state: handleStepState(4),
),

View file

@ -18,7 +18,6 @@ void main() {
child: Column(
children: const <Widget>[
MainProgression(
releaseState: null,
stateFilePath: './testPath',
),
],
@ -62,7 +61,6 @@ void main() {
child: Column(
children: const <Widget>[
MainProgression(
releaseState: null,
stateFilePath: './testPath',
),
],

View file

@ -41,22 +41,18 @@ Future<bool> run(List<String> arguments) async {
)
..addFlag(
'skip-on-fetch-failure',
defaultsTo: false,
help: 'Whether to skip tests that we fail to download.',
)
..addFlag(
'skip-template',
defaultsTo: false,
help: 'Whether to skip tests named "template.test".',
)
..addFlag(
'verbose',
defaultsTo: false,
help: 'Describe what is happening in detail.',
)
..addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print this help message.',
);

View file

@ -239,7 +239,6 @@ final ArgParser _argParser = ArgParser()
..addMultiOption(
'task',
abbr: 't',
splitCommas: true,
help: 'Either:\n'
' - the name of a task defined in manifest.yaml.\n'
' Example: complex_layout__start_up.\n'
@ -362,13 +361,10 @@ final ArgParser _argParser = ArgParser()
)
..addFlag(
'silent',
negatable: true,
defaultsTo: false,
)
..addMultiOption(
'test',
hide: true,
splitCommas: true,
callback: (List<String> value) {
if (value.isNotEmpty) {
throw const FormatException(

View file

@ -13,7 +13,5 @@ Future<void> main() async {
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/animated_image.dart',
'animated_image',
measureCpuGpu: true,
measureMemory: true,
).run);
}

View file

@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createComplexLayoutScrollPerfTest(measureCpuGpu: true));
await task(createComplexLayoutScrollPerfTest());
}

View file

@ -115,7 +115,6 @@ Future<void> main() async {
'list',
'runtimes',
],
canFail: false,
workingDirectory: flutterDirectory.path,
);
@ -166,7 +165,6 @@ Future<void> main() async {
'com.apple.CoreSimulator.SimDeviceType.iPhone-11',
iOSSimRuntime,
],
canFail: false,
workingDirectory: flutterDirectory.path,
);
@ -180,7 +178,6 @@ Future<void> main() async {
'com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-44mm',
watchSimRuntime,
],
canFail: false,
workingDirectory: flutterDirectory.path,
);
@ -188,7 +185,6 @@ Future<void> main() async {
await eval(
'xcrun',
<String>['simctl', 'pair', watchDeviceID, phoneDeviceID],
canFail: false,
workingDirectory: flutterDirectory.path,
);
@ -196,13 +192,11 @@ Future<void> main() async {
await eval(
'xcrun',
<String>['simctl', 'bootstatus', phoneDeviceID, '-b'],
canFail: false,
workingDirectory: flutterDirectory.path,
);
await eval(
'xcrun',
<String>['simctl', 'bootstatus', watchDeviceID, '-b'],
canFail: false,
workingDirectory: flutterDirectory.path,
);

View file

@ -13,8 +13,6 @@ Future<void> main() async {
'${flutterDirectory.path}/dev/benchmarks/macrobenchmarks',
'test_driver/large_image_changer.dart',
'large_image_changer',
measureCpuGpu: true,
measureMemory: true,
// This benchmark doesn't care about frame times, frame times will be heavily
// impacted by IO time for loading the image initially.
benchmarkScoreKeys: <String>[

View file

@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createPostBackdropFilterPerfTest(measureCpuGpu: true));
await task(createPostBackdropFilterPerfTest());
}

View file

@ -32,7 +32,6 @@ void main() {
'/smuggle-it',
'lib/route.dart',
],
canFail: false,
);
});
section('TEST WHETHER `flutter run --route` WORKS');

View file

@ -8,5 +8,5 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
Future<void> main() async {
deviceOperatingSystem = DeviceOperatingSystem.ios;
await task(createSimpleAnimationPerfTest(measureCpuGpu: true));
await task(createSimpleAnimationPerfTest());
}

View file

@ -49,8 +49,6 @@ class TestCommand extends Command<void> {
'task, will write test results to the file.');
argParser.addFlag(
'silent',
negatable: true,
defaultsTo: false,
);
}

View file

@ -274,7 +274,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
@override
Future<List<String>> discoverDevices() async {
final List<String> output = (await eval(adbPath, <String>['devices', '-l'], canFail: false))
final List<String> output = (await eval(adbPath, <String>['devices', '-l']))
.trim().split('\n');
final List<String> results = <String>[];
for (final String line in output) {
@ -327,7 +327,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
// Restarting `adb` helps with keeping device connections alive. When `adb`
// runs non-stop for too long it loses connections to devices. There may be
// a better method, but so far that's the best one I've found.
await exec(adbPath, <String>['kill-server'], canFail: false);
await exec(adbPath, <String>['kill-server']);
}
}
@ -555,7 +555,6 @@ class AndroidDevice extends Device {
adbPath,
<String>['-s', deviceId, ...arguments],
environment: environment,
canFail: false,
printStdout: !silent,
printStderr: !silent,
);

View file

@ -224,7 +224,7 @@ Future<String> getDartVersion() async {
Future<String?> getCurrentFlutterRepoCommit() {
if (!dir('${flutterDirectory.path}/.git').existsSync()) {
return Future<String?>.value(null);
return Future<String?>.value();
}
return inDirectory<String>(flutterDirectory, () {

View file

@ -145,7 +145,6 @@ class PluginPlatformInterfaceMacOS {
final Process run = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
flutterCommandArgs('run', <String>['-d', 'macos', '-v']),
environment: null,
);
Completer<void> registryExecutedCompleter = Completer<void>();
final StreamSubscription<void> subscription = run.stdout

View file

@ -133,8 +133,6 @@ Future<TaskResult> runWebBenchmark({ required bool useCanvasKit }) async {
final ChromeOptions options = ChromeOptions(
url: 'http://localhost:$benchmarkServerPort/index.html',
userDataDirectory: userDataDir,
windowHeight: 1024,
windowWidth: 1024,
headless: isUncalibratedSmokeTest,
debugPort: chromeDebugPort,
);

View file

@ -27,8 +27,8 @@ void main() {
final AndroidDevice androidDevice = device as AndroidDevice;
expect(await androidDevice.isArm64(), isTrue);
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.product.cpu.abi'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'getprop', arguments: <String>['ro.product.cpu.abi']),
]);
});
});
@ -51,7 +51,7 @@ void main() {
test('sends power event', () async {
await device.togglePower();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'input', arguments: <String>['keyevent', '26']),
]);
});
@ -62,7 +62,7 @@ void main() {
FakeDevice.pretendAwake();
await device.wakeUp();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
]);
});
@ -71,7 +71,7 @@ void main() {
FakeDevice.pretendAsleep();
await device.wakeUp();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
cmd(command: 'input', arguments: <String>['keyevent', '26']),
]);
@ -83,7 +83,7 @@ void main() {
FakeDevice.pretendAsleep();
await device.sendToSleep();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
]);
});
@ -92,7 +92,7 @@ void main() {
FakeDevice.pretendAwake();
await device.sendToSleep();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
cmd(command: 'input', arguments: <String>['keyevent', '26']),
]);
@ -104,7 +104,7 @@ void main() {
FakeDevice.pretendAwake();
await device.unlock();
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'dumpsys', arguments: <String>['power']),
cmd(command: 'input', arguments: <String>['keyevent', '82']),
]);
@ -115,7 +115,7 @@ void main() {
test('tap', () async {
await device.tap(100, 200);
expectLog(<CommandArgs>[
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk'], environment: null),
cmd(command: 'getprop', arguments: <String>['ro.bootimage.build.fingerprint', ';', 'getprop', 'ro.build.version.release', ';', 'getprop', 'ro.build.version.sdk']),
cmd(command: 'input', arguments: <String>['tap', '100', '200']),
]);
});

View file

@ -61,7 +61,7 @@ Sat Mar 9 20:13:00 2019 49 /usr/sbin/syslogd
),
RunningProcessInfo(
'49',
DateTime(2019, 3, 9, 20, 13, 00),
DateTime(2019, 3, 9, 20, 13),
'/usr/sbin/syslogd',
),
]));

View file

@ -32,14 +32,12 @@ class _TextFieldPageState extends State<TextFieldPage> {
TextField(
key: normalTextFieldKey,
controller: _normalController,
autofocus: false,
),
const Spacer(),
TextField(
key: passwordTextFieldKey,
controller: _passwordController,
obscureText: true,
autofocus: false,
),
],
),

View file

@ -227,7 +227,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
setState(() {});
break;
}
return Future<dynamic>.value(null);
return Future<dynamic>.value();
}
Future<dynamic> onViewMethodChannelCall(MethodCall call) {
@ -240,7 +240,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
setState(() {});
break;
}
return Future<dynamic>.value(null);
return Future<dynamic>.value();
}
Widget buildEventTile(BuildContext context, int index) {

View file

@ -10,8 +10,7 @@ import 'test_step.dart';
Future<TestStepResult> methodCallJsonSuccessHandshake(dynamic payload) async {
const MethodChannel channel =
MethodChannel('json-method', JSONMethodCodec());
return _methodCallSuccessHandshake(
'JSON success($payload)', channel, payload);
return _methodCallSuccessHandshake('JSON success($payload)', channel, payload);
}
Future<TestStepResult> methodCallJsonErrorHandshake(dynamic payload) async {
@ -32,8 +31,7 @@ Future<TestStepResult> methodCallStandardSuccessHandshake(
'std-method',
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallSuccessHandshake(
'Standard success($payload)', channel, payload);
return _methodCallSuccessHandshake('Standard success($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardErrorHandshake(dynamic payload) async {
@ -41,8 +39,7 @@ Future<TestStepResult> methodCallStandardErrorHandshake(dynamic payload) async {
'std-method',
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallErrorHandshake(
'Standard error($payload)', channel, payload);
return _methodCallErrorHandshake('Standard error($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardNotImplementedHandshake() async {
@ -50,8 +47,7 @@ Future<TestStepResult> methodCallStandardNotImplementedHandshake() async {
'std-method',
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallNotImplementedHandshake(
'Standard notImplemented()', channel);
return _methodCallNotImplementedHandshake('Standard notImplemented()', channel);
}
Future<TestStepResult> _methodCallSuccessHandshake(
@ -89,8 +85,7 @@ Future<TestStepResult> _methodCallErrorHandshake(
final List<dynamic> received = <dynamic>[];
channel.setMethodCallHandler((MethodCall call) async {
received.add(call.arguments);
throw PlatformException(
code: 'error', message: null, details: arguments);
throw PlatformException(code: 'error', details: arguments);
});
dynamic errorDetails = nothing;
dynamic error = nothing;

View file

@ -23,8 +23,6 @@ class SectionCard extends StatelessWidget {
child: DecoratedBox(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: <Color>[
section.leftColor!,
section.rightColor!,
@ -132,7 +130,6 @@ class SectionDetailView extends StatelessWidget {
package: detail.imageAssetPackage,
),
fit: BoxFit.cover,
alignment: Alignment.center,
),
),
);

View file

@ -136,7 +136,7 @@ class CalcExpression {
/// in the calculator's display panel.
@override
String toString() {
final StringBuffer buffer = StringBuffer('');
final StringBuffer buffer = StringBuffer();
buffer.writeAll(_list);
return buffer.toString();
}

View file

@ -67,7 +67,6 @@ class ColorItem extends StatelessWidget {
bottom: false,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text('$prefix$index'),
Text(colorString()),

View file

@ -327,7 +327,6 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
height: 128.0,

View file

@ -247,7 +247,6 @@ class _CupertinoPickerDemoState extends State<CupertinoPickerDemo> {
return _BottomPicker(
child: CupertinoDatePicker(
backgroundColor: CupertinoColors.systemBackground.resolveFrom(context),
mode: CupertinoDatePickerMode.dateAndTime,
initialDateTime: dateTime,
onDateTimeChanged: (DateTime newDateTime) {
setState(() => dateTime = newDateTime);

View file

@ -117,13 +117,11 @@ class _CupertinoSegmentedControlDemoState extends State<CupertinoSegmentedContro
BoxShadow(
offset: Offset(0.0, 6.0),
blurRadius: 10.0,
spreadRadius: 0.0,
color: _kKeyPenumbraOpacity,
),
BoxShadow(
offset: Offset(0.0, 1.0),
blurRadius: 18.0,
spreadRadius: 0.0,
color: _kAmbientShadowOpacity,
),
],

View file

@ -42,7 +42,6 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
children: <Widget> [
CupertinoSlider(
value: _value,
min: 0.0,
max: 100.0,
onChanged: (double value) {
setState(() {
@ -58,7 +57,6 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
children: <Widget> [
CupertinoSlider(
value: _discreteValue,
min: 0.0,
max: 100.0,
divisions: 5,
onChanged: (double value) {

View file

@ -27,7 +27,6 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
static const _ChoiceValue<Widget> kNoFab = _ChoiceValue<Widget>(
title: 'None',
label: 'do not show a floating action button',
value: null,
);
static const _ChoiceValue<Widget> kCircularFab = _ChoiceValue<Widget>(

View file

@ -275,7 +275,6 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
return Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
ListTile(
title: const Text('Simple dropdown:'),

View file

@ -344,7 +344,7 @@ class _ChipDemoState extends State<ChipDemo> {
data: _showShapeBorder
? theme.chipTheme.copyWith(
shape: BeveledRectangleBorder(
side: const BorderSide(width: 0.66, style: BorderStyle.solid, color: Colors.grey),
side: const BorderSide(width: 0.66, color: Colors.grey),
borderRadius: BorderRadius.circular(10.0),
))
: theme.chipTheme,

View file

@ -33,8 +33,6 @@ class DialogDemoItem extends StatelessWidget {
return SimpleDialogOption(
onPressed: onPressed,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(icon, size: 36.0, color: color),
Padding(

View file

@ -308,7 +308,6 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
// Allow room for the value indicator.
padding: const EdgeInsets.only(top: 44.0),
child: Slider(
min: 0.0,
max: 100.0,
divisions: 5,
activeColor: Colors.orange[100 + (field.value! * 5.0).round()],

View file

@ -284,7 +284,6 @@ class _SlidersState extends State<_Sliders> {
Slider.adaptive(
label: _continuousValue.toStringAsFixed(6),
value: _continuousValue,
min: 0.0,
max: 100.0,
onChanged: (double value) {
setState(() {
@ -307,7 +306,6 @@ class _SlidersState extends State<_Sliders> {
children: <Widget>[
Slider.adaptive(
value: _discreteValue,
min: 0.0,
max: 200.0,
divisions: 5,
label: '${_discreteValue.round()}',
@ -338,7 +336,6 @@ class _SlidersState extends State<_Sliders> {
),
child: Slider(
value: _discreteCustomValue,
min: 0.0,
max: 200.0,
divisions: 5,
semanticFormatterCallback: (double value) => value.round().toString(),
@ -381,7 +378,6 @@ class _RangeSlidersState extends State<_RangeSliders> {
children: <Widget>[
RangeSlider(
values: _continuousValues,
min: 0.0,
max: 100.0,
onChanged: (RangeValues values) {
setState(() {
@ -404,7 +400,6 @@ class _RangeSlidersState extends State<_RangeSliders> {
children: <Widget>[
RangeSlider(
values: _discreteValues,
min: 0.0,
max: 200.0,
divisions: 5,
labels: RangeLabels('${_discreteValues.start.round()}', '${_discreteValues.end.round()}'),
@ -433,7 +428,6 @@ class _RangeSlidersState extends State<_RangeSliders> {
),
child: RangeSlider(
values: _discreteCustomValues,
min: 0.0,
max: 200.0,
divisions: 5,
labels: RangeLabels('${_discreteCustomValues.start.round()}', '${_discreteCustomValues.end.round()}'),

View file

@ -107,7 +107,6 @@ class _CardDataItem extends StatelessWidget {
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Align(
alignment: page!.id == 'H'

View file

@ -252,7 +252,6 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
suffixText: 'USD',
suffixStyle: TextStyle(color: Colors.green),
),
maxLines: 1,
),
const SizedBox(height: 24.0),
PasswordField(

View file

@ -171,7 +171,7 @@ class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerP
).animate(
CurvedAnimation(
parent: _controller.view,
curve: const Interval(0.434, 1.0, curve: Curves.linear), // not used
curve: const Interval(0.434, 1.0), // not used
// only the reverseCurve will be used
reverseCurve: Interval(0.434, 1.0, curve: Curves.fastOutSlowIn.flipped),
),
@ -448,7 +448,7 @@ class _ProductThumbnailRowState extends State<ProductThumbnailRow> {
);
final Animation<double> opacity = CurvedAnimation(
curve: const Interval(0.33, 1.0, curve: Curves.linear),
curve: const Interval(0.33, 1.0),
parent: animation,
);

View file

@ -124,7 +124,6 @@ class ShoppingCartSummary extends StatelessWidget {
child: Column(
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const Expanded(
child: Text('TOTAL'),

View file

@ -45,7 +45,6 @@ class ProductCard extends StatelessWidget {
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AspectRatio(
aspectRatio: imageAspectRatio,
@ -56,7 +55,6 @@ class ProductCard extends StatelessWidget {
width: 121.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text(
product == null ? '' : product!.name,

View file

@ -253,7 +253,6 @@ class GridLists {
// loaded from the web.
GridView.count(
crossAxisCount: 3,
childAspectRatio: 1.0,
padding: const EdgeInsets.all(4.0),
mainAxisSpacing: 4.0,
crossAxisSpacing: 4.0,

View file

@ -58,14 +58,12 @@ class _CategoryItem extends StatelessWidget {
// repainted when the button's ink splash animates.
return RepaintBoundary(
child: RawMaterialButton(
padding: EdgeInsets.zero,
hoverColor: theme.primaryColor.withOpacity(0.05),
splashColor: theme.primaryColor.withOpacity(0.12),
highlightColor: Colors.transparent,
onPressed: onTap,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(6.0),
@ -184,7 +182,6 @@ class _DemoItem extends StatelessWidget {
final bool isDark = theme.brightness == Brightness.dark;
final double textScaleFactor = MediaQuery.textScaleFactorOf(context);
return RawMaterialButton(
padding: EdgeInsets.zero,
splashColor: theme.primaryColor.withOpacity(0.12),
highlightColor: Colors.transparent,
onPressed: () {

View file

@ -162,7 +162,7 @@ Future<void> smokeGallery(WidgetTester tester) async {
await tester.tap(find.text(category.name));
await tester.pumpAndSettle();
for (final GalleryDemo demo in kGalleryCategoryToDemos[category]!) {
await Scrollable.ensureVisible(tester.element(find.text(demo.title)), alignment: 0.0);
await Scrollable.ensureVisible(tester.element(find.text(demo.title)));
await smokeDemo(tester, demo);
tester.binding.debugAssertNoTransientCallbacks('A transient callback was still active after running $demo');
}

View file

@ -45,7 +45,7 @@ Future<void> runDemos(List<String> demos, WidgetController controller) async {
await controller.pumpAndSettle();
// Scroll back to the top
await controller.drag(demoList, const Offset(0.0, 10000.0));
await controller.pumpAndSettle(const Duration(milliseconds: 100));
await controller.pumpAndSettle();
}
currentDemoCategory = demoCategory;

View file

@ -31,7 +31,7 @@ void main([List<String> args = const <String>[]]) {
await tester.pumpAndSettle();
final int id = tester.getSemantics(find.bySemanticsLabel('Material')).id;
expect(id, greaterThan(-1));
}, skip: !withSemantics, semanticsEnabled: true);
}, skip: !withSemantics);
testWidgets(
'all demos',

View file

@ -31,7 +31,6 @@ Future<void> main() async {
},
behavior: HitTestBehavior.opaque,
child: const IgnorePointer(
ignoring: true,
child: GalleryApp(testMode: true),
),
));

View file

@ -199,7 +199,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
setState(() {});
break;
}
return Future<dynamic>.value(null);
return Future<dynamic>.value();
}
Future<dynamic> onViewMethodChannelCall(MethodCall call) {
@ -212,7 +212,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
setState(() {});
break;
}
return Future<dynamic>.value(null);
return Future<dynamic>.value();
}
Widget buildEventTile(BuildContext context, int index) {

View file

@ -105,6 +105,5 @@ void dispatchMouseWheelEvent(int mouseX, int mouseY,
deltaMode: deltaMode,
deltaX : deltaX,
deltaY : deltaY,
shiftKey: false,
));
}

View file

@ -248,13 +248,10 @@ class DragAndDropAppState extends State<DragAndDropApp> {
children: <Widget>[
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
ExampleDragSource(
color: Colors.yellow.shade300,
under: true,
heavy: false,
child: const Text('under'),
),
ExampleDragSource(
@ -266,7 +263,6 @@ class DragAndDropAppState extends State<DragAndDropApp> {
ExampleDragSource(
color: Colors.indigo.shade300,
under: false,
heavy: false,
child: const Text('above'),
),
],

View file

@ -89,7 +89,6 @@ class _HoverDemoState extends State<HoverDemo> {
const Padding(
padding: EdgeInsets.all(8.0),
child: TextField(
autofocus: false,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Enter Text',

View file

@ -96,7 +96,6 @@ class _HomeState extends State<Home> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
child: Slider(
min: 0.0,
max: 1024.0,
value: seed.toDouble(),
label: '$seed',

View file

@ -250,15 +250,15 @@ ArgParser _createArgsParser() {
final ArgParser parser = ArgParser();
parser.addFlag('help', abbr: 'h', negatable: false,
help: 'Show command help.');
parser.addFlag('verbose', negatable: true, defaultsTo: true,
parser.addFlag('verbose', defaultsTo: true,
help: 'Whether to report all error messages (on) or attempt to '
'filter out some known false positives (off). Shut this off '
'locally if you want to address Flutter-specific issues.');
parser.addFlag('checked', abbr: 'c', negatable: true,
parser.addFlag('checked', abbr: 'c',
help: 'Run dartdoc in checked mode.');
parser.addFlag('json', negatable: true,
parser.addFlag('json',
help: 'Display json-formatted output from dartdoc and skip stdout/stderr prefixing.');
parser.addFlag('validate-links', negatable: true,
parser.addFlag('validate-links',
help: 'Display warnings for broken links generated by dartdoc (slow)');
return parser;
}

View file

@ -50,7 +50,7 @@ Future<void> cleanUp(File integrationTest) async {
try {
await integrationTest.delete();
// Delete the integration_test directory if it is empty.
await integrationTest.parent.delete(recursive: false);
await integrationTest.parent.delete();
} on FileSystemException {
// Ignore, there might be other files in there preventing it from
// being removed, or it might not exist.
@ -205,7 +205,6 @@ Future<String> runCommand(
process = await processManager.start(
cmd,
workingDirectory: workingDirectory.absolute.path,
includeParentEnvironment: true,
environment: environment,
);
process.stdout.listen(

View file

@ -132,7 +132,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'collect',
defaultsTo: false,
negatable: false,
help: 'If this flag is set, then collect and parse header files from '
'Chromium and Android instead of reading pre-parsed data from '
@ -141,7 +140,6 @@ Future<void> main(List<String> rawArguments) async {
);
argParser.addFlag(
'help',
defaultsTo: false,
negatable: false,
help: 'Print help for this command.',
);

View file

@ -22,7 +22,7 @@ class MaskConstant {
return name
.split(' ')
.map<String>((String word) => lowerCamelToUpperCamel(word.toLowerCase()))
.join('');
.join();
}
String get lowerCamelName {

View file

@ -81,7 +81,7 @@ class IOSCodeGenerator extends PlatformCodeGenerator {
buffer.write(wrapString(constant.description, prefix: ' * '));
buffer.writeln(' */');
buffer.writeln('const uint64_t k${constant.upperCamelName} = ${toHex(constant.value, digits: 11)};');
buffer.writeln('');
buffer.writeln();
}
return buffer.toString().trimRight();
}

View file

@ -61,7 +61,7 @@ class KeyboardKeysCodeGenerator extends BaseCodeGenerator {
'[RawKeyEvent.physicalKey] for more information.');
lines.add(entry.usbHidCode, '''
$firstComment ///
$otherComments static const PhysicalKeyboardKey ${entry.constantName} = PhysicalKeyboardKey(${toHex(entry.usbHidCode, digits: 8)});
$otherComments static const PhysicalKeyboardKey ${entry.constantName} = PhysicalKeyboardKey(${toHex(entry.usbHidCode)});
''');
}
return lines.sortedJoin().trimRight();
@ -71,7 +71,7 @@ $otherComments static const PhysicalKeyboardKey ${entry.constantName} = Physica
final OutputLines<int> lines = OutputLines<int>('Physical debug names');
for (final PhysicalKeyEntry entry in keyData.entries) {
lines.add(entry.usbHidCode, '''
${toHex(entry.usbHidCode, digits: 8)}: '${entry.commentName}',''');
${toHex(entry.usbHidCode)}: '${entry.commentName}',''');
}
return lines.sortedJoin().trimRight();
}

View file

@ -23,7 +23,7 @@ class KeyCodesCcGenerator extends BaseCodeGenerator {
final OutputLines<int> lines = OutputLines<int>('Physical Key list');
for (final PhysicalKeyEntry entry in keyData.entries) {
lines.add(entry.usbHidCode, '''
constexpr uint64_t kPhysical${_toUpperCammel(entry.constantName)} = ${toHex(entry.usbHidCode, digits: 8)};''');
constexpr uint64_t kPhysical${_toUpperCammel(entry.constantName)} = ${toHex(entry.usbHidCode)};''');
}
return lines.sortedJoin().trimRight();
}

View file

@ -15,7 +15,7 @@ Future<void> main() async {
final HttpClient client = HttpClient();
final HttpClientRequest request = await client.getUrl(Uri.parse(registry));
final HttpClientResponse response = await request.close();
final String body = (await response.cast<List<int>>().transform<String>(utf8.decoder).toList()).join('');
final String body = (await response.cast<List<int>>().transform<String>(utf8.decoder).toList()).join();
final File subtagRegistry = File('../language_subtag_registry.dart');
final File subtagRegistryFlutterTools = File('../../../../packages/flutter_tools/lib/src/localizations/language_subtag_registry.dart');

View file

@ -118,7 +118,7 @@ class LocaleInfo implements Comparable<LocaleInfo> {
return originalString
.split('_')
.map<String>((String part) => part.substring(0, 1).toUpperCase() + part.substring(1).toLowerCase())
.join('');
.join();
}
@override
@ -232,17 +232,14 @@ GeneratorOptions parseArgs(List<String> rawArgs) {
..addFlag(
'overwrite',
abbr: 'w',
defaultsTo: false,
)
..addFlag(
'material',
help: 'Whether to print the generated classes for the Material package only. Ignored when --overwrite is passed.',
defaultsTo: false,
)
..addFlag(
'cupertino',
help: 'Whether to print the generated classes for the Cupertino package only. Ignored when --overwrite is passed.',
defaultsTo: false,
);
final argslib.ArgResults args = argParser.parse(rawArgs);
final bool writeToFile = args['overwrite'] as bool;

View file

@ -165,7 +165,7 @@ class SourceStats {
SourceStats getStatsFor(Directory dir, [SourceStats? stats]) {
stats ??= SourceStats();
for (final FileSystemEntity entity in dir.listSync(recursive: false, followLinks: false)) {
for (final FileSystemEntity entity in dir.listSync(followLinks: false)) {
final String name = path.basename(entity.path);
if (entity is File && name.endsWith('.dart')) {
stats.files += 1;

View file

@ -212,7 +212,7 @@ ArgResults _handleArguments(List<String> args) {
..addOption(_iconsClassPathOption,
defaultsTo: _defaultIconsPath,
help: 'Location of the material icons file')
..addFlag(_dryRunOption, defaultsTo: false);
..addFlag(_dryRunOption);
argParser.addFlag('help', abbr: 'h', negatable: false, callback: (bool help) {
if (help) {
print(argParser.usage);
@ -289,7 +289,7 @@ String _regenerateIconsFile(String iconData, Map<String, String> tokenPairMap) {
// Generate for Icons
if (line.contains(_beginGeneratedMark)) {
generating = true;
final String iconDeclarationsString = newIcons.map((_Icon icon) => icon.fullDeclaration).join('');
final String iconDeclarationsString = newIcons.map((_Icon icon) => icon.fullDeclaration).join();
buf.write(iconDeclarationsString);
} else if (line.contains(_endGeneratedMark)) {
generating = false;

View file

@ -39,7 +39,6 @@ final CatmullRomSpline path = CatmullRomSpline(
],
startHandle: const Offset(0.93, 0.93),
endHandle: const Offset(0.18, 0.23),
tension: 0.0,
);
class FollowCurve2D extends StatefulWidget {
@ -74,7 +73,7 @@ class _FollowCurve2DState extends State<FollowCurve2D>
animation = CurvedAnimation(parent: controller, curve: widget.curve);
// Have the controller repeat indefinitely. If you want it to "bounce" back
// and forth, set the reverse parameter to true.
controller.repeat(reverse: false);
controller.repeat();
controller.addListener(() => setState(() {}));
}
@ -107,7 +106,6 @@ class MyStatelessWidget extends StatelessWidget {
alignment: Alignment.center,
child: FollowCurve2D(
path: path,
curve: Curves.easeInOut,
duration: const Duration(seconds: 3),
child: CircleAvatar(
backgroundColor: Colors.yellow,

View file

@ -53,8 +53,6 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
largeTitle: Text('Scroll down'),
),
CupertinoSliverRefreshControl(
refreshTriggerPullDistance: 100.0,
refreshIndicatorExtent: 60.0,
onRefresh: () async {
await Future<void>.delayed(
const Duration(milliseconds: 1000),

View file

@ -116,7 +116,6 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
Align(
alignment: Alignment.topLeft,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Switch(
value: useResolver,

View file

@ -64,8 +64,8 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
restorationId: 'date_picker_dialog',
initialEntryMode: DatePickerEntryMode.calendarOnly,
initialDate: DateTime.fromMillisecondsSinceEpoch(arguments! as int),
firstDate: DateTime(2021, 1, 1),
lastDate: DateTime(2022, 1, 1),
firstDate: DateTime(2021),
lastDate: DateTime(2022),
);
},
);

View file

@ -41,7 +41,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
String? get restorationId => widget.restorationId;
final RestorableDateTimeN _startDate =
RestorableDateTimeN(DateTime(2021, 1, 1));
RestorableDateTimeN(DateTime(2021));
final RestorableDateTimeN _endDate =
RestorableDateTimeN(DateTime(2021, 1, 5));
late final RestorableRouteFuture<DateTimeRange?>
@ -85,9 +85,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
restorationId: 'date_picker_dialog',
initialDateRange:
_initialDateTimeRange(arguments! as Map<dynamic, dynamic>),
firstDate: DateTime(2021, 1, 1),
firstDate: DateTime(2021),
currentDate: DateTime(2021, 1, 25),
lastDate: DateTime(2022, 1, 1),
lastDate: DateTime(2022),
);
},
);

View file

@ -42,7 +42,6 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
return DropdownButton<String>(
value: dropdownValue,
icon: const Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
style: const TextStyle(color: Colors.deepPurple),
underline: Container(

View file

@ -47,7 +47,6 @@ class _ArticleDescription extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -73,7 +72,6 @@ class _ArticleDescription extends StatelessWidget {
),
),
Expanded(
flex: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,

View file

@ -49,7 +49,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
},
side: MaterialStateBorderSide.resolveWith((Set<MaterialState> states) {
if (states.contains(MaterialState.selected)) {
return const BorderSide(width: 1, color: Colors.red);
return const BorderSide(color: Colors.red);
}
return null; // Defer to default value on the theme or widget.
}),

Some files were not shown because too many files have changed in this diff Show more