enable lint unnecessary_const (#19342)

This commit is contained in:
Alexandre Ardhuin
2018-07-16 21:43:48 +02:00
committed by GitHub
parent d10e46ea65
commit cc1cf13eec
556 changed files with 40458 additions and 40457 deletions

View File

@@ -43,36 +43,36 @@ class ExtendedStandardMessageCodec extends StandardMessageCodec {
Future<TestStepResult> basicBinaryHandshake(ByteData message) async {
const BasicMessageChannel<ByteData> channel =
const BasicMessageChannel<ByteData>(
BasicMessageChannel<ByteData>(
'binary-msg',
const BinaryCodec(),
BinaryCodec(),
);
return _basicMessageHandshake<ByteData>(
'Binary >${toString(message)}<', channel, message);
}
Future<TestStepResult> basicStringHandshake(String message) async {
const BasicMessageChannel<String> channel = const BasicMessageChannel<String>(
const BasicMessageChannel<String> channel = BasicMessageChannel<String>(
'string-msg',
const StringCodec(),
StringCodec(),
);
return _basicMessageHandshake<String>('String >$message<', channel, message);
}
Future<TestStepResult> basicJsonHandshake(dynamic message) async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'json-msg',
const JSONMessageCodec(),
JSONMessageCodec(),
);
return _basicMessageHandshake<dynamic>('JSON >$message<', channel, message);
}
Future<TestStepResult> basicStandardHandshake(dynamic message) async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'std-msg',
const ExtendedStandardMessageCodec(),
ExtendedStandardMessageCodec(),
);
return _basicMessageHandshake<dynamic>(
'Standard >${toString(message)}<', channel, message);
@@ -80,35 +80,35 @@ Future<TestStepResult> basicStandardHandshake(dynamic message) async {
Future<TestStepResult> basicBinaryMessageToUnknownChannel() async {
const BasicMessageChannel<ByteData> channel =
const BasicMessageChannel<ByteData>(
BasicMessageChannel<ByteData>(
'binary-unknown',
const BinaryCodec(),
BinaryCodec(),
);
return _basicMessageToUnknownChannel<ByteData>('Binary', channel);
}
Future<TestStepResult> basicStringMessageToUnknownChannel() async {
const BasicMessageChannel<String> channel = const BasicMessageChannel<String>(
const BasicMessageChannel<String> channel = BasicMessageChannel<String>(
'string-unknown',
const StringCodec(),
StringCodec(),
);
return _basicMessageToUnknownChannel<String>('String', channel);
}
Future<TestStepResult> basicJsonMessageToUnknownChannel() async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'json-unknown',
const JSONMessageCodec(),
JSONMessageCodec(),
);
return _basicMessageToUnknownChannel<dynamic>('JSON', channel);
}
Future<TestStepResult> basicStandardMessageToUnknownChannel() async {
const BasicMessageChannel<dynamic> channel =
const BasicMessageChannel<dynamic>(
BasicMessageChannel<dynamic>(
'std-unknown',
const ExtendedStandardMessageCodec(),
ExtendedStandardMessageCodec(),
);
return _basicMessageToUnknownChannel<dynamic>('Standard', channel);
}

View File

@@ -9,46 +9,46 @@ import 'test_step.dart';
Future<TestStepResult> methodCallJsonSuccessHandshake(dynamic payload) async {
const MethodChannel channel =
const MethodChannel('json-method', const JSONMethodCodec());
MethodChannel('json-method', JSONMethodCodec());
return _methodCallSuccessHandshake(
'JSON success($payload)', channel, payload);
}
Future<TestStepResult> methodCallJsonErrorHandshake(dynamic payload) async {
const MethodChannel channel =
const MethodChannel('json-method', const JSONMethodCodec());
MethodChannel('json-method', JSONMethodCodec());
return _methodCallErrorHandshake('JSON error($payload)', channel, payload);
}
Future<TestStepResult> methodCallJsonNotImplementedHandshake() async {
const MethodChannel channel =
const MethodChannel('json-method', const JSONMethodCodec());
MethodChannel('json-method', JSONMethodCodec());
return _methodCallNotImplementedHandshake('JSON notImplemented()', channel);
}
Future<TestStepResult> methodCallStandardSuccessHandshake(
dynamic payload) async {
const MethodChannel channel = const MethodChannel(
const MethodChannel channel = MethodChannel(
'std-method',
const StandardMethodCodec(const ExtendedStandardMessageCodec()),
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallSuccessHandshake(
'Standard success($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardErrorHandshake(dynamic payload) async {
const MethodChannel channel = const MethodChannel(
const MethodChannel channel = MethodChannel(
'std-method',
const StandardMethodCodec(const ExtendedStandardMessageCodec()),
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallErrorHandshake(
'Standard error($payload)', channel, payload);
}
Future<TestStepResult> methodCallStandardNotImplementedHandshake() async {
const MethodChannel channel = const MethodChannel(
const MethodChannel channel = MethodChannel(
'std-method',
const StandardMethodCodec(const ExtendedStandardMessageCodec()),
StandardMethodCodec(ExtendedStandardMessageCodec()),
);
return _methodCallNotImplementedHandshake(
'Standard notImplemented()', channel);

View File

@@ -25,8 +25,8 @@ const String nothing = '-';
/// - The Flutter app records the incoming reply echo.
/// - The platform finally replies to the original message with another echo.
class TestStepResult {
static const TextStyle bold = const TextStyle(fontWeight: FontWeight.bold);
static const TestStepResult complete = const TestStepResult(
static const TextStyle bold = TextStyle(fontWeight: FontWeight.bold);
static const TestStepResult complete = TestStepResult(
'Test complete',
nothing,
TestStatus.complete,

View File

@@ -25,7 +25,7 @@ void main() {
if (status != 'complete') {
fail('Failed at step $step with status $status');
}
}, timeout: const Timeout(const Duration(minutes: 1)));
}, timeout: const Timeout(Duration(minutes: 1)));
tearDownAll(() async {
driver?.close();