Use Dart 2 camel case constants (#15360)

This commit is contained in:
Jason Simmons
2018-03-12 11:06:32 -07:00
committed by GitHub
parent 33f9afd99c
commit 466d15433f
141 changed files with 708 additions and 708 deletions

View File

@@ -530,7 +530,7 @@ class FlutterDriver {
await new Future<Null>.delayed(const Duration(seconds: 2));
final Map<String, dynamic> result = await _peer.sendRequest('_flutter.screenshot').timeout(timeout);
return BASE64.decode(result['screenshot']);
return base64.decode(result['screenshot']);
}
/// Returns the Flags set in the Dart VM as JSON.

View File

@@ -3,7 +3,7 @@
// found in the LICENSE file.
import 'dart:async';
import 'dart:convert' show JSON, JsonEncoder;
import 'dart:convert' show json, JsonEncoder;
import 'dart:math' as math;
import 'package:file/file.dart';
@@ -112,10 +112,10 @@ class TimelineSummary {
await file.writeAsString(_encodeJson(summaryJson, pretty));
}
String _encodeJson(Map<String, dynamic> json, bool pretty) {
String _encodeJson(Map<String, dynamic> jsonObject, bool pretty) {
return pretty
? _prettyEncoder.convert(json)
: JSON.encode(json);
? _prettyEncoder.convert(jsonObject)
: json.encode(jsonObject);
}
List<TimelineEvent> _extractNamedEvents(String name) {

View File

@@ -298,7 +298,7 @@ class FlutterDriverExtension {
Future<ScrollResult> _scroll(Command command) async {
final Scroll scrollCommand = command;
final Finder target = await _waitForElement(_createFinder(scrollCommand.finder));
final int totalMoves = scrollCommand.duration.inMicroseconds * scrollCommand.frequency ~/ Duration.MICROSECONDS_PER_SECOND;
final int totalMoves = scrollCommand.duration.inMicroseconds * scrollCommand.frequency ~/ Duration.microsecondsPerSecond;
final Offset delta = new Offset(scrollCommand.dx, scrollCommand.dy) / totalMoves.toDouble();
final Duration pause = scrollCommand.duration ~/ totalMoves;
final Offset startLocation = _prober.getCenter(target);

View File

@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert' show JSON;
import 'dart:convert' show json;
import 'package:file/file.dart';
import 'package:flutter_driver/flutter_driver.dart';
@@ -245,7 +245,7 @@ void main() {
]).writeSummaryToFile('test', destinationDirectory: tempDir.path);
final String written =
await fs.file(path.join(tempDir.path, 'test.timeline_summary.json')).readAsString();
expect(JSON.decode(written), <String, dynamic>{
expect(json.decode(written), <String, dynamic>{
'average_frame_build_time_millis': 7.0,
'worst_frame_build_time_millis': 11.0,
'missed_frame_build_budget_count': 2,