Prefer const constructors (#11853)

* upgrade to linter-0.1.35

* re-enable lint prefer_const_constructors

* address review comments
This commit is contained in:
Alexandre Ardhuin
2017-08-31 08:55:21 +02:00
committed by GitHub
parent f0bf7b5c8c
commit bb4f4070f9
25 changed files with 172 additions and 158 deletions

View File

@@ -98,7 +98,7 @@ void main() {
if (result != 0)
throw 'Received unexpected exit code $result from run process.';
print('test: validating that the app has in fact closed...');
await client.done.timeout(new Duration(seconds: 5));
await client.done.timeout(const Duration(seconds: 5));
});
return new TaskResult.success(null);
});

View File

@@ -18,7 +18,7 @@ class _FlavorState extends State<Flavor> {
@override
void initState() {
super.initState();
new MethodChannel('flavor').invokeMethod('getFlavor').then((String flavor) {
const MethodChannel('flavor').invokeMethod('getFlavor').then((String flavor) {
setState(() {
_flavor = flavor;
});
@@ -27,8 +27,8 @@ class _FlavorState extends State<Flavor> {
@override
Widget build(BuildContext context) {
return _flavor == null
? new Text('Awaiting flavor...')
return _flavor == null
? const Text('Awaiting flavor...')
: new Text(_flavor, key: const ValueKey<String>('flavor'));
}
}

View File

@@ -16,7 +16,7 @@ Future<TestStepResult> systemNavigatorPop() {
channel.setMessageHandler((String message) async {
completer.complete(
new TestStepResult('System navigation pop', '', TestStatus.ok));
const TestStepResult('System navigation pop', '', TestStatus.ok));
return '';
});
SystemNavigator.pop();