[dart] Add new analysis rules
Added unnecessary_const and unnecessary_new and update our code to build
with that.
FIDL-574 #done
Change-Id: I7a0dc1328c61f3ddc734a04025219dddddae59e9
diff --git a/app/spinning_cube/lib/main.dart b/app/spinning_cube/lib/main.dart
index 8a6e346..35f4a72 100644
--- a/app/spinning_cube/lib/main.dart
+++ b/app/spinning_cube/lib/main.dart
@@ -15,7 +15,7 @@
Ticker createTicker(TickerCallback onTick) => Ticker(onTick);
}
-const Duration _kCubeRotationAnimationPeriod = const Duration(
+const Duration _kCubeRotationAnimationPeriod = Duration(
milliseconds: 12000,
);
diff --git a/bin/bluetooth_settings/lib/main.dart b/bin/bluetooth_settings/lib/main.dart
index 6d6c8d4..c9565b8 100644
--- a/bin/bluetooth_settings/lib/main.dart
+++ b/bin/bluetooth_settings/lib/main.dart
@@ -13,11 +13,11 @@
void main() {
setupLogger();
- Widget app = new MaterialApp(
- home: new Container(
- child: new ScopedModel<BluetoothSettingsModel>(
- model: new BluetoothSettingsModel(),
- child: const BluetoothSettings(),
+ Widget app = MaterialApp(
+ home: Container(
+ child: ScopedModel<BluetoothSettingsModel>(
+ model: BluetoothSettingsModel(),
+ child: BluetoothSettings(),
),
),
);
diff --git a/bin/bluetooth_settings/lib/src/bluetooth_model.dart b/bin/bluetooth_settings/lib/src/bluetooth_model.dart
index 74db363..8b739f9 100644
--- a/bin/bluetooth_settings/lib/src/bluetooth_model.dart
+++ b/bin/bluetooth_settings/lib/src/bluetooth_model.dart
@@ -14,7 +14,7 @@
/// Model containing state needed for the bluetooth settings app.
class BluetoothSettingsModel extends Model {
/// Bluetooth controller proxy.
- final ControlProxy _control = new ControlProxy();
+ final ControlProxy _control = ControlProxy();
final BluetoothSettingsPairingDelegate _pairingDelegate =
BluetoothSettingsPairingDelegate();
diff --git a/bin/bluetooth_settings/lib/src/bluetooth_settings.dart b/bin/bluetooth_settings/lib/src/bluetooth_settings.dart
index 0440c20..819150c 100644
--- a/bin/bluetooth_settings/lib/src/bluetooth_settings.dart
+++ b/bin/bluetooth_settings/lib/src/bluetooth_settings.dart
@@ -17,13 +17,13 @@
@override
Widget build(BuildContext context) =>
- new ScopedModelDescendant<BluetoothSettingsModel>(
+ ScopedModelDescendant<BluetoothSettingsModel>(
builder: (
BuildContext context,
Widget child,
BluetoothSettingsModel model,
) =>
- new LayoutBuilder(
+ LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) =>
Material(
child: _buildBluetoothSettings(
diff --git a/bin/crasher_dart/lib/main.dart b/bin/crasher_dart/lib/main.dart
index 047f1f0..586b1be 100644
--- a/bin/crasher_dart/lib/main.dart
+++ b/bin/crasher_dart/lib/main.dart
@@ -29,9 +29,9 @@
Future<void> throwAsync() async {
Future.delayed(Duration(seconds: 1),
- () => throw new Exception('Dart exception from async function'));
+ () => throw Exception('Dart exception from async function'));
}
void throwSync() {
- throw new Exception('Dart exception from sync function');
+ throw Exception('Dart exception from sync function');
}
diff --git a/bin/device_settings/lib/main.dart b/bin/device_settings/lib/main.dart
index f579b16..f04dfd8 100644
--- a/bin/device_settings/lib/main.dart
+++ b/bin/device_settings/lib/main.dart
@@ -19,7 +19,7 @@
home: Container(
child: ProviderNode(
providers: providers,
- child: const DeviceSettings(),
+ child: DeviceSettings(),
),
),
);
diff --git a/bin/display_settings/lib/main.dart b/bin/display_settings/lib/main.dart
index 95759b2..443f726 100644
--- a/bin/display_settings/lib/main.dart
+++ b/bin/display_settings/lib/main.dart
@@ -13,11 +13,11 @@
final Display display = Display();
setupLogger();
- Widget app = new MaterialApp(
- home: new Container(
- child: new ScopedModel<DisplayPolicyBrightnessModel>(
- model: new DisplayPolicyBrightnessModel(display),
- child: const DisplaySettings(),
+ Widget app = MaterialApp(
+ home: Container(
+ child: ScopedModel<DisplayPolicyBrightnessModel>(
+ model: DisplayPolicyBrightnessModel(display),
+ child: DisplaySettings(),
),
),
);
diff --git a/bin/display_settings/lib/src/widget.dart b/bin/display_settings/lib/src/widget.dart
index ceb48dd..53f789d 100644
--- a/bin/display_settings/lib/src/widget.dart
+++ b/bin/display_settings/lib/src/widget.dart
@@ -18,7 +18,7 @@
return SettingsSection(
title: 'Brightness',
scale: scale,
- child: new Slider(
+ child: Slider(
activeColor: Colors.grey[600],
inactiveColor: Colors.grey[200],
value: model.brightness,
@@ -35,13 +35,13 @@
@override
Widget build(BuildContext context) =>
- new ScopedModelDescendant<DisplayPolicyBrightnessModel>(
+ ScopedModelDescendant<DisplayPolicyBrightnessModel>(
builder: (
BuildContext context,
Widget child,
DisplayPolicyBrightnessModel model,
) =>
- new LayoutBuilder(
+ LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) =>
Material(
child: _buildDisplaySettings(
diff --git a/bin/fidl_bindings_test/test/test/clone_test.dart b/bin/fidl_bindings_test/test/test/clone_test.dart
index 0ae70e7..a56f787 100644
--- a/bin/fidl_bindings_test/test/test/clone_test.dart
+++ b/bin/fidl_bindings_test/test/test/clone_test.dart
@@ -26,13 +26,13 @@
});
test('set field', () {
final s1 = ExampleStruct(foo: 'test', bar: 42);
- final s2 = ExampleStruct.clone(s1, baz: new Uint8List(10));
+ final s2 = ExampleStruct.clone(s1, baz: Uint8List(10));
expect(s2.foo, equals('test'));
expect(s2.bar, equals(42));
expect(s2.baz?.length, equals(10));
});
test('unset field', () {
- final s1 = ExampleStruct(foo: 'test', bar: 42, baz: new Uint8List(10));
+ final s1 = ExampleStruct(foo: 'test', bar: 42, baz: Uint8List(10));
final s2 = ExampleStruct.cloneWithout(s1, baz: true);
expect(s2.foo, equals('test'));
expect(s2.bar, equals(42));
diff --git a/bin/fidl_bindings_test/test/test/event_test.dart b/bin/fidl_bindings_test/test/test/event_test.dart
index 43319c9..71918d7 100644
--- a/bin/fidl_bindings_test/test/test/event_test.dart
+++ b/bin/fidl_bindings_test/test/test/event_test.dart
@@ -13,7 +13,7 @@
group('events', () {
setUpAll(() async {
- server = new TestServerInstance();
+ server = TestServerInstance();
await server.start();
});
@@ -35,9 +35,9 @@
test('three args', () async {
final primes =
- new Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
+ Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
await server.proxy.sendThreeArgEvent(
- 23, 42, new NoHandleStruct(foo: 'hello', bar: 1729, baz: primes));
+ 23, 42, NoHandleStruct(foo: 'hello', bar: 1729, baz: primes));
final threeReply = await server.proxy.threeArgEvent.first;
expect(threeReply.x, equals(23));
expect(threeReply.y, equals(42));
diff --git a/bin/fidl_bindings_test/test/test/failure_test.dart b/bin/fidl_bindings_test/test/test/failure_test.dart
index ded0327..f8360fda 100644
--- a/bin/fidl_bindings_test/test/test/failure_test.dart
+++ b/bin/fidl_bindings_test/test/test/failure_test.dart
@@ -15,7 +15,7 @@
TestServerInstance server;
group('failure', () {
setUp(() async {
- server = new TestServerInstance();
+ server = TestServerInstance();
await server.start();
});
@@ -62,7 +62,7 @@
});
test('binding closes immediately after sending response', () async {
- var impl = new SimpleServerImpl();
+ var impl = SimpleServerImpl();
var proxy = impl.newAsyncProxy();
var pinged = false;
@@ -78,15 +78,15 @@
group('unbound', () {
test('one-way call on unbound proxy', () {
- final proxy = new TestServerProxy();
+ final proxy = TestServerProxy();
expect(proxy.oneWayNoArgs(), throwsA(anything));
});
test('two-way call on unbound proxy', () {
- final proxy = new TestServerProxy();
+ final proxy = TestServerProxy();
expect(proxy.twoWayNoArgs(), throwsA(anything));
});
test('event listen on unbound proxy', () {
- final proxy = new TestServerProxy();
+ final proxy = TestServerProxy();
expect(proxy.emptyEvent.first, doesNotComplete);
});
});
@@ -97,7 +97,7 @@
// close the bound channel.
class SimpleServerImpl extends fidlgen.SimpleServer {
SimpleServerProxy newAsyncProxy() {
- var proxy = new SimpleServerProxy();
+ var proxy = SimpleServerProxy();
binding.bind(
this,
InterfaceRequest<fidlgen.SimpleServer>(
@@ -111,5 +111,5 @@
binding.close();
}
- fidlgen.SimpleServerBinding binding = new fidlgen.SimpleServerBinding();
+ fidlgen.SimpleServerBinding binding = fidlgen.SimpleServerBinding();
}
diff --git a/bin/fidl_bindings_test/test/test/hash_test.dart b/bin/fidl_bindings_test/test/test/hash_test.dart
index 6186c24..f029689 100644
--- a/bin/fidl_bindings_test/test/test/hash_test.dart
+++ b/bin/fidl_bindings_test/test/test/hash_test.dart
@@ -30,13 +30,13 @@
group('structs', () {
test('no handles', () {
final s1 = NoHandleStruct(
- foo: 'hello', bar: 42, baz: new Uint8List.fromList([2, 4, 6, 8]));
+ foo: 'hello', bar: 42, baz: Uint8List.fromList([2, 4, 6, 8]));
final s2 = NoHandleStruct(
- foo: 'hello', bar: 42, baz: new Uint8List.fromList([2, 4, 6, 8]));
+ foo: 'hello', bar: 42, baz: Uint8List.fromList([2, 4, 6, 8]));
final s3 = NoHandleStruct(
- foo: 'goodbye', bar: 42, baz: new Uint8List.fromList([2, 4, 6, 8]));
+ foo: 'goodbye', bar: 42, baz: Uint8List.fromList([2, 4, 6, 8]));
final s4 = NoHandleStruct(
- foo: 'hello', bar: 42, baz: new Uint8List.fromList([3, 6, 9, 12]));
+ foo: 'hello', bar: 42, baz: Uint8List.fromList([3, 6, 9, 12]));
expect(s1 == s2, isTrue);
expect(s1 == s3, isFalse);
expect(s1 == s4, isFalse);
diff --git a/bin/fidl_bindings_test/test/test/oneway_test.dart b/bin/fidl_bindings_test/test/test/oneway_test.dart
index d13df18..7ce68ed 100644
--- a/bin/fidl_bindings_test/test/test/oneway_test.dart
+++ b/bin/fidl_bindings_test/test/test/oneway_test.dart
@@ -13,7 +13,7 @@
group('one way', () {
setUpAll(() async {
- server = new TestServerInstance();
+ server = TestServerInstance();
await server.start();
});
@@ -36,9 +36,9 @@
test('three args', () async {
final primes =
- new Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
+ Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
await server.proxy.oneWayThreeArgs(
- 23, 42, new NoHandleStruct(foo: 'hello', bar: 1729, baz: primes));
+ 23, 42, NoHandleStruct(foo: 'hello', bar: 1729, baz: primes));
final threeReply = await server.proxy.receivedOneWayThreeArgs();
expect(threeReply.x, equals(23));
expect(threeReply.y, equals(42));
@@ -49,9 +49,9 @@
test('table', () async {
final primes =
- new Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
+ Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
await server.proxy.oneWayExampleTable(
- new ExampleTable(foo: 'hello', bar: 1729, baz: primes));
+ ExampleTable(foo: 'hello', bar: 1729, baz: primes));
final received = await server.proxy.receivedOneWayExampleTable();
expect(received.foo, equals('hello'));
expect(received.bar, equals(1729));
@@ -60,7 +60,7 @@
test('partial table', () async {
await server.proxy.oneWayExampleTable(
- new ExampleTable(bar: 1729)); // not seting foo, nor baz
+ ExampleTable(bar: 1729)); // not seting foo, nor baz
final received = await server.proxy.receivedOneWayExampleTable();
expect(received.foo, equals(null));
expect(received.bar, equals(1729));
@@ -69,7 +69,7 @@
test('empty table', () async {
await server.proxy.oneWayExampleTable(
- new ExampleTable());
+ ExampleTable());
final received = await server.proxy.receivedOneWayExampleTable();
expect(received.foo, equals(null));
expect(received.bar, equals(null));
@@ -96,7 +96,7 @@
test('xunion with vector of bytes', () async {
final primes =
- new Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
+ Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
await server.proxy.oneWayExampleXunion(
ExampleXunion.withBaz(primes));
final received = await server.proxy.receivedOneWayExampleXunion();
diff --git a/bin/fidl_bindings_test/test/test/roundtrip_test.dart b/bin/fidl_bindings_test/test/test/roundtrip_test.dart
index 4e3706f..e4d0ce5 100644
--- a/bin/fidl_bindings_test/test/test/roundtrip_test.dart
+++ b/bin/fidl_bindings_test/test/test/roundtrip_test.dart
@@ -17,7 +17,7 @@
static void run<T>(String name, T input, $fidl.FidlType<T> type, Uint8List bytes) {
group(name, () {
- new SuccessCase(input, type, bytes)
+ SuccessCase(input, type, bytes)
.._checkEncode()
.._checkDecode();
});
@@ -25,18 +25,18 @@
void _checkEncode() {
test('encode', () {
- final $fidl.Encoder $encoder = new $fidl.Encoder()
+ final $fidl.Encoder $encoder = $fidl.Encoder()
..alloc(type.encodedSize);
type.encode($encoder, input, 0);
final message = $encoder.message;
- expect(new Uint8List.view(message.data.buffer, 0, message.dataLength), equals(bytes));
+ expect(Uint8List.view(message.data.buffer, 0, message.dataLength), equals(bytes));
});
}
void _checkDecode() {
test('decode', () {
- final $fidl.Decoder $decoder = new $fidl.Decoder(
- new $fidl.Message(new ByteData.view(bytes.buffer, 0, bytes.length), [], bytes.length, 0))
+ final $fidl.Decoder $decoder = $fidl.Decoder(
+ $fidl.Message(ByteData.view(bytes.buffer, 0, bytes.length), [], bytes.length, 0))
..claimMemory(type.encodedSize);
final $actual = type.decode($decoder, 0);
expect($actual, equals(input));
@@ -66,7 +66,7 @@
SuccessCase.run('simpletable-x-and-y',
TestSimpleTable(
- table: new SimpleTable(x: 42, y: 67),
+ table: SimpleTable(x: 42, y: 67),
),
kTestSimpleTable_Type,
Uint8List.fromList([
@@ -89,7 +89,7 @@
SuccessCase.run('simpletable-just-y',
TestSimpleTable(
- table: new SimpleTable(y: 67),
+ table: SimpleTable(y: 67),
),
kTestSimpleTable_Type,
Uint8List.fromList([
@@ -111,7 +111,7 @@
SuccessCase.run('table-with-string-and-vector-1',
TestTableWithStringAndVector(
- table: new TableWithStringAndVector(
+ table: TableWithStringAndVector(
foo: 'hello',
bar: 27,
),
@@ -132,7 +132,7 @@
);
SuccessCase.run('empty-table',
- TestSimpleTable(table: new SimpleTable()),
+ TestSimpleTable(table: SimpleTable()),
kTestSimpleTable_Type,
Uint8List.fromList([
0, 0, 0, 0, 0, 0, 0, 0, // max ordinal
@@ -225,7 +225,7 @@
SuccessCase.run('xunion-in-table-xunion-absent',
TestXUnionInTable(
- value: new XUnionInTable(
+ value: XUnionInTable(
before: 'before',
after: 'after',
)
@@ -265,7 +265,7 @@
SuccessCase.run('xunion-in-table-xunion-present',
TestXUnionInTable(
- value: new XUnionInTable(
+ value: XUnionInTable(
before: 'before',
xu: SampleXUnion.withU(0xdeadbeef),
after: 'after',
diff --git a/bin/fidl_bindings_test/test/test/state_test.dart b/bin/fidl_bindings_test/test/test/state_test.dart
index 9062d8c..49be67e 100644
--- a/bin/fidl_bindings_test/test/test/state_test.dart
+++ b/bin/fidl_bindings_test/test/test/state_test.dart
@@ -10,12 +10,12 @@
void main() async {
group('proxy state', () {
test('initial', () {
- final proxy = new TestServerProxy();
+ final proxy = TestServerProxy();
expect(proxy.ctrl.state, equals(InterfaceState.unbound));
});
test('request', () {
- final proxy = new TestServerProxy();
+ final proxy = TestServerProxy();
expect(proxy.ctrl.whenBound, completes);
final request = proxy.ctrl.request();
expect(proxy.ctrl.state, equals(InterfaceState.bound));
@@ -23,8 +23,8 @@
});
test('bind', () {
- final pair = new InterfacePair<TestServer>();
- final proxy = new TestServerProxy();
+ final pair = InterfacePair<TestServer>();
+ final proxy = TestServerProxy();
expect(proxy.ctrl.whenBound, completes);
proxy.ctrl.bind(pair.handle);
expect(proxy.ctrl.state, equals(InterfaceState.bound));
@@ -33,12 +33,12 @@
test('after bind', () {
// Set up a bound proxy...
- var pair = new InterfacePair<TestServer>();
- final proxy = new TestServerProxy();
+ var pair = InterfacePair<TestServer>();
+ final proxy = TestServerProxy();
proxy.ctrl.bind(pair.handle);
// The bound proxy cannot be bound to a handle.
- pair = new InterfacePair<TestServer>();
+ pair = InterfacePair<TestServer>();
expect(() => proxy.ctrl.bind(pair.handle), throwsA(anything));
// The bound proxy cannot vend an interface request.
expect(proxy.ctrl.request, throwsA(anything));
@@ -47,8 +47,8 @@
test('unbind', () {
// Set up a bound proxy...
- final pair = new InterfacePair<TestServer>();
- final proxy = new TestServerProxy();
+ final pair = InterfacePair<TestServer>();
+ final proxy = TestServerProxy();
proxy.ctrl.bind(pair.handle);
expect(proxy.ctrl.whenClosed, completes);
@@ -60,8 +60,8 @@
test('close', () {
// Set up a bound proxy...
- final pair = new InterfacePair<TestServer>();
- final proxy = new TestServerProxy();
+ final pair = InterfacePair<TestServer>();
+ final proxy = TestServerProxy();
proxy.ctrl.bind(pair.handle);
expect(proxy.ctrl.whenClosed, completes);
@@ -73,15 +73,15 @@
test('after close', () {
// Set up a closed proxy...
- var pair = new InterfacePair<TestServer>();
- final proxy = new TestServerProxy();
+ var pair = InterfacePair<TestServer>();
+ final proxy = TestServerProxy();
proxy.ctrl.bind(pair.handle);
proxy.ctrl.close();
// The closed proxy will never reach bound state.
expect(proxy.ctrl.whenBound, throwsA(anything));
// The closed proxy cannot be bound to a handle.
- pair = new InterfacePair<TestServer>();
+ pair = InterfacePair<TestServer>();
expect(() => proxy.ctrl.bind(pair.handle), throwsA(anything));
// The closed proxy cannot vend an interface request.
expect(proxy.ctrl.request, throwsA(anything));
diff --git a/bin/fidl_bindings_test/test/test/twoway_test.dart b/bin/fidl_bindings_test/test/test/twoway_test.dart
index caf6f8f..4853787 100644
--- a/bin/fidl_bindings_test/test/test/twoway_test.dart
+++ b/bin/fidl_bindings_test/test/test/twoway_test.dart
@@ -12,7 +12,7 @@
TestServerInstance server;
group('two way', () {
setUpAll(() async {
- server = new TestServerInstance();
+ server = TestServerInstance();
await server.start();
});
@@ -32,10 +32,10 @@
test('three args', () async {
final primes =
- new Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
+ Uint8List.fromList([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);
final threeReply = await server.proxy.twoWayThreeArgs(
- 23, 42, new NoHandleStruct(foo: 'hello', bar: 1729, baz: primes));
+ 23, 42, NoHandleStruct(foo: 'hello', bar: 1729, baz: primes));
expect(threeReply.x, equals(23));
expect(threeReply.y, equals(42));
diff --git a/bin/fidlgen_dart/backend/ir/ir.go b/bin/fidlgen_dart/backend/ir/ir.go
index 1655c88..1f9e295 100644
--- a/bin/fidlgen_dart/backend/ir/ir.go
+++ b/bin/fidlgen_dart/backend/ir/ir.go
@@ -364,12 +364,12 @@
lines = append(lines, fmt.Sprintf(" %s,\n", p.typeExpr))
}
- return fmt.Sprintf("const <$fidl.MemberType>[\n%s ]", strings.Join(lines, ""))
+ return fmt.Sprintf("<$fidl.MemberType>[\n%s ]", strings.Join(lines, ""))
}
func formatStructMemberList(members []StructMember) string {
if len(members) == 0 {
- return "const <$fidl.MemberType>[]"
+ return "<$fidl.MemberType>[]"
}
lines := []string{}
@@ -378,12 +378,12 @@
lines = append(lines, fmt.Sprintf(" %s,\n", v.typeExpr))
}
- return fmt.Sprintf("const <$fidl.MemberType>[\n%s ]", strings.Join(lines, ""))
+ return fmt.Sprintf("<$fidl.MemberType>[\n%s ]", strings.Join(lines, ""))
}
func formatTableMemberList(members []TableMember) string {
if len(members) == 0 {
- return "const <int, $fidl.FidlType>{}"
+ return "<int, $fidl.FidlType>{}"
}
lines := []string{}
@@ -392,12 +392,12 @@
lines = append(lines, fmt.Sprintf(" %d: %s,\n", v.Ordinal, v.Type.typeExpr))
}
- return fmt.Sprintf("const <int, $fidl.FidlType>{\n%s }", strings.Join(lines, ""))
+ return fmt.Sprintf("<int, $fidl.FidlType>{\n%s }", strings.Join(lines, ""))
}
func formatUnionMemberList(members []UnionMember) string {
if len(members) == 0 {
- return "const <$fidl.MemberType>[]"
+ return "<$fidl.MemberType>[]"
}
lines := []string{}
@@ -406,12 +406,12 @@
lines = append(lines, fmt.Sprintf(" %s,\n", v.typeExpr))
}
- return fmt.Sprintf("const <$fidl.MemberType>[\n%s ]", strings.Join(lines, ""))
+ return fmt.Sprintf("<$fidl.MemberType>[\n%s ]", strings.Join(lines, ""))
}
func formatXUnionMemberList(members []XUnionMember) string {
if len(members) == 0 {
- return "const <int, $fidl.FidlType>{}"
+ return "<int, $fidl.FidlType>{}"
}
var lines []string
@@ -419,7 +419,7 @@
lines = append(lines, fmt.Sprintf(" %d: %s,\n", v.Ordinal, v.Type.typeExpr))
}
- return fmt.Sprintf("const <int, $fidl.FidlType>{\n%s }", strings.Join(lines, ""))
+ return fmt.Sprintf("<int, $fidl.FidlType>{\n%s }", strings.Join(lines, ""))
}
func formatLibraryName(library types.LibraryIdentifier) string {
@@ -431,7 +431,7 @@
}
func typeExprForMethod(request []Parameter, response []Parameter, name string) string {
- return fmt.Sprintf(`const $fidl.MethodType(
+ return fmt.Sprintf(`$fidl.MethodType(
request: %s,
response: %s,
name: r"%s",
@@ -443,7 +443,7 @@
if !ok {
log.Fatal("Unknown primitive subtype: ", val)
}
- return fmt.Sprintf("const $fidl.%s()", t)
+ return fmt.Sprintf("$fidl.%s()", t)
}
func libraryPrefix(library types.LibraryIdentifier) string {
@@ -594,7 +594,7 @@
}
elementStr := fmt.Sprintf("element: %s", t.typeExpr)
elementCountStr := fmt.Sprintf("elementCount: %s", formatInt(val.ElementCount))
- r.typeExpr = fmt.Sprintf("const $fidl.ArrayType<%s>(%s, %s)", r.Decl, elementStr, elementCountStr)
+ r.typeExpr = fmt.Sprintf("$fidl.ArrayType<%s>(%s, %s)", r.Decl, elementStr, elementCountStr)
case types.VectorType:
t := c.compileType(*val.ElementType)
if len(t.typedDataDecl) > 0 {
@@ -609,13 +609,13 @@
elementStr := fmt.Sprintf("element: %s", t.typeExpr)
maybeElementCountStr := fmt.Sprintf("maybeElementCount: %s", formatInt(val.ElementCount))
nullableStr := fmt.Sprintf("nullable: %s", formatBool(val.Nullable))
- r.typeExpr = fmt.Sprintf("const $fidl.VectorType<%s>(%s, %s, %s)",
+ r.typeExpr = fmt.Sprintf("$fidl.VectorType<%s>(%s, %s, %s)",
r.Decl, elementStr, maybeElementCountStr, nullableStr)
case types.StringType:
r.Decl = "String"
r.SyncDecl = r.Decl
r.AsyncDecl = r.Decl
- r.typeExpr = fmt.Sprintf("const $fidl.StringType(maybeElementCount: %s, nullable: %s)",
+ r.typeExpr = fmt.Sprintf("$fidl.StringType(maybeElementCount: %s, nullable: %s)",
formatInt(val.ElementCount), formatBool(val.Nullable))
case types.HandleType:
switch val.HandleSubtype {
@@ -632,7 +632,7 @@
}
r.SyncDecl = r.Decl
r.AsyncDecl = r.Decl
- r.typeExpr = fmt.Sprintf("const $fidl.%sType(nullable: %s)",
+ r.typeExpr = fmt.Sprintf("$fidl.%sType(nullable: %s)",
r.Decl, formatBool(val.Nullable))
case types.RequestType:
compound := types.ParseCompoundIdentifier(val.RequestSubtype)
@@ -644,7 +644,7 @@
r.SyncDecl = fmt.Sprintf("$fidl.InterfaceRequest<$sync.%s>", t)
}
r.AsyncDecl = r.Decl
- r.typeExpr = fmt.Sprintf("const $fidl.InterfaceRequestType<%s>(nullable: %s)",
+ r.typeExpr = fmt.Sprintf("$fidl.InterfaceRequestType<%s>(nullable: %s)",
t, formatBool(val.Nullable))
case types.PrimitiveType:
r.Decl = c.compilePrimitiveSubtype(val.PrimitiveSubtype)
@@ -682,7 +682,7 @@
r.AsyncDecl = r.SyncDecl
if val.Nullable {
if r.declType != types.XUnionDeclType {
- r.typeExpr = fmt.Sprintf("const $fidl.PointerType<%s>(element: %s)",
+ r.typeExpr = fmt.Sprintf("$fidl.PointerType<%s>(element: %s)",
t, c.typeSymbolForCompoundIdentifier(types.ParseCompoundIdentifier(val.Identifier)))
} else {
r.typeExpr = c.optTypeSymbolForCompoundIdentifier(types.ParseCompoundIdentifier(val.Identifier))
@@ -699,7 +699,7 @@
r.SyncDecl = fmt.Sprintf("$fidl.InterfaceHandle<$sync.%s>", t)
}
r.AsyncDecl = r.Decl
- r.typeExpr = fmt.Sprintf("const $fidl.InterfaceHandleType<%s>(nullable: %s)",
+ r.typeExpr = fmt.Sprintf("$fidl.InterfaceHandleType<%s>(nullable: %s)",
t, formatBool(val.Nullable))
default:
log.Fatal("Unknown declaration type: ", r.declType)
@@ -736,7 +736,7 @@
n,
[]EnumMember{},
c.typeSymbolForCompoundIdentifier(ci),
- fmt.Sprintf("const $fidl.EnumType<%s>(type: %s, ctor: %s._ctor)", n, typeExprForPrimitiveSubtype(val.Type), n),
+ fmt.Sprintf("$fidl.EnumType<%s>(type: %s, ctor: %s._ctor)", n, typeExprForPrimitiveSubtype(val.Type), n),
docString(val),
}
for _, v := range val.Members {
@@ -767,7 +767,7 @@
Name: name,
Offset: offset,
Convert: convert,
- typeExpr: fmt.Sprintf("const $fidl.MemberType<%s>(%s, %s)", t.Decl, typeStr, offsetStr),
+ typeExpr: fmt.Sprintf("$fidl.MemberType<%s>(%s, %s)", t.Decl, typeStr, offsetStr),
}
}
@@ -936,7 +936,7 @@
c.compileLowerCamelIdentifier(val.Name),
defaultValue,
val.Offset,
- fmt.Sprintf("const $fidl.MemberType<%s>(%s, %s)", t.Decl, typeStr, offsetStr),
+ fmt.Sprintf("$fidl.MemberType<%s>(%s, %s)", t.Decl, typeStr, offsetStr),
docString(val),
}
}
@@ -970,7 +970,7 @@
r.HasNullableField = hasNullableField
- r.TypeExpr = fmt.Sprintf(`const $fidl.StructType<%s>(
+ r.TypeExpr = fmt.Sprintf(`$fidl.StructType<%s>(
encodedSize: %v,
members: %s,
ctor: %s._ctor,
@@ -1009,7 +1009,7 @@
}
}
- r.TypeExpr = fmt.Sprintf(`const $fidl.TableType<%s>(
+ r.TypeExpr = fmt.Sprintf(`$fidl.TableType<%s>(
encodedSize: %v,
members: %s,
ctor: %s._ctor,
@@ -1026,7 +1026,7 @@
c.compileLowerCamelIdentifier(val.Name),
c.compileUpperCamelIdentifier(val.Name),
val.Offset,
- fmt.Sprintf("const $fidl.MemberType<%s>(%s, %s)", t.Decl, typeStr, offsetStr),
+ fmt.Sprintf("$fidl.MemberType<%s>(%s, %s)", t.Decl, typeStr, offsetStr),
docString(val),
}
}
@@ -1046,7 +1046,7 @@
r.Members = append(r.Members, c.compileUnionMember(v))
}
- r.TypeExpr = fmt.Sprintf(`const $fidl.UnionType<%s>(
+ r.TypeExpr = fmt.Sprintf(`$fidl.UnionType<%s>(
encodedSize: %v,
members: %s,
ctor: %s._ctor,
@@ -1077,12 +1077,12 @@
Members: members,
Documented: docString(val),
}
- r.TypeExpr = fmt.Sprintf(`const $fidl.XUnionType<%s>(
+ r.TypeExpr = fmt.Sprintf(`$fidl.XUnionType<%s>(
encodedSize: %v,
members: %s,
ctor: %s._ctor,
)`, r.Name, val.Size, formatXUnionMemberList(r.Members), r.Name)
- r.OptTypeExpr = fmt.Sprintf(`const $fidl.XUnionType<%s>(
+ r.OptTypeExpr = fmt.Sprintf(`$fidl.XUnionType<%s>(
encodedSize: %v,
members: %s,
ctor: %s._ctor,
diff --git a/bin/fidlgen_dart/backend/templates/enum.tmpl.go b/bin/fidlgen_dart/backend/templates/enum.tmpl.go
index dfe7c50..68cdc12 100644
--- a/bin/fidlgen_dart/backend/templates/enum.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/enum.tmpl.go
@@ -26,7 +26,7 @@
{{- range .Doc }}
///{{ . -}}
{{- end }}
- static const {{ $.Name }} {{ .Name }} = const {{ $.Name }}._({{ .Value }});
+ static const {{ $.Name }} {{ .Name }} = {{ $.Name }}._({{ .Value }});
{{- end }}
const {{ .Name }}._(this.value);
@@ -34,13 +34,13 @@
@override
final int value;
- static const Map<String, {{ .Name }}> valuesMap = const {
+ static const Map<String, {{ .Name }}> valuesMap = {
{{- range .Members }}
r'{{ .Name }}': {{ .Name }},
{{- end }}
};
- static const List<{{ .Name }}> values = const [
+ static const List<{{ .Name }}> values = [
{{- range .Members }}
{{ .Name }},
{{- end }}
@@ -60,7 +60,7 @@
}
}
- static {{ .Name }} _ctor(int v) => new {{ .Name }}(v);
+ static {{ .Name }} _ctor(int v) => {{ .Name }}(v);
}
const $fidl.EnumType<{{ .Name }}> {{ .TypeSymbol }} = {{ .TypeExpr }};
diff --git a/bin/fidlgen_dart/backend/templates/interface.tmpl.go b/bin/fidlgen_dart/backend/templates/interface.tmpl.go
index 082a44b..4ad038f 100644
--- a/bin/fidlgen_dart/backend/templates/interface.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/interface.tmpl.go
@@ -52,12 +52,12 @@
class {{ .ProxyName }} extends $fidl.Proxy<{{ .Name }}>
implements {{ .Name }} {
- {{ .ProxyName }}() : super(new $fidl.ProxyController<{{ .Name }}>($serviceName: {{ .ServiceName }}, $interfaceName: r'{{ .Name }}')) {
+ {{ .ProxyName }}() : super($fidl.ProxyController<{{ .Name }}>($serviceName: {{ .ServiceName }}, $interfaceName: r'{{ .Name }}')) {
ctrl.onResponse = _handleResponse;
}
void _handleEvent($fidl.Message $message) {
- final $fidl.Decoder $decoder = new $fidl.Decoder($message);
+ final $fidl.Decoder $decoder = $fidl.Decoder($message);
switch ($message.ordinal) {
{{- range .Methods }}
{{- if not .HasRequest }}
@@ -108,7 +108,7 @@
$message.closeHandles();
return;
}
- final $fidl.Decoder $decoder = new $fidl.Decoder($message);
+ final $fidl.Decoder $decoder = $fidl.Decoder($message);
switch ($message.ordinal) {
{{- range .Methods }}
{{- if .HasRequest }}
@@ -152,7 +152,7 @@
return;
}
- final $fidl.Encoder $encoder = new $fidl.Encoder();
+ final $fidl.Encoder $encoder = $fidl.Encoder();
$encoder.encodeMessageHeader({{ .OrdinalName }}, 0);
{{- if .Request }}
$encoder.alloc({{ .RequestSize }} - $fidl.kMessageHeaderSize);
@@ -202,7 +202,7 @@
{{- if not .HasRequest }}
{{- if .HasResponse }}
void {{ template "ResponseMethodSignature" . }} {
- final $fidl.Encoder $encoder = new $fidl.Encoder();
+ final $fidl.Encoder $encoder = $fidl.Encoder();
$encoder.encodeMessageHeader({{ .OrdinalName }}, 0);
{{- if .Response.WireParameters }}
$encoder.alloc({{ .ResponseSize }} - $fidl.kMessageHeaderSize);
@@ -226,7 +226,7 @@
events._binding = this;
}
- final {{ .EventsName }} events = new {{ .EventsName }}();
+ final {{ .EventsName }} events = {{ .EventsName }}();
{{- end }}
{{ range .Methods }}
@@ -234,7 +234,7 @@
{{- if .HasResponse }}
Function _{{ .Name }}Responder($fidl.MessageSink $respond, int $txid) {
return ({{ template "Params" .Response.WireParameters }}) {
- final $fidl.Encoder $encoder = new $fidl.Encoder();
+ final $fidl.Encoder $encoder = $fidl.Encoder();
$encoder.encodeMessageHeader({{ .OrdinalName }}, $txid);
{{- if .Response.WireParameters }}
$encoder.alloc({{ .ResponseSize }} - $fidl.kMessageHeaderSize);
@@ -252,7 +252,7 @@
@override
void handleMessage($fidl.Message $message, $fidl.MessageSink $respond) {
- final $fidl.Decoder $decoder = new $fidl.Decoder($message);
+ final $fidl.Decoder $decoder = $fidl.Decoder($message);
switch ($message.ordinal) {
{{- range .Methods }}
{{- if .HasRequest }}
@@ -282,7 +282,7 @@
{{- end }}
{{- end }}
default:
- throw new $fidl.FidlError('Unexpected message name for {{ .BindingName }}');
+ throw $fidl.FidlError('Unexpected message name for {{ .BindingName }}');
}
}
}
@@ -343,7 +343,7 @@
$types[0].decode($decoder, 0)
{{- else }}
{{- if .AsyncResponseClass -}}
- new {{ .AsyncResponseClass }}(
+ {{ .AsyncResponseClass }}(
{{- range $index, $response := .Response.WireParameters }}
$types[{{ $index }}].decode($decoder, 0),
{{- end -}}
@@ -411,7 +411,7 @@
abstract class {{ .Name }} extends $fidl.Service {
static const String $serviceName = {{ .ServiceName }};
@override
- $fidl.ServiceData get $serviceData => const {{ .ServiceData }}();
+ $fidl.ServiceData get $serviceData => {{ .ServiceData }}();
{{- range .Methods }}
{{- if .HasRequest }}
@@ -458,7 +458,7 @@
{{- end }}
class {{ .ProxyName }} extends $fidl.AsyncProxy<{{ .Name }}>
implements {{ .Name }} {
- {{ .ProxyName }}() : super(new $fidl.AsyncProxyController<{{ .Name }}>($serviceName: {{ .ServiceName }}, $interfaceName: r'{{ .Name }}')) {
+ {{ .ProxyName }}() : super($fidl.AsyncProxyController<{{ .Name }}>($serviceName: {{ .ServiceName }}, $interfaceName: r'{{ .Name }}')) {
ctrl.onResponse = _handleResponse;
{{- if .HasEvents }}
@@ -479,7 +479,7 @@
$fidl.ServiceData get $serviceData => {{ .ServiceData }}();
void _handleEvent($fidl.Message $message) {
- final $fidl.Decoder $decoder = new $fidl.Decoder($message);
+ final $fidl.Decoder $decoder = $fidl.Decoder($message);
switch ($message.ordinal) {
{{- range .Methods }}
{{- if not .HasRequest }}
@@ -495,7 +495,7 @@
);
// ignore: avoid_catches_without_on_clauses
} catch(_e) {
- ctrl.proxyError(new $fidl.FidlError('Exception handling event $_name: $_e'));
+ ctrl.proxyError($fidl.FidlError('Exception handling event $_name: $_e'));
ctrl.close();
rethrow;
} finally {
@@ -506,7 +506,7 @@
{{- end }}
{{- end }}
default:
- ctrl.proxyError(new $fidl.FidlError('Unexpected message ordinal: ${$message.ordinal}'));
+ ctrl.proxyError($fidl.FidlError('Unexpected message ordinal: ${$message.ordinal}'));
ctrl.close();
break;
}
@@ -523,7 +523,7 @@
$message.closeHandles();
return;
}
- final $fidl.Decoder $decoder = new $fidl.Decoder($message);
+ final $fidl.Decoder $decoder = $fidl.Decoder($message);
switch ($message.ordinal) {
{{- range .Methods }}
{{- if .HasRequest }}
@@ -560,7 +560,7 @@
{{ end }}
// ignore: avoid_catches_without_on_clauses
} catch(_e) {
- ctrl.proxyError(new $fidl.FidlError('Exception handling method response $_name: $_e'));
+ ctrl.proxyError($fidl.FidlError('Exception handling method response $_name: $_e'));
ctrl.close();
rethrow;
} finally {
@@ -571,7 +571,7 @@
{{- end }}
{{- end }}
default:
- ctrl.proxyError(new $fidl.FidlError('Unexpected message ordinal: ${$message.ordinal}'));
+ ctrl.proxyError($fidl.FidlError('Unexpected message ordinal: ${$message.ordinal}'));
ctrl.close();
break;
}
@@ -585,10 +585,10 @@
@override
{{ template "AsyncReturn" . }} {{ .Name }}({{ template "AsyncParams" .Request }}) async {
if (!ctrl.isBound) {
- return new Future.error(new $fidl.FidlStateException('Proxy<${ctrl.$interfaceName}> is closed.'), StackTrace.current);
+ return Future.error($fidl.FidlStateException('Proxy<${ctrl.$interfaceName}> is closed.'), StackTrace.current);
}
- final $fidl.Encoder $encoder = new $fidl.Encoder();
+ final $fidl.Encoder $encoder = $fidl.Encoder();
$encoder.encodeMessageHeader({{ .OrdinalName }}, 0);
{{- if .Request }}
$encoder.alloc({{ .RequestSize }} - $fidl.kMessageHeaderSize);
@@ -599,17 +599,17 @@
{{- end }}
{{- if .HasResponse }}
- final $completer = new Completer<{{ .AsyncResponseType }}>();
+ final $completer = Completer<{{ .AsyncResponseType }}>();
ctrl.sendMessageWithResponse($encoder.message, $completer);
return $completer.future;
{{- else }}
- return new Future.sync(() {
+ return Future.sync(() {
ctrl.sendMessage($encoder.message);
});
{{- end }}
}
{{ else }}
- final _{{ .Name }}EventStreamController = new StreamController<{{ .AsyncResponseType }}>.broadcast();
+ final _{{ .Name }}EventStreamController = StreamController<{{ .AsyncResponseType }}>.broadcast();
{{- range .Doc }}
///{{ . -}}
{{- end }}
@@ -634,7 +634,7 @@
{{- if not .HasRequest }}
if (impl.{{ .Name }} != null) {
$subscriptions.add(impl.{{ .Name }}.listen(($response) {
- final $fidl.Encoder $encoder = new $fidl.Encoder();
+ final $fidl.Encoder $encoder = $fidl.Encoder();
$encoder.encodeMessageHeader({{ .OrdinalName }}, 0);
$encoder.alloc({{ .ResponseSize }} - $fidl.kMessageHeaderSize);
final List<$fidl.MemberType> $types = {{ .TypeSymbol }}.response;
@@ -653,7 +653,7 @@
@override
void handleMessage($fidl.Message $message, $fidl.MessageSink $respond) {
- final $fidl.Decoder $decoder = new $fidl.Decoder($message);
+ final $fidl.Decoder $decoder = $fidl.Decoder($message);
switch ($message.ordinal) {
{{- range .Methods }}
{{- if .HasRequest }}
@@ -696,7 +696,7 @@
})
{{ end }}
.then(($response) {
- final $fidl.Encoder $encoder = new $fidl.Encoder();
+ final $fidl.Encoder $encoder = $fidl.Encoder();
$encoder.encodeMessageHeader({{ .OrdinalName }}, $message.txid);
{{- if .Response.WireParameters }}
$encoder.alloc({{ .ResponseSize }} - $fidl.kMessageHeaderSize);
@@ -721,7 +721,7 @@
{{- end }}
{{- end }}
default:
- throw new $fidl.FidlError('Unexpected message name for {{ .BindingName }}');
+ throw $fidl.FidlError('Unexpected message name for {{ .BindingName }}');
}
}
}
diff --git a/bin/fidlgen_dart/backend/templates/struct.tmpl.go b/bin/fidlgen_dart/backend/templates/struct.tmpl.go
index 69eb657..3a33757 100644
--- a/bin/fidlgen_dart/backend/templates/struct.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/struct.tmpl.go
@@ -78,7 +78,7 @@
)';
}
- static {{ .Name }} _ctor(List<Object> argv) => new {{ .Name }}._(argv);
+ static {{ .Name }} _ctor(List<Object> argv) => {{ .Name }}._(argv);
}
// See FIDL-308:
diff --git a/bin/fidlgen_dart/backend/templates/table.tmpl.go b/bin/fidlgen_dart/backend/templates/table.tmpl.go
index 1a01f37..6785bb2 100644
--- a/bin/fidlgen_dart/backend/templates/table.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/table.tmpl.go
@@ -41,7 +41,7 @@
};
}
- static {{ .Name }} _ctor(Map<int, dynamic> argv) => new {{ .Name }}._(argv);
+ static {{ .Name }} _ctor(Map<int, dynamic> argv) => {{ .Name }}._(argv);
}
// See FIDL-308:
diff --git a/bin/fidlgen_dart/backend/templates/union.tmpl.go b/bin/fidlgen_dart/backend/templates/union.tmpl.go
index 9f00b2a..4fe3146 100644
--- a/bin/fidlgen_dart/backend/templates/union.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/union.tmpl.go
@@ -59,7 +59,7 @@
Object get $data => _data;
static {{ .Name }} _ctor(int index, Object data) {
- return new {{ .Name }}._({{ .TagName }}.values[index], data);
+ return {{ .Name }}._({{ .TagName }}.values[index], data);
}
}
diff --git a/bin/fidlgen_dart/backend/templates/xunion.tmpl.go b/bin/fidlgen_dart/backend/templates/xunion.tmpl.go
index 162f56d..c9855ab 100644
--- a/bin/fidlgen_dart/backend/templates/xunion.tmpl.go
+++ b/bin/fidlgen_dart/backend/templates/xunion.tmpl.go
@@ -13,7 +13,7 @@
{{- end }}
}
-const Map<int, {{ .TagName }}> _{{ .TagName }}_map = const {
+const Map<int, {{ .TagName }}> _{{ .TagName }}_map = {
{{- range .Members }}
{{ .Ordinal }}: {{ $.TagName }}.{{ .Name }},
{{- end }}
@@ -65,7 +65,7 @@
Object get $data => _data;
static {{ .Name }} _ctor(int ordinal, Object data) {
- return new {{ .Name }}._(ordinal, data);
+ return {{ .Name }}._(ordinal, data);
}
}
diff --git a/bin/flutter_screencap_test/lib/main.dart b/bin/flutter_screencap_test/lib/main.dart
index 5e67627..f14541f 100644
--- a/bin/flutter_screencap_test/lib/main.dart
+++ b/bin/flutter_screencap_test/lib/main.dart
@@ -5,8 +5,8 @@
import 'package:flutter/material.dart';
import 'package:lib.app.dart/logging.dart';
-const Color _lightColor = const Color(0xFF4dac26);
-const Color _darkColor = const Color(0xFFd01c8b);
+const Color _lightColor = Color(0xFF4dac26);
+const Color _darkColor = Color(0xFFd01c8b);
const int _gridSize = 6;
/// Display a checker board pattern in red and green to verify that the
@@ -15,23 +15,23 @@
@override
Widget build(BuildContext context) {
Size size = MediaQuery.of(context).size;
- Size oneSize = new Size(size.width / _gridSize, size.height / _gridSize);
+ Size oneSize = Size(size.width / _gridSize, size.height / _gridSize);
List<Widget> rows = <Widget>[];
for (int i = 0; i < _gridSize; i++) {
List<Widget> boxes = <Widget>[];
for (int j = 0; j < _gridSize; j++) {
- boxes.add(new Container(
+ boxes.add(Container(
width: oneSize.width,
height: oneSize.height,
color: (i % 2) == (j % 2) ? _darkColor : _lightColor,
));
}
- rows.add(new Row(
+ rows.add(Row(
children: boxes,
mainAxisSize: MainAxisSize.max,
));
}
- return new Column(
+ return Column(
mainAxisSize: MainAxisSize.max,
children: rows,
);
@@ -44,7 +44,7 @@
logToStdoutForTest: true,
);
log.info('starting flutter_screencap_test_app');
- runApp(new MaterialApp(
- home: new CheckerBoard(),
+ runApp(MaterialApp(
+ home: CheckerBoard(),
));
}
diff --git a/bin/simple_browser/lib/src/widgets/navigation_bar.dart b/bin/simple_browser/lib/src/widgets/navigation_bar.dart
index 78daa70..cbbe87a 100644
--- a/bin/simple_browser/lib/src/widgets/navigation_bar.dart
+++ b/bin/simple_browser/lib/src/widgets/navigation_bar.dart
@@ -24,7 +24,7 @@
initialData: false,
builder: (context, snapshot) => RaisedButton(
padding: EdgeInsets.all(4),
- child: const Text('BCK'),
+ child: Text('BCK'),
color: Colors.grey[350],
disabledColor: Colors.grey[700],
onPressed: snapshot.data
@@ -40,7 +40,7 @@
initialData: false,
builder: (context, snapshot) => RaisedButton(
padding: EdgeInsets.all(4),
- child: const Text('FWD'),
+ child: Text('FWD'),
color: Colors.grey[350],
disabledColor: Colors.grey[700],
onPressed: snapshot.data
diff --git a/bin/system_dashboard/lib/src/dashboard.dart b/bin/system_dashboard/lib/src/dashboard.dart
index e31a76d..75bce31 100644
--- a/bin/system_dashboard/lib/src/dashboard.dart
+++ b/bin/system_dashboard/lib/src/dashboard.dart
@@ -47,7 +47,7 @@
Widget _utilization(SystemInfoModel model) {
return Padding(
- padding: const EdgeInsets.all(1.0),
+ padding: EdgeInsets.all(1.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -64,7 +64,7 @@
child: LinearProgressIndicator(
value: model.cpuUtilization / 100,
backgroundColor: Colors.greenAccent,
- valueColor: new AlwaysStoppedAnimation<Color>(Colors.red),
+ valueColor: AlwaysStoppedAnimation<Color>(Colors.red),
),
),
),
@@ -76,7 +76,7 @@
child: LinearProgressIndicator(
value: model.memoryUtilization / 100,
backgroundColor: Colors.greenAccent,
- valueColor: new AlwaysStoppedAnimation<Color>(Colors.red),
+ valueColor: AlwaysStoppedAnimation<Color>(Colors.red),
),
),
),
@@ -104,7 +104,7 @@
Widget _fanSpeedAndTemperature(SystemInfoModel model) {
return Padding(
- padding: const EdgeInsets.all(1.0),
+ padding: EdgeInsets.all(1.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -117,7 +117,7 @@
color: Colors.lightBlue,
shape: CircleBorder(),
child: Padding(
- padding: const EdgeInsets.all(10.0),
+ padding: EdgeInsets.all(10.0),
child: Icon(Icons.settings_applications,
color: Colors.white, size: 30.0),
)),
@@ -125,7 +125,7 @@
color: Colors.green[400],
shape: CircleBorder(),
child: Padding(
- padding: const EdgeInsets.all(10.0),
+ padding: EdgeInsets.all(10.0),
child: Icon(Icons.ac_unit, color: Colors.white, size: 30.0),
)),
],
@@ -152,7 +152,7 @@
Widget _bigCluster(SystemInfoModel model) {
return Padding(
- padding: const EdgeInsets.all(5.0),
+ padding: EdgeInsets.all(5.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -168,7 +168,7 @@
color: Colors.indigo[500],
shape: CircleBorder(),
child: Padding(
- padding: const EdgeInsets.all(16.0),
+ padding: EdgeInsets.all(16.0),
child: Icon(Icons.broken_image,
color: Colors.white, size: 30.0),
)),
@@ -176,7 +176,7 @@
color: Colors.amber,
shape: CircleBorder(),
child: Padding(
- padding: const EdgeInsets.all(16.0),
+ padding: EdgeInsets.all(16.0),
child:
Icon(Icons.flash_on, color: Colors.white, size: 30.0),
)),
@@ -204,7 +204,7 @@
Widget _littleCluster(SystemInfoModel model) {
return Padding(
- padding: const EdgeInsets.all(5.0),
+ padding: EdgeInsets.all(5.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -220,7 +220,7 @@
color: Colors.indigo[500],
shape: CircleBorder(),
child: Padding(
- padding: const EdgeInsets.all(16.0),
+ padding: EdgeInsets.all(16.0),
child: Icon(Icons.broken_image,
color: Colors.white, size: 30.0),
)),
@@ -228,7 +228,7 @@
color: Colors.amber,
shape: CircleBorder(),
child: Padding(
- padding: const EdgeInsets.all(16.0),
+ padding: EdgeInsets.all(16.0),
child:
Icon(Icons.flash_on, color: Colors.white, size: 30.0),
)),
diff --git a/bin/system_dashboard/lib/src/system_info_model.dart b/bin/system_dashboard/lib/src/system_info_model.dart
index 6c8f595..bc724f2 100644
--- a/bin/system_dashboard/lib/src/system_info_model.dart
+++ b/bin/system_dashboard/lib/src/system_info_model.dart
@@ -23,7 +23,7 @@
List<scpi.DvfsOpp> _bigClusterOpps;
List<scpi.DvfsOpp> _smallClusterOpps;
- static const Duration _systemInformationUpdatePeriod = const Duration(seconds: 4);
+ static const Duration _systemInformationUpdatePeriod = Duration(seconds: 4);
final scpi.SystemControllerProxy _systemControllerProxy = scpi.SystemControllerProxy();
diff --git a/bin/ui/benchmarks/image_grid_flutter/lib/image_grid.dart b/bin/ui/benchmarks/image_grid_flutter/lib/image_grid.dart
index 7617855..c2bdbce 100644
--- a/bin/ui/benchmarks/image_grid_flutter/lib/image_grid.dart
+++ b/bin/ui/benchmarks/image_grid_flutter/lib/image_grid.dart
@@ -9,10 +9,10 @@
import 'package:flutter/rendering.dart';
import 'package:meta/meta.dart';
-const EdgeInsets _kPadding = const EdgeInsets.only(top: 32.0, bottom: 12.0);
+const EdgeInsets _kPadding = EdgeInsets.only(top: 32.0, bottom: 12.0);
const ListEquality<RawImage> _kImageListEquality =
- const ListEquality<RawImage>();
+ ListEquality<RawImage>();
// Shows a grid of horizontally scrolling images. Their scroll behavior is
// driven automatically using a ScrollController (see ImageGridModel).
@@ -34,34 +34,34 @@
@override
Widget build(BuildContext context) {
- return new DefaultTextStyle(
- style: const TextStyle(
+ return DefaultTextStyle(
+ style: TextStyle(
color: Colors.black,
fontSize: 8.0,
height: 1.2,
),
- child: new Container(
+ child: Container(
padding: _kPadding,
- child: new Column(
+ child: Column(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
- new Text('Image Grid Test (Flutter)'),
- new Container(
+ Text('Image Grid Test (Flutter)'),
+ Container(
height: 8.0,
),
- new Expanded(
- child: new CustomScrollView(
+ Expanded(
+ child: CustomScrollView(
scrollDirection: Axis.horizontal,
controller: scrollController,
slivers: <Widget>[
- new SliverPadding(
- padding: const EdgeInsets.only(left: 32.0),
- sliver: new SliverGrid(
- gridDelegate: new _ImageGridDelegate(
+ SliverPadding(
+ padding: EdgeInsets.only(left: 32.0),
+ sliver: SliverGrid(
+ gridDelegate: _ImageGridDelegate(
images: images,
rowCount: 3,
),
- delegate: new SliverChildBuilderDelegate(
+ delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) =>
_buildItem(images[index]),
childCount: images.length),
@@ -77,18 +77,18 @@
}
Widget _buildItem(RawImage image) {
- return new Container(
- padding: const EdgeInsets.only(
+ return Container(
+ padding: EdgeInsets.only(
right: 16.0,
bottom: 16.0,
),
- child: new PhysicalModel(
+ child: PhysicalModel(
color: Colors.grey[200],
- borderRadius: new BorderRadius.circular(4.0),
+ borderRadius: BorderRadius.circular(4.0),
elevation: 2.0,
child: drawImages
? image
- : new Container(
+ : Container(
width: 500.0,
height: 500.0,
),
@@ -112,7 +112,7 @@
SliverGridLayout getLayout(SliverConstraints constraints) {
if (_newConstraints(constraints)) {
_lastConstraints = constraints;
- _lastLayout = new _ImageGridLayout(
+ _lastLayout = _ImageGridLayout(
sliverGridGeometryList: _getSliverGeometryList(
constraints.crossAxisExtent,
),
@@ -173,7 +173,7 @@
double crossAxisOffset = rowHeight * rowIndex;
double mainAxisExtent = _getScaledImageWidth(image, rowHeight);
double crossAxisExtent = rowHeight;
- SliverGridGeometry gridGeometry = new SliverGridGeometry(
+ SliverGridGeometry gridGeometry = SliverGridGeometry(
scrollOffset: scrollOffset,
crossAxisOffset: crossAxisOffset,
mainAxisExtent: mainAxisExtent,
diff --git a/bin/ui/benchmarks/image_grid_flutter/lib/image_grid_model.dart b/bin/ui/benchmarks/image_grid_flutter/lib/image_grid_model.dart
index 1d4d1d9..ef77978 100644
--- a/bin/ui/benchmarks/image_grid_flutter/lib/image_grid_model.dart
+++ b/bin/ui/benchmarks/image_grid_flutter/lib/image_grid_model.dart
@@ -13,7 +13,7 @@
import 'package:lib.widgets/widgets.dart';
const RK4SpringDescription _kSimulationDesc =
- const RK4SpringDescription(tension: 10.0, friction: 50.0);
+ RK4SpringDescription(tension: 10.0, friction: 50.0);
const double _kMinScrollOffset = 0.0;
const double _kMaxScrollOffset = 4000.0;
const int _kNumImages = 100;
@@ -21,7 +21,7 @@
/// [Model] that manages the state of the Image Grid Module
class ImageGridModel extends Model {
final _TracedSpringModel _scrollModel =
- new _TracedSpringModel(springDescription: _kSimulationDesc);
+ _TracedSpringModel(springDescription: _kSimulationDesc);
ImageGridModel() {
scheduleMicrotask(() {
@@ -30,7 +30,7 @@
_scrollModel.jump(0.0);
// Set up auto-scroller behavior.
- _scrollController = new ScrollController();
+ _scrollController = ScrollController();
_scrollModel
..addListener(() {
if (!_scrollController.hasClients) {
@@ -53,21 +53,21 @@
Future<List<RawImage>> generateImages() async {
List<RawImage> images = [];
for (int i = 0; i < _kNumImages; i++) {
- var recorder = new ui.PictureRecorder();
- var canvas = new Canvas(recorder);
- var color = const Color(0xFF673AB7); // Deep Purple 500
+ var recorder = ui.PictureRecorder();
+ var canvas = Canvas(recorder);
+ var color = Color(0xFF673AB7); // Deep Purple 500
canvas.drawColor(color, BlendMode.srcOver);
- final paint = new Paint()
- ..color = const Color(0xFFF50057) // Pink A400
+ final paint = Paint()
+ ..color = Color(0xFFF50057) // Pink A400
..style = PaintingStyle.fill;
- canvas.drawCircle(new Offset(250.0, 250.0), 200.0, paint);
+ canvas.drawCircle(Offset(250.0, 250.0), 200.0, paint);
var image = await recorder.endRecording().toImage(500, 500);
images.add(
- new RawImage(image: image, width: 500.0, height: 500.0, scale: 1.0));
+ RawImage(image: image, width: 500.0, height: 500.0, scale: 1.0));
}
return images;
}
@@ -83,7 +83,7 @@
class _TracedSpringModel extends SpringModel {
final FrameRateTracer _frameRateTracer =
- new FrameRateTracer(name: 'auto scroll');
+ FrameRateTracer(name: 'auto scroll');
_TracedSpringModel({RK4SpringDescription springDescription})
: super(springDescription: springDescription);
diff --git a/bin/ui/benchmarks/image_grid_flutter/lib/main.dart b/bin/ui/benchmarks/image_grid_flutter/lib/main.dart
index 924eeab..d1b2bdb 100644
--- a/bin/ui/benchmarks/image_grid_flutter/lib/main.dart
+++ b/bin/ui/benchmarks/image_grid_flutter/lib/main.dart
@@ -12,29 +12,29 @@
void main() {
setupLogger(name: 'Image Grid ');
- ImageGridModel imageGridModel = new ImageGridModel();
+ ImageGridModel imageGridModel = ImageGridModel();
runApp(
- new MaterialApp(
- home: new ScopedModel<ImageGridModel>(
+ MaterialApp(
+ home: ScopedModel<ImageGridModel>(
model: imageGridModel,
- child: new ScopedModelDescendant<ImageGridModel>(
+ child: ScopedModelDescendant<ImageGridModel>(
builder: (BuildContext context, Widget child, ImageGridModel model) {
- return new ScopedModelDescendant<ImageGridModel>(
+ return ScopedModelDescendant<ImageGridModel>(
builder: (
BuildContext context,
Widget child,
ImageGridModel model,
) {
- return new Scaffold(
+ return Scaffold(
backgroundColor: Colors.white,
body: model.images != null
- ? new ImageGrid(
+ ? ImageGrid(
images: model.images,
drawImages: false,
scrollController: model.scrollController,
)
- : new Container(),
+ : Container(),
);
},
);
diff --git a/bin/userpicker_base_shell/lib/authentication_overlay.dart b/bin/userpicker_base_shell/lib/authentication_overlay.dart
index df554e9..ae4c170 100644
--- a/bin/userpicker_base_shell/lib/authentication_overlay.dart
+++ b/bin/userpicker_base_shell/lib/authentication_overlay.dart
@@ -25,31 +25,31 @@
@override
Widget build(BuildContext context) =>
- new ScopedModelDescendant<AuthenticationOverlayModel>(
+ ScopedModelDescendant<AuthenticationOverlayModel>(
builder: (
BuildContext context,
Widget child,
AuthenticationOverlayModel model,
) =>
- new AnimatedBuilder(
+ AnimatedBuilder(
animation: model.animation,
- builder: (BuildContext context, Widget child) => new Offstage(
+ builder: (BuildContext context, Widget child) => Offstage(
offstage: model.animation.isDismissed,
- child: new Opacity(
+ child: Opacity(
opacity: model.animation.value,
child: child,
),
),
- child: new Stack(
+ child: Stack(
fit: StackFit.passthrough,
children: <Widget>[
- new GestureDetector(
+ GestureDetector(
onTap: _onCancel,
),
- new FractionallySizedBox(
+ FractionallySizedBox(
widthFactor: 0.75,
heightFactor: 0.75,
- child: new ChildView(
+ child: ChildView(
connection: model.childViewConnection,
),
),
diff --git a/bin/userpicker_base_shell/lib/authentication_overlay_model.dart b/bin/userpicker_base_shell/lib/authentication_overlay_model.dart
index fe633c1..8ad3329 100644
--- a/bin/userpicker_base_shell/lib/authentication_overlay_model.dart
+++ b/bin/userpicker_base_shell/lib/authentication_overlay_model.dart
@@ -18,12 +18,12 @@
/// Constructor.
AuthenticationOverlayModel() {
- _transitionAnimation = new AnimationController(
+ _transitionAnimation = AnimationController(
value: 0.0,
- duration: const Duration(seconds: 1),
+ duration: Duration(seconds: 1),
vsync: this,
);
- _curvedTransitionAnimation = new CurvedAnimation(
+ _curvedTransitionAnimation = CurvedAnimation(
parent: _transitionAnimation,
curve: Curves.fastOutSlowIn,
reverseCurve: Curves.fastOutSlowIn,
@@ -73,5 +73,5 @@
}
@override
- Ticker createTicker(TickerCallback onTick) => new Ticker(onTick);
+ Ticker createTicker(TickerCallback onTick) => Ticker(onTick);
}
diff --git a/bin/userpicker_base_shell/lib/authentication_ui_context_impl.dart b/bin/userpicker_base_shell/lib/authentication_ui_context_impl.dart
index 9543fc5..15961d4 100644
--- a/bin/userpicker_base_shell/lib/authentication_ui_context_impl.dart
+++ b/bin/userpicker_base_shell/lib/authentication_ui_context_impl.dart
@@ -29,7 +29,7 @@
@override
Future<void> startOverlay(InterfaceHandle<ViewOwner> viewOwner) =>
- startOverlay2(new EventPair(viewOwner?.passChannel()?.passHandle()));
+ startOverlay2(EventPair(viewOwner?.passChannel()?.passHandle()));
@override
// ignore: override_on_non_overriding_method
diff --git a/bin/userpicker_base_shell/lib/circular_button.dart b/bin/userpicker_base_shell/lib/circular_button.dart
index 6beafab..9ff5eae 100644
--- a/bin/userpicker_base_shell/lib/circular_button.dart
+++ b/bin/userpicker_base_shell/lib/circular_button.dart
@@ -18,15 +18,15 @@
: assert(icon != null);
@override
- Widget build(BuildContext context) => new Material(
+ Widget build(BuildContext context) => Material(
type: MaterialType.circle,
elevation: 2.0,
color: Colors.grey[200],
- child: new InkWell(
+ child: InkWell(
onTap: () => onTap?.call(),
- child: new Container(
- padding: const EdgeInsets.all(12.0),
- child: new Icon(icon),
+ child: Container(
+ padding: EdgeInsets.all(12.0),
+ child: Icon(icon),
),
),
);
diff --git a/bin/userpicker_base_shell/lib/clock.dart b/bin/userpicker_base_shell/lib/clock.dart
index ed7e932..98c04d7 100644
--- a/bin/userpicker_base_shell/lib/clock.dart
+++ b/bin/userpicker_base_shell/lib/clock.dart
@@ -10,19 +10,19 @@
/// System Clock in the Base Shell
class Clock extends StatelessWidget {
- final TimeStringer _time = new TimeStringer();
+ final TimeStringer _time = TimeStringer();
@override
Widget build(BuildContext context) {
- return new LayoutBuilder(
+ return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
- return new AnimatedBuilder(
+ return AnimatedBuilder(
animation: _time,
builder: (BuildContext context, Widget child) {
- return new Container(
- child: new Text(
+ return Container(
+ child: Text(
_time.timeOnly,
- style: new TextStyle(
+ style: TextStyle(
color: Colors.white,
fontSize: min(
constraints.maxWidth / 6.0,
diff --git a/bin/userpicker_base_shell/lib/main.dart b/bin/userpicker_base_shell/lib/main.dart
index a9fd421..d39ed70 100644
--- a/bin/userpicker_base_shell/lib/main.dart
+++ b/bin/userpicker_base_shell/lib/main.dart
@@ -31,12 +31,12 @@
void main() {
setupLogger(name: 'userpicker_base_shell');
- StartupContext startupContext = new StartupContext.fromStartupInfo();
+ StartupContext startupContext = StartupContext.fromStartupInfo();
// Connect to Cobalt
- cobalt.LoggerProxy logger = new cobalt.LoggerProxy();
+ cobalt.LoggerProxy logger = cobalt.LoggerProxy();
- cobalt.LoggerFactoryProxy loggerFactory = new cobalt.LoggerFactoryProxy();
+ cobalt.LoggerFactoryProxy loggerFactory = cobalt.LoggerFactoryProxy();
StartupContext.fromStartupInfo().incoming.connectToService(loggerFactory);
SizedVmo configVmo = SizedVmo.fromFile(_kCobaltConfigBinProtoPath);
@@ -52,18 +52,18 @@
});
loggerFactory.ctrl.close();
- NetstackProxy netstackProxy = new NetstackProxy();
+ NetstackProxy netstackProxy = NetstackProxy();
StartupContext.fromStartupInfo().incoming.connectToService(netstackProxy);
- NetstackModel netstackModel = new NetstackModel(netstack: netstackProxy)
+ NetstackModel netstackModel = NetstackModel(netstack: netstackProxy)
..start();
- _OverlayModel wifiInfoOverlayModel = new _OverlayModel();
+ _OverlayModel wifiInfoOverlayModel = _OverlayModel();
final AuthenticationOverlayModel authModel = AuthenticationOverlayModel();
UserPickerBaseShellModel userPickerBaseShellModel =
- new UserPickerBaseShellModel(
+ UserPickerBaseShellModel(
onBaseShellStopped: () {
netstackProxy.ctrl.close();
netstackModel.dispose();
@@ -77,13 +77,13 @@
logger: logger,
);
- Widget mainWidget = new Stack(
+ Widget mainWidget = Stack(
fit: StackFit.passthrough,
children: <Widget>[
- new UserPickerBaseShellScreen(
+ UserPickerBaseShellScreen(
launcher: startupContext.launcher,
),
- new ScopedModel<AuthenticationOverlayModel>(
+ ScopedModel<AuthenticationOverlayModel>(
model: authModel,
child: AuthenticationOverlay(),
),
@@ -93,21 +93,21 @@
Widget app = mainWidget;
List<OverlayEntry> overlays = <OverlayEntry>[
- new OverlayEntry(
- builder: (BuildContext context) => new MediaQuery(
- data: const MediaQueryData(),
- child: new FocusScope(
- node: new FocusScopeNode(),
+ OverlayEntry(
+ builder: (BuildContext context) => MediaQuery(
+ data: MediaQueryData(),
+ child: FocusScope(
+ node: FocusScopeNode(),
autofocus: true,
child: app,
),
),
),
- new OverlayEntry(
- builder: (BuildContext context) => new ScopedModel<_OverlayModel>(
+ OverlayEntry(
+ builder: (BuildContext context) => ScopedModel<_OverlayModel>(
model: wifiInfoOverlayModel,
- child: new _WifiInfo(
- wifiWidget: new ApplicationWidget(
+ child: _WifiInfo(
+ wifiWidget: ApplicationWidget(
url:
'fuchsia-pkg://fuchsia.com/wifi_settings#meta/wifi_settings.cmx',
launcher: startupContext.launcher,
@@ -117,19 +117,19 @@
),
];
- _baseShellWidget = new BaseShellWidget<UserPickerBaseShellModel>(
+ _baseShellWidget = BaseShellWidget<UserPickerBaseShellModel>(
startupContext: startupContext,
baseShellModel: userPickerBaseShellModel,
- authenticationUiContext: new AuthenticationUiContextImpl(
+ authenticationUiContext: AuthenticationUiContextImpl(
onStartOverlay: authModel.onStartOverlay,
onStopOverlay: authModel.onStopOverlay),
- child: new LayoutBuilder(
+ child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) =>
(constraints.biggest == Size.zero)
? const Offstage()
- : new ScopedModel<NetstackModel>(
+ : ScopedModel<NetstackModel>(
model: netstackModel,
- child: new Overlay(initialEntries: overlays),
+ child: Overlay(initialEntries: overlays),
),
),
);
@@ -146,32 +146,32 @@
@override
Widget build(BuildContext context) =>
- new ScopedModelDescendant<_OverlayModel>(
+ ScopedModelDescendant<_OverlayModel>(
builder: (
BuildContext context,
Widget child,
_OverlayModel model,
) =>
- new Offstage(
+ Offstage(
offstage: !model.showing,
- child: new Stack(
+ child: Stack(
children: <Widget>[
- new Listener(
+ Listener(
behavior: HitTestBehavior.opaque,
onPointerDown: (PointerDownEvent event) {
model.showing = false;
},
),
- new Center(
- child: new FractionallySizedBox(
+ Center(
+ child: FractionallySizedBox(
widthFactor: 0.75,
heightFactor: 0.75,
- child: new Container(
- margin: const EdgeInsets.all(8.0),
- child: new PhysicalModel(
+ child: Container(
+ margin: EdgeInsets.all(8.0),
+ child: PhysicalModel(
color: Colors.grey[900],
elevation: _kIndicatorElevation,
- borderRadius: new BorderRadius.circular(8.0),
+ borderRadius: BorderRadius.circular(8.0),
child: wifiWidget,
),
),
diff --git a/bin/userpicker_base_shell/lib/time_stringer.dart b/bin/userpicker_base_shell/lib/time_stringer.dart
index b8020b3..b35a06d 100644
--- a/bin/userpicker_base_shell/lib/time_stringer.dart
+++ b/bin/userpicker_base_shell/lib/time_stringer.dart
@@ -7,11 +7,11 @@
import 'package:flutter/widgets.dart';
import 'package:intl/intl.dart';
-final DateFormat _kTimeOnlyDateFormat = new DateFormat('h:mm', 'en_US');
-final DateFormat _kDateOnlyDateFormat = new DateFormat('EEEE MMM d', 'en_US');
-final DateFormat _kShortStringDateFormat = new DateFormat('h:mm', 'en_US');
-final DateFormat _kLongStringDateFormat = new DateFormat('EEEE h:mm', 'en_US');
-final DateFormat _kMeridiemOnlyFormat = new DateFormat('a', 'en_US');
+final DateFormat _kTimeOnlyDateFormat = DateFormat('h:mm', 'en_US');
+final DateFormat _kDateOnlyDateFormat = DateFormat('EEEE MMM d', 'en_US');
+final DateFormat _kShortStringDateFormat = DateFormat('h:mm', 'en_US');
+final DateFormat _kLongStringDateFormat = DateFormat('EEEE h:mm', 'en_US');
+final DateFormat _kMeridiemOnlyFormat = DateFormat('a', 'en_US');
/// Creates time strings and notifies when they change.
class TimeStringer extends Listenable {
@@ -43,28 +43,28 @@
/// Returns the time only (eg. '10:34').
String get timeOnly => _kTimeOnlyDateFormat
.format(
- new DateTime.now(),
+ DateTime.now(),
)
.toUpperCase();
/// Returns the date only (eg. 'MONDAY AUG 3').
String get dateOnly => _kDateOnlyDateFormat
.format(
- new DateTime.now(),
+ DateTime.now(),
)
.toUpperCase();
/// Returns a short version of the time (eg. '10:34').
String get shortString =>
- _kShortStringDateFormat.format(new DateTime.now()).toLowerCase();
+ _kShortStringDateFormat.format(DateTime.now()).toLowerCase();
/// Returns a long version of the time including the day (eg. 'Monday 10:34').
String get longString =>
- _kLongStringDateFormat.format(new DateTime.now()).toLowerCase();
+ _kLongStringDateFormat.format(DateTime.now()).toLowerCase();
/// Returns the meridiem (eg. 'AM')
String get meridiem =>
- _kMeridiemOnlyFormat.format(new DateTime.now()).toUpperCase();
+ _kMeridiemOnlyFormat.format(DateTime.now()).toUpperCase();
/// Returns the offset, in minutes.
int get offsetMinutes => _offsetMinutes;
@@ -79,7 +79,7 @@
void _scheduleTimer() {
_timer?.cancel();
_timer =
- new Timer(new Duration(seconds: 61 - new DateTime.now().second), () {
+ Timer(Duration(seconds: 61 - DateTime.now().second), () {
_notifyListeners();
_scheduleTimer();
});
diff --git a/bin/userpicker_base_shell/lib/user_list.dart b/bin/userpicker_base_shell/lib/user_list.dart
index a04b479..919e021 100644
--- a/bin/userpicker_base_shell/lib/user_list.dart
+++ b/bin/userpicker_base_shell/lib/user_list.dart
@@ -16,7 +16,7 @@
const double _kButtonFontSizeLarge = 16.0;
const double _kButtonFontSizeSmall = 14.0;
-const TextStyle _kTextStyle = const TextStyle(
+const TextStyle _kTextStyle = TextStyle(
color: Colors.white,
fontSize: 10.0,
letterSpacing: 1.0,
@@ -24,9 +24,9 @@
);
final BorderRadius _kButtonBorderRadiusPhone =
- new BorderRadius.circular(_kUserAvatarSizeSmall / 2.0);
+ BorderRadius.circular(_kUserAvatarSizeSmall / 2.0);
final BorderRadius _kButtonBorderRadiusLarge =
- new BorderRadius.circular(_kUserAvatarSizeLarge / 2.0);
+ BorderRadius.circular(_kUserAvatarSizeLarge / 2.0);
/// Shows the list of users and allows the user to add new users
class UserList extends StatelessWidget {
@@ -42,12 +42,12 @@
bool isSmall,
}) {
double size = isSmall ? _kUserAvatarSizeSmall : _kUserAvatarSizeLarge;
- return new GestureDetector(
+ return GestureDetector(
onTap: () => onTap?.call(),
- child: new Container(
+ child: Container(
height: size,
width: size,
- child: new Alphatar.fromNameAndUrl(
+ child: Alphatar.fromNameAndUrl(
name: account.displayName,
avatarUrl: _getImageUrl(account),
size: size,
@@ -66,8 +66,8 @@
onTap: () => onTap?.call(),
width: size,
isSmall: isSmall,
- child: new Center(
- child: new Icon(
+ child: Center(
+ child: Icon(
icon,
color: Colors.white,
size: size / 2.0,
@@ -83,17 +83,17 @@
double width,
bool isDisabled = false,
}) {
- return new GestureDetector(
+ return GestureDetector(
onTap: isDisabled ? null : () => onTap?.call(),
- child: new Container(
+ child: Container(
height: isSmall ? _kUserAvatarSizeSmall : _kUserAvatarSizeLarge,
width: width ?? (isSmall ? _kButtonWidthSmall : _kButtonWidthLarge),
alignment: FractionalOffset.center,
- margin: const EdgeInsets.only(left: 16.0),
- decoration: new BoxDecoration(
+ margin: EdgeInsets.only(left: 16.0),
+ decoration: BoxDecoration(
borderRadius:
isSmall ? _kButtonBorderRadiusPhone : _kButtonBorderRadiusLarge,
- border: new Border.all(
+ border: Border.all(
color: isDisabled ? Colors.grey : Colors.white,
width: 1.0,
),
@@ -110,12 +110,12 @@
double fontSize = isSmall ? _kButtonFontSizeSmall : _kButtonFontSizeLarge;
if (loginDisabled) {
- return new Row(
+ return Row(
children: <Widget>[
_buildUserActionButton(
- child: new Text(
+ child: Text(
'RESET',
- style: new TextStyle(
+ style: TextStyle(
fontSize: fontSize,
color: Colors.white,
),
@@ -124,9 +124,9 @@
isSmall: isSmall,
),
_buildUserActionButton(
- child: new Text(
+ child: Text(
'WIFI',
- style: new TextStyle(
+ style: TextStyle(
fontSize: fontSize,
color: Colors.white,
),
@@ -135,9 +135,9 @@
isSmall: isSmall,
),
_buildUserActionButton(
- child: new Text(
+ child: Text(
'LOGIN DISABLED => No SessionShell configured',
- style: new TextStyle(
+ style: TextStyle(
fontSize: fontSize,
color: Colors.white,
),
@@ -149,7 +149,7 @@
],
);
}
- return new Row(
+ return Row(
children: <Widget>[
_buildIconButton(
onTap: () => model.hideUserActions(),
@@ -157,9 +157,9 @@
icon: Icons.close,
),
_buildUserActionButton(
- child: new Text(
+ child: Text(
'RESET',
- style: new TextStyle(
+ style: TextStyle(
fontSize: fontSize,
color: Colors.white,
),
@@ -168,9 +168,9 @@
isSmall: isSmall,
),
_buildUserActionButton(
- child: new Text(
+ child: Text(
'WIFI',
- style: new TextStyle(
+ style: TextStyle(
fontSize: fontSize,
color: Colors.white,
),
@@ -179,9 +179,9 @@
isSmall: isSmall,
),
_buildUserActionButton(
- child: new Text(
+ child: Text(
'LOGIN',
- style: new TextStyle(
+ style: TextStyle(
fontSize: fontSize,
color: Colors.white,
),
@@ -194,9 +194,9 @@
isSmall: isSmall,
),
_buildUserActionButton(
- child: new Text(
+ child: Text(
'GUEST',
- style: new TextStyle(
+ style: TextStyle(
fontSize: fontSize,
color: Colors.white,
),
@@ -218,7 +218,7 @@
}
Uri uri = Uri.parse(account.imageUrl);
if (uri.queryParameters['sz'] != null) {
- Map<String, dynamic> queryParameters = new Map<String, dynamic>.from(
+ Map<String, dynamic> queryParameters = Map<String, dynamic>.from(
uri.queryParameters,
);
queryParameters['sz'] = '160';
@@ -244,11 +244,11 @@
return userCard;
}
- Widget userImage = new LongPressDraggable<Account>(
+ Widget userImage = LongPressDraggable<Account>(
child: userCard,
feedback: userCard,
data: account,
- childWhenDragging: new Opacity(opacity: 0.0, child: userCard),
+ childWhenDragging: Opacity(opacity: 0.0, child: userCard),
feedbackOffset: Offset.zero,
dragAnchor: DragAnchor.child,
maxSimultaneousDrags: 1,
@@ -257,14 +257,14 @@
);
if (model.showingUserActions) {
- return new Padding(
- padding: const EdgeInsets.only(left: 16.0),
- child: new Column(
+ return Padding(
+ padding: EdgeInsets.only(left: 16.0),
+ child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
- new Padding(
- padding: const EdgeInsets.only(bottom: 8.0),
- child: new Text(
+ Padding(
+ padding: EdgeInsets.only(bottom: 8.0),
+ child: Text(
account.displayName,
textAlign: TextAlign.center,
maxLines: 1,
@@ -276,15 +276,15 @@
),
);
} else {
- return new Padding(
- padding: const EdgeInsets.only(left: 16.0),
+ return Padding(
+ padding: EdgeInsets.only(left: 16.0),
child: userImage,
);
}
}
Widget _buildUserList(UserPickerBaseShellModel model) {
- return new LayoutBuilder(
+ return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
List<Widget> children = <Widget>[];
@@ -293,7 +293,7 @@
if (model.showingUserActions) {
children.add(
- new Align(
+ Align(
alignment: FractionalOffset.bottomCenter,
child: _buildExpandedUserActions(
model: model,
@@ -303,7 +303,7 @@
);
} else {
children.add(
- new Align(
+ Align(
alignment: FractionalOffset.bottomCenter,
child: _buildIconButton(
onTap: model.showUserActions,
@@ -316,7 +316,7 @@
children.addAll(
model.accounts.map(
- (Account account) => new Align(
+ (Account account) => Align(
alignment: FractionalOffset.bottomCenter,
child: _buildUserEntry(
account: account,
@@ -332,21 +332,21 @@
),
);
- return new Container(
+ return Container(
height: (isSmall ? _kUserAvatarSizeSmall : _kUserAvatarSizeLarge) +
24.0 +
(model.showingUserActions ? 24.0 : 0.0),
- child: new AnimatedOpacity(
- duration: const Duration(milliseconds: 250),
+ child: AnimatedOpacity(
+ duration: Duration(milliseconds: 250),
opacity: model.showingRemoveUserTarget ? 0.0 : 1.0,
- child: new ListView(
- padding: const EdgeInsets.only(
+ child: ListView(
+ padding: EdgeInsets.only(
bottom: 24.0,
right: 24.0,
),
scrollDirection: Axis.horizontal,
reverse: true,
- physics: const BouncingScrollPhysics(),
+ physics: BouncingScrollPhysics(),
shrinkWrap: true,
children: children,
),
@@ -358,26 +358,26 @@
@override
Widget build(BuildContext context) =>
- new ScopedModelDescendant<UserPickerBaseShellModel>(builder: (
+ ScopedModelDescendant<UserPickerBaseShellModel>(builder: (
BuildContext context,
Widget child,
UserPickerBaseShellModel model,
) {
if (model.showingLoadingSpinner) {
- return new Stack(
+ return Stack(
fit: StackFit.passthrough,
children: <Widget>[
- new Center(
- child: new Container(
+ Center(
+ child: Container(
width: 64.0,
height: 64.0,
- child: const FuchsiaSpinner(),
+ child: FuchsiaSpinner(),
),
),
],
);
} else {
- return new Stack(
+ return Stack(
fit: StackFit.passthrough,
children: <Widget>[
_buildUserList(model),
diff --git a/bin/userpicker_base_shell/lib/user_picker_base_shell_model.dart b/bin/userpicker_base_shell/lib/user_picker_base_shell_model.dart
index ceef118..b233781 100644
--- a/bin/userpicker_base_shell/lib/user_picker_base_shell_model.dart
+++ b/bin/userpicker_base_shell/lib/user_picker_base_shell_model.dart
@@ -21,7 +21,7 @@
/// Function signature for GetPresentationMode callback
typedef GetPresentationModeCallback = void Function(PresentationMode mode);
-const Duration _kShowLoadingSpinnerDelay = const Duration(milliseconds: 500);
+const Duration _kShowLoadingSpinnerDelay = Duration(milliseconds: 500);
/// Model that provides common state
class UserPickerBaseShellModel extends CommonBaseShellModel
@@ -76,7 +76,7 @@
/// Call when reset is tapped.
void resetTapped() {
- File dm = new File('/dev/misc/dmctl');
+ File dm = File('/dev/misc/dmctl');
print('dmctl exists? ${dm.existsSync()}');
if (dm.existsSync()) {
dm.writeAsStringSync('reboot', flush: true);
@@ -163,7 +163,7 @@
void _updateShowLoadingSpinner() {
if (accounts == null || _addingUser || _loadingChildView) {
if (_showingLoadingSpinner == null) {
- _showLoadingSpinnerTimer = new Timer(
+ _showLoadingSpinnerTimer = Timer(
_kShowLoadingSpinnerDelay,
() {
_showingLoadingSpinner = true;
diff --git a/bin/userpicker_base_shell/lib/user_picker_base_shell_screen.dart b/bin/userpicker_base_shell/lib/user_picker_base_shell_screen.dart
index 159f8fa..c99d57d 100644
--- a/bin/userpicker_base_shell/lib/user_picker_base_shell_screen.dart
+++ b/bin/userpicker_base_shell/lib/user_picker_base_shell_screen.dart
@@ -22,7 +22,7 @@
}) : super(key: key);
@override
Widget build(BuildContext context) {
- return new ScopedModelDescendant<UserPickerBaseShellModel>(
+ return ScopedModelDescendant<UserPickerBaseShellModel>(
builder: (
BuildContext context,
Widget child,
@@ -32,28 +32,28 @@
if (model.childViewConnection == null || model.loadingChildView) {
stackChildren.addAll(<Widget>[
- new UserPickerScreen(),
- new Align(
+ UserPickerScreen(),
+ Align(
alignment: FractionalOffset.center,
- child: new Offstage(
+ child: Offstage(
offstage: !model.showingClock,
- child: new Clock(),
+ child: Clock(),
),
),
]);
}
if (model.childViewConnection != null) {
- stackChildren.add(new Offstage(
- child: new Container(
+ stackChildren.add(Offstage(
+ child: Container(
color: Colors.black,
- child: new ChildView(connection: model.childViewConnection),
+ child: ChildView(connection: model.childViewConnection),
),
offstage: model.loadingChildView,
));
}
- return new Stack(fit: StackFit.expand, children: stackChildren);
+ return Stack(fit: StackFit.expand, children: stackChildren);
},
);
}
diff --git a/bin/userpicker_base_shell/lib/user_picker_screen.dart b/bin/userpicker_base_shell/lib/user_picker_screen.dart
index 0a73bc0..144c05f 100644
--- a/bin/userpicker_base_shell/lib/user_picker_screen.dart
+++ b/bin/userpicker_base_shell/lib/user_picker_screen.dart
@@ -17,33 +17,33 @@
class UserPickerScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return new ScopedModelDescendant<UserPickerBaseShellModel>(
+ return ScopedModelDescendant<UserPickerBaseShellModel>(
builder: (
BuildContext context,
Widget child,
UserPickerBaseShellModel model,
) {
- return new Material(
+ return Material(
color: Colors.grey[900],
- child: new Stack(
+ child: Stack(
fit: StackFit.passthrough,
children: <Widget>[
/// Add user picker for selecting users and adding new users
- new Align(
+ Align(
alignment: FractionalOffset.bottomRight,
- child: new RepaintBoundary(
- child: new UserList(
+ child: RepaintBoundary(
+ child: UserList(
loginDisabled: false,
),
),
),
// Add user removal target
- new Align(
+ Align(
alignment: FractionalOffset.center,
- child: new RepaintBoundary(
- child: new Container(
- child: new DragTarget<Account>(
+ child: RepaintBoundary(
+ child: Container(
+ child: DragTarget<Account>(
onWillAccept: (Account data) => true,
onAccept: model.removeUser,
builder: (
@@ -51,7 +51,7 @@
List<Account> candidateData,
__,
) =>
- new _UserRemovalTarget(
+ _UserRemovalTarget(
show: model.showingRemoveUserTarget,
grow: candidateData.isNotEmpty,
),
@@ -79,7 +79,7 @@
const _UserRemovalTarget({this.show, this.grow});
@override
- _UserRemovalTargetState createState() => new _UserRemovalTargetState();
+ _UserRemovalTargetState createState() => _UserRemovalTargetState();
}
class _UserRemovalTargetState extends State<_UserRemovalTarget>
@@ -93,24 +93,24 @@
@override
void initState() {
super.initState();
- _masterAnimationController = new AnimationController(
+ _masterAnimationController = AnimationController(
vsync: this,
- duration: const Duration(milliseconds: 500),
+ duration: Duration(milliseconds: 500),
);
- _initialScaleController = new AnimationController(
+ _initialScaleController = AnimationController(
vsync: this,
- duration: const Duration(milliseconds: 250),
+ duration: Duration(milliseconds: 250),
);
- _initialScaleCurvedAnimation = new CurvedAnimation(
+ _initialScaleCurvedAnimation = CurvedAnimation(
parent: _initialScaleController,
curve: Curves.fastOutSlowIn,
reverseCurve: Curves.fastOutSlowIn,
);
- _scaleController = new AnimationController(
+ _scaleController = AnimationController(
vsync: this,
- duration: const Duration(milliseconds: 250),
+ duration: Duration(milliseconds: 250),
);
- _scaleCurvedAnimation = new CurvedAnimation(
+ _scaleCurvedAnimation = CurvedAnimation(
parent: _scaleController,
curve: Curves.fastOutSlowIn,
reverseCurve: Curves.fastOutSlowIn,
@@ -154,32 +154,32 @@
}
@override
- Widget build(BuildContext context) => new Container(
- child: new AnimatedBuilder(
+ Widget build(BuildContext context) => Container(
+ child: AnimatedBuilder(
animation: _masterAnimationController,
- builder: (BuildContext context, Widget child) => new Transform(
+ builder: (BuildContext context, Widget child) => Transform(
alignment: FractionalOffset.center,
- transform: new Matrix4.identity().scaled(
+ transform: Matrix4.identity().scaled(
lerpDouble(1.0, 0.7, _scaleCurvedAnimation.value) *
_initialScaleCurvedAnimation.value,
lerpDouble(1.0, 0.7, _scaleCurvedAnimation.value) *
_initialScaleCurvedAnimation.value,
),
- child: new Container(
+ child: Container(
width: _kRemovalTargetSize,
height: _kRemovalTargetSize,
- decoration: new BoxDecoration(
+ decoration: BoxDecoration(
borderRadius:
- new BorderRadius.circular(_kRemovalTargetSize / 2.0),
- border: new Border.all(color: Colors.white.withAlpha(200)),
+ BorderRadius.circular(_kRemovalTargetSize / 2.0),
+ border: Border.all(color: Colors.white.withAlpha(200)),
color: Colors.white.withAlpha(
lerpDouble(0, 100.0, _scaleCurvedAnimation.value)
.toInt()),
),
child: Center(
- child: const Text(
+ child: Text(
'REMOVE',
- style: const TextStyle(
+ style: TextStyle(
color: Colors.white,
fontSize: 16.0,
),
diff --git a/bin/wifi_settings/lib/main.dart b/bin/wifi_settings/lib/main.dart
index 471f048..8628204 100644
--- a/bin/wifi_settings/lib/main.dart
+++ b/bin/wifi_settings/lib/main.dart
@@ -13,11 +13,11 @@
void main() {
setupLogger(name: 'wifi_settings');
- Widget app = new MaterialApp(
- home: new Container(
- child: new ScopedModel<WifiSettingsModel>(
- model: new WifiSettingsModel(),
- child: const WlanManager(),
+ Widget app = MaterialApp(
+ home: Container(
+ child: ScopedModel<WifiSettingsModel>(
+ model: WifiSettingsModel(),
+ child: WlanManager(),
),
),
);
diff --git a/bin/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart b/bin/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart
index 15a2c59..97afdd7 100644
--- a/bin/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart
+++ b/bin/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart
@@ -21,10 +21,10 @@
/// All subclasses must connect the [wlan.WlanProxy] in their constructor
class WifiSettingsModel extends Model {
/// How often to poll the wlan for wifi information.
- final Duration _updatePeriod = const Duration(seconds: 3);
+ final Duration _updatePeriod = Duration(seconds: 3);
/// How often to poll the wlan for available wifi networks.
- final Duration _scanPeriod = const Duration(seconds: 40);
+ final Duration _scanPeriod = Duration(seconds: 40);
final wlan.WlanProxy _wlanProxy = wlan.WlanProxy();
diff --git a/bin/xi/xi_embeddable/lib/main.dart b/bin/xi/xi_embeddable/lib/main.dart
index a72b338..f6df1e3 100644
--- a/bin/xi/xi_embeddable/lib/main.dart
+++ b/bin/xi/xi_embeddable/lib/main.dart
@@ -45,7 +45,7 @@
}).catchError(
(err, trace) => log.severe('failed to get link or agent', err, trace));
- runApp(new EmbeddedEditor(
+ runApp(EmbeddedEditor(
client: client,
debugBackground: kDrawDebugBackground,
));
diff --git a/bin/xi/xi_mod/lib/main.dart b/bin/xi/xi_mod/lib/main.dart
index 67162ba..b3cd60f 100644
--- a/bin/xi/xi_mod/lib/main.dart
+++ b/bin/xi/xi_mod/lib/main.dart
@@ -22,10 +22,10 @@
//TODO: migrate to using intents
Module().registerIntentHandler(NoopIntentHandler());
- XiFuchsiaClient xi = new XiFuchsiaClient(null);
- XiCoreProxy coreProxy = new CoreProxy(xi);
+ XiFuchsiaClient xi = XiFuchsiaClient(null);
+ XiCoreProxy coreProxy = CoreProxy(xi);
- runApp(new EditorTabs(
+ runApp(EditorTabs(
coreProxy: coreProxy,
debugBackground: kDrawDebugBackground,
));
diff --git a/bin/xi/xi_session_agent/lib/main.dart b/bin/xi/xi_session_agent/lib/main.dart
index b8652c8..615e9d8 100644
--- a/bin/xi/xi_session_agent/lib/main.dart
+++ b/bin/xi/xi_session_agent/lib/main.dart
@@ -132,7 +132,7 @@
class ViewForwarder extends XiClient implements XiRpcHandler {
final Socket _socket;
- final SocketReader _reader = new SocketReader();
+ final SocketReader _reader = SocketReader();
final String viewId;
final XiClient core;
@@ -153,13 +153,13 @@
@override
void send(String data) {
final List<int> ints = utf8.encode('$data\n');
- final Uint8List bytes = new Uint8List.fromList(ints);
+ final Uint8List bytes = Uint8List.fromList(ints);
final ByteData buffer = bytes.buffer.asByteData();
final WriteResult result = _reader.socket.write(buffer);
if (result.status != ZX.OK) {
- StateError error = new StateError('ERROR WRITING: $result');
+ StateError error = StateError('ERROR WRITING: $result');
streamController
..addError(error)
..close();
@@ -171,7 +171,7 @@
final ReadResult result = _reader.socket.read(1000);
if (result.status != ZX.OK) {
- StateError error = new StateError('Socket read error: ${result.status}');
+ StateError error = StateError('Socket read error: ${result.status}');
streamController
..addError(error)
..close();
diff --git a/bin/xi/xi_session_demo/lib/main.dart b/bin/xi/xi_session_demo/lib/main.dart
index 4368c74..aad7fd5 100644
--- a/bin/xi/xi_session_demo/lib/main.dart
+++ b/bin/xi/xi_session_demo/lib/main.dart
@@ -22,7 +22,7 @@
DemoModel model = DemoModel();
- runApp(new ScopedModel<DemoModel>(
+ runApp(ScopedModel<DemoModel>(
model: model,
child: MessagesDemo(),
));
diff --git a/bin/xi/xi_session_demo/lib/src/demo_model.dart b/bin/xi/xi_session_demo/lib/src/demo_model.dart
index d66cf80..e28ea69 100644
--- a/bin/xi/xi_session_demo/lib/src/demo_model.dart
+++ b/bin/xi/xi_session_demo/lib/src/demo_model.dart
@@ -22,7 +22,7 @@
'Hello!',
'This is pretending to be a messaging app.',
'Press "+" to open a compose view',
- 'Then press "send" to add a new message.',
+ 'Then press "send" to add a message.',
];
final _sessionManagerProxy = XiSessionManagerProxy();
diff --git a/bin/xi/xi_session_demo/lib/src/demo_widget.dart b/bin/xi/xi_session_demo/lib/src/demo_widget.dart
index 7f00767..6f56f54 100644
--- a/bin/xi/xi_session_demo/lib/src/demo_widget.dart
+++ b/bin/xi/xi_session_demo/lib/src/demo_widget.dart
@@ -50,8 +50,8 @@
floatingActionButton: FloatingActionButton(
child: Text('Send'), onPressed: () => model.sendButtonAction()),
body: model.editorConn != null
- ? new ChildView(connection: model.editorConn)
- : new Placeholder(),
+ ? ChildView(connection: model.editorConn)
+ : Placeholder(),
),
),
),
diff --git a/examples/eddystone_agent/main.dart b/examples/eddystone_agent/main.dart
index d976cf9..1c32cd6 100644
--- a/examples/eddystone_agent/main.dart
+++ b/examples/eddystone_agent/main.dart
@@ -15,16 +15,16 @@
import 'package:lib.module_resolver.dart/intent_builder.dart';
import 'package:lib.proposal.dart/proposal.dart';
-final ProposalPublisherProxy _proposalPublisher = new ProposalPublisherProxy();
-final StartupContext _context = new StartupContext.fromStartupInfo();
+final ProposalPublisherProxy _proposalPublisher = ProposalPublisherProxy();
+final StartupContext _context = StartupContext.fromStartupInfo();
final ble.CentralDelegateBinding _delegateBinding =
- new ble.CentralDelegateBinding();
-final ble.CentralProxy _central = new ble.CentralProxy();
+ ble.CentralDelegateBinding();
+final ble.CentralProxy _central = ble.CentralProxy();
const String kEddystoneUuid = '0000feaa-0000-1000-8000-00805f9b34fb';
-final Set<String> proposed = new Set<String>();
+final Set<String> proposed = Set<String>();
Future<Null> proposeUrl(String url) async {
// TODO(jamuraa): resolve this URL for a title or more info?
@@ -38,8 +38,8 @@
details: 'Eddystone nearby webpage detected',
color: 0xFF0000FF,
actions: <Action>[
- new Action.withCreateStory(
- new CreateStory(intent: new IntentBuilder.handler(url).intent),
+ Action.withCreateStory(
+ CreateStory(intent: IntentBuilder.handler(url).intent),
)
],
));
@@ -55,13 +55,13 @@
if (encoded.length < 2) {
return null;
}
- const Map<int, String> prefixes = const {
+ const Map<int, String> prefixes = {
0: 'http://www.',
1: 'https://www.',
2: 'http://',
3: 'https://',
};
- const Map<int, String> expansions = const {
+ const Map<int, String> expansions = {
0: '.com/',
1: '.org/',
2: '.edu/',
@@ -82,12 +82,12 @@
log.warning('Eddystone-URL has invalid scheme: ${encoded.first}');
return null;
}
- StringBuffer buffer = new StringBuffer(decoded);
+ StringBuffer buffer = StringBuffer(decoded);
for (final int c in encoded.skip(1)) {
if ((c < 0x20) || (c > 0x7F)) {
buffer.write(expansions[c]);
} else {
- buffer.write(new String.fromCharCode(c));
+ buffer.write(String.fromCharCode(c));
}
}
return buffer.toString();
@@ -98,13 +98,13 @@
void start(ble.Central central) {
ble.ScanFilter filter =
- const ble.ScanFilter(serviceUuids: const [kEddystoneUuid]);
+ const ble.ScanFilter(serviceUuids: [kEddystoneUuid]);
log.info('BLE starting scan for Eddystone beacons');
central.startScan(filter, (bt.Status status) {
if (status.error != null) {
log.warning(
'BLE scan start failed: ${status.error.description}, retry in $_delayMinutes mins');
- new Timer(new Duration(minutes: _delayMinutes), () => start(_central));
+ Timer(Duration(minutes: _delayMinutes), () => start(_central));
_delayMinutes *= 2;
if (_delayMinutes > 60) {
_delayMinutes = 60;
@@ -165,7 +165,7 @@
connectToService(_context.environmentServices, _proposalPublisher.ctrl);
connectToService(_context.environmentServices, _central.ctrl);
- var scanner = new EddystoneScanner();
+ var scanner = EddystoneScanner();
_central.setDelegate(_delegateBinding.wrap(scanner));
scanner.start(_central);
diff --git a/examples/fidl/echo_client_dart/lib/main.dart b/examples/fidl/echo_client_dart/lib/main.dart
index 06d10a0..996d979 100644
--- a/examples/fidl/echo_client_dart/lib/main.dart
+++ b/examples/fidl/echo_client_dart/lib/main.dart
@@ -15,14 +15,14 @@
server = args[1];
}
- _context = new StartupContext.fromStartupInfo();
+ _context = StartupContext.fromStartupInfo();
- final Services services = new Services();
+ final Services services = Services();
final LaunchInfo launchInfo =
- new LaunchInfo(url: server, directoryRequest: services.request());
+ LaunchInfo(url: server, directoryRequest: services.request());
_context.launcher.createComponent(launchInfo, null);
- _echo = new EchoProxy();
+ _echo = EchoProxy();
_echo.ctrl.bind(services.connectToServiceByName<Echo>(Echo.$serviceName));
_echo.echoString('hello', (String response) {
diff --git a/examples/fidl/echo_server_dart/lib/main.dart b/examples/fidl/echo_server_dart/lib/main.dart
index dac1637..f920fee 100644
--- a/examples/fidl/echo_server_dart/lib/main.dart
+++ b/examples/fidl/echo_server_dart/lib/main.dart
@@ -9,7 +9,7 @@
bool quiet = false;
class _EchoImpl extends Echo {
- final EchoBinding _binding = new EchoBinding();
+ final EchoBinding _binding = EchoBinding();
void bind(InterfaceRequest<Echo> request) {
_binding.bind(this, request);
@@ -29,8 +29,8 @@
void main(List<String> args) {
quiet = args.contains('-q');
- _context = new StartupContext.fromStartupInfo();
- _echo = new _EchoImpl();
+ _context = StartupContext.fromStartupInfo();
+ _echo = _EchoImpl();
_context.outgoingServices
.addServiceForName<Echo>(_echo.bind, Echo.$serviceName);
}
diff --git a/examples/fidl/fidl_bindings_performance/lib/main.dart b/examples/fidl/fidl_bindings_performance/lib/main.dart
index cee89e4..ac6bbb9 100644
--- a/examples/fidl/fidl_bindings_performance/lib/main.dart
+++ b/examples/fidl/fidl_bindings_performance/lib/main.dart
@@ -24,17 +24,17 @@
const String kMessage = 'hello';
Future<int> runTest(String server, void ready(Echo echo, void complete())) {
- final EchoProxy echo = new EchoProxy();
- final ComponentControllerProxy controller = new ComponentControllerProxy();
- final Services services = new Services();
- final LaunchInfo launchInfo = new LaunchInfo(
+ final EchoProxy echo = EchoProxy();
+ final ComponentControllerProxy controller = ComponentControllerProxy();
+ final Services services = Services();
+ final LaunchInfo launchInfo = LaunchInfo(
url: server,
arguments: <String>['-q'],
directoryRequest: services.request());
_context.launcher.createComponent(launchInfo, controller.ctrl.request());
echo.ctrl.bind(services.connectToServiceByName<Echo>(Echo.$serviceName));
- final Completer<int> completer = new Completer<int>();
+ final Completer<int> completer = Completer<int>();
// Notice if the echo server or its controller goes away.
echo.ctrl.onConnectionError = () {
@@ -50,7 +50,7 @@
// Wait until the echo server is up and replying to messages.
echo.echoString(kMessage, (String response) {
- final Stopwatch stopwatch = new Stopwatch()..start();
+ final Stopwatch stopwatch = Stopwatch()..start();
void done() {
stopwatch.stop();
void complete() {
@@ -119,7 +119,7 @@
}
void main(List<String> argv) async {
- final parser = new ArgParser()
+ final parser = ArgParser()
..addMultiOption('server', abbr: 's', defaultsTo: kDefaultServers)
..addMultiOption('num-calls',
abbr: 'n', defaultsTo: kDefaultCalls.map((i) => i.toString()))
@@ -133,7 +133,7 @@
final PerfTest perfTest =
args['parallel'] ? testParallelPerf : testSerialPerf;
- _context = new StartupContext.fromStartupInfo();
+ _context = StartupContext.fromStartupInfo();
// Map of server to map of count to total microseconds.
final Map<String, Map<int, int>> results = {};
@@ -157,7 +157,7 @@
print('server,${numCalls.join(',')}');
for (final String server in results.keys) {
- StringBuffer line = new StringBuffer(server);
+ StringBuffer line = StringBuffer(server);
for (final int count in numCalls) {
final int microseconds = results[server][count] ?? 0;
line.write(',${(microseconds / count)}');
diff --git a/examples/ledger/todo_list/lib/main.dart b/examples/ledger/todo_list/lib/main.dart
index 2eb039f..5e0f640 100644
--- a/examples/ledger/todo_list/lib/main.dart
+++ b/examples/ledger/todo_list/lib/main.dart
@@ -17,7 +17,7 @@
void main() {
setupLogger(name: 'Todo List');
- final model = new TodoListModel()..connect(_getComponentContext());
+ final model = TodoListModel()..connect(_getComponentContext());
// We don't support intents in this module so explicitly ignore them.
Module().registerIntentHandler(NoopIntentHandler());
@@ -26,7 +26,7 @@
runApp(
MaterialApp(
- home: new ScopedModel<TodoListModel>(
+ home: ScopedModel<TodoListModel>(
model: model,
child: TodoListModuleScreen(
onNewItem: model.addItem,
diff --git a/examples/ledger/todo_list/lib/src/models/todo_list_model.dart b/examples/ledger/todo_list/lib/src/models/todo_list_model.dart
index eee3b2a..a5f0ce1 100644
--- a/examples/ledger/todo_list/lib/src/models/todo_list_model.dart
+++ b/examples/ledger/todo_list/lib/src/models/todo_list_model.dart
@@ -47,7 +47,7 @@
final snapshot = ledger.PageSnapshotProxy();
await _page.getSnapshotNew(
snapshot.ctrl.request(),
- new Uint8List(0),
+ Uint8List(0),
_pageWatcherBinding.wrap(_PageWatcher(this)),
);
_readItems(snapshot);
@@ -82,7 +82,7 @@
}
Uint8List _makeKey() {
- Uint8List key = new Uint8List(16);
+ Uint8List key = Uint8List(16);
for (int i = 0; i < 16; i++) {
key[i] = _random.nextInt(256);
}
diff --git a/examples/ledger/todo_list/lib/src/widgets/new_item_input.dart b/examples/ledger/todo_list/lib/src/widgets/new_item_input.dart
index bb5c803..af19406 100644
--- a/examples/ledger/todo_list/lib/src/widgets/new_item_input.dart
+++ b/examples/ledger/todo_list/lib/src/widgets/new_item_input.dart
@@ -16,31 +16,31 @@
const NewItemInput({Key key, this.onNewItem}) : super(key: key);
@override
- _NewItemInputState createState() => new _NewItemInputState(onNewItem);
+ _NewItemInputState createState() => _NewItemInputState(onNewItem);
}
class _NewItemInputState extends State<NewItemInput> {
_NewItemInputState(this.onNewItem);
- final TextEditingController _controller = new TextEditingController();
+ final TextEditingController _controller = TextEditingController();
final NewItemCallback onNewItem;
@override
Widget build(BuildContext context) {
- return new Row(children: <Widget>[
- new Expanded(
- child: new TextField(
+ return Row(children: <Widget>[
+ Expanded(
+ child: TextField(
controller: _controller,
onSubmitted: (String value) {
onNewItem(_controller.text);
_controller.text = '';
},
- decoration: const InputDecoration(
+ decoration: InputDecoration(
hintText: 'What would you like to achieve today?'))),
- new SizedBox(
+ SizedBox(
width: 72.0,
- child: new IconButton(
- icon: const Icon(Icons.add),
+ child: IconButton(
+ icon: Icon(Icons.add),
onPressed: () {
onNewItem(_controller.text);
_controller.text = '';
diff --git a/examples/ledger/todo_list/lib/src/widgets/todo_list_module_screen.dart b/examples/ledger/todo_list/lib/src/widgets/todo_list_module_screen.dart
index 3552e95..e685a1d 100644
--- a/examples/ledger/todo_list/lib/src/widgets/todo_list_module_screen.dart
+++ b/examples/ledger/todo_list/lib/src/widgets/todo_list_module_screen.dart
@@ -20,19 +20,19 @@
final ThemeData themeData = Theme.of(context);
List<Widget> rowChildren = <Widget>[
- new Expanded(child: new Text(content)),
- new SizedBox(
+ Expanded(child: Text(content)),
+ SizedBox(
width: 72.0,
- child: new IconButton(
- icon: const Icon(Icons.done),
+ child: IconButton(
+ icon: Icon(Icons.done),
color: themeData.primaryColor,
onPressed: onDone,
),
),
];
- return new Padding(
- padding: const EdgeInsets.symmetric(vertical: 16.0),
- child: new Row(
+ return Padding(
+ padding: EdgeInsets.symmetric(vertical: 16.0),
+ child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: rowChildren),
);
@@ -58,15 +58,15 @@
@override
Widget build(BuildContext context) {
- return new Scaffold(
- body: new ScopedModelDescendant<TodoListModel>(builder: (
+ return Scaffold(
+ body: ScopedModelDescendant<TodoListModel>(builder: (
BuildContext context,
Widget child,
TodoListModel model,
) {
List<Widget> listItems = <Widget>[];
model.items.forEach((List<int> key, String value) {
- listItems.add(new _TodoItem(
+ listItems.add(_TodoItem(
content: value,
onDone: () {
onItemDone(key);
@@ -75,18 +75,18 @@
});
List<Widget> slivers = <Widget>[
- new SliverAppBar(
+ SliverAppBar(
expandedHeight: _appBarHeight,
pinned: true,
- flexibleSpace: const FlexibleSpaceBar(
- title: const Text('Todo List'),
+ flexibleSpace: FlexibleSpaceBar(
+ title: Text('Todo List'),
),
),
- new SliverToBoxAdapter(child: new NewItemInput(onNewItem: onNewItem)),
- new SliverList(delegate: new SliverChildListDelegate(listItems))
+ SliverToBoxAdapter(child: NewItemInput(onNewItem: onNewItem)),
+ SliverList(delegate: SliverChildListDelegate(listItems))
];
- return new Material(child: new CustomScrollView(slivers: slivers));
+ return Material(child: CustomScrollView(slivers: slivers));
}),
);
}
diff --git a/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart b/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart
index d268b98..4f8ebd4 100644
--- a/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart
+++ b/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart
@@ -24,17 +24,17 @@
@override
Widget build(BuildContext context) {
- TextField title = new TextField(
- decoration: new InputDecoration(
+ TextField title = TextField(
+ decoration: InputDecoration(
hintText: _todoItem._title,
));
- RaisedButton deleteButton = new RaisedButton(
- child: const Text('Delete'),
+ RaisedButton deleteButton = RaisedButton(
+ child: Text('Delete'),
onPressed: _handleDeleteButtonBeingPressed);
- List<Widget> children = <Widget>[new Flexible(child: title), deleteButton];
+ List<Widget> children = <Widget>[Flexible(child: title), deleteButton];
- return new Row(children: children);
+ return Row(children: children);
}
}
diff --git a/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart b/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart
index 7f6ba02..5d4b734 100644
--- a/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart
+++ b/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart
@@ -12,14 +12,14 @@
Widget build(BuildContext context) {
// TODO: Retrieve the list of items from Sledge.
final List<TodoItem> todoItems = <TodoItem>[]
- ..add(new TodoItem('foo'))
- ..add(new TodoItem('bar'))
- ..add(new TodoItem('baz'));
+ ..add(TodoItem('foo'))
+ ..add(TodoItem('bar'))
+ ..add(TodoItem('baz'));
- return new ListView(
+ return ListView(
shrinkWrap: true,
children: todoItems
- .map((TodoItem todoItem) => new TodoItemWidget(todoItem))
+ .map((TodoItem todoItem) => TodoItemWidget(todoItem))
.toList());
}
}
diff --git a/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart b/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart
index 6c2e6f1..cba0a0f 100644
--- a/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart
+++ b/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart
@@ -10,8 +10,8 @@
class TodoWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return new Scaffold(
- appBar: new AppBar(title: const Text('Sledge example')),
- body: new TodoListWidget());
+ return Scaffold(
+ appBar: AppBar(title: Text('Sledge example')),
+ body: TodoListWidget());
}
}
diff --git a/examples/mediaplayer/mediaplayer_flutter/lib/config.dart b/examples/mediaplayer/mediaplayer_flutter/lib/config.dart
index 7715711..0b34451 100644
--- a/examples/mediaplayer/mediaplayer_flutter/lib/config.dart
+++ b/examples/mediaplayer/mediaplayer_flutter/lib/config.dart
@@ -10,10 +10,10 @@
/// Reads the configuration from [fileName].
Future<List<Asset>> readConfig(String fileName) async {
- File file = new File(fileName);
+ File file = File(fileName);
if (!file.existsSync()) {
- throw new ArgumentError.value(fileName, 'fileName', 'File does not exist');
+ throw ArgumentError.value(fileName, 'fileName', 'File does not exist');
}
return _convertAssetList(json.decode(await file.readAsString()));
@@ -58,7 +58,7 @@
try {
uri = Uri.parse(_convertString(value));
} on FormatException {
- throw new FormatException('Config file is malformed: bad URI $value');
+ throw FormatException('Config file is malformed: bad URI $value');
}
break;
case 'type':
@@ -73,7 +73,7 @@
type = AssetType.playlist;
break;
default:
- throw new FormatException(
+ throw FormatException(
'Config file is malformed: $value is not a valid type');
}
break;
@@ -118,7 +118,7 @@
case AssetType.movie:
_checkNotNull(type, uri, 'a URI');
_checkNull(type, children, 'children');
- return new Asset.movie(
+ return Asset.movie(
uri: uri,
title: title,
artist: artist,
@@ -129,7 +129,7 @@
case AssetType.song:
_checkNotNull(type, uri, 'a URI');
_checkNull(type, children, 'children');
- return new Asset.song(
+ return Asset.song(
uri: uri,
title: title,
artist: artist,
@@ -151,27 +151,27 @@
throw const FormatException(
'Config file is malformed: playlist children must be songs or movies');
}
- return new Asset.playlist(
+ return Asset.playlist(
title: title,
children: children,
loop: loop,
);
default:
- throw new FormatException('Unknown asset type: $type');
+ throw FormatException('Unknown asset type: $type');
}
}
void _checkNotNull(AssetType type, Object value, String name) {
if (value == null) {
- throw new FormatException(
+ throw FormatException(
'Config file is malformed: a $type must have $name');
}
}
void _checkNull(AssetType type, Object value, String name) {
if (value != null) {
- throw new FormatException(
+ throw FormatException(
'Config file is malformed: a $type must not have $name');
}
}
diff --git a/examples/mediaplayer/mediaplayer_flutter/lib/main.dart b/examples/mediaplayer/mediaplayer_flutter/lib/main.dart
index a307bde..7b67c6c 100644
--- a/examples/mediaplayer/mediaplayer_flutter/lib/main.dart
+++ b/examples/mediaplayer/mediaplayer_flutter/lib/main.dart
@@ -19,11 +19,11 @@
import 'asset.dart';
import 'config.dart';
-final StartupContext _context = new StartupContext.fromStartupInfo();
+final StartupContext _context = StartupContext.fromStartupInfo();
final MediaPlayerController _controller =
- new MediaPlayerController(_context.environmentServices);
+ MediaPlayerController(_context.environmentServices);
-ModuleImpl _module = new ModuleImpl();
+ModuleImpl _module = ModuleImpl();
void _log(String msg) {
print('[mediaplayer_flutter Module] $msg');
@@ -32,7 +32,7 @@
/// An implementation of the [Lifecycle] interface, which controls the lifetime
/// of the module.
class ModuleImpl implements Lifecycle {
- final LifecycleBinding _lifecycleBinding = new LifecycleBinding();
+ final LifecycleBinding _lifecycleBinding = LifecycleBinding();
/// Binds an [InterfaceRequest] for a [Lifecycle] interface to this object.
void bindLifecycle(InterfaceRequest<Lifecycle> request) {
@@ -48,7 +48,7 @@
}
}
-const List<String> _configFileNames = const <String>[
+const List<String> _configFileNames = <String>[
'/data/mediaplayer_flutter.config',
'/pkg/data/mediaplayer_flutter.config',
];
@@ -140,7 +140,7 @@
const _PlaybackScreen({Key key}) : super(key: key);
@override
- _PlaybackScreenState createState() => new _PlaybackScreenState();
+ _PlaybackScreenState createState() => _PlaybackScreenState();
}
class _PlaybackScreenState extends State<_PlaybackScreen> {
@@ -171,11 +171,11 @@
return;
}
- to.add(new Container(
- margin: const EdgeInsets.only(left: 10.0),
- child: new Text(
+ to.add(Container(
+ margin: EdgeInsets.only(left: 10.0),
+ child: Text(
label,
- style: new TextStyle(color: color, fontSize: fontSize),
+ style: TextStyle(color: color, fontSize: fontSize),
),
));
}
@@ -225,7 +225,7 @@
@override
Widget build(BuildContext context) {
List<Widget> columnChildren = <Widget>[
- new MediaPlayer(_controller),
+ MediaPlayer(_controller),
];
Map<String, String> metadata = _controller.metadata;
@@ -251,30 +251,30 @@
_addProblem(columnChildren);
- return new Material(
+ return Material(
color: Colors.black,
- child: new Stack(
+ child: Stack(
children: <Widget>[
- new Positioned(
+ Positioned(
left: 0.0,
right: 0.0,
top: 0.0,
- child: new Column(
+ child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: columnChildren,
),
),
- new Positioned(
+ Positioned(
right: 0.0,
top: 0.0,
- child: new Offstage(
+ child: Offstage(
offstage: !_controller.shouldShowControlOverlay,
- child: new PhysicalModel(
+ child: PhysicalModel(
elevation: 2.0,
color: Colors.transparent,
- borderRadius: new BorderRadius.circular(60.0),
- child: new IconButton(
- icon: new Icon(
+ borderRadius: BorderRadius.circular(60.0),
+ child: IconButton(
+ icon: Icon(
_assets.length == 1 ? Icons.close : Icons.arrow_back),
iconSize: 60.0,
onPressed: () {
@@ -302,7 +302,7 @@
const _ChooserScreen({Key key}) : super(key: key);
@override
- _ChooserScreenState createState() => new _ChooserScreenState();
+ _ChooserScreenState createState() => _ChooserScreenState();
}
class _ChooserScreenState extends State<_ChooserScreen> {
@@ -321,34 +321,34 @@
break;
}
- return new RaisedButton(
+ return RaisedButton(
onPressed: () {
_play(asset);
Navigator.of(context).pushNamed('/play');
},
color: Colors.black,
- child: new Row(
+ child: Row(
children: <Widget>[
- new Icon(
+ Icon(
iconData,
size: 60.0,
color: Colors.grey[200],
),
- new Column(
+ Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
- new Text(
+ Text(
asset.title ?? '(no title)',
- style: new TextStyle(color: Colors.grey[200], fontSize: 18.0),
+ style: TextStyle(color: Colors.grey[200], fontSize: 18.0),
),
- new Text(
+ Text(
asset.artist ?? '',
- style: new TextStyle(color: Colors.grey[600], fontSize: 13.0),
+ style: TextStyle(color: Colors.grey[600], fontSize: 13.0),
),
- new Text(
+ Text(
asset.album ?? '',
- style: new TextStyle(color: Colors.grey[800], fontSize: 13.0),
+ style: TextStyle(color: Colors.grey[800], fontSize: 13.0),
),
],
),
@@ -359,22 +359,22 @@
@override
Widget build(BuildContext context) {
- return new Material(
+ return Material(
color: Colors.black,
- child: new Stack(
+ child: Stack(
children: <Widget>[
- new ListView(
+ ListView(
itemExtent: 75.0,
children: _assets.map(_buildChooseButton).toList(),
),
- new Positioned(
+ Positioned(
right: 0.0,
top: 0.0,
- child: new PhysicalModel(
+ child: PhysicalModel(
elevation: 2.0,
color: Colors.transparent,
- child: new IconButton(
- icon: const Icon(Icons.close),
+ child: IconButton(
+ icon: Icon(Icons.close),
iconSize: 60.0,
onPressed: () {
io.exit(0);
@@ -411,14 +411,14 @@
_play(_assets[0]);
}
- runApp(new MaterialApp(
+ runApp(MaterialApp(
title: 'Media Player',
home:
- _assets.length == 1 ? const _PlaybackScreen() : const _ChooserScreen(),
+ _assets.length == 1 ? const _PlaybackScreen() : _ChooserScreen(),
routes: <String, WidgetBuilder>{
'/play': (BuildContext context) => const _PlaybackScreen()
},
- theme: new ThemeData(primarySwatch: Colors.blue),
+ theme: ThemeData(primarySwatch: Colors.blue),
debugShowCheckedModeBanner: false,
));
}
diff --git a/examples/mine_digger/main.dart b/examples/mine_digger/main.dart
index 491befa..4db81ff 100644
--- a/examples/mine_digger/main.dart
+++ b/examples/mine_digger/main.dart
@@ -16,27 +16,27 @@
// CoveredMineNode and ExposedMineNode, none of them holding state.
// Colors for each mine count (0-8):
-const List<Color> textColors = const <Color>[
- const Color(0xFF555555),
- const Color(0xFF0094FF), // blue
- const Color(0xFF13A023), // green
- const Color(0xFFDA1414), // red
- const Color(0xFF1E2347), // black
- const Color(0xFF7F0037), // dark red
- const Color(0xFF000000),
- const Color(0xFF000000),
- const Color(0xFF000000),
+const List<Color> textColors = <Color>[
+ Color(0xFF555555),
+ Color(0xFF0094FF), // blue
+ Color(0xFF13A023), // green
+ Color(0xFFDA1414), // red
+ Color(0xFF1E2347), // black
+ Color(0xFF7F0037), // dark red
+ Color(0xFF000000),
+ Color(0xFF000000),
+ Color(0xFF000000),
];
final List<TextStyle> textStyles = textColors.map((Color color) {
- return new TextStyle(color: color, fontWeight: FontWeight.bold);
+ return TextStyle(color: color, fontWeight: FontWeight.bold);
}).toList();
enum CellState { covered, exploded, cleared, flagged, shown }
class MineDigger extends StatefulWidget {
@override
- MineDiggerState createState() => new MineDiggerState();
+ MineDiggerState createState() => MineDiggerState();
}
class MineDiggerState extends State<MineDigger> {
@@ -48,7 +48,7 @@
bool hasWon;
int detectedCount;
Timer timer;
- Stopwatch gameTime = new Stopwatch();
+ Stopwatch gameTime = Stopwatch();
// |cells| keeps track of the positions of the mines.
List<List<bool>> cells;
@@ -75,21 +75,21 @@
timer?.cancel();
- timer = new Timer.periodic(const Duration(seconds: 1), (Timer timer) {
+ timer = Timer.periodic(const Duration(seconds: 1), (Timer timer) {
setState((){
// time blah blah
});
});
// Initialize matrices.
- cells = new List<List<bool>>.generate(rows, (int row) {
- return new List<bool>.filled(cols, false);
+ cells = List<List<bool>>.generate(rows, (int row) {
+ return List<bool>.filled(cols, false);
});
- uiState = new List<List<CellState>>.generate(rows, (int row) {
- return new List<CellState>.filled(cols, CellState.covered);
+ uiState = List<List<CellState>>.generate(rows, (int row) {
+ return List<CellState>.filled(cols, CellState.covered);
});
// Place the mines.
- Random random = new Random();
+ Random random = Random();
int minesRemaining = totalMineCount;
while (minesRemaining > 0) {
int pos = random.nextInt(rows * cols);
@@ -125,7 +125,7 @@
state = cells[iy][ix] ? CellState.shown : state;
}
if (state == CellState.covered || state == CellState.flagged) {
- row.add(new GestureDetector(
+ row.add(GestureDetector(
onTap: () {
if (state == CellState.covered)
probe(ix, iy);
@@ -134,9 +134,9 @@
// TODO(cpu): Add audio or haptic feedback.
flag(ix, iy);
},
- child: new Listener(
+ child: Listener(
onPointerDown: _pointerDownHandlerFor(ix, iy),
- child: new CoveredMineNode(
+ child: CoveredMineNode(
flagged: state == CellState.flagged,
posX: ix,
posY: iy
@@ -149,17 +149,17 @@
hasCoveredCell = true;
}
} else {
- row.add(new ExposedMineNode(
+ row.add(ExposedMineNode(
state: state,
count: count
));
}
}
flexRows.add(
- new Row(
+ Row(
children: row,
mainAxisAlignment: MainAxisAlignment.center,
- key: new ValueKey<int>(iy)
+ key: ValueKey<int>(iy)
)
);
}
@@ -172,11 +172,11 @@
}
}
- return new Container(
- padding: const EdgeInsets.all(10.0),
- margin: const EdgeInsets.all(10.0),
- color: const Color(0xFF6B6B6B),
- child: new Column(children: flexRows)
+ return Container(
+ padding: EdgeInsets.all(10.0),
+ margin: EdgeInsets.all(10.0),
+ color: Color(0xFF6B6B6B),
+ child: Column(children: flexRows)
);
}
@@ -187,20 +187,20 @@
'Kaboom! Try harder [press here]';
int elapsed = gameTime.elapsedMilliseconds ~/ 1000;
- return new AppBar(
+ return AppBar(
// FIXME: Strange to have the app bar be tapable.
- title: new Listener(
+ title: Listener(
onPointerDown: handleAppBarPointerDown,
- child: new Text(appBarCaption,
+ child: Text(appBarCaption,
style: Theme.of(context).primaryTextTheme.title)
),
centerTitle: true,
actions: <Widget>[
- new Container(
- child: new Text('$elapsed seconds'),
+ Container(
+ child: Text('$elapsed seconds'),
color: Colors.teal,
- margin: const EdgeInsets.all(14.0),
- padding: const EdgeInsets.all(2.0))
+ margin: EdgeInsets.all(14.0),
+ padding: EdgeInsets.all(2.0))
]
);
}
@@ -210,12 +210,12 @@
// We build the board before we build the app bar because we compute the win state
// during build step.
Widget board = buildBoard();
- return new MaterialApp(
+ return MaterialApp(
title: 'Mine Digger',
- home: new Scaffold(
+ home: Scaffold(
appBar: buildAppBar(context),
- body: new Container(
- child: new Center(child: board),
+ body: Container(
+ child: Center(child: board),
color: Colors.grey[50],
),
),
@@ -305,19 +305,19 @@
}
Widget buildCell(Widget child) {
- return new Container(
- padding: const EdgeInsets.all(1.0),
+ return Container(
+ padding: EdgeInsets.all(1.0),
height: 27.0, width: 27.0,
- color: const Color(0xFFC0C0C0),
- margin: const EdgeInsets.all(2.0),
+ color: Color(0xFFC0C0C0),
+ margin: EdgeInsets.all(2.0),
child: child
);
}
Widget buildInnerCell(Widget child) {
- return new Container(
- padding: const EdgeInsets.all(1.0),
- margin: const EdgeInsets.all(3.0),
+ return Container(
+ padding: EdgeInsets.all(1.0),
+ margin: EdgeInsets.all(3.0),
height: 17.0, width: 17.0,
child: child
);
@@ -335,8 +335,8 @@
Widget build(BuildContext context) {
Widget text;
if (flagged) {
- text = buildInnerCell(new RichText(
- text: new TextSpan(
+ text = buildInnerCell(RichText(
+ text: TextSpan(
text: 'm', // TODO(cpu) this should be \u2691
style: textStyles[5],
),
@@ -344,10 +344,10 @@
));
}
- Container inner = new Container(
- margin: const EdgeInsets.all(2.0),
+ Container inner = Container(
+ margin: EdgeInsets.all(2.0),
height: 17.0, width: 17.0,
- color: const Color(0xFFD9D9D9),
+ color: Color(0xFFD9D9D9),
child: text,
);
@@ -368,8 +368,8 @@
if (state == CellState.cleared) {
// Uncovered cell with nearby mine count.
if (count != 0) {
- text = new RichText(
- text: new TextSpan(
+ text = RichText(
+ text: TextSpan(
text: '$count',
style: textStyles[count],
),
@@ -379,8 +379,8 @@
} else {
// Exploded mine or shown mine for 'game over'.
int color = state == CellState.exploded ? 3 : 0;
- text = new RichText(
- text: new TextSpan(
+ text = RichText(
+ text: TextSpan(
text: '*', // TODO(cpu) this should be \u2600
style: textStyles[color],
),
@@ -392,5 +392,5 @@
}
void main() {
- runApp(new MineDigger());
+ runApp(MineDigger());
}
diff --git a/examples/test/driver_example_mod/lib/src/handlers/root_intent_handler.dart b/examples/test/driver_example_mod/lib/src/handlers/root_intent_handler.dart
index 694578c..d57abb2 100644
--- a/examples/test/driver_example_mod/lib/src/handlers/root_intent_handler.dart
+++ b/examples/test/driver_example_mod/lib/src/handlers/root_intent_handler.dart
@@ -12,40 +12,40 @@
class RootIntentHandler extends IntentHandler {
@override
void handleIntent(Intent intent) async {
- DriverExampleModel model = new DriverExampleModel();
+ DriverExampleModel model = DriverExampleModel();
runApp(
- new ScopedModel<DriverExampleModel>(
+ ScopedModel<DriverExampleModel>(
model: model,
- child: new MaterialApp(
- home: new Scaffold(
- body: new ScopedModelDescendant<DriverExampleModel>(
+ child: MaterialApp(
+ home: Scaffold(
+ body: ScopedModelDescendant<DriverExampleModel>(
builder: (BuildContext context, Widget child,
DriverExampleModel model) {
return Column(
children: <Widget>[
- new Center(
- child: new Directionality(
+ Center(
+ child: Directionality(
textDirection: TextDirection.ltr,
- child: new Text(
+ child: Text(
'This counter has a value of: ${model.count}'),
),
),
- new Row(
+ Row(
children: <Widget>[
- new FlatButton(
- child: const Text('+1'),
+ FlatButton(
+ child: Text('+1'),
onPressed: () => model.increment(),
),
- new FlatButton(
- child: const Text('-1'),
+ FlatButton(
+ child: Text('-1'),
onPressed: () => model.decrement(),
),
- new FlatButton(
- child: const Text('+5'),
+ FlatButton(
+ child: Text('+5'),
onPressed: () => model.increment(by: 5),
),
- new FlatButton(
- child: const Text('-5'),
+ FlatButton(
+ child: Text('-5'),
onPressed: () => model.decrement(by: 5),
),
],
diff --git a/examples/test/flutter_widget_test/test/flutter_widget_test.dart b/examples/test/flutter_widget_test/test/flutter_widget_test.dart
index d4c089f..46465e6 100644
--- a/examples/test/flutter_widget_test/test/flutter_widget_test.dart
+++ b/examples/test/flutter_widget_test/test/flutter_widget_test.dart
@@ -4,17 +4,17 @@
void main() {
testWidgets('my first widget test', (WidgetTester tester) async {
// You can use keys to locate the widget you need to test
- var sliderKey = new UniqueKey();
+ var sliderKey = UniqueKey();
var value = 0.0;
// Tells the tester to build a UI based on the widget tree passed to it
await tester.pumpWidget(
- new StatefulBuilder(
+ StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
- return new MaterialApp(
- home: new Material(
- child: new Center(
- child: new Slider(
+ return MaterialApp(
+ home: Material(
+ child: Center(
+ child: Slider(
key: sliderKey,
value: value,
onChanged: (double newValue) {
diff --git a/examples/ui/localized_mod/lib/localization/messages_all.dart b/examples/ui/localized_mod/lib/localization/messages_all.dart
index e35721f..a91b228 100644
--- a/examples/ui/localized_mod/lib/localization/messages_all.dart
+++ b/examples/ui/localized_mod/lib/localization/messages_all.dart
@@ -37,16 +37,16 @@
onFailure: (_) => null);
if (availableLocale == null) {
// ignore: unnecessary_new
- return new Future.value(false);
+ return Future.value(false);
}
var lib = _deferredLibraries[availableLocale];
// ignore: unnecessary_new
- await (lib == null ? new Future.value(false) : lib());
+ await (lib == null ? Future.value(false) : lib());
// ignore: unnecessary_new
- initializeInternalMessageLookup(() => new CompositeMessageLookup());
+ initializeInternalMessageLookup(() => CompositeMessageLookup());
messageLookup.addLocale(availableLocale, _findGeneratedMessagesFor);
// ignore: unnecessary_new
- return new Future.value(true);
+ return Future.value(true);
}
bool _messagesExistFor(String locale) {
diff --git a/examples/ui/localized_mod/lib/localization/messages_he.dart b/examples/ui/localized_mod/lib/localization/messages_he.dart
index df01141..0246077 100644
--- a/examples/ui/localized_mod/lib/localization/messages_he.dart
+++ b/examples/ui/localized_mod/lib/localization/messages_he.dart
@@ -7,7 +7,7 @@
import 'package:intl/message_lookup_by_library.dart';
// ignore: unnecessary_new
-final messages = new MessageLookup();
+final messages = MessageLookup();
// ignore: unused_element
final _keepAnalysisHappy = Intl.defaultLocale;
diff --git a/examples/ui/localized_mod/lib/localization/messages_messages.dart b/examples/ui/localized_mod/lib/localization/messages_messages.dart
index 5516dc3..c2d2c2c 100644
--- a/examples/ui/localized_mod/lib/localization/messages_messages.dart
+++ b/examples/ui/localized_mod/lib/localization/messages_messages.dart
@@ -7,7 +7,7 @@
import 'package:intl/message_lookup_by_library.dart';
// ignore: unnecessary_new
-final messages = new MessageLookup();
+final messages = MessageLookup();
// ignore: unused_element
final _keepAnalysisHappy = Intl.defaultLocale;
diff --git a/examples/ui/localized_mod/lib/localized_mod_strings.dart b/examples/ui/localized_mod/lib/localized_mod_strings.dart
index b197e13..29bf541 100644
--- a/examples/ui/localized_mod/lib/localized_mod_strings.dart
+++ b/examples/ui/localized_mod/lib/localized_mod_strings.dart
@@ -25,7 +25,7 @@
name: 'bodyText',
args: [itemCount],
desc: 'How many messages are in the list.',
- examples: const {'itemCount': 42},
+ examples: {'itemCount': 42},
);
static String get footer => Intl.message(
diff --git a/examples/ui/simple_flutter/lib/leaf.dart b/examples/ui/simple_flutter/lib/leaf.dart
index 1586a41..869969c 100644
--- a/examples/ui/simple_flutter/lib/leaf.dart
+++ b/examples/ui/simple_flutter/lib/leaf.dart
@@ -1,16 +1,16 @@
import 'package:flutter/material.dart';
-void main() => runApp(new MyApp());
+void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return new MaterialApp(
+ return MaterialApp(
title: 'Flutter Demo',
- theme: new ThemeData(
+ theme: ThemeData(
primarySwatch: Colors.blue,
),
- home: new MyHomePage(title: 'Leaf Flutter'),
+ home: MyHomePage(title: 'Leaf Flutter'),
);
}
}
@@ -21,22 +21,22 @@
final String title;
@override
- _MyHomePageState createState() => new _MyHomePageState();
+ _MyHomePageState createState() => _MyHomePageState();
}
// Update with Tap to increment counter
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
- return new Scaffold(
- appBar: new AppBar(
- title: new Text(widget.title),
+ return Scaffold(
+ appBar: AppBar(
+ title: Text(widget.title),
),
- body: new Center(
- child: new Column(
+ body: Center(
+ child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- new Text('Hi!'),
+ Text('Hi!'),
],
)));
}
diff --git a/examples/ui/simple_flutter/lib/main.dart b/examples/ui/simple_flutter/lib/main.dart
index 8bb2233..d99b595 100644
--- a/examples/ui/simple_flutter/lib/main.dart
+++ b/examples/ui/simple_flutter/lib/main.dart
@@ -2,17 +2,17 @@
import 'package:lib.app.dart/app.dart';
import 'package:lib.widgets/application_deprecated.dart';
-void main() => runApp(new MyApp());
+void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return new MaterialApp(
+ return MaterialApp(
title: 'Gesture Demo',
- theme: new ThemeData(
+ theme: ThemeData(
primarySwatch: Colors.blue,
),
- home: new MyHomePage(title: 'Gesture Demo - Multiple Process'),
+ home: MyHomePage(title: 'Gesture Demo - Multiple Process'),
);
}
}
@@ -23,7 +23,7 @@
final String title;
@override
- _MyHomePageState createState() => new _MyHomePageState();
+ _MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@@ -53,47 +53,47 @@
@override
Widget build(BuildContext context) {
- return new Scaffold(
- appBar: new AppBar(
- title: new Text(widget.title),
+ return Scaffold(
+ appBar: AppBar(
+ title: Text(widget.title),
),
- body: new Center(
- child: new Row(
+ body: Center(
+ child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- new Column(
+ Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- new Dismissible(
- key: new Key('left$leftCounter'),
+ Dismissible(
+ key: Key('left$leftCounter'),
onDismissed: _onLeftDismissed,
resizeDuration: null,
- child: new Card(
- child: new Container(
+ child: Card(
+ child: Container(
width: 300.0,
height: 300.0,
color: colors[leftCounter % colors.length]),
)),
- new Text('Left, $leftCounter')
+ Text('Left, $leftCounter')
]),
- new Column(
+ Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- new Dismissible(
- key: new Key('right$rightCounter'),
+ Dismissible(
+ key: Key('right$rightCounter'),
onDismissed: _onRightDismissed,
resizeDuration: null,
- child: new Card(
- child: new Container(
+ child: Card(
+ child: Container(
width: 300.0,
height: 300.0,
- child: new ApplicationWidget(
+ child: ApplicationWidget(
url:
'fuchsia-pkg://fuchsia.com/simple_flutter#meta/leaf_flutter.cmx',
launcher:
StartupContext.fromStartupInfo().launcher),
))),
- new Text('Right, $rightCounter')
+ Text('Right, $rightCounter')
]),
],
),
diff --git a/lib/base_shell/lib/base_model.dart b/lib/base_shell/lib/base_model.dart
index 8d68ef7..4f558d3 100644
--- a/lib/base_shell/lib/base_model.dart
+++ b/lib/base_shell/lib/base_model.dart
@@ -32,7 +32,7 @@
/// Function signature for GetPresentationMode callback
typedef GetPresentationModeCallback = void Function(PresentationMode mode);
-const Duration _kCobaltTimerTimeout = const Duration(seconds: 20);
+const Duration _kCobaltTimerTimeout = Duration(seconds: 20);
const int _kSessionShellLoginTimeMetricId = 14;
// This class is extends the Presentation protocol and implements and PresentationModeListener.
diff --git a/lib/base_shell/lib/base_shell_widget.dart b/lib/base_shell/lib/base_shell_widget.dart
index 11a4c28..b6026b9 100644
--- a/lib/base_shell/lib/base_shell_widget.dart
+++ b/lib/base_shell/lib/base_shell_widget.dart
@@ -27,11 +27,11 @@
/// The bindings for the [BaseShell] service implemented by [BaseShellImpl].
final Set<BaseShellBinding> _baseShellBindingSet =
- new Set<BaseShellBinding>();
+ Set<BaseShellBinding>();
/// The bindings for the [Lifecycle] service implemented by [BaseShellImpl].
final Set<LifecycleBinding> _lifecycleBindingSet =
- new Set<LifecycleBinding>();
+ Set<LifecycleBinding>();
/// The [BaseShell] to [advertise].
final BaseShellImpl _baseShell;
@@ -54,14 +54,14 @@
);
@override
- Widget build(BuildContext context) => new MaterialApp(
- home: new Material(
- child: new Directionality(
+ Widget build(BuildContext context) => MaterialApp(
+ home: Material(
+ child: Directionality(
textDirection: TextDirection.ltr,
- child: new WindowMediaQuery(
+ child: WindowMediaQuery(
child: _baseShellModel == null
? child
- : new ScopedModel<T>(model: _baseShellModel, child: child),
+ : ScopedModel<T>(model: _baseShellModel, child: child),
),
),
),
@@ -72,12 +72,12 @@
void advertise() {
startupContext.outgoing
..addPublicService((InterfaceRequest<BaseShell> request) {
- BaseShellBinding binding = new BaseShellBinding()
+ BaseShellBinding binding = BaseShellBinding()
..bind(_baseShell, request);
_baseShellBindingSet.add(binding);
}, BaseShell.$serviceName)
..addPublicService((InterfaceRequest<Lifecycle> request) {
- LifecycleBinding binding = new LifecycleBinding()
+ LifecycleBinding binding = LifecycleBinding()
..bind(_baseShell, request);
_lifecycleBindingSet.add(binding);
}, Lifecycle.$serviceName);
@@ -87,7 +87,7 @@
BaseShellModel baseShellModel,
AuthenticationUiContext authenticationUiContext,
) {
- return new BaseShellImpl(
+ return BaseShellImpl(
authenticationUiContext: authenticationUiContext,
onReady: baseShellModel?.onReady,
onStop: () {
diff --git a/lib/base_shell/lib/netstack_model.dart b/lib/base_shell/lib/netstack_model.dart
index 145d3f1..c01127a 100644
--- a/lib/base_shell/lib/netstack_model.dart
+++ b/lib/base_shell/lib/netstack_model.dart
@@ -14,9 +14,9 @@
const String _kLoopbackInterfaceName = 'en1';
-const Duration _kRepeatAnimationDuration = const Duration(milliseconds: 400);
+const Duration _kRepeatAnimationDuration = Duration(milliseconds: 400);
-const Duration _kRevealAnimationDuration = const Duration(milliseconds: 200);
+const Duration _kRevealAnimationDuration = Duration(milliseconds: 200);
void _updateAnimations(
bool oldValue,
bool newValue,
@@ -55,19 +55,19 @@
/// Constructor.
InterfaceInfo(this._interface, this._stats, TickerProvider _vsync) {
- receivingRevealAnimation = new AnimationController(
+ receivingRevealAnimation = AnimationController(
duration: _kRevealAnimationDuration,
vsync: _vsync,
);
- receivingRepeatAnimation = new AnimationController(
+ receivingRepeatAnimation = AnimationController(
duration: _kRepeatAnimationDuration,
vsync: _vsync,
);
- sendingRevealAnimation = new AnimationController(
+ sendingRevealAnimation = AnimationController(
duration: _kRevealAnimationDuration,
vsync: _vsync,
);
- sendingRepeatAnimation = new AnimationController(
+ sendingRepeatAnimation = AnimationController(
duration: _kRepeatAnimationDuration,
vsync: _vsync,
);
@@ -146,7 +146,7 @@
netstack.getStats(interface.id).then(
(ns.NetInterfaceStats stats) {
if (_interfaces[interface.id] == null) {
- _interfaces[interface.id] = new InterfaceInfo(
+ _interfaces[interface.id] = InterfaceInfo(
interface,
stats,
this,
diff --git a/lib/keyboard/flutter/lib/src/keyboard_container.dart b/lib/keyboard/flutter/lib/src/keyboard_container.dart
index 9bfc5a4..9182a2d 100644
--- a/lib/keyboard/flutter/lib/src/keyboard_container.dart
+++ b/lib/keyboard/flutter/lib/src/keyboard_container.dart
@@ -62,8 +62,8 @@
child: SizedBox(
height: _kKeyboardOverlayHeight,
child: Material(
- borderRadius: const BorderRadius.vertical(
- top: const Radius.circular(_kKeyboardCornerRadius)),
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(_kKeyboardCornerRadius)),
elevation: elevation ?? model.keyboardElevation,
child: ApplicationWidget(
url: 'fuchsia-pkg://fuchsia.com/latin-ime#meta/latin-ime.cmx',
diff --git a/lib/keyboard_deprecated/flutter/lib/src/keyboard_container.dart b/lib/keyboard_deprecated/flutter/lib/src/keyboard_container.dart
index 893b635..4f9aeac 100644
--- a/lib/keyboard_deprecated/flutter/lib/src/keyboard_container.dart
+++ b/lib/keyboard_deprecated/flutter/lib/src/keyboard_container.dart
@@ -62,8 +62,8 @@
child: SizedBox(
height: _kKeyboardOverlayHeight,
child: Material(
- borderRadius: const BorderRadius.vertical(
- top: const Radius.circular(_kKeyboardCornerRadius)),
+ borderRadius: BorderRadius.vertical(
+ top: Radius.circular(_kKeyboardCornerRadius)),
elevation: elevation ?? model.keyboardElevation,
child: ApplicationWidget(
url: 'fuchsia-pkg://fuchsia.com/latin-ime#meta/latin-ime.cmx',
diff --git a/lib/settings/lib/device_info.dart b/lib/settings/lib/device_info.dart
index 835e74f..f79f883 100644
--- a/lib/settings/lib/device_info.dart
+++ b/lib/settings/lib/device_info.dart
@@ -15,7 +15,7 @@
/// Returns the date the source code was last updated.
static DateTime getSourceDate() {
- final File updateFile = new File(_lastUpdateFilePath);
+ final File updateFile = File(_lastUpdateFilePath);
if (updateFile.existsSync()) {
final String lastUpdate = updateFile.readAsStringSync();
diff --git a/lib/settings/lib/timezone_picker.dart b/lib/settings/lib/timezone_picker.dart
index d460ed1..ccb5a65 100644
--- a/lib/settings/lib/timezone_picker.dart
+++ b/lib/settings/lib/timezone_picker.dart
@@ -13,568 +13,568 @@
// Note: these timezones were generated from a script using ICU data.
// These should ideally be loaded ad hoc or stored somewhere.
-const List<_Timezone> _kTimeZones = const <_Timezone>[
- const _Timezone(zoneId: 'US/Eastern'),
- const _Timezone(zoneId: 'US/Pacific'),
- const _Timezone(zoneId: 'Europe/Paris'),
- const _Timezone(zoneId: 'Africa/Abidjan'),
- const _Timezone(zoneId: 'Africa/Accra'),
- const _Timezone(zoneId: 'Africa/Addis_Ababa'),
- const _Timezone(zoneId: 'Africa/Algiers'),
- const _Timezone(zoneId: 'Africa/Asmara'),
- const _Timezone(zoneId: 'Africa/Asmera'),
- const _Timezone(zoneId: 'Africa/Bamako'),
- const _Timezone(zoneId: 'Africa/Bangui'),
- const _Timezone(zoneId: 'Africa/Banjul'),
- const _Timezone(zoneId: 'Africa/Bissau'),
- const _Timezone(zoneId: 'Africa/Blantyre'),
- const _Timezone(zoneId: 'Africa/Brazzaville'),
- const _Timezone(zoneId: 'Africa/Bujumbura'),
- const _Timezone(zoneId: 'Africa/Cairo'),
- const _Timezone(zoneId: 'Africa/Casablanca'),
- const _Timezone(zoneId: 'Africa/Ceuta'),
- const _Timezone(zoneId: 'Africa/Conakry'),
- const _Timezone(zoneId: 'Africa/Dakar'),
- const _Timezone(zoneId: 'Africa/Dar_es_Salaam'),
- const _Timezone(zoneId: 'Africa/Djibouti'),
- const _Timezone(zoneId: 'Africa/Douala'),
- const _Timezone(zoneId: 'Africa/El_Aaiun'),
- const _Timezone(zoneId: 'Africa/Freetown'),
- const _Timezone(zoneId: 'Africa/Gaborone'),
- const _Timezone(zoneId: 'Africa/Harare'),
- const _Timezone(zoneId: 'Africa/Johannesburg'),
- const _Timezone(zoneId: 'Africa/Kampala'),
- const _Timezone(zoneId: 'Africa/Khartoum'),
- const _Timezone(zoneId: 'Africa/Kigali'),
- const _Timezone(zoneId: 'Africa/Kinshasa'),
- const _Timezone(zoneId: 'Africa/Lagos'),
- const _Timezone(zoneId: 'Africa/Libreville'),
- const _Timezone(zoneId: 'Africa/Lome'),
- const _Timezone(zoneId: 'Africa/Luanda'),
- const _Timezone(zoneId: 'Africa/Lubumbashi'),
- const _Timezone(zoneId: 'Africa/Lusaka'),
- const _Timezone(zoneId: 'Africa/Malabo'),
- const _Timezone(zoneId: 'Africa/Maputo'),
- const _Timezone(zoneId: 'Africa/Maseru'),
- const _Timezone(zoneId: 'Africa/Mbabane'),
- const _Timezone(zoneId: 'Africa/Mogadishu'),
- const _Timezone(zoneId: 'Africa/Monrovia'),
- const _Timezone(zoneId: 'Africa/Nairobi'),
- const _Timezone(zoneId: 'Africa/Ndjamena'),
- const _Timezone(zoneId: 'Africa/Niamey'),
- const _Timezone(zoneId: 'Africa/Nouakchott'),
- const _Timezone(zoneId: 'Africa/Ouagadougou'),
- const _Timezone(zoneId: 'Africa/Porto-Novo'),
- const _Timezone(zoneId: 'Africa/Sao_Tome'),
- const _Timezone(zoneId: 'Africa/Timbuktu'),
- const _Timezone(zoneId: 'Africa/Tripoli'),
- const _Timezone(zoneId: 'Africa/Tunis'),
- const _Timezone(zoneId: 'Africa/Windhoek'),
- const _Timezone(zoneId: 'America/Adak'),
- const _Timezone(zoneId: 'America/Anchorage'),
- const _Timezone(zoneId: 'America/Anguilla'),
- const _Timezone(zoneId: 'America/Antigua'),
- const _Timezone(zoneId: 'America/Araguaina'),
- const _Timezone(zoneId: 'America/Argentina/Buenos_Aires'),
- const _Timezone(zoneId: 'America/Argentina/Catamarca'),
- const _Timezone(zoneId: 'America/Argentina/ComodRivadavia'),
- const _Timezone(zoneId: 'America/Argentina/Cordoba'),
- const _Timezone(zoneId: 'America/Argentina/Jujuy'),
- const _Timezone(zoneId: 'America/Argentina/La_Rioja'),
- const _Timezone(zoneId: 'America/Argentina/Mendoza'),
- const _Timezone(zoneId: 'America/Argentina/Rio_Gallegos'),
- const _Timezone(zoneId: 'America/Argentina/San_Juan'),
- const _Timezone(zoneId: 'America/Argentina/Tucuman'),
- const _Timezone(zoneId: 'America/Argentina/Ushuaia'),
- const _Timezone(zoneId: 'America/Aruba'),
- const _Timezone(zoneId: 'America/Asuncion'),
- const _Timezone(zoneId: 'America/Atikokan'),
- const _Timezone(zoneId: 'America/Atka'),
- const _Timezone(zoneId: 'America/Bahia'),
- const _Timezone(zoneId: 'America/Barbados'),
- const _Timezone(zoneId: 'America/Belem'),
- const _Timezone(zoneId: 'America/Belize'),
- const _Timezone(zoneId: 'America/Blanc-Sablon'),
- const _Timezone(zoneId: 'America/Boa_Vista'),
- const _Timezone(zoneId: 'America/Bogota'),
- const _Timezone(zoneId: 'America/Boise'),
- const _Timezone(zoneId: 'America/Buenos_Aires'),
- const _Timezone(zoneId: 'America/Cambridge_Bay'),
- const _Timezone(zoneId: 'America/Campo_Grande'),
- const _Timezone(zoneId: 'America/Cancun'),
- const _Timezone(zoneId: 'America/Caracas'),
- const _Timezone(zoneId: 'America/Catamarca'),
- const _Timezone(zoneId: 'America/Cayenne'),
- const _Timezone(zoneId: 'America/Cayman'),
- const _Timezone(zoneId: 'America/Chicago'),
- const _Timezone(zoneId: 'America/Chihuahua'),
- const _Timezone(zoneId: 'America/Coral_Harbour'),
- const _Timezone(zoneId: 'America/Cordoba'),
- const _Timezone(zoneId: 'America/Costa_Rica'),
- const _Timezone(zoneId: 'America/Cuiaba'),
- const _Timezone(zoneId: 'America/Curacao'),
- const _Timezone(zoneId: 'America/Danmarkshavn'),
- const _Timezone(zoneId: 'America/Dawson'),
- const _Timezone(zoneId: 'America/Dawson_Creek'),
- const _Timezone(zoneId: 'America/Denver'),
- const _Timezone(zoneId: 'America/Detroit'),
- const _Timezone(zoneId: 'America/Dominica'),
- const _Timezone(zoneId: 'America/Edmonton'),
- const _Timezone(zoneId: 'America/Eirunepe'),
- const _Timezone(zoneId: 'America/El_Salvador'),
- const _Timezone(zoneId: 'America/Ensenada'),
- const _Timezone(zoneId: 'America/Fort_Wayne'),
- const _Timezone(zoneId: 'America/Fortaleza'),
- const _Timezone(zoneId: 'America/Glace_Bay'),
- const _Timezone(zoneId: 'America/Godthab'),
- const _Timezone(zoneId: 'America/Goose_Bay'),
- const _Timezone(zoneId: 'America/Grand_Turk'),
- const _Timezone(zoneId: 'America/Grenada'),
- const _Timezone(zoneId: 'America/Guadeloupe'),
- const _Timezone(zoneId: 'America/Guatemala'),
- const _Timezone(zoneId: 'America/Guayaquil'),
- const _Timezone(zoneId: 'America/Guyana'),
- const _Timezone(zoneId: 'America/Halifax'),
- const _Timezone(zoneId: 'America/Havana'),
- const _Timezone(zoneId: 'America/Hermosillo'),
- const _Timezone(zoneId: 'America/Indiana/Indianapolis'),
- const _Timezone(zoneId: 'America/Indiana/Knox'),
- const _Timezone(zoneId: 'America/Indiana/Marengo'),
- const _Timezone(zoneId: 'America/Indiana/Petersburg'),
- const _Timezone(zoneId: 'America/Indiana/Tell_City'),
- const _Timezone(zoneId: 'America/Indiana/Vevay'),
- const _Timezone(zoneId: 'America/Indiana/Vincennes'),
- const _Timezone(zoneId: 'America/Indiana/Winamac'),
- const _Timezone(zoneId: 'America/Indianapolis'),
- const _Timezone(zoneId: 'America/Inuvik'),
- const _Timezone(zoneId: 'America/Iqaluit'),
- const _Timezone(zoneId: 'America/Jamaica'),
- const _Timezone(zoneId: 'America/Jujuy'),
- const _Timezone(zoneId: 'America/Juneau'),
- const _Timezone(zoneId: 'America/Kentucky/Louisville'),
- const _Timezone(zoneId: 'America/Kentucky/Monticello'),
- const _Timezone(zoneId: 'America/Knox_IN'),
- const _Timezone(zoneId: 'America/La_Paz'),
- const _Timezone(zoneId: 'America/Lima'),
- const _Timezone(zoneId: 'America/Los_Angeles'),
- const _Timezone(zoneId: 'America/Louisville'),
- const _Timezone(zoneId: 'America/Maceio'),
- const _Timezone(zoneId: 'America/Managua'),
- const _Timezone(zoneId: 'America/Manaus'),
- const _Timezone(zoneId: 'America/Marigot'),
- const _Timezone(zoneId: 'America/Martinique'),
- const _Timezone(zoneId: 'America/Mazatlan'),
- const _Timezone(zoneId: 'America/Mendoza'),
- const _Timezone(zoneId: 'America/Menominee'),
- const _Timezone(zoneId: 'America/Merida'),
- const _Timezone(zoneId: 'America/Mexico_City'),
- const _Timezone(zoneId: 'America/Miquelon'),
- const _Timezone(zoneId: 'America/Moncton'),
- const _Timezone(zoneId: 'America/Monterrey'),
- const _Timezone(zoneId: 'America/Montevideo'),
- const _Timezone(zoneId: 'America/Montreal'),
- const _Timezone(zoneId: 'America/Montserrat'),
- const _Timezone(zoneId: 'America/Nassau'),
- const _Timezone(zoneId: 'America/New_York'),
- const _Timezone(zoneId: 'America/Nipigon'),
- const _Timezone(zoneId: 'America/Nome'),
- const _Timezone(zoneId: 'America/Noronha'),
- const _Timezone(zoneId: 'America/North_Dakota/Center'),
- const _Timezone(zoneId: 'America/North_Dakota/New_Salem'),
- const _Timezone(zoneId: 'America/Panama'),
- const _Timezone(zoneId: 'America/Pangnirtung'),
- const _Timezone(zoneId: 'America/Paramaribo'),
- const _Timezone(zoneId: 'America/Phoenix'),
- const _Timezone(zoneId: 'America/Port-au-Prince'),
- const _Timezone(zoneId: 'America/Port_of_Spain'),
- const _Timezone(zoneId: 'America/Porto_Acre'),
- const _Timezone(zoneId: 'America/Porto_Velho'),
- const _Timezone(zoneId: 'America/Puerto_Rico'),
- const _Timezone(zoneId: 'America/Rainy_River'),
- const _Timezone(zoneId: 'America/Rankin_Inlet'),
- const _Timezone(zoneId: 'America/Recife'),
- const _Timezone(zoneId: 'America/Regina'),
- const _Timezone(zoneId: 'America/Resolute'),
- const _Timezone(zoneId: 'America/Rio_Branco'),
- const _Timezone(zoneId: 'America/Rosario'),
- const _Timezone(zoneId: 'America/Santiago'),
- const _Timezone(zoneId: 'America/Santo_Domingo'),
- const _Timezone(zoneId: 'America/Sao_Paulo'),
- const _Timezone(zoneId: 'America/Scoresbysund'),
- const _Timezone(zoneId: 'America/Shiprock'),
- const _Timezone(zoneId: 'America/St_Barthelemy'),
- const _Timezone(zoneId: 'America/St_Johns'),
- const _Timezone(zoneId: 'America/St_Kitts'),
- const _Timezone(zoneId: 'America/St_Lucia'),
- const _Timezone(zoneId: 'America/St_Thomas'),
- const _Timezone(zoneId: 'America/St_Vincent'),
- const _Timezone(zoneId: 'America/Swift_Current'),
- const _Timezone(zoneId: 'America/Tegucigalpa'),
- const _Timezone(zoneId: 'America/Thule'),
- const _Timezone(zoneId: 'America/Thunder_Bay'),
- const _Timezone(zoneId: 'America/Tijuana'),
- const _Timezone(zoneId: 'America/Toronto'),
- const _Timezone(zoneId: 'America/Tortola'),
- const _Timezone(zoneId: 'America/Vancouver'),
- const _Timezone(zoneId: 'America/Virgin'),
- const _Timezone(zoneId: 'America/Whitehorse'),
- const _Timezone(zoneId: 'America/Winnipeg'),
- const _Timezone(zoneId: 'America/Yakutat'),
- const _Timezone(zoneId: 'America/Yellowknife'),
- const _Timezone(zoneId: 'Antarctica/Casey'),
- const _Timezone(zoneId: 'Antarctica/Davis'),
- const _Timezone(zoneId: 'Antarctica/DumontDUrville'),
- const _Timezone(zoneId: 'Antarctica/Mawson'),
- const _Timezone(zoneId: 'Antarctica/McMurdo'),
- const _Timezone(zoneId: 'Antarctica/Palmer'),
- const _Timezone(zoneId: 'Antarctica/Rothera'),
- const _Timezone(zoneId: 'Antarctica/South_Pole'),
- const _Timezone(zoneId: 'Antarctica/Syowa'),
- const _Timezone(zoneId: 'Antarctica/Vostok'),
- const _Timezone(zoneId: 'Arctic/Longyearbyen'),
- const _Timezone(zoneId: 'Asia/Aden'),
- const _Timezone(zoneId: 'Asia/Almaty'),
- const _Timezone(zoneId: 'Asia/Amman'),
- const _Timezone(zoneId: 'Asia/Anadyr'),
- const _Timezone(zoneId: 'Asia/Aqtau'),
- const _Timezone(zoneId: 'Asia/Aqtobe'),
- const _Timezone(zoneId: 'Asia/Ashgabat'),
- const _Timezone(zoneId: 'Asia/Ashkhabad'),
- const _Timezone(zoneId: 'Asia/Baghdad'),
- const _Timezone(zoneId: 'Asia/Bahrain'),
- const _Timezone(zoneId: 'Asia/Baku'),
- const _Timezone(zoneId: 'Asia/Bangkok'),
- const _Timezone(zoneId: 'Asia/Beirut'),
- const _Timezone(zoneId: 'Asia/Bishkek'),
- const _Timezone(zoneId: 'Asia/Brunei'),
- const _Timezone(zoneId: 'Asia/Calcutta'),
- const _Timezone(zoneId: 'Asia/Choibalsan'),
- const _Timezone(zoneId: 'Asia/Chongqing'),
- const _Timezone(zoneId: 'Asia/Chungking'),
- const _Timezone(zoneId: 'Asia/Colombo'),
- const _Timezone(zoneId: 'Asia/Dacca'),
- const _Timezone(zoneId: 'Asia/Damascus'),
- const _Timezone(zoneId: 'Asia/Dhaka'),
- const _Timezone(zoneId: 'Asia/Dili'),
- const _Timezone(zoneId: 'Asia/Dubai'),
- const _Timezone(zoneId: 'Asia/Dushanbe'),
- const _Timezone(zoneId: 'Asia/Gaza'),
- const _Timezone(zoneId: 'Asia/Harbin'),
- const _Timezone(zoneId: 'Asia/Hong_Kong'),
- const _Timezone(zoneId: 'Asia/Hovd'),
- const _Timezone(zoneId: 'Asia/Irkutsk'),
- const _Timezone(zoneId: 'Asia/Istanbul'),
- const _Timezone(zoneId: 'Asia/Jakarta'),
- const _Timezone(zoneId: 'Asia/Jayapura'),
- const _Timezone(zoneId: 'Asia/Jerusalem'),
- const _Timezone(zoneId: 'Asia/Kabul'),
- const _Timezone(zoneId: 'Asia/Kamchatka'),
- const _Timezone(zoneId: 'Asia/Karachi'),
- const _Timezone(zoneId: 'Asia/Kashgar'),
- const _Timezone(zoneId: 'Asia/Katmandu'),
- const _Timezone(zoneId: 'Asia/Krasnoyarsk'),
- const _Timezone(zoneId: 'Asia/Kuala_Lumpur'),
- const _Timezone(zoneId: 'Asia/Kuching'),
- const _Timezone(zoneId: 'Asia/Kuwait'),
- const _Timezone(zoneId: 'Asia/Macao'),
- const _Timezone(zoneId: 'Asia/Macau'),
- const _Timezone(zoneId: 'Asia/Magadan'),
- const _Timezone(zoneId: 'Asia/Makassar'),
- const _Timezone(zoneId: 'Asia/Manila'),
- const _Timezone(zoneId: 'Asia/Muscat'),
- const _Timezone(zoneId: 'Asia/Nicosia'),
- const _Timezone(zoneId: 'Asia/Novosibirsk'),
- const _Timezone(zoneId: 'Asia/Omsk'),
- const _Timezone(zoneId: 'Asia/Oral'),
- const _Timezone(zoneId: 'Asia/Phnom_Penh'),
- const _Timezone(zoneId: 'Asia/Pontianak'),
- const _Timezone(zoneId: 'Asia/Pyongyang'),
- const _Timezone(zoneId: 'Asia/Qatar'),
- const _Timezone(zoneId: 'Asia/Qyzylorda'),
- const _Timezone(zoneId: 'Asia/Rangoon'),
- const _Timezone(zoneId: 'Asia/Riyadh'),
- const _Timezone(zoneId: 'Asia/Riyadh87'),
- const _Timezone(zoneId: 'Asia/Riyadh88'),
- const _Timezone(zoneId: 'Asia/Riyadh89'),
- const _Timezone(zoneId: 'Asia/Saigon'),
- const _Timezone(zoneId: 'Asia/Sakhalin'),
- const _Timezone(zoneId: 'Asia/Samarkand'),
- const _Timezone(zoneId: 'Asia/Seoul'),
- const _Timezone(zoneId: 'Asia/Shanghai'),
- const _Timezone(zoneId: 'Asia/Singapore'),
- const _Timezone(zoneId: 'Asia/Taipei'),
- const _Timezone(zoneId: 'Asia/Tashkent'),
- const _Timezone(zoneId: 'Asia/Tbilisi'),
- const _Timezone(zoneId: 'Asia/Tehran'),
- const _Timezone(zoneId: 'Asia/Tel_Aviv'),
- const _Timezone(zoneId: 'Asia/Thimbu'),
- const _Timezone(zoneId: 'Asia/Thimphu'),
- const _Timezone(zoneId: 'Asia/Tokyo'),
- const _Timezone(zoneId: 'Asia/Ujung_Pandang'),
- const _Timezone(zoneId: 'Asia/Ulaanbaatar'),
- const _Timezone(zoneId: 'Asia/Ulan_Bator'),
- const _Timezone(zoneId: 'Asia/Urumqi'),
- const _Timezone(zoneId: 'Asia/Vientiane'),
- const _Timezone(zoneId: 'Asia/Vladivostok'),
- const _Timezone(zoneId: 'Asia/Yakutsk'),
- const _Timezone(zoneId: 'Asia/Yekaterinburg'),
- const _Timezone(zoneId: 'Asia/Yerevan'),
- const _Timezone(zoneId: 'Atlantic/Azores'),
- const _Timezone(zoneId: 'Atlantic/Bermuda'),
- const _Timezone(zoneId: 'Atlantic/Canary'),
- const _Timezone(zoneId: 'Atlantic/Cape_Verde'),
- const _Timezone(zoneId: 'Atlantic/Faeroe'),
- const _Timezone(zoneId: 'Atlantic/Faroe'),
- const _Timezone(zoneId: 'Atlantic/Jan_Mayen'),
- const _Timezone(zoneId: 'Atlantic/Madeira'),
- const _Timezone(zoneId: 'Atlantic/Reykjavik'),
- const _Timezone(zoneId: 'Atlantic/South_Georgia'),
- const _Timezone(zoneId: 'Atlantic/St_Helena'),
- const _Timezone(zoneId: 'Atlantic/Stanley'),
- const _Timezone(zoneId: 'Australia/ACT'),
- const _Timezone(zoneId: 'Australia/Adelaide'),
- const _Timezone(zoneId: 'Australia/Brisbane'),
- const _Timezone(zoneId: 'Australia/Broken_Hill'),
- const _Timezone(zoneId: 'Australia/Canberra'),
- const _Timezone(zoneId: 'Australia/Currie'),
- const _Timezone(zoneId: 'Australia/Darwin'),
- const _Timezone(zoneId: 'Australia/Eucla'),
- const _Timezone(zoneId: 'Australia/Hobart'),
- const _Timezone(zoneId: 'Australia/LHI'),
- const _Timezone(zoneId: 'Australia/Lindeman'),
- const _Timezone(zoneId: 'Australia/Lord_Howe'),
- const _Timezone(zoneId: 'Australia/Melbourne'),
- const _Timezone(zoneId: 'Australia/NSW'),
- const _Timezone(zoneId: 'Australia/North'),
- const _Timezone(zoneId: 'Australia/Perth'),
- const _Timezone(zoneId: 'Australia/Queensland'),
- const _Timezone(zoneId: 'Australia/South'),
- const _Timezone(zoneId: 'Australia/Sydney'),
- const _Timezone(zoneId: 'Australia/Tasmania'),
- const _Timezone(zoneId: 'Australia/Victoria'),
- const _Timezone(zoneId: 'Australia/West'),
- const _Timezone(zoneId: 'Australia/Yancowinna'),
- const _Timezone(zoneId: 'Brazil/Acre'),
- const _Timezone(zoneId: 'Brazil/DeNoronha'),
- const _Timezone(zoneId: 'Brazil/East'),
- const _Timezone(zoneId: 'Brazil/West'),
- const _Timezone(zoneId: 'CET'),
- const _Timezone(zoneId: 'CST6CDT'),
- const _Timezone(zoneId: 'Canada/Atlantic'),
- const _Timezone(zoneId: 'Canada/Central'),
- const _Timezone(zoneId: 'Canada/East-Saskatchewan'),
- const _Timezone(zoneId: 'Canada/Eastern'),
- const _Timezone(zoneId: 'Canada/Mountain'),
- const _Timezone(zoneId: 'Canada/Newfoundland'),
- const _Timezone(zoneId: 'Canada/Pacific'),
- const _Timezone(zoneId: 'Canada/Saskatchewan'),
- const _Timezone(zoneId: 'Canada/Yukon'),
- const _Timezone(zoneId: 'Chile/Continental'),
- const _Timezone(zoneId: 'Chile/EasterIsland'),
- const _Timezone(zoneId: 'Cuba'),
- const _Timezone(zoneId: 'EET'),
- const _Timezone(zoneId: 'EST'),
- const _Timezone(zoneId: 'EST5EDT'),
- const _Timezone(zoneId: 'Egypt'),
- const _Timezone(zoneId: 'Eire'),
- const _Timezone(zoneId: 'Etc/GMT'),
- const _Timezone(zoneId: 'Etc/GMT+0'),
- const _Timezone(zoneId: 'Etc/GMT+1'),
- const _Timezone(zoneId: 'Etc/GMT+10'),
- const _Timezone(zoneId: 'Etc/GMT+11'),
- const _Timezone(zoneId: 'Etc/GMT+12'),
- const _Timezone(zoneId: 'Etc/GMT+2'),
- const _Timezone(zoneId: 'Etc/GMT+3'),
- const _Timezone(zoneId: 'Etc/GMT+4'),
- const _Timezone(zoneId: 'Etc/GMT+5'),
- const _Timezone(zoneId: 'Etc/GMT+6'),
- const _Timezone(zoneId: 'Etc/GMT+7'),
- const _Timezone(zoneId: 'Etc/GMT+8'),
- const _Timezone(zoneId: 'Etc/GMT+9'),
- const _Timezone(zoneId: 'Etc/GMT-0'),
- const _Timezone(zoneId: 'Etc/GMT-1'),
- const _Timezone(zoneId: 'Etc/GMT-10'),
- const _Timezone(zoneId: 'Etc/GMT-11'),
- const _Timezone(zoneId: 'Etc/GMT-12'),
- const _Timezone(zoneId: 'Etc/GMT-13'),
- const _Timezone(zoneId: 'Etc/GMT-14'),
- const _Timezone(zoneId: 'Etc/GMT-2'),
- const _Timezone(zoneId: 'Etc/GMT-3'),
- const _Timezone(zoneId: 'Etc/GMT-4'),
- const _Timezone(zoneId: 'Etc/GMT-5'),
- const _Timezone(zoneId: 'Etc/GMT-6'),
- const _Timezone(zoneId: 'Etc/GMT-7'),
- const _Timezone(zoneId: 'Etc/GMT-8'),
- const _Timezone(zoneId: 'Etc/GMT-9'),
- const _Timezone(zoneId: 'Etc/GMT0'),
- const _Timezone(zoneId: 'Etc/Greenwich'),
- const _Timezone(zoneId: 'Etc/UCT'),
- const _Timezone(zoneId: 'Etc/UTC'),
- const _Timezone(zoneId: 'Etc/Universal'),
- const _Timezone(zoneId: 'Etc/Zulu'),
- const _Timezone(zoneId: 'Europe/Amsterdam'),
- const _Timezone(zoneId: 'Europe/Andorra'),
- const _Timezone(zoneId: 'Europe/Athens'),
- const _Timezone(zoneId: 'Europe/Belfast'),
- const _Timezone(zoneId: 'Europe/Belgrade'),
- const _Timezone(zoneId: 'Europe/Berlin'),
- const _Timezone(zoneId: 'Europe/Bratislava'),
- const _Timezone(zoneId: 'Europe/Brussels'),
- const _Timezone(zoneId: 'Europe/Bucharest'),
- const _Timezone(zoneId: 'Europe/Budapest'),
- const _Timezone(zoneId: 'Europe/Chisinau'),
- const _Timezone(zoneId: 'Europe/Copenhagen'),
- const _Timezone(zoneId: 'Europe/Dublin'),
- const _Timezone(zoneId: 'Europe/Gibraltar'),
- const _Timezone(zoneId: 'Europe/Guernsey'),
- const _Timezone(zoneId: 'Europe/Helsinki'),
- const _Timezone(zoneId: 'Europe/Isle_of_Man'),
- const _Timezone(zoneId: 'Europe/Istanbul'),
- const _Timezone(zoneId: 'Europe/Jersey'),
- const _Timezone(zoneId: 'Europe/Kaliningrad'),
- const _Timezone(zoneId: 'Europe/Kiev'),
- const _Timezone(zoneId: 'Europe/Lisbon'),
- const _Timezone(zoneId: 'Europe/Ljubljana'),
- const _Timezone(zoneId: 'Europe/London'),
- const _Timezone(zoneId: 'Europe/Luxembourg'),
- const _Timezone(zoneId: 'Europe/Madrid'),
- const _Timezone(zoneId: 'Europe/Malta'),
- const _Timezone(zoneId: 'Europe/Mariehamn'),
- const _Timezone(zoneId: 'Europe/Minsk'),
- const _Timezone(zoneId: 'Europe/Monaco'),
- const _Timezone(zoneId: 'Europe/Moscow'),
- const _Timezone(zoneId: 'Europe/Nicosia'),
- const _Timezone(zoneId: 'Europe/Oslo'),
- const _Timezone(zoneId: 'Europe/Podgorica'),
- const _Timezone(zoneId: 'Europe/Prague'),
- const _Timezone(zoneId: 'Europe/Riga'),
- const _Timezone(zoneId: 'Europe/Rome'),
- const _Timezone(zoneId: 'Europe/Samara'),
- const _Timezone(zoneId: 'Europe/San_Marino'),
- const _Timezone(zoneId: 'Europe/Sarajevo'),
- const _Timezone(zoneId: 'Europe/Simferopol'),
- const _Timezone(zoneId: 'Europe/Skopje'),
- const _Timezone(zoneId: 'Europe/Sofia'),
- const _Timezone(zoneId: 'Europe/Stockholm'),
- const _Timezone(zoneId: 'Europe/Tallinn'),
- const _Timezone(zoneId: 'Europe/Tirane'),
- const _Timezone(zoneId: 'Europe/Tiraspol'),
- const _Timezone(zoneId: 'Europe/Uzhgorod'),
- const _Timezone(zoneId: 'Europe/Vaduz'),
- const _Timezone(zoneId: 'Europe/Vatican'),
- const _Timezone(zoneId: 'Europe/Vienna'),
- const _Timezone(zoneId: 'Europe/Vilnius'),
- const _Timezone(zoneId: 'Europe/Volgograd'),
- const _Timezone(zoneId: 'Europe/Warsaw'),
- const _Timezone(zoneId: 'Europe/Zagreb'),
- const _Timezone(zoneId: 'Europe/Zaporozhye'),
- const _Timezone(zoneId: 'Europe/Zurich'),
- const _Timezone(zoneId: 'Factory'),
- const _Timezone(zoneId: 'GB'),
- const _Timezone(zoneId: 'GB-Eire'),
- const _Timezone(zoneId: 'GMT'),
- const _Timezone(zoneId: 'GMT+0'),
- const _Timezone(zoneId: 'GMT-0'),
- const _Timezone(zoneId: 'GMT0'),
- const _Timezone(zoneId: 'Greenwich'),
- const _Timezone(zoneId: 'HST'),
- const _Timezone(zoneId: 'Hongkong'),
- const _Timezone(zoneId: 'Iceland'),
- const _Timezone(zoneId: 'Indian/Antananarivo'),
- const _Timezone(zoneId: 'Indian/Chagos'),
- const _Timezone(zoneId: 'Indian/Christmas'),
- const _Timezone(zoneId: 'Indian/Cocos'),
- const _Timezone(zoneId: 'Indian/Comoro'),
- const _Timezone(zoneId: 'Indian/Kerguelen'),
- const _Timezone(zoneId: 'Indian/Mahe'),
- const _Timezone(zoneId: 'Indian/Maldives'),
- const _Timezone(zoneId: 'Indian/Mauritius'),
- const _Timezone(zoneId: 'Indian/Mayotte'),
- const _Timezone(zoneId: 'Indian/Reunion'),
- const _Timezone(zoneId: 'Iran'),
- const _Timezone(zoneId: 'Israel'),
- const _Timezone(zoneId: 'Jamaica'),
- const _Timezone(zoneId: 'Japan'),
- const _Timezone(zoneId: 'Kwajalein'),
- const _Timezone(zoneId: 'Libya'),
- const _Timezone(zoneId: 'MET'),
- const _Timezone(zoneId: 'MST'),
- const _Timezone(zoneId: 'MST7MDT'),
- const _Timezone(zoneId: 'Mexico/BajaNorte'),
- const _Timezone(zoneId: 'Mexico/BajaSur'),
- const _Timezone(zoneId: 'Mexico/General'),
- const _Timezone(zoneId: 'Mideast/Riyadh87'),
- const _Timezone(zoneId: 'Mideast/Riyadh88'),
- const _Timezone(zoneId: 'Mideast/Riyadh89'),
- const _Timezone(zoneId: 'NZ'),
- const _Timezone(zoneId: 'NZ-CHAT'),
- const _Timezone(zoneId: 'Navajo'),
- const _Timezone(zoneId: 'PRC'),
- const _Timezone(zoneId: 'PST8PDT'),
- const _Timezone(zoneId: 'Pacific/Apia'),
- const _Timezone(zoneId: 'Pacific/Auckland'),
- const _Timezone(zoneId: 'Pacific/Chatham'),
- const _Timezone(zoneId: 'Pacific/Easter'),
- const _Timezone(zoneId: 'Pacific/Efate'),
- const _Timezone(zoneId: 'Pacific/Enderbury'),
- const _Timezone(zoneId: 'Pacific/Fakaofo'),
- const _Timezone(zoneId: 'Pacific/Fiji'),
- const _Timezone(zoneId: 'Pacific/Funafuti'),
- const _Timezone(zoneId: 'Pacific/Galapagos'),
- const _Timezone(zoneId: 'Pacific/Gambier'),
- const _Timezone(zoneId: 'Pacific/Guadalcanal'),
- const _Timezone(zoneId: 'Pacific/Guam'),
- const _Timezone(zoneId: 'Pacific/Honolulu'),
- const _Timezone(zoneId: 'Pacific/Johnston'),
- const _Timezone(zoneId: 'Pacific/Kiritimati'),
- const _Timezone(zoneId: 'Pacific/Kosrae'),
- const _Timezone(zoneId: 'Pacific/Kwajalein'),
- const _Timezone(zoneId: 'Pacific/Majuro'),
- const _Timezone(zoneId: 'Pacific/Marquesas'),
- const _Timezone(zoneId: 'Pacific/Midway'),
- const _Timezone(zoneId: 'Pacific/Nauru'),
- const _Timezone(zoneId: 'Pacific/Niue'),
- const _Timezone(zoneId: 'Pacific/Norfolk'),
- const _Timezone(zoneId: 'Pacific/Noumea'),
- const _Timezone(zoneId: 'Pacific/Pago_Pago'),
- const _Timezone(zoneId: 'Pacific/Palau'),
- const _Timezone(zoneId: 'Pacific/Pitcairn'),
- const _Timezone(zoneId: 'Pacific/Ponape'),
- const _Timezone(zoneId: 'Pacific/Port_Moresby'),
- const _Timezone(zoneId: 'Pacific/Rarotonga'),
- const _Timezone(zoneId: 'Pacific/Saipan'),
- const _Timezone(zoneId: 'Pacific/Samoa'),
- const _Timezone(zoneId: 'Pacific/Tahiti'),
- const _Timezone(zoneId: 'Pacific/Tarawa'),
- const _Timezone(zoneId: 'Pacific/Tongatapu'),
- const _Timezone(zoneId: 'Pacific/Truk'),
- const _Timezone(zoneId: 'Pacific/Wake'),
- const _Timezone(zoneId: 'Pacific/Wallis'),
- const _Timezone(zoneId: 'Pacific/Yap'),
- const _Timezone(zoneId: 'Poland'),
- const _Timezone(zoneId: 'Portugal'),
- const _Timezone(zoneId: 'ROC'),
- const _Timezone(zoneId: 'ROK'),
- const _Timezone(zoneId: 'Singapore'),
- const _Timezone(zoneId: 'Turkey'),
- const _Timezone(zoneId: 'UCT'),
- const _Timezone(zoneId: 'US/Alaska'),
- const _Timezone(zoneId: 'US/Aleutian'),
- const _Timezone(zoneId: 'US/Arizona'),
- const _Timezone(zoneId: 'US/Central'),
- const _Timezone(zoneId: 'US/East-Indiana'),
- const _Timezone(zoneId: 'US/Hawaii'),
- const _Timezone(zoneId: 'US/Indiana-Starke'),
- const _Timezone(zoneId: 'US/Michigan'),
- const _Timezone(zoneId: 'US/Mountain'),
- const _Timezone(zoneId: 'US/Pacific'),
- const _Timezone(zoneId: 'US/Pacific-New'),
- const _Timezone(zoneId: 'US/Samoa'),
- const _Timezone(zoneId: 'UTC'),
- const _Timezone(zoneId: 'Universal'),
- const _Timezone(zoneId: 'W-SU'),
- const _Timezone(zoneId: 'WET'),
- const _Timezone(zoneId: 'Zulu'),
+const List<_Timezone> _kTimeZones = <_Timezone>[
+ _Timezone(zoneId: 'US/Eastern'),
+ _Timezone(zoneId: 'US/Pacific'),
+ _Timezone(zoneId: 'Europe/Paris'),
+ _Timezone(zoneId: 'Africa/Abidjan'),
+ _Timezone(zoneId: 'Africa/Accra'),
+ _Timezone(zoneId: 'Africa/Addis_Ababa'),
+ _Timezone(zoneId: 'Africa/Algiers'),
+ _Timezone(zoneId: 'Africa/Asmara'),
+ _Timezone(zoneId: 'Africa/Asmera'),
+ _Timezone(zoneId: 'Africa/Bamako'),
+ _Timezone(zoneId: 'Africa/Bangui'),
+ _Timezone(zoneId: 'Africa/Banjul'),
+ _Timezone(zoneId: 'Africa/Bissau'),
+ _Timezone(zoneId: 'Africa/Blantyre'),
+ _Timezone(zoneId: 'Africa/Brazzaville'),
+ _Timezone(zoneId: 'Africa/Bujumbura'),
+ _Timezone(zoneId: 'Africa/Cairo'),
+ _Timezone(zoneId: 'Africa/Casablanca'),
+ _Timezone(zoneId: 'Africa/Ceuta'),
+ _Timezone(zoneId: 'Africa/Conakry'),
+ _Timezone(zoneId: 'Africa/Dakar'),
+ _Timezone(zoneId: 'Africa/Dar_es_Salaam'),
+ _Timezone(zoneId: 'Africa/Djibouti'),
+ _Timezone(zoneId: 'Africa/Douala'),
+ _Timezone(zoneId: 'Africa/El_Aaiun'),
+ _Timezone(zoneId: 'Africa/Freetown'),
+ _Timezone(zoneId: 'Africa/Gaborone'),
+ _Timezone(zoneId: 'Africa/Harare'),
+ _Timezone(zoneId: 'Africa/Johannesburg'),
+ _Timezone(zoneId: 'Africa/Kampala'),
+ _Timezone(zoneId: 'Africa/Khartoum'),
+ _Timezone(zoneId: 'Africa/Kigali'),
+ _Timezone(zoneId: 'Africa/Kinshasa'),
+ _Timezone(zoneId: 'Africa/Lagos'),
+ _Timezone(zoneId: 'Africa/Libreville'),
+ _Timezone(zoneId: 'Africa/Lome'),
+ _Timezone(zoneId: 'Africa/Luanda'),
+ _Timezone(zoneId: 'Africa/Lubumbashi'),
+ _Timezone(zoneId: 'Africa/Lusaka'),
+ _Timezone(zoneId: 'Africa/Malabo'),
+ _Timezone(zoneId: 'Africa/Maputo'),
+ _Timezone(zoneId: 'Africa/Maseru'),
+ _Timezone(zoneId: 'Africa/Mbabane'),
+ _Timezone(zoneId: 'Africa/Mogadishu'),
+ _Timezone(zoneId: 'Africa/Monrovia'),
+ _Timezone(zoneId: 'Africa/Nairobi'),
+ _Timezone(zoneId: 'Africa/Ndjamena'),
+ _Timezone(zoneId: 'Africa/Niamey'),
+ _Timezone(zoneId: 'Africa/Nouakchott'),
+ _Timezone(zoneId: 'Africa/Ouagadougou'),
+ _Timezone(zoneId: 'Africa/Porto-Novo'),
+ _Timezone(zoneId: 'Africa/Sao_Tome'),
+ _Timezone(zoneId: 'Africa/Timbuktu'),
+ _Timezone(zoneId: 'Africa/Tripoli'),
+ _Timezone(zoneId: 'Africa/Tunis'),
+ _Timezone(zoneId: 'Africa/Windhoek'),
+ _Timezone(zoneId: 'America/Adak'),
+ _Timezone(zoneId: 'America/Anchorage'),
+ _Timezone(zoneId: 'America/Anguilla'),
+ _Timezone(zoneId: 'America/Antigua'),
+ _Timezone(zoneId: 'America/Araguaina'),
+ _Timezone(zoneId: 'America/Argentina/Buenos_Aires'),
+ _Timezone(zoneId: 'America/Argentina/Catamarca'),
+ _Timezone(zoneId: 'America/Argentina/ComodRivadavia'),
+ _Timezone(zoneId: 'America/Argentina/Cordoba'),
+ _Timezone(zoneId: 'America/Argentina/Jujuy'),
+ _Timezone(zoneId: 'America/Argentina/La_Rioja'),
+ _Timezone(zoneId: 'America/Argentina/Mendoza'),
+ _Timezone(zoneId: 'America/Argentina/Rio_Gallegos'),
+ _Timezone(zoneId: 'America/Argentina/San_Juan'),
+ _Timezone(zoneId: 'America/Argentina/Tucuman'),
+ _Timezone(zoneId: 'America/Argentina/Ushuaia'),
+ _Timezone(zoneId: 'America/Aruba'),
+ _Timezone(zoneId: 'America/Asuncion'),
+ _Timezone(zoneId: 'America/Atikokan'),
+ _Timezone(zoneId: 'America/Atka'),
+ _Timezone(zoneId: 'America/Bahia'),
+ _Timezone(zoneId: 'America/Barbados'),
+ _Timezone(zoneId: 'America/Belem'),
+ _Timezone(zoneId: 'America/Belize'),
+ _Timezone(zoneId: 'America/Blanc-Sablon'),
+ _Timezone(zoneId: 'America/Boa_Vista'),
+ _Timezone(zoneId: 'America/Bogota'),
+ _Timezone(zoneId: 'America/Boise'),
+ _Timezone(zoneId: 'America/Buenos_Aires'),
+ _Timezone(zoneId: 'America/Cambridge_Bay'),
+ _Timezone(zoneId: 'America/Campo_Grande'),
+ _Timezone(zoneId: 'America/Cancun'),
+ _Timezone(zoneId: 'America/Caracas'),
+ _Timezone(zoneId: 'America/Catamarca'),
+ _Timezone(zoneId: 'America/Cayenne'),
+ _Timezone(zoneId: 'America/Cayman'),
+ _Timezone(zoneId: 'America/Chicago'),
+ _Timezone(zoneId: 'America/Chihuahua'),
+ _Timezone(zoneId: 'America/Coral_Harbour'),
+ _Timezone(zoneId: 'America/Cordoba'),
+ _Timezone(zoneId: 'America/Costa_Rica'),
+ _Timezone(zoneId: 'America/Cuiaba'),
+ _Timezone(zoneId: 'America/Curacao'),
+ _Timezone(zoneId: 'America/Danmarkshavn'),
+ _Timezone(zoneId: 'America/Dawson'),
+ _Timezone(zoneId: 'America/Dawson_Creek'),
+ _Timezone(zoneId: 'America/Denver'),
+ _Timezone(zoneId: 'America/Detroit'),
+ _Timezone(zoneId: 'America/Dominica'),
+ _Timezone(zoneId: 'America/Edmonton'),
+ _Timezone(zoneId: 'America/Eirunepe'),
+ _Timezone(zoneId: 'America/El_Salvador'),
+ _Timezone(zoneId: 'America/Ensenada'),
+ _Timezone(zoneId: 'America/Fort_Wayne'),
+ _Timezone(zoneId: 'America/Fortaleza'),
+ _Timezone(zoneId: 'America/Glace_Bay'),
+ _Timezone(zoneId: 'America/Godthab'),
+ _Timezone(zoneId: 'America/Goose_Bay'),
+ _Timezone(zoneId: 'America/Grand_Turk'),
+ _Timezone(zoneId: 'America/Grenada'),
+ _Timezone(zoneId: 'America/Guadeloupe'),
+ _Timezone(zoneId: 'America/Guatemala'),
+ _Timezone(zoneId: 'America/Guayaquil'),
+ _Timezone(zoneId: 'America/Guyana'),
+ _Timezone(zoneId: 'America/Halifax'),
+ _Timezone(zoneId: 'America/Havana'),
+ _Timezone(zoneId: 'America/Hermosillo'),
+ _Timezone(zoneId: 'America/Indiana/Indianapolis'),
+ _Timezone(zoneId: 'America/Indiana/Knox'),
+ _Timezone(zoneId: 'America/Indiana/Marengo'),
+ _Timezone(zoneId: 'America/Indiana/Petersburg'),
+ _Timezone(zoneId: 'America/Indiana/Tell_City'),
+ _Timezone(zoneId: 'America/Indiana/Vevay'),
+ _Timezone(zoneId: 'America/Indiana/Vincennes'),
+ _Timezone(zoneId: 'America/Indiana/Winamac'),
+ _Timezone(zoneId: 'America/Indianapolis'),
+ _Timezone(zoneId: 'America/Inuvik'),
+ _Timezone(zoneId: 'America/Iqaluit'),
+ _Timezone(zoneId: 'America/Jamaica'),
+ _Timezone(zoneId: 'America/Jujuy'),
+ _Timezone(zoneId: 'America/Juneau'),
+ _Timezone(zoneId: 'America/Kentucky/Louisville'),
+ _Timezone(zoneId: 'America/Kentucky/Monticello'),
+ _Timezone(zoneId: 'America/Knox_IN'),
+ _Timezone(zoneId: 'America/La_Paz'),
+ _Timezone(zoneId: 'America/Lima'),
+ _Timezone(zoneId: 'America/Los_Angeles'),
+ _Timezone(zoneId: 'America/Louisville'),
+ _Timezone(zoneId: 'America/Maceio'),
+ _Timezone(zoneId: 'America/Managua'),
+ _Timezone(zoneId: 'America/Manaus'),
+ _Timezone(zoneId: 'America/Marigot'),
+ _Timezone(zoneId: 'America/Martinique'),
+ _Timezone(zoneId: 'America/Mazatlan'),
+ _Timezone(zoneId: 'America/Mendoza'),
+ _Timezone(zoneId: 'America/Menominee'),
+ _Timezone(zoneId: 'America/Merida'),
+ _Timezone(zoneId: 'America/Mexico_City'),
+ _Timezone(zoneId: 'America/Miquelon'),
+ _Timezone(zoneId: 'America/Moncton'),
+ _Timezone(zoneId: 'America/Monterrey'),
+ _Timezone(zoneId: 'America/Montevideo'),
+ _Timezone(zoneId: 'America/Montreal'),
+ _Timezone(zoneId: 'America/Montserrat'),
+ _Timezone(zoneId: 'America/Nassau'),
+ _Timezone(zoneId: 'America/New_York'),
+ _Timezone(zoneId: 'America/Nipigon'),
+ _Timezone(zoneId: 'America/Nome'),
+ _Timezone(zoneId: 'America/Noronha'),
+ _Timezone(zoneId: 'America/North_Dakota/Center'),
+ _Timezone(zoneId: 'America/North_Dakota/New_Salem'),
+ _Timezone(zoneId: 'America/Panama'),
+ _Timezone(zoneId: 'America/Pangnirtung'),
+ _Timezone(zoneId: 'America/Paramaribo'),
+ _Timezone(zoneId: 'America/Phoenix'),
+ _Timezone(zoneId: 'America/Port-au-Prince'),
+ _Timezone(zoneId: 'America/Port_of_Spain'),
+ _Timezone(zoneId: 'America/Porto_Acre'),
+ _Timezone(zoneId: 'America/Porto_Velho'),
+ _Timezone(zoneId: 'America/Puerto_Rico'),
+ _Timezone(zoneId: 'America/Rainy_River'),
+ _Timezone(zoneId: 'America/Rankin_Inlet'),
+ _Timezone(zoneId: 'America/Recife'),
+ _Timezone(zoneId: 'America/Regina'),
+ _Timezone(zoneId: 'America/Resolute'),
+ _Timezone(zoneId: 'America/Rio_Branco'),
+ _Timezone(zoneId: 'America/Rosario'),
+ _Timezone(zoneId: 'America/Santiago'),
+ _Timezone(zoneId: 'America/Santo_Domingo'),
+ _Timezone(zoneId: 'America/Sao_Paulo'),
+ _Timezone(zoneId: 'America/Scoresbysund'),
+ _Timezone(zoneId: 'America/Shiprock'),
+ _Timezone(zoneId: 'America/St_Barthelemy'),
+ _Timezone(zoneId: 'America/St_Johns'),
+ _Timezone(zoneId: 'America/St_Kitts'),
+ _Timezone(zoneId: 'America/St_Lucia'),
+ _Timezone(zoneId: 'America/St_Thomas'),
+ _Timezone(zoneId: 'America/St_Vincent'),
+ _Timezone(zoneId: 'America/Swift_Current'),
+ _Timezone(zoneId: 'America/Tegucigalpa'),
+ _Timezone(zoneId: 'America/Thule'),
+ _Timezone(zoneId: 'America/Thunder_Bay'),
+ _Timezone(zoneId: 'America/Tijuana'),
+ _Timezone(zoneId: 'America/Toronto'),
+ _Timezone(zoneId: 'America/Tortola'),
+ _Timezone(zoneId: 'America/Vancouver'),
+ _Timezone(zoneId: 'America/Virgin'),
+ _Timezone(zoneId: 'America/Whitehorse'),
+ _Timezone(zoneId: 'America/Winnipeg'),
+ _Timezone(zoneId: 'America/Yakutat'),
+ _Timezone(zoneId: 'America/Yellowknife'),
+ _Timezone(zoneId: 'Antarctica/Casey'),
+ _Timezone(zoneId: 'Antarctica/Davis'),
+ _Timezone(zoneId: 'Antarctica/DumontDUrville'),
+ _Timezone(zoneId: 'Antarctica/Mawson'),
+ _Timezone(zoneId: 'Antarctica/McMurdo'),
+ _Timezone(zoneId: 'Antarctica/Palmer'),
+ _Timezone(zoneId: 'Antarctica/Rothera'),
+ _Timezone(zoneId: 'Antarctica/South_Pole'),
+ _Timezone(zoneId: 'Antarctica/Syowa'),
+ _Timezone(zoneId: 'Antarctica/Vostok'),
+ _Timezone(zoneId: 'Arctic/Longyearbyen'),
+ _Timezone(zoneId: 'Asia/Aden'),
+ _Timezone(zoneId: 'Asia/Almaty'),
+ _Timezone(zoneId: 'Asia/Amman'),
+ _Timezone(zoneId: 'Asia/Anadyr'),
+ _Timezone(zoneId: 'Asia/Aqtau'),
+ _Timezone(zoneId: 'Asia/Aqtobe'),
+ _Timezone(zoneId: 'Asia/Ashgabat'),
+ _Timezone(zoneId: 'Asia/Ashkhabad'),
+ _Timezone(zoneId: 'Asia/Baghdad'),
+ _Timezone(zoneId: 'Asia/Bahrain'),
+ _Timezone(zoneId: 'Asia/Baku'),
+ _Timezone(zoneId: 'Asia/Bangkok'),
+ _Timezone(zoneId: 'Asia/Beirut'),
+ _Timezone(zoneId: 'Asia/Bishkek'),
+ _Timezone(zoneId: 'Asia/Brunei'),
+ _Timezone(zoneId: 'Asia/Calcutta'),
+ _Timezone(zoneId: 'Asia/Choibalsan'),
+ _Timezone(zoneId: 'Asia/Chongqing'),
+ _Timezone(zoneId: 'Asia/Chungking'),
+ _Timezone(zoneId: 'Asia/Colombo'),
+ _Timezone(zoneId: 'Asia/Dacca'),
+ _Timezone(zoneId: 'Asia/Damascus'),
+ _Timezone(zoneId: 'Asia/Dhaka'),
+ _Timezone(zoneId: 'Asia/Dili'),
+ _Timezone(zoneId: 'Asia/Dubai'),
+ _Timezone(zoneId: 'Asia/Dushanbe'),
+ _Timezone(zoneId: 'Asia/Gaza'),
+ _Timezone(zoneId: 'Asia/Harbin'),
+ _Timezone(zoneId: 'Asia/Hong_Kong'),
+ _Timezone(zoneId: 'Asia/Hovd'),
+ _Timezone(zoneId: 'Asia/Irkutsk'),
+ _Timezone(zoneId: 'Asia/Istanbul'),
+ _Timezone(zoneId: 'Asia/Jakarta'),
+ _Timezone(zoneId: 'Asia/Jayapura'),
+ _Timezone(zoneId: 'Asia/Jerusalem'),
+ _Timezone(zoneId: 'Asia/Kabul'),
+ _Timezone(zoneId: 'Asia/Kamchatka'),
+ _Timezone(zoneId: 'Asia/Karachi'),
+ _Timezone(zoneId: 'Asia/Kashgar'),
+ _Timezone(zoneId: 'Asia/Katmandu'),
+ _Timezone(zoneId: 'Asia/Krasnoyarsk'),
+ _Timezone(zoneId: 'Asia/Kuala_Lumpur'),
+ _Timezone(zoneId: 'Asia/Kuching'),
+ _Timezone(zoneId: 'Asia/Kuwait'),
+ _Timezone(zoneId: 'Asia/Macao'),
+ _Timezone(zoneId: 'Asia/Macau'),
+ _Timezone(zoneId: 'Asia/Magadan'),
+ _Timezone(zoneId: 'Asia/Makassar'),
+ _Timezone(zoneId: 'Asia/Manila'),
+ _Timezone(zoneId: 'Asia/Muscat'),
+ _Timezone(zoneId: 'Asia/Nicosia'),
+ _Timezone(zoneId: 'Asia/Novosibirsk'),
+ _Timezone(zoneId: 'Asia/Omsk'),
+ _Timezone(zoneId: 'Asia/Oral'),
+ _Timezone(zoneId: 'Asia/Phnom_Penh'),
+ _Timezone(zoneId: 'Asia/Pontianak'),
+ _Timezone(zoneId: 'Asia/Pyongyang'),
+ _Timezone(zoneId: 'Asia/Qatar'),
+ _Timezone(zoneId: 'Asia/Qyzylorda'),
+ _Timezone(zoneId: 'Asia/Rangoon'),
+ _Timezone(zoneId: 'Asia/Riyadh'),
+ _Timezone(zoneId: 'Asia/Riyadh87'),
+ _Timezone(zoneId: 'Asia/Riyadh88'),
+ _Timezone(zoneId: 'Asia/Riyadh89'),
+ _Timezone(zoneId: 'Asia/Saigon'),
+ _Timezone(zoneId: 'Asia/Sakhalin'),
+ _Timezone(zoneId: 'Asia/Samarkand'),
+ _Timezone(zoneId: 'Asia/Seoul'),
+ _Timezone(zoneId: 'Asia/Shanghai'),
+ _Timezone(zoneId: 'Asia/Singapore'),
+ _Timezone(zoneId: 'Asia/Taipei'),
+ _Timezone(zoneId: 'Asia/Tashkent'),
+ _Timezone(zoneId: 'Asia/Tbilisi'),
+ _Timezone(zoneId: 'Asia/Tehran'),
+ _Timezone(zoneId: 'Asia/Tel_Aviv'),
+ _Timezone(zoneId: 'Asia/Thimbu'),
+ _Timezone(zoneId: 'Asia/Thimphu'),
+ _Timezone(zoneId: 'Asia/Tokyo'),
+ _Timezone(zoneId: 'Asia/Ujung_Pandang'),
+ _Timezone(zoneId: 'Asia/Ulaanbaatar'),
+ _Timezone(zoneId: 'Asia/Ulan_Bator'),
+ _Timezone(zoneId: 'Asia/Urumqi'),
+ _Timezone(zoneId: 'Asia/Vientiane'),
+ _Timezone(zoneId: 'Asia/Vladivostok'),
+ _Timezone(zoneId: 'Asia/Yakutsk'),
+ _Timezone(zoneId: 'Asia/Yekaterinburg'),
+ _Timezone(zoneId: 'Asia/Yerevan'),
+ _Timezone(zoneId: 'Atlantic/Azores'),
+ _Timezone(zoneId: 'Atlantic/Bermuda'),
+ _Timezone(zoneId: 'Atlantic/Canary'),
+ _Timezone(zoneId: 'Atlantic/Cape_Verde'),
+ _Timezone(zoneId: 'Atlantic/Faeroe'),
+ _Timezone(zoneId: 'Atlantic/Faroe'),
+ _Timezone(zoneId: 'Atlantic/Jan_Mayen'),
+ _Timezone(zoneId: 'Atlantic/Madeira'),
+ _Timezone(zoneId: 'Atlantic/Reykjavik'),
+ _Timezone(zoneId: 'Atlantic/South_Georgia'),
+ _Timezone(zoneId: 'Atlantic/St_Helena'),
+ _Timezone(zoneId: 'Atlantic/Stanley'),
+ _Timezone(zoneId: 'Australia/ACT'),
+ _Timezone(zoneId: 'Australia/Adelaide'),
+ _Timezone(zoneId: 'Australia/Brisbane'),
+ _Timezone(zoneId: 'Australia/Broken_Hill'),
+ _Timezone(zoneId: 'Australia/Canberra'),
+ _Timezone(zoneId: 'Australia/Currie'),
+ _Timezone(zoneId: 'Australia/Darwin'),
+ _Timezone(zoneId: 'Australia/Eucla'),
+ _Timezone(zoneId: 'Australia/Hobart'),
+ _Timezone(zoneId: 'Australia/LHI'),
+ _Timezone(zoneId: 'Australia/Lindeman'),
+ _Timezone(zoneId: 'Australia/Lord_Howe'),
+ _Timezone(zoneId: 'Australia/Melbourne'),
+ _Timezone(zoneId: 'Australia/NSW'),
+ _Timezone(zoneId: 'Australia/North'),
+ _Timezone(zoneId: 'Australia/Perth'),
+ _Timezone(zoneId: 'Australia/Queensland'),
+ _Timezone(zoneId: 'Australia/South'),
+ _Timezone(zoneId: 'Australia/Sydney'),
+ _Timezone(zoneId: 'Australia/Tasmania'),
+ _Timezone(zoneId: 'Australia/Victoria'),
+ _Timezone(zoneId: 'Australia/West'),
+ _Timezone(zoneId: 'Australia/Yancowinna'),
+ _Timezone(zoneId: 'Brazil/Acre'),
+ _Timezone(zoneId: 'Brazil/DeNoronha'),
+ _Timezone(zoneId: 'Brazil/East'),
+ _Timezone(zoneId: 'Brazil/West'),
+ _Timezone(zoneId: 'CET'),
+ _Timezone(zoneId: 'CST6CDT'),
+ _Timezone(zoneId: 'Canada/Atlantic'),
+ _Timezone(zoneId: 'Canada/Central'),
+ _Timezone(zoneId: 'Canada/East-Saskatchewan'),
+ _Timezone(zoneId: 'Canada/Eastern'),
+ _Timezone(zoneId: 'Canada/Mountain'),
+ _Timezone(zoneId: 'Canada/Newfoundland'),
+ _Timezone(zoneId: 'Canada/Pacific'),
+ _Timezone(zoneId: 'Canada/Saskatchewan'),
+ _Timezone(zoneId: 'Canada/Yukon'),
+ _Timezone(zoneId: 'Chile/Continental'),
+ _Timezone(zoneId: 'Chile/EasterIsland'),
+ _Timezone(zoneId: 'Cuba'),
+ _Timezone(zoneId: 'EET'),
+ _Timezone(zoneId: 'EST'),
+ _Timezone(zoneId: 'EST5EDT'),
+ _Timezone(zoneId: 'Egypt'),
+ _Timezone(zoneId: 'Eire'),
+ _Timezone(zoneId: 'Etc/GMT'),
+ _Timezone(zoneId: 'Etc/GMT+0'),
+ _Timezone(zoneId: 'Etc/GMT+1'),
+ _Timezone(zoneId: 'Etc/GMT+10'),
+ _Timezone(zoneId: 'Etc/GMT+11'),
+ _Timezone(zoneId: 'Etc/GMT+12'),
+ _Timezone(zoneId: 'Etc/GMT+2'),
+ _Timezone(zoneId: 'Etc/GMT+3'),
+ _Timezone(zoneId: 'Etc/GMT+4'),
+ _Timezone(zoneId: 'Etc/GMT+5'),
+ _Timezone(zoneId: 'Etc/GMT+6'),
+ _Timezone(zoneId: 'Etc/GMT+7'),
+ _Timezone(zoneId: 'Etc/GMT+8'),
+ _Timezone(zoneId: 'Etc/GMT+9'),
+ _Timezone(zoneId: 'Etc/GMT-0'),
+ _Timezone(zoneId: 'Etc/GMT-1'),
+ _Timezone(zoneId: 'Etc/GMT-10'),
+ _Timezone(zoneId: 'Etc/GMT-11'),
+ _Timezone(zoneId: 'Etc/GMT-12'),
+ _Timezone(zoneId: 'Etc/GMT-13'),
+ _Timezone(zoneId: 'Etc/GMT-14'),
+ _Timezone(zoneId: 'Etc/GMT-2'),
+ _Timezone(zoneId: 'Etc/GMT-3'),
+ _Timezone(zoneId: 'Etc/GMT-4'),
+ _Timezone(zoneId: 'Etc/GMT-5'),
+ _Timezone(zoneId: 'Etc/GMT-6'),
+ _Timezone(zoneId: 'Etc/GMT-7'),
+ _Timezone(zoneId: 'Etc/GMT-8'),
+ _Timezone(zoneId: 'Etc/GMT-9'),
+ _Timezone(zoneId: 'Etc/GMT0'),
+ _Timezone(zoneId: 'Etc/Greenwich'),
+ _Timezone(zoneId: 'Etc/UCT'),
+ _Timezone(zoneId: 'Etc/UTC'),
+ _Timezone(zoneId: 'Etc/Universal'),
+ _Timezone(zoneId: 'Etc/Zulu'),
+ _Timezone(zoneId: 'Europe/Amsterdam'),
+ _Timezone(zoneId: 'Europe/Andorra'),
+ _Timezone(zoneId: 'Europe/Athens'),
+ _Timezone(zoneId: 'Europe/Belfast'),
+ _Timezone(zoneId: 'Europe/Belgrade'),
+ _Timezone(zoneId: 'Europe/Berlin'),
+ _Timezone(zoneId: 'Europe/Bratislava'),
+ _Timezone(zoneId: 'Europe/Brussels'),
+ _Timezone(zoneId: 'Europe/Bucharest'),
+ _Timezone(zoneId: 'Europe/Budapest'),
+ _Timezone(zoneId: 'Europe/Chisinau'),
+ _Timezone(zoneId: 'Europe/Copenhagen'),
+ _Timezone(zoneId: 'Europe/Dublin'),
+ _Timezone(zoneId: 'Europe/Gibraltar'),
+ _Timezone(zoneId: 'Europe/Guernsey'),
+ _Timezone(zoneId: 'Europe/Helsinki'),
+ _Timezone(zoneId: 'Europe/Isle_of_Man'),
+ _Timezone(zoneId: 'Europe/Istanbul'),
+ _Timezone(zoneId: 'Europe/Jersey'),
+ _Timezone(zoneId: 'Europe/Kaliningrad'),
+ _Timezone(zoneId: 'Europe/Kiev'),
+ _Timezone(zoneId: 'Europe/Lisbon'),
+ _Timezone(zoneId: 'Europe/Ljubljana'),
+ _Timezone(zoneId: 'Europe/London'),
+ _Timezone(zoneId: 'Europe/Luxembourg'),
+ _Timezone(zoneId: 'Europe/Madrid'),
+ _Timezone(zoneId: 'Europe/Malta'),
+ _Timezone(zoneId: 'Europe/Mariehamn'),
+ _Timezone(zoneId: 'Europe/Minsk'),
+ _Timezone(zoneId: 'Europe/Monaco'),
+ _Timezone(zoneId: 'Europe/Moscow'),
+ _Timezone(zoneId: 'Europe/Nicosia'),
+ _Timezone(zoneId: 'Europe/Oslo'),
+ _Timezone(zoneId: 'Europe/Podgorica'),
+ _Timezone(zoneId: 'Europe/Prague'),
+ _Timezone(zoneId: 'Europe/Riga'),
+ _Timezone(zoneId: 'Europe/Rome'),
+ _Timezone(zoneId: 'Europe/Samara'),
+ _Timezone(zoneId: 'Europe/San_Marino'),
+ _Timezone(zoneId: 'Europe/Sarajevo'),
+ _Timezone(zoneId: 'Europe/Simferopol'),
+ _Timezone(zoneId: 'Europe/Skopje'),
+ _Timezone(zoneId: 'Europe/Sofia'),
+ _Timezone(zoneId: 'Europe/Stockholm'),
+ _Timezone(zoneId: 'Europe/Tallinn'),
+ _Timezone(zoneId: 'Europe/Tirane'),
+ _Timezone(zoneId: 'Europe/Tiraspol'),
+ _Timezone(zoneId: 'Europe/Uzhgorod'),
+ _Timezone(zoneId: 'Europe/Vaduz'),
+ _Timezone(zoneId: 'Europe/Vatican'),
+ _Timezone(zoneId: 'Europe/Vienna'),
+ _Timezone(zoneId: 'Europe/Vilnius'),
+ _Timezone(zoneId: 'Europe/Volgograd'),
+ _Timezone(zoneId: 'Europe/Warsaw'),
+ _Timezone(zoneId: 'Europe/Zagreb'),
+ _Timezone(zoneId: 'Europe/Zaporozhye'),
+ _Timezone(zoneId: 'Europe/Zurich'),
+ _Timezone(zoneId: 'Factory'),
+ _Timezone(zoneId: 'GB'),
+ _Timezone(zoneId: 'GB-Eire'),
+ _Timezone(zoneId: 'GMT'),
+ _Timezone(zoneId: 'GMT+0'),
+ _Timezone(zoneId: 'GMT-0'),
+ _Timezone(zoneId: 'GMT0'),
+ _Timezone(zoneId: 'Greenwich'),
+ _Timezone(zoneId: 'HST'),
+ _Timezone(zoneId: 'Hongkong'),
+ _Timezone(zoneId: 'Iceland'),
+ _Timezone(zoneId: 'Indian/Antananarivo'),
+ _Timezone(zoneId: 'Indian/Chagos'),
+ _Timezone(zoneId: 'Indian/Christmas'),
+ _Timezone(zoneId: 'Indian/Cocos'),
+ _Timezone(zoneId: 'Indian/Comoro'),
+ _Timezone(zoneId: 'Indian/Kerguelen'),
+ _Timezone(zoneId: 'Indian/Mahe'),
+ _Timezone(zoneId: 'Indian/Maldives'),
+ _Timezone(zoneId: 'Indian/Mauritius'),
+ _Timezone(zoneId: 'Indian/Mayotte'),
+ _Timezone(zoneId: 'Indian/Reunion'),
+ _Timezone(zoneId: 'Iran'),
+ _Timezone(zoneId: 'Israel'),
+ _Timezone(zoneId: 'Jamaica'),
+ _Timezone(zoneId: 'Japan'),
+ _Timezone(zoneId: 'Kwajalein'),
+ _Timezone(zoneId: 'Libya'),
+ _Timezone(zoneId: 'MET'),
+ _Timezone(zoneId: 'MST'),
+ _Timezone(zoneId: 'MST7MDT'),
+ _Timezone(zoneId: 'Mexico/BajaNorte'),
+ _Timezone(zoneId: 'Mexico/BajaSur'),
+ _Timezone(zoneId: 'Mexico/General'),
+ _Timezone(zoneId: 'Mideast/Riyadh87'),
+ _Timezone(zoneId: 'Mideast/Riyadh88'),
+ _Timezone(zoneId: 'Mideast/Riyadh89'),
+ _Timezone(zoneId: 'NZ'),
+ _Timezone(zoneId: 'NZ-CHAT'),
+ _Timezone(zoneId: 'Navajo'),
+ _Timezone(zoneId: 'PRC'),
+ _Timezone(zoneId: 'PST8PDT'),
+ _Timezone(zoneId: 'Pacific/Apia'),
+ _Timezone(zoneId: 'Pacific/Auckland'),
+ _Timezone(zoneId: 'Pacific/Chatham'),
+ _Timezone(zoneId: 'Pacific/Easter'),
+ _Timezone(zoneId: 'Pacific/Efate'),
+ _Timezone(zoneId: 'Pacific/Enderbury'),
+ _Timezone(zoneId: 'Pacific/Fakaofo'),
+ _Timezone(zoneId: 'Pacific/Fiji'),
+ _Timezone(zoneId: 'Pacific/Funafuti'),
+ _Timezone(zoneId: 'Pacific/Galapagos'),
+ _Timezone(zoneId: 'Pacific/Gambier'),
+ _Timezone(zoneId: 'Pacific/Guadalcanal'),
+ _Timezone(zoneId: 'Pacific/Guam'),
+ _Timezone(zoneId: 'Pacific/Honolulu'),
+ _Timezone(zoneId: 'Pacific/Johnston'),
+ _Timezone(zoneId: 'Pacific/Kiritimati'),
+ _Timezone(zoneId: 'Pacific/Kosrae'),
+ _Timezone(zoneId: 'Pacific/Kwajalein'),
+ _Timezone(zoneId: 'Pacific/Majuro'),
+ _Timezone(zoneId: 'Pacific/Marquesas'),
+ _Timezone(zoneId: 'Pacific/Midway'),
+ _Timezone(zoneId: 'Pacific/Nauru'),
+ _Timezone(zoneId: 'Pacific/Niue'),
+ _Timezone(zoneId: 'Pacific/Norfolk'),
+ _Timezone(zoneId: 'Pacific/Noumea'),
+ _Timezone(zoneId: 'Pacific/Pago_Pago'),
+ _Timezone(zoneId: 'Pacific/Palau'),
+ _Timezone(zoneId: 'Pacific/Pitcairn'),
+ _Timezone(zoneId: 'Pacific/Ponape'),
+ _Timezone(zoneId: 'Pacific/Port_Moresby'),
+ _Timezone(zoneId: 'Pacific/Rarotonga'),
+ _Timezone(zoneId: 'Pacific/Saipan'),
+ _Timezone(zoneId: 'Pacific/Samoa'),
+ _Timezone(zoneId: 'Pacific/Tahiti'),
+ _Timezone(zoneId: 'Pacific/Tarawa'),
+ _Timezone(zoneId: 'Pacific/Tongatapu'),
+ _Timezone(zoneId: 'Pacific/Truk'),
+ _Timezone(zoneId: 'Pacific/Wake'),
+ _Timezone(zoneId: 'Pacific/Wallis'),
+ _Timezone(zoneId: 'Pacific/Yap'),
+ _Timezone(zoneId: 'Poland'),
+ _Timezone(zoneId: 'Portugal'),
+ _Timezone(zoneId: 'ROC'),
+ _Timezone(zoneId: 'ROK'),
+ _Timezone(zoneId: 'Singapore'),
+ _Timezone(zoneId: 'Turkey'),
+ _Timezone(zoneId: 'UCT'),
+ _Timezone(zoneId: 'US/Alaska'),
+ _Timezone(zoneId: 'US/Aleutian'),
+ _Timezone(zoneId: 'US/Arizona'),
+ _Timezone(zoneId: 'US/Central'),
+ _Timezone(zoneId: 'US/East-Indiana'),
+ _Timezone(zoneId: 'US/Hawaii'),
+ _Timezone(zoneId: 'US/Indiana-Starke'),
+ _Timezone(zoneId: 'US/Michigan'),
+ _Timezone(zoneId: 'US/Mountain'),
+ _Timezone(zoneId: 'US/Pacific'),
+ _Timezone(zoneId: 'US/Pacific-New'),
+ _Timezone(zoneId: 'US/Samoa'),
+ _Timezone(zoneId: 'UTC'),
+ _Timezone(zoneId: 'Universal'),
+ _Timezone(zoneId: 'W-SU'),
+ _Timezone(zoneId: 'WET'),
+ _Timezone(zoneId: 'Zulu'),
];
/// Callback when user picks a timezone.
@@ -595,22 +595,22 @@
_onTap = onTap;
@override
- Widget build(BuildContext context) => new ListView.builder(
- physics: const BouncingScrollPhysics(),
+ Widget build(BuildContext context) => ListView.builder(
+ physics: BouncingScrollPhysics(),
itemCount: _kTimeZones.length,
- itemBuilder: (BuildContext context, int index) => new Material(
+ itemBuilder: (BuildContext context, int index) => Material(
color: _currentTimezoneId == _kTimeZones[index].zoneId
? Colors.grey[500]
: Colors.transparent,
- child: new InkWell(
+ child: InkWell(
onTap: () {
_onTap?.call(_kTimeZones[index].zoneId);
},
- child: new Padding(
- padding: const EdgeInsets.all(8.0),
- child: new Text(
+ child: Padding(
+ padding: EdgeInsets.all(8.0),
+ child: Text(
'${_kTimeZones[index].zoneId}',
- style: const TextStyle(color: Colors.black),
+ style: TextStyle(color: Colors.black),
),
),
),
diff --git a/lib/settings/lib/widgets.dart b/lib/settings/lib/widgets.dart
index 7bcd223..df6dd5c 100644
--- a/lib/settings/lib/widgets.dart
+++ b/lib/settings/lib/widgets.dart
@@ -106,7 +106,7 @@
child: Container(
width: 64.0,
height: 64.0,
- child: const FuchsiaSpinner(),
+ child: FuchsiaSpinner(),
)),
));
return Container(
@@ -115,7 +115,7 @@
);
} else {
return ListView(
- physics: const BouncingScrollPhysics(),
+ physics: BouncingScrollPhysics(),
padding: verticalInsets,
children: children..addAll(sections));
}
diff --git a/lib/setui/common/lib/action.dart b/lib/setui/common/lib/action.dart
index e9d9f2f..ca146d6 100644
--- a/lib/setui/common/lib/action.dart
+++ b/lib/setui/common/lib/action.dart
@@ -46,7 +46,7 @@
/// Called by client to return result
void onResult(String result) {
- callback.onResult(new ActionResult(step, result));
+ callback.onResult(ActionResult(step, result));
}
/// Called by owner to start the action
diff --git a/lib/setui/common/lib/conductor_builder.dart b/lib/setui/common/lib/conductor_builder.dart
index 833f21f..6e4e2e5 100644
--- a/lib/setui/common/lib/conductor_builder.dart
+++ b/lib/setui/common/lib/conductor_builder.dart
@@ -15,7 +15,7 @@
/// A builder for assembling a [Conductor]. Abstracts away details surrounding
/// the [Roster] and [Syllabus].
class ConductorBuilder {
- final Roster _roster = new Roster();
+ final Roster _roster = Roster();
final File _syllabusFile;
/// Constructs a builder with a [Syllabus] at the specified [File].
@@ -26,11 +26,11 @@
/// Builds the [Conductor].
Future<Conductor> build() {
- Completer<Conductor> completer = new Completer<Conductor>();
+ Completer<Conductor> completer = Completer<Conductor>();
_syllabusFile.readAsString().then((String config) {
final Syllabus syllabus = SyllabusParser.parse(loadYamlDocuments(config));
- completer.complete(new Conductor(syllabus, _roster));
+ completer.complete(Conductor(syllabus, _roster));
});
return completer.future;
diff --git a/lib/setui/common/lib/syllabus_parser.dart b/lib/setui/common/lib/syllabus_parser.dart
index 8fcde62..f131793 100644
--- a/lib/setui/common/lib/syllabus_parser.dart
+++ b/lib/setui/common/lib/syllabus_parser.dart
@@ -48,7 +48,7 @@
// First pass: create steps.
docs[1].contents.value.forEach((key, value) {
final String action = value[_keyAction];
- steps[key] = new Step(key, action);
+ steps[key] = Step(key, action);
});
// Second pass: link up nodes.
@@ -69,7 +69,7 @@
final YamlMap metaData = docs[0].contents.value;
- return new Syllabus(steps.values.toList(), steps[metaData[_keyEntry]],
+ return Syllabus(steps.values.toList(), steps[metaData[_keyEntry]],
metaData[_keySingleUseId]);
}
diff --git a/lib/setui/common/test/conductor_builder_test.dart b/lib/setui/common/test/conductor_builder_test.dart
index 4fcf23f..73da1ec 100644
--- a/lib/setui/common/test/conductor_builder_test.dart
+++ b/lib/setui/common/test/conductor_builder_test.dart
@@ -30,11 +30,11 @@
void main() {
// Make sure first action is launched.
test('test_start', () async {
- final MockFile syllabusFile = new MockFile();
- final MockBlueprint blueprint = new MockBlueprint();
- final MockAction action = new MockAction();
+ final MockFile syllabusFile = MockFile();
+ final MockBlueprint blueprint = MockBlueprint();
+ final MockAction action = MockAction();
- final Completer<String> completer = new Completer<String>()
+ final Completer<String> completer = Completer<String>()
..complete(_syllabus);
// Load predefined syllabus when
@@ -42,7 +42,7 @@
when(blueprint.key).thenReturn('begin');
when(blueprint.assemble(any, any)).thenReturn(action);
- final ConductorBuilder builder = new ConductorBuilder(syllabusFile)
+ final ConductorBuilder builder = ConductorBuilder(syllabusFile)
..addBlueprint(blueprint);
(await builder.build()).start();
diff --git a/lib/setui/common/test/conductor_test.dart b/lib/setui/common/test/conductor_test.dart
index b23f6a1..7227ab8 100644
--- a/lib/setui/common/test/conductor_test.dart
+++ b/lib/setui/common/test/conductor_test.dart
@@ -12,7 +12,7 @@
class MockAction extends Mock implements Action<TestBlueprint> {}
class TestBlueprint extends Blueprint {
- final MockAction action = new MockAction();
+ final MockAction action = MockAction();
TestBlueprint(String name) : super(name, 'TestBlueprint');
@@ -25,14 +25,14 @@
void main() {
// Make sure first action is launched.
test('test_start', () {
- final Step entry = new Step('step1', 'action1');
- final TestBlueprint actionBlueprint = new TestBlueprint('action1');
+ final Step entry = Step('step1', 'action1');
+ final TestBlueprint actionBlueprint = TestBlueprint('action1');
- final Syllabus syllabus = new Syllabus([entry], entry);
+ final Syllabus syllabus = Syllabus([entry], entry);
- final Roster roster = new Roster()..add(actionBlueprint);
+ final Roster roster = Roster()..add(actionBlueprint);
- new Conductor(syllabus, roster).start();
+ Conductor(syllabus, roster).start();
MockAction action = actionBlueprint.action;
verify(action.launch());
});
@@ -40,17 +40,17 @@
// Ensure we proceed to the next step when the current step's action is
// missing
test('test_advance', () {
- final Step step2 = new Step('step2', 'action2');
- final TestBlueprint actionBlueprint = new TestBlueprint('action2');
+ final Step step2 = Step('step2', 'action2');
+ final TestBlueprint actionBlueprint = TestBlueprint('action2');
- final Step entry = new Step('step1', 'action1')
+ final Step entry = Step('step1', 'action1')
..defaultTransition = step2.key;
- final Syllabus syllabus = new Syllabus([step2, entry], entry);
+ final Syllabus syllabus = Syllabus([step2, entry], entry);
- final Roster roster = new Roster()..add(actionBlueprint);
+ final Roster roster = Roster()..add(actionBlueprint);
- new Conductor(syllabus, roster).start();
+ Conductor(syllabus, roster).start();
verify(actionBlueprint.action.launch());
});
}
diff --git a/lib/setui/common/test/step_test.dart b/lib/setui/common/test/step_test.dart
index 7fd1fad..2f21c6e 100644
--- a/lib/setui/common/test/step_test.dart
+++ b/lib/setui/common/test/step_test.dart
@@ -19,7 +19,7 @@
const String action = 'start';
// Create a parent node with two unique child actions.
- final Step parent = new Step(name, action)
+ final Step parent = Step(name, action)
..addResult(result1, childKey1)
..addResult(result2, childKey2);
@@ -52,7 +52,7 @@
const String result1 = 'result1';
// Create parent with a single child node.
- final Step parent = new Step('parent', 'start')
+ final Step parent = Step('parent', 'start')
..addResult(result1, childKey)
..defaultTransition = defaultKey;
diff --git a/lib/setui/common/test/syllabus_test.dart b/lib/setui/common/test/syllabus_test.dart
index 0a9b5f1..0ba8c55 100644
--- a/lib/setui/common/test/syllabus_test.dart
+++ b/lib/setui/common/test/syllabus_test.dart
@@ -10,13 +10,13 @@
// Makes sure retrieveStep retrieves the [Step] by the given name or returns
// null if it doesn't exist.
test('test_step_retrieval', () {
- final Step child3 = new Step('step3', 'action3');
- final Step child2 = new Step('step2', 'action2')
+ final Step child3 = Step('step3', 'action3');
+ final Step child2 = Step('step2', 'action2')
..addResult('result', child3.key);
- final Step child1 = new Step('step1', 'action1')
+ final Step child1 = Step('step1', 'action1')
..addResult('result', child2.key);
- final Syllabus syllabus = new Syllabus([child3, child2, child1], child1);
+ final Syllabus syllabus = Syllabus([child3, child2, child1], child1);
expect(syllabus.retrieveStep('step3'), child3);
expect(syllabus.retrieveStep('unknownStep'), null);
diff --git a/lib/setui/flutter/lib/widget_blueprint.dart b/lib/setui/flutter/lib/widget_blueprint.dart
index 0eb4e87..3573130 100644
--- a/lib/setui/flutter/lib/widget_blueprint.dart
+++ b/lib/setui/flutter/lib/widget_blueprint.dart
@@ -24,6 +24,6 @@
@override
Action assemble(Step step, ActionResultReceiver receiver) {
- return new WidgetAction(step, receiver, this);
+ return WidgetAction(step, receiver, this);
}
}
diff --git a/lib/setui/settings/common/lib/setting_adapter.dart b/lib/setui/settings/common/lib/setting_adapter.dart
index 23d5f35..e0f4c72 100644
--- a/lib/setui/settings/common/lib/setting_adapter.dart
+++ b/lib/setui/settings/common/lib/setting_adapter.dart
@@ -78,18 +78,18 @@
const AdapterLogType._(this.value);
- static const AdapterLogType fetch = const AdapterLogType._(fetchId);
+ static const AdapterLogType fetch = AdapterLogType._(fetchId);
- static const AdapterLogType update = const AdapterLogType._(updateId);
+ static const AdapterLogType update = AdapterLogType._(updateId);
- static const AdapterLogType setting = const AdapterLogType._(settingId);
+ static const AdapterLogType setting = AdapterLogType._(settingId);
- static const AdapterLogType response = const AdapterLogType._(responseId);
+ static const AdapterLogType response = AdapterLogType._(responseId);
- static const AdapterLogType mutation = const AdapterLogType._(mutationId);
+ static const AdapterLogType mutation = AdapterLogType._(mutationId);
static const AdapterLogType mutationResponse =
- const AdapterLogType._(mutationResponseId);
+ AdapterLogType._(mutationResponseId);
int toJson() {
return value;
diff --git a/lib/setui/settings/common/lib/setting_controller.dart b/lib/setui/settings/common/lib/setting_controller.dart
index 35f93eb..f8e6fcf 100644
--- a/lib/setui/settings/common/lib/setting_controller.dart
+++ b/lib/setui/settings/common/lib/setting_controller.dart
@@ -33,7 +33,7 @@
return SettingType.connectivity;
}
- throw new Exception('Undefined setting type!');
+ throw Exception('Undefined setting type!');
}
Future<void> mutate(Mutation mutation, MutationHandles handles) async {
diff --git a/lib/setui/settings/common/lib/setting_source.dart b/lib/setui/settings/common/lib/setting_source.dart
index 3b39b4b..0aa1585 100644
--- a/lib/setui/settings/common/lib/setting_source.dart
+++ b/lib/setui/settings/common/lib/setting_source.dart
@@ -15,7 +15,7 @@
T _value;
final StreamController<T> _streamController =
- new StreamController<T>.broadcast();
+ StreamController<T>.broadcast();
StreamSubscription<T> addListener(void callback(T value)) =>
_streamController.stream.listen(callback);
diff --git a/lib/setui/settings/service/lib/src/network_controller.dart b/lib/setui/settings/service/lib/src/network_controller.dart
index 777b7ac..335ee37 100644
--- a/lib/setui/settings/service/lib/src/network_controller.dart
+++ b/lib/setui/settings/service/lib/src/network_controller.dart
@@ -27,10 +27,10 @@
/// STOPSHIP(brycelee): re-enable once Migration is complete
// /// How often to poll the wlan for wifi information.
-// const Duration _statusPeriod = const Duration(seconds: 3);
+// const Duration _statusPeriod = Duration(seconds: 3);
// /// How often to poll the wlan for available wifi networks.
-// const Duration _scanPeriod = const Duration(seconds: 40);
+// const Duration _scanPeriod = Duration(seconds: 40);
// const int _scanTimeout = 25;
diff --git a/lib/shell/lib/models/overlay_drag_model.dart b/lib/shell/lib/models/overlay_drag_model.dart
index db6b299..2f02453 100644
--- a/lib/shell/lib/models/overlay_drag_model.dart
+++ b/lib/shell/lib/models/overlay_drag_model.dart
@@ -13,7 +13,7 @@
show ScopedModel, Model, ScopedModelDescendant;
const RK4SpringDescription _kSimulationDesc =
- const RK4SpringDescription(tension: 450.0, friction: 50.0);
+ RK4SpringDescription(tension: 450.0, friction: 50.0);
/// Tracks any ongoing vertical drag that effects the overlay.
class OverlayDragModel extends TickingModel {
@@ -38,7 +38,7 @@
/// Wraps [ModelFinder.of] for this [Model]. See [ModelFinder.of] for more
/// details.
static OverlayDragModel of(BuildContext context) =>
- new ModelFinder<OverlayDragModel>().of(context);
+ ModelFinder<OverlayDragModel>().of(context);
/// Called when a vertical drag starts.
void start() {}
@@ -69,7 +69,7 @@
}
/// Spring offset to 0.0. Set effectedModel to null when 0.0.
- _resetSimulation = new RK4SpringSimulation(
+ _resetSimulation = RK4SpringSimulation(
initValue: offset,
desc: _kSimulationDesc,
)..target = 0.0;
diff --git a/lib/shell/lib/models/overlay_position_model.dart b/lib/shell/lib/models/overlay_position_model.dart
index c0a7aa8..80e5c9e 100644
--- a/lib/shell/lib/models/overlay_position_model.dart
+++ b/lib/shell/lib/models/overlay_position_model.dart
@@ -16,7 +16,7 @@
show ScopedModel, Model, ScopedModelDescendant;
const RK4SpringDescription _kSimulationDesc =
- const RK4SpringDescription(tension: 450.0, friction: 50.0);
+ RK4SpringDescription(tension: 450.0, friction: 50.0);
/// Model controlling an overlay.
class OverlayPositionModel extends TracingSpringModel {
@@ -44,7 +44,7 @@
0.0: hideMetricId
},
) {
- _overlayDragModel = new OverlayDragModel(overlayPositionModel: this)
+ _overlayDragModel = OverlayDragModel(overlayPositionModel: this)
..addListener(notifyListeners);
}
@@ -75,7 +75,7 @@
void restartNoInteractionTimer() {
_stopNoInteractionTimer();
if (noInteractionTimeout != null) {
- _noInteractionTimer = new Timer(noInteractionTimeout, () {
+ _noInteractionTimer = Timer(noInteractionTimeout, () {
onNoInteraction?.call();
hide();
});
diff --git a/lib/story_shell/examples/example_manual_relationships/lib/grouping.dart b/lib/story_shell/examples/example_manual_relationships/lib/grouping.dart
index 205b183..5a48890 100644
--- a/lib/story_shell/examples/example_manual_relationships/lib/grouping.dart
+++ b/lib/story_shell/examples/example_manual_relationships/lib/grouping.dart
@@ -10,11 +10,11 @@
@override
Widget build(BuildContext context) {
- return new Container(
- color: const Color(0xFFFFFFFF),
- margin: const EdgeInsets.all(10.0),
- padding: const EdgeInsets.all(10.0),
- child: new Column(
+ return Container(
+ color: Color(0xFFFFFFFF),
+ margin: EdgeInsets.all(10.0),
+ padding: EdgeInsets.all(10.0),
+ child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: children,
),
diff --git a/lib/story_shell/examples/example_manual_relationships/lib/launch_copresent_button.dart b/lib/story_shell/examples/example_manual_relationships/lib/launch_copresent_button.dart
index 2b89beb..356b734 100644
--- a/lib/story_shell/examples/example_manual_relationships/lib/launch_copresent_button.dart
+++ b/lib/story_shell/examples/example_manual_relationships/lib/launch_copresent_button.dart
@@ -17,7 +17,7 @@
@override
CopresentLauncherState createState() =>
- new CopresentLauncherState(_moduleContext, _generateChildId);
+ CopresentLauncherState(_moduleContext, _generateChildId);
}
/// Copresent Launch State
@@ -37,13 +37,13 @@
(math.pow(2, _copresentEmphasisExp) * 10.0).roundToDouble() / 10.0;
@override
- Widget build(BuildContext context) => new Container(
+ Widget build(BuildContext context) => Container(
alignment: FractionalOffset.center,
- constraints: const BoxConstraints(maxWidth: 200.0),
- child: new Column(
+ constraints: BoxConstraints(maxWidth: 200.0),
+ child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- new Slider(
+ Slider(
min: -1.6,
max: 1.6,
value: _copresentEmphasisExp,
@@ -51,18 +51,18 @@
onChanged: (double value) =>
setState(() => _copresentEmphasisExp = value),
),
- new StartModuleButton(
+ StartModuleButton(
_moduleContext,
- new SurfaceRelation(
+ SurfaceRelation(
emphasis: _emphasis,
arrangement: SurfaceArrangement.copresent,
),
'Copresent',
_generateChildId,
),
- new StartModuleButton(
+ StartModuleButton(
_moduleContext,
- new SurfaceRelation(
+ SurfaceRelation(
emphasis: _emphasis,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
diff --git a/lib/story_shell/examples/example_manual_relationships/lib/main.dart b/lib/story_shell/examples/example_manual_relationships/lib/main.dart
index 0127e7f..82a8c17 100644
--- a/lib/story_shell/examples/example_manual_relationships/lib/main.dart
+++ b/lib/story_shell/examples/example_manual_relationships/lib/main.dart
@@ -18,11 +18,11 @@
import 'launch_copresent_button.dart';
import 'start_module_button.dart';
-final StartupContext _context = new StartupContext.fromStartupInfo();
+final StartupContext _context = StartupContext.fromStartupInfo();
/// This is used for keeping the reference around.
-ModuleImpl _module = new ModuleImpl();
-ModuleContextProxy _moduleContext = new ModuleContextProxy();
+ModuleImpl _module = ModuleImpl();
+ModuleContextProxy _moduleContext = ModuleContextProxy();
int _childId = 0;
String _generateChildId() {
@@ -51,30 +51,30 @@
/// Starts a predefined test container
void startContainerInShell() {
- IntentBuilder intentBuilder = new IntentBuilder.handler(
+ IntentBuilder intentBuilder = IntentBuilder.handler(
'fuchsia-pkg://fuchsia.com/example_manual_relationships#meta/example_manual_relationships.cmx');
- const List<double> leftRect = const <double>[0.0, 0.0, 0.5, 1.0];
- const List<double> trRect = const <double>[0.5, 0.0, 0.5, 0.5];
- const List<double> brRect = const <double>[0.5, 0.5, 0.5, 0.5];
- LayoutEntry left = new LayoutEntry(
- nodeName: 'left', rectangle: new Float32List.fromList(leftRect));
- LayoutEntry tr = new LayoutEntry(
- nodeName: 'top_right', rectangle: new Float32List.fromList(trRect));
- LayoutEntry br = new LayoutEntry(
- nodeName: 'bottom_right', rectangle: new Float32List.fromList(brRect));
+ const List<double> leftRect = <double>[0.0, 0.0, 0.5, 1.0];
+ const List<double> trRect = <double>[0.5, 0.0, 0.5, 0.5];
+ const List<double> brRect = <double>[0.5, 0.5, 0.5, 0.5];
+ LayoutEntry left = LayoutEntry(
+ nodeName: 'left', rectangle: Float32List.fromList(leftRect));
+ LayoutEntry tr = LayoutEntry(
+ nodeName: 'top_right', rectangle: Float32List.fromList(trRect));
+ LayoutEntry br = LayoutEntry(
+ nodeName: 'bottom_right', rectangle: Float32List.fromList(brRect));
ContainerLayout main =
- new ContainerLayout(surfaces: <LayoutEntry>[left, tr, br]);
+ ContainerLayout(surfaces: <LayoutEntry>[left, tr, br]);
List<ContainerLayout> layouts = <ContainerLayout>[main];
- ContainerRelationEntry rootLeft = const ContainerRelationEntry(
+ ContainerRelationEntry rootLeft = ContainerRelationEntry(
nodeName: 'left',
parentNodeName: 'test',
- relationship: const SurfaceRelation());
- ContainerRelationEntry rootTr = const ContainerRelationEntry(
+ relationship: SurfaceRelation());
+ ContainerRelationEntry rootTr = ContainerRelationEntry(
nodeName: 'top_right',
parentNodeName: 'test',
- relationship: const SurfaceRelation());
- ContainerRelationEntry rootBr = const ContainerRelationEntry(
+ relationship: SurfaceRelation());
+ ContainerRelationEntry rootBr = ContainerRelationEntry(
nodeName: 'bottom_right',
parentNodeName: 'test',
relationship:
@@ -85,11 +85,11 @@
rootBr
];
ContainerNode leftNode =
- new ContainerNode(nodeName: 'left', intent: intentBuilder.intent);
+ ContainerNode(nodeName: 'left', intent: intentBuilder.intent);
ContainerNode trNode =
- new ContainerNode(nodeName: 'top_right', intent: intentBuilder.intent);
+ ContainerNode(nodeName: 'top_right', intent: intentBuilder.intent);
ContainerNode brNode =
- new ContainerNode(nodeName: 'bottom_right', intent: intentBuilder.intent);
+ ContainerNode(nodeName: 'bottom_right', intent: intentBuilder.intent);
List<ContainerNode> nodes = <ContainerNode>[leftNode, trNode, brNode];
_moduleContext.startContainerInShell(
@@ -110,10 +110,10 @@
@override
Widget build(BuildContext context) {
return const Padding(
- padding: const EdgeInsets.all(16.0),
- child: const RaisedButton(
- child: const Center(
- child: const Text('Launch Container'),
+ padding: EdgeInsets.all(16.0),
+ child: RaisedButton(
+ child: Center(
+ child: Text('Launch Container'),
),
onPressed: (startContainerInShell),
),
@@ -130,33 +130,33 @@
@override
Widget build(BuildContext context) {
- return new Row(
+ return Row(
children: <Widget>[
- new Text('${_controller.name} '),
- new Expanded(
- child: new Padding(
- padding: const EdgeInsets.all(2.0),
- child: new ButtonTheme(
- padding: const EdgeInsets.all(1.0),
- child: new RaisedButton(
- child: const Text(
+ Text('${_controller.name} '),
+ Expanded(
+ child: Padding(
+ padding: EdgeInsets.all(2.0),
+ child: ButtonTheme(
+ padding: EdgeInsets.all(1.0),
+ child: RaisedButton(
+ child: Text(
'Focus',
- style: const TextStyle(fontSize: 10.0),
+ style: TextStyle(fontSize: 10.0),
),
onPressed: _controller.focus,
),
),
),
),
- new Expanded(
- child: new Padding(
- padding: const EdgeInsets.all(2.0),
- child: new ButtonTheme(
- padding: const EdgeInsets.all(1.0),
- child: new RaisedButton(
- child: const Text(
+ Expanded(
+ child: Padding(
+ padding: EdgeInsets.all(2.0),
+ child: ButtonTheme(
+ padding: EdgeInsets.all(1.0),
+ child: RaisedButton(
+ child: Text(
'Dismiss',
- style: const TextStyle(fontSize: 10.0),
+ style: TextStyle(fontSize: 10.0),
),
onPressed: _controller.defocus,
),
@@ -172,21 +172,21 @@
class MainWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- DateTime now = new DateTime.now().toLocal();
- return new Scaffold(
- body: new Center(
- child: new Container(
- constraints: const BoxConstraints(maxWidth: 200.0),
- child: new ListView(
+ DateTime now = DateTime.now().toLocal();
+ return Scaffold(
+ body: Center(
+ child: Container(
+ constraints: BoxConstraints(maxWidth: 200.0),
+ child: ListView(
children: <Widget>[
- new Grouping(
+ Grouping(
children: <Widget>[
- new Text(
+ Text(
"Module ${now.minute}:${now.second.toString().padLeft(2, '0')}"),
- new Padding(
- padding: const EdgeInsets.all(8.0),
- child: new RaisedButton(
- child: const Text('Close'),
+ Padding(
+ padding: EdgeInsets.all(8.0),
+ child: RaisedButton(
+ child: Text('Close'),
onPressed: () {
// NOTE(mesch): There used to be code here that calls
// ModuleContext.Done(), but that method no longer
@@ -197,7 +197,7 @@
),
],
),
- new Grouping(
+ Grouping(
children: <Widget>[
CopresentLauncher(_moduleContext, _generateChildId),
const Divider(),
@@ -228,7 +228,7 @@
/// Module related Services: Lifecycle and ModuleContext
class ModuleImpl implements Lifecycle {
- final LifecycleBinding _lifecycleBinding = new LifecycleBinding();
+ final LifecycleBinding _lifecycleBinding = LifecycleBinding();
ModuleImpl() {
log.info('ModuleImpl::initialize call');
@@ -262,11 +262,11 @@
);
Color randomColor =
- new Color(0xFF000000 + new math.Random().nextInt(0xFFFFFF));
+ Color(0xFF000000 + math.Random().nextInt(0xFFFFFF));
- runApp(new MaterialApp(
+ runApp(MaterialApp(
title: 'Manual Module',
- home: new MainWidget(),
- theme: new ThemeData(canvasColor: randomColor),
+ home: MainWidget(),
+ theme: ThemeData(canvasColor: randomColor),
));
}
diff --git a/lib/story_shell/examples/example_manual_relationships/lib/start_module_button.dart b/lib/story_shell/examples/example_manual_relationships/lib/start_module_button.dart
index 89a315c..c0c67b7 100644
--- a/lib/story_shell/examples/example_manual_relationships/lib/start_module_button.dart
+++ b/lib/story_shell/examples/example_manual_relationships/lib/start_module_button.dart
@@ -26,11 +26,11 @@
@override
Widget build(BuildContext context) {
- return new Padding(
- padding: const EdgeInsets.all(16.0),
- child: new RaisedButton(
- child: new Center(
- child: new Text(_display),
+ return Padding(
+ padding: EdgeInsets.all(16.0),
+ child: RaisedButton(
+ child: Center(
+ child: Text(_display),
),
onPressed: () {
print(
@@ -44,11 +44,11 @@
/// Starts a new module and returns its controller
ModuleController startChildModule(
ModuleContext moduleContext, SurfaceRelation relation) {
- ModuleControllerProxy moduleController = new ModuleControllerProxy();
+ ModuleControllerProxy moduleController = ModuleControllerProxy();
String name = _generateChildId();
- IntentBuilder intentBuilder = new IntentBuilder.handler(_kModuleUrl);
+ IntentBuilder intentBuilder = IntentBuilder.handler(_kModuleUrl);
moduleContext.addModuleToStory(
name,
intentBuilder.intent,
diff --git a/lib/story_shell/examples/mondrian_test/lib/main.dart b/lib/story_shell/examples/mondrian_test/lib/main.dart
index f0633f8..f42480d 100644
--- a/lib/story_shell/examples/mondrian_test/lib/main.dart
+++ b/lib/story_shell/examples/mondrian_test/lib/main.dart
@@ -11,13 +11,13 @@
setupLogger(name: 'mondrianTest');
Color randomColor =
- new Color(0xFF000000 + new math.Random().nextInt(0xFFFFFF));
+ Color(0xFF000000 + math.Random().nextInt(0xFFFFFF));
- runApp(new MaterialApp(
+ runApp(MaterialApp(
title: 'Mondrian Test',
- home: new Container(
+ home: Container(
color: randomColor,
),
- theme: new ThemeData(canvasColor: randomColor),
+ theme: ThemeData(canvasColor: randomColor),
));
}
diff --git a/lib/story_shell/examples/story_shell_test/test/key_listener_test.dart b/lib/story_shell/examples/story_shell_test/test/key_listener_test.dart
index 4edaa6a..a2460ec 100644
--- a/lib/story_shell/examples/story_shell_test/test/key_listener_test.dart
+++ b/lib/story_shell/examples/story_shell_test/test/key_listener_test.dart
@@ -96,7 +96,7 @@
mockPresentation.triggerEvent();
// give the call time to propagate
Future sleep1() {
- return new Future.delayed(const Duration(seconds: 1), () {});
+ return Future.delayed(const Duration(seconds: 1), () {});
}
await sleep1();
diff --git a/lib/story_shell/lib/key_listener.dart b/lib/story_shell/lib/key_listener.dart
index 185b3d6..5493a10 100644
--- a/lib/story_shell/lib/key_listener.dart
+++ b/lib/story_shell/lib/key_listener.dart
@@ -30,7 +30,7 @@
/// Key event listener
final KeyboardCaptureListenerHackBinding _keyEventListener =
- new KeyboardCaptureListenerHackBinding();
+ KeyboardCaptureListenerHackBinding();
/// Call to register a key event - callback pair. The pair will be added
/// to a Map, multiple callbacks can be associated with the same key event.
diff --git a/lib/xi/client/lib/src/client.dart b/lib/xi/client/lib/src/client.dart
index c67597e..54ab0c2 100644
--- a/lib/xi/client/lib/src/client.dart
+++ b/lib/xi/client/lib/src/client.dart
@@ -58,7 +58,7 @@
/// process.stdout.listen(streamController.add);
///
StreamController<List<int>> streamController =
- new StreamController<List<int>>();
+ StreamController<List<int>>();
/// [XiClient] constructor.
XiClient() {
diff --git a/lib/xi/fuchsia_client/lib/client.dart b/lib/xi/fuchsia_client/lib/client.dart
index 04336c7..75321ab 100644
--- a/lib/xi/fuchsia_client/lib/client.dart
+++ b/lib/xi/fuchsia_client/lib/client.dart
@@ -19,7 +19,7 @@
/// This should not be used on its own, but subclassed by some another type
/// that will handle setting up the socket.
class FuchsiaSocketClient extends XiClient {
- final SocketReader _reader = new SocketReader();
+ final SocketReader _reader = SocketReader();
@override
Future<Null> init() async {}
@@ -27,13 +27,13 @@
@override
void send(String data) {
final List<int> ints = utf8.encode('$data\n');
- final Uint8List bytes = new Uint8List.fromList(ints);
+ final Uint8List bytes = Uint8List.fromList(ints);
final ByteData buffer = bytes.buffer.asByteData();
final WriteResult result = _reader.socket.write(buffer);
if (result.status != ZX.OK) {
- StateError error = new StateError('ERROR WRITING: $result');
+ StateError error = StateError('ERROR WRITING: $result');
streamController
..addError(error)
..close();
@@ -48,7 +48,7 @@
final ReadResult result = _reader.socket.read(1000);
if (result.status != ZX.OK) {
- StateError error = new StateError('Socket read error: ${result.status}');
+ StateError error = StateError('Socket read error: ${result.status}');
streamController
..addError(error)
..close();
@@ -70,7 +70,7 @@
// Note: _ledgerHandle is currently unused, but we're hoping to bring it back.
}
final _dirProxy = io.DirectoryProxy();
- final service.JsonProxy _jsonProxy = new service.JsonProxy();
+ final service.JsonProxy _jsonProxy = service.JsonProxy();
@override
Future<Null> init() async {
@@ -78,7 +78,7 @@
return;
}
- final LaunchInfo launchInfo = new LaunchInfo(
+ final LaunchInfo launchInfo = LaunchInfo(
url: 'fuchsia-pkg://fuchsia.com/xi_core#meta/xi_core.cmx',
directoryRequest: _dirProxy.ctrl.request().passChannel());
@@ -89,7 +89,7 @@
Incoming(_dirProxy).connectToService(_jsonProxy);
- final SocketPair pair = new SocketPair();
+ final SocketPair pair = SocketPair();
await _jsonProxy.connectSocket(pair.first);
_reader
..bind(pair.second)
@@ -101,7 +101,7 @@
@override
void send(String data) {
if (initialized == false) {
- throw new StateError('Must call .init() first.');
+ throw StateError('Must call .init() first.');
}
super.send(data);
}
diff --git a/lib/xi/fuchsia_client/test/xi_fuchsia_client_test.dart b/lib/xi/fuchsia_client/test/xi_fuchsia_client_test.dart
index 741f00c..c376881 100644
--- a/lib/xi/fuchsia_client/test/xi_fuchsia_client_test.dart
+++ b/lib/xi/fuchsia_client/test/xi_fuchsia_client_test.dart
@@ -7,7 +7,7 @@
void main() {
test('XiFuchsiaClient constructor', () {
- XiFuchsiaClient client = new XiFuchsiaClient(null);
+ XiFuchsiaClient client = XiFuchsiaClient(null);
expect(client.initialized, equals(false));
});
}
diff --git a/lib/xi/widgets/lib/src/document.dart b/lib/xi/widgets/lib/src/document.dart
index 2de0f51..56b6cfa 100644
--- a/lib/xi/widgets/lib/src/document.dart
+++ b/lib/xi/widgets/lib/src/document.dart
@@ -16,16 +16,16 @@
/// Stores and manages updates to the state for a Xi document, and provides
/// access to the editing API to the [Editor], via the [XiViewProxy].
class Document extends Stream<Document> implements XiViewHandler {
- final LineCache lines = new LineCache(TextStyle(color: Colors.black));
+ final LineCache lines = LineCache(TextStyle(color: Colors.black));
- final TextStyle _defaultStyle = const TextStyle(color: Colors.white);
+ final TextStyle _defaultStyle = TextStyle(color: Colors.white);
/// A connection to xi-core.
XiViewProxy _viewProxy;
final StreamController<Document> _controller;
- Document() : _controller = new StreamController.broadcast();
+ Document() : _controller = StreamController.broadcast();
List<Completer<XiViewProxy>> _pending = [];
@@ -39,7 +39,7 @@
if (_viewProxy != null) {
return Future.value(_viewProxy);
}
- final completer = new Completer();
+ final completer = Completer();
_pending.add(completer);
return completer.future;
}
@@ -56,13 +56,13 @@
_notifyListeners();
}
- LineCol _scrollPos = new LineCol(line: 0, col: 0);
+ LineCol _scrollPos = LineCol(line: 0, col: 0);
LineCol get scrollPos => _scrollPos;
double _measureWidth(String s) {
- TextSpan span = new TextSpan(text: s, style: _defaultStyle);
+ TextSpan span = TextSpan(text: s, style: _defaultStyle);
TextPainter painter =
- new TextPainter(text: span, textDirection: TextDirection.ltr)..layout();
+ TextPainter(text: span, textDirection: TextDirection.ltr)..layout();
return painter.width;
}
@@ -89,7 +89,7 @@
@override
void scrollTo(int line, int col) {
- _scrollPos = new LineCol(line: line, col: col);
+ _scrollPos = LineCol(line: line, col: col);
_notifyListeners();
}
diff --git a/lib/xi/widgets/lib/src/editor.dart b/lib/xi/widgets/lib/src/editor.dart
index 78c0696..a0d879e 100644
--- a/lib/xi/widgets/lib/src/editor.dart
+++ b/lib/xi/widgets/lib/src/editor.dart
@@ -29,7 +29,7 @@
super(key: key);
@override
- EditorState createState() => new EditorState();
+ EditorState createState() => EditorState();
}
/// A simple class representing a line and column location in the view.
@@ -52,22 +52,22 @@
/// State for editor tab
class EditorState extends State<Editor> {
- final ScrollController _controller = new ScrollController();
+ final ScrollController _controller = ScrollController();
// Height of lines (currently fixed, all lines have the same height)
double _lineHeight;
// location of last tap (used to expand selection on long press)
LineCol _lastTapLocation;
- final FocusNode _focusNode = new FocusNode();
+ final FocusNode _focusNode = FocusNode();
TextStyle _defaultStyle;
StreamSubscription<Document> _documentStream;
/// Creates a new editor state.
EditorState() {
- Color color = const Color(0xFF000000);
- _defaultStyle = new TextStyle(color: color);
+ Color color = Color(0xFF000000);
+ _defaultStyle = TextStyle(color: color);
// TODO: make style configurable
_lineHeight = _lineHeightForStyle(_defaultStyle);
}
@@ -106,11 +106,11 @@
double _lineHeightForStyle(TextStyle style) {
ui.ParagraphBuilder builder =
- new ui.ParagraphBuilder(new ui.ParagraphStyle())
+ ui.ParagraphBuilder(ui.ParagraphStyle())
..pushStyle(style.getTextStyle())
..addText(_zeroWidthSpace);
ui.Paragraph layout = builder.build()
- ..layout(new ui.ParagraphConstraints(width: double.infinity));
+ ..layout(ui.ParagraphConstraints(width: double.infinity));
return layout.height;
}
@@ -189,7 +189,7 @@
} else if (codePoint == 10) {
viewProxy.then((view) => view.insertNewline());
} else {
- String chars = new String.fromCharCode(codePoint);
+ String chars = String.fromCharCode(codePoint);
viewProxy.then((view) => view.insert(chars));
}
}
@@ -237,7 +237,7 @@
if (text != null) {
col = _utf16ToUtf8Offset(text.text.text, text.getIndexForHorizontal(x));
}
- return new LineCol(line: line, col: col);
+ return LineCol(line: line, col: col);
}
void _handleTapDown(TapDownDetails details) {
@@ -281,10 +281,10 @@
if (line == null) {
viewProxy.then((view) => view.requestLines(ix, ix + 1));
}
- return new TextLine(
+ return TextLine(
// TODO: the string '[invalid]' is debug painting, replace with actual UX.
line?.text ??
- new TextSpan(text: '[invalid]', style: widget.document.lines.style),
+ TextSpan(text: '[invalid]', style: widget.document.lines.style),
line?.cursor,
line?.styles,
_lineHeight,
@@ -296,28 +296,28 @@
FocusScope.of(context).reparentIfNeeded(_focusNode);
final Widget lines = (widget.document == null)
- ? new Container()
- : new ListView.builder(
+ ? Container()
+ : ListView.builder(
itemExtent: _lineHeight,
itemCount: widget.document.lines.height,
itemBuilder: _itemBuilder,
controller: _controller,
);
- return new RawKeyboardListener(
+ return RawKeyboardListener(
focusNode: _focusNode,
onKey: _handleKey,
- child: new GestureDetector(
+ child: GestureDetector(
onTapDown: _handleTapDown,
onLongPress: _handleLongPress,
onHorizontalDragUpdate: _handleHorizontalDragUpdate,
behavior: HitTestBehavior.opaque,
- child: new NotificationListener<ScrollUpdateNotification>(
+ child: NotificationListener<ScrollUpdateNotification>(
onNotification: (ScrollUpdateNotification update) {
_sendScrollViewport();
return true;
},
- child: new Container(
+ child: Container(
color: Colors.white,
constraints: BoxConstraints.expand(),
child: widget.debugBackground ? _makeDebugBackground(lines) : lines,
@@ -351,13 +351,13 @@
/// Creates a new widget with the editor overlayed on a watermarked background
Widget _makeDebugBackground(Widget editor) {
- return new Stack(children: <Widget>[
+ return Stack(children: <Widget>[
Container(
- constraints: new BoxConstraints.expand(),
- child: new Center(
+ constraints: BoxConstraints.expand(),
+ child: Center(
child: Transform.rotate(
angle: -math.pi / 6.0,
- child: new Text('xi editor',
+ child: Text('xi editor',
style: TextStyle(
fontSize: 144.0,
color: Colors.pink[50],
diff --git a/lib/xi/widgets/lib/src/editor_host.dart b/lib/xi/widgets/lib/src/editor_host.dart
index bae868c..0fc46fc 100644
--- a/lib/xi/widgets/lib/src/editor_host.dart
+++ b/lib/xi/widgets/lib/src/editor_host.dart
@@ -26,12 +26,12 @@
super(key: key);
@override
- State<EditorHost> createState() => new EditorHostState();
+ State<EditorHost> createState() => EditorHostState();
}
/// State for XiApp.
class EditorHostState extends State<EditorHost> implements XiHandler {
- final Document _document = new Document();
+ final Document _document = Document();
EditorHostState();
@@ -61,15 +61,15 @@
/// Uses a [MaterialApp] as the root of the Xi UI hierarchy.
@override
Widget build(BuildContext context) {
- return new MaterialApp(
+ return MaterialApp(
title: 'Xi',
- home: new Material(
+ home: Material(
// required for the debug background to render correctly
type: MaterialType.transparency,
child: Container(
- constraints: new BoxConstraints.expand(),
+ constraints: BoxConstraints.expand(),
color: Colors.white,
- child: new Editor(
+ child: Editor(
document: _document, debugBackground: widget.debugBackground),
),
),
diff --git a/lib/xi/widgets/lib/src/editor_tabs.dart b/lib/xi/widgets/lib/src/editor_tabs.dart
index 318907b..3aab424 100644
--- a/lib/xi/widgets/lib/src/editor_tabs.dart
+++ b/lib/xi/widgets/lib/src/editor_tabs.dart
@@ -22,7 +22,7 @@
super(key: key, coreProxy: coreProxy, debugBackground: debugBackground);
@override
- State<EditorTabs> createState() => new EditorTabsState();
+ State<EditorTabs> createState() => EditorTabsState();
}
class EditorTabsState extends State<EditorTabs>
@@ -45,7 +45,7 @@
super.initState();
widget.coreProxy.handler = this;
widget.coreProxy.clientStarted().then((_) => newView());
- _tabController = new TabController(vsync: this, length: 0);
+ _tabController = TabController(vsync: this, length: 0);
}
void newView() {
@@ -54,10 +54,10 @@
_viewIds.add(viewId);
_fakeDocumentTitles[viewId] = 'Untitled $_nextDocumentTitleNumber';
_nextDocumentTitleNumber += 1;
- _documents.putIfAbsent(viewId, () => new Document());
+ _documents.putIfAbsent(viewId, () => Document());
_documents[viewId].finalizeViewProxy(widget.coreProxy.view(viewId));
int prevIndex = _tabController.index;
- _tabController = new TabController(
+ _tabController = TabController(
vsync: this, length: _viewIds.length, initialIndex: prevIndex)
..animateTo(_viewIds.length - 1);
});
@@ -71,7 +71,7 @@
_viewIds.remove(viewId);
_documents.remove(viewId);
int prevIndex = _tabController.index;
- _tabController = new TabController(
+ _tabController = TabController(
vsync: this,
length: _viewIds.length,
initialIndex: math.max(0, math.min(prevIndex, _viewIds.length - 1)));
@@ -84,7 +84,7 @@
// can get called before `newView`'s future resolves. However this does mean
// races are possible if this is called with a `viewId` of a closed view, in which case
// we could have some zombie documents sitting around.
- _documents.putIfAbsent(viewId, () => new Document());
+ _documents.putIfAbsent(viewId, () => Document());
return _documents[viewId];
}
@@ -106,16 +106,16 @@
@override
Widget build(BuildContext context) {
List<Widget> actions = [
- new IconButton(icon: Icon(Icons.add), onPressed: newView)
+ IconButton(icon: Icon(Icons.add), onPressed: newView)
];
if (_viewIds.length > 1) {
- actions.add(new IconButton(
+ actions.add(IconButton(
icon: Icon(Icons.remove),
onPressed: () => closeView(_viewIds[_tabController.index])));
}
return MaterialApp(
- theme: new ThemeData(
+ theme: ThemeData(
primaryColor: Colors.pink[300],
),
home: Scaffold(
@@ -125,11 +125,11 @@
? TabBar(
indicatorColor: Colors.white,
indicatorWeight: 4.0,
- labelStyle: const TextStyle(fontSize: 16.0),
+ labelStyle: TextStyle(fontSize: 16.0),
isScrollable: true,
controller: _tabController,
tabs: _viewIds
- .map((id) => new Tab(text: _fakeDocumentTitles[id]))
+ .map((id) => Tab(text: _fakeDocumentTitles[id]))
.toList(),
)
: null,
@@ -152,10 +152,10 @@
}
return TabBarView(
- physics: const NeverScrollableScrollPhysics(),
+ physics: NeverScrollableScrollPhysics(),
controller: _tabController,
children: _viewIds.map((id) {
- return new Editor(
+ return Editor(
document: _documents[id],
key: Key(id),
debugBackground: widget.debugBackground,
diff --git a/lib/xi/widgets/lib/src/embedded_editor.dart b/lib/xi/widgets/lib/src/embedded_editor.dart
index a8f2916..88d21b1 100644
--- a/lib/xi/widgets/lib/src/embedded_editor.dart
+++ b/lib/xi/widgets/lib/src/embedded_editor.dart
@@ -24,12 +24,12 @@
}) : super(key: key);
@override
- State<EmbeddedEditor> createState() => new EmbeddedEditorState();
+ State<EmbeddedEditor> createState() => EmbeddedEditorState();
}
class EmbeddedEditorState extends State<EmbeddedEditor>
implements XiRpcHandler {
- final Document _document = new Document();
+ final Document _document = Document();
EmbeddedEditorState();
@@ -43,15 +43,15 @@
/// Uses a [MaterialApp] as the root of the Xi UI hierarchy.
@override
Widget build(BuildContext context) {
- return new MaterialApp(
+ return MaterialApp(
title: 'Xi',
- home: new Material(
+ home: Material(
// required for the debug background to render correctly
type: MaterialType.transparency,
child: Container(
- constraints: new BoxConstraints.expand(),
+ constraints: BoxConstraints.expand(),
color: Colors.white,
- child: new Editor(
+ child: Editor(
document: _document, debugBackground: widget.debugBackground),
),
),
diff --git a/lib/xi/widgets/lib/src/line_cache.dart b/lib/xi/widgets/lib/src/line_cache.dart
index 64e4b7c..d207281 100644
--- a/lib/xi/widgets/lib/src/line_cache.dart
+++ b/lib/xi/widgets/lib/src/line_cache.dart
@@ -27,13 +27,13 @@
/// Constructor, from json data (xi-core update protocol format)
Line.fromJson(Map<String, dynamic> json, TextStyle style)
- : text = new TextSpan(text: json['text'], style: style),
+ : text = TextSpan(text: json['text'], style: style),
cursor = _transformCursor(json['text'], json) ?? <int>[],
styles = _transformStyles(json['text'], json) ?? <int>[];
/// Update cursor and styles for a line, retaining text, using json
/// from the xi-core "update" op
- Line updateFromJson(Map<String, dynamic> json) => new Line(
+ Line updateFromJson(Map<String, dynamic> json) => Line(
text,
_transformCursor(text.text, json) ?? cursor,
_transformStyles(text.text, json) ?? styles,
@@ -44,8 +44,8 @@
// responsibility?
int getIndexForHorizontal(double horizontal) {
TextPainter textPainter =
- new TextPainter(text: text, textDirection: TextDirection.ltr)..layout();
- Offset offset = new Offset(horizontal, 0.0);
+ TextPainter(text: text, textDirection: TextDirection.ltr)..layout();
+ Offset offset = Offset(horizontal, 0.0);
TextPosition pos = textPainter.getPositionForOffset(offset);
return pos.offset;
}
@@ -77,7 +77,7 @@
switch (op['op']) {
case 'ins':
for (Map<String, dynamic> line in op['lines']) {
- newLines.add(new Line.fromJson(line, style));
+ newLines.add(Line.fromJson(line, style));
}
break;
case 'invalidate':
diff --git a/lib/xi/widgets/lib/src/text_line.dart b/lib/xi/widgets/lib/src/text_line.dart
index f620404..2c5298d 100644
--- a/lib/xi/widgets/lib/src/text_line.dart
+++ b/lib/xi/widgets/lib/src/text_line.dart
@@ -52,7 +52,7 @@
@override
_RenderTextLine createRenderObject(BuildContext context) {
- return new _RenderTextLine(text, cursor, styles, height);
+ return _RenderTextLine(text, cursor, styles, height);
}
@override
@@ -71,7 +71,7 @@
List<int> styles,
double height,
) : _textPainter =
- new TextPainter(text: text, textDirection: TextDirection.ltr),
+ TextPainter(text: text, textDirection: TextDirection.ltr),
_cursor = cursor,
_styles = styles,
_height = height;
@@ -154,8 +154,8 @@
// TODO: if we stop building TextLine objects for cache misses, can't be null
if (_cursor != null) {
for (int ix in _cursor) {
- Rect caretPrototype = new Rect.fromLTWH(0.0, 0.0, 1.0, _height);
- TextPosition position = new TextPosition(offset: ix);
+ Rect caretPrototype = Rect.fromLTWH(0.0, 0.0, 1.0, _height);
+ TextPosition position = TextPosition(offset: ix);
Offset caretOffset =
_textPainter.getOffsetForCaret(position, caretPrototype);
_cursorRects.add(caretPrototype.shift(caretOffset));
@@ -173,7 +173,7 @@
int styleId = _styles[i + 2];
if (styleId == 0) {
TextSelection selection =
- new TextSelection(baseOffset: start, extentOffset: end);
+ TextSelection(baseOffset: start, extentOffset: end);
for (TextBox box in _textPainter.getBoxesForSelection(selection)) {
_selectionRects.add(box.toRect());
}
@@ -186,7 +186,7 @@
@override
void performLayout() {
- size = constraints.constrain(new Size(_nominalWidth, _height));
+ size = constraints.constrain(Size(_nominalWidth, _height));
// TODO: necessary?
_textPainter.layout();
}
@@ -194,11 +194,11 @@
@override
void paint(PaintingContext context, Offset offset) {
//print('painting, offset = $offset');
- Paint paint = new Paint();
+ Paint paint = Paint();
_layoutIfNeeded();
- Color cursorColor = const Color(0xFF000040);
- Color selectionColor = const Color(0xFFB2D8FC);
+ Color cursorColor = Color(0xFF000040);
+ Color selectionColor = Color(0xFFB2D8FC);
for (Rect selectionRect in _selectionRects) {
paint.color = selectionColor;
context.canvas.drawRect(selectionRect.shift(offset), paint);
diff --git a/public/dart-pkg/zircon/test/channel_test.dart b/public/dart-pkg/zircon/test/channel_test.dart
index b5139ce..de49157 100644
--- a/public/dart-pkg/zircon/test/channel_test.dart
+++ b/public/dart-pkg/zircon/test/channel_test.dart
@@ -12,7 +12,7 @@
/// Helper method to turn a [String] into a [ByteData] containing the
/// text of the string encoded as UTF-8.
ByteData utf8Bytes(final String text) {
- return new ByteData.view(new Uint8List.fromList(utf8.encode(text)).buffer);
+ return ByteData.view(Uint8List.fromList(utf8.encode(text)).buffer);
}
void main() {
@@ -28,9 +28,9 @@
expect(pair.first.close(), equals(0));
expect(pair.first.isValid, isFalse);
expect(pair.second.isValid, isTrue);
- expect(System.channelWrite(pair.first, new ByteData(1), <Handle>[]),
+ expect(System.channelWrite(pair.first, ByteData(1), <Handle>[]),
equals(ZX.ERR_BAD_HANDLE));
- expect(System.channelWrite(pair.second, new ByteData(1), <Handle>[]),
+ expect(System.channelWrite(pair.second, ByteData(1), <Handle>[]),
equals(ZX.ERR_PEER_CLOSED));
});
@@ -75,7 +75,7 @@
test('async wait channel read', () async {
final HandlePairResult pair = System.channelCreate();
- final Completer<List<int>> completer = new Completer<List<int>>();
+ final Completer<List<int>> completer = Completer<List<int>>();
pair.first.asyncWait(ZX.CHANNEL_READABLE, (int status, int pending) {
completer.complete(<int>[status, pending]);
});
@@ -92,7 +92,7 @@
test('async wait channel closed', () async {
final HandlePairResult pair = System.channelCreate();
- final Completer<int> completer = new Completer<int>();
+ final Completer<int> completer = Completer<int>();
pair.first.asyncWait(ZX.CHANNEL_PEER_CLOSED, (int status, int pending) {
completer.complete(status);
});
diff --git a/public/dart-pkg/zircon/test/eventpair_test.dart b/public/dart-pkg/zircon/test/eventpair_test.dart
index 1e026bb..5a90eae 100644
--- a/public/dart-pkg/zircon/test/eventpair_test.dart
+++ b/public/dart-pkg/zircon/test/eventpair_test.dart
@@ -38,7 +38,7 @@
test('async wait peer closed', () async {
final HandlePairResult pair = System.eventpairCreate();
- final Completer<int> completer = new Completer<int>();
+ final Completer<int> completer = Completer<int>();
pair.first.asyncWait(EventPair.PEER_CLOSED, (int status, int pending) {
completer.complete(status);
});
diff --git a/public/dart-pkg/zircon/test/socket_test.dart b/public/dart-pkg/zircon/test/socket_test.dart
index c99f781..bf7162e 100644
--- a/public/dart-pkg/zircon/test/socket_test.dart
+++ b/public/dart-pkg/zircon/test/socket_test.dart
@@ -12,7 +12,7 @@
/// Helper method to turn a [String] into a [ByteData] containing the
/// text of the string encoded as UTF-8.
ByteData utf8Bytes(final String text) {
- return new ByteData.view(new Uint8List.fromList(utf8.encode(text)).buffer);
+ return ByteData.view(Uint8List.fromList(utf8.encode(text)).buffer);
}
void main() {
@@ -32,10 +32,10 @@
expect(pair.first.isValid, isFalse);
expect(pair.second.isValid, isTrue);
final WriteResult firstResult =
- System.socketWrite(pair.first, new ByteData(1), 0);
+ System.socketWrite(pair.first, ByteData(1), 0);
expect(firstResult.status, equals(ZX.ERR_BAD_HANDLE));
final WriteResult secondResult =
- System.socketWrite(pair.second, new ByteData(1), 0);
+ System.socketWrite(pair.second, ByteData(1), 0);
expect(secondResult.status, equals(ZX.ERR_PEER_CLOSED));
});
@@ -99,7 +99,7 @@
test('async wait socket read', () async {
final HandlePairResult pair = System.socketCreate();
- final Completer<int> completer = new Completer<int>();
+ final Completer<int> completer = Completer<int>();
pair.first.asyncWait(ZX.SOCKET_READABLE, (int status, int pending) {
completer.complete(status);
});
@@ -114,7 +114,7 @@
test('async wait socket closed', () async {
final HandlePairResult pair = System.socketCreate();
- final Completer<int> completer = new Completer<int>();
+ final Completer<int> completer = Completer<int>();
pair.first.asyncWait(ZX.SOCKET_PEER_CLOSED, (int status, int pending) {
completer.complete(status);
});
diff --git a/public/dart-pkg/zircon/test/vmo_test.dart b/public/dart-pkg/zircon/test/vmo_test.dart
index 5f1b41b..ab48ef4 100644
--- a/public/dart-pkg/zircon/test/vmo_test.dart
+++ b/public/dart-pkg/zircon/test/vmo_test.dart
@@ -13,13 +13,13 @@
group('test vmo', () {
test('fromFile', () {
const String fuchsia = 'Fuchsia';
- File f = new File('tmp/testdata')
+ File f = File('tmp/testdata')
..createSync()
..writeAsStringSync(fuchsia);
String readFuchsia = f.readAsStringSync();
expect(readFuchsia, equals(fuchsia));
- SizedVmo fileVmo = new SizedVmo.fromFile('tmp/testdata');
+ SizedVmo fileVmo = SizedVmo.fromFile('tmp/testdata');
Uint8List fileData = fileVmo.map();
String fileString = utf8.decode(fileData.sublist(0, fileVmo.size));
expect(fileString, equals(fuchsia));
@@ -27,8 +27,8 @@
test('duplicate', () {
const String fuchsia = 'Fuchsia';
- Uint8List data = new Uint8List.fromList(fuchsia.codeUnits);
- SizedVmo vmo = new SizedVmo.fromUint8List(data);
+ Uint8List data = Uint8List.fromList(fuchsia.codeUnits);
+ SizedVmo vmo = SizedVmo.fromUint8List(data);
final Vmo duplicate =
vmo.duplicate(ZX.RIGHTS_BASIC | ZX.RIGHT_READ | ZX.RIGHT_MAP);
expect(duplicate.isValid, isTrue);
diff --git a/public/dart/composition_delegate/lib/src/composition_delegate/composition_delegate.dart b/public/dart/composition_delegate/lib/src/composition_delegate/composition_delegate.dart
index 02e198e..226bb31 100644
--- a/public/dart/composition_delegate/lib/src/composition_delegate/composition_delegate.dart
+++ b/public/dart/composition_delegate/lib/src/composition_delegate/composition_delegate.dart
@@ -34,13 +34,13 @@
/// The default LayoutContext
static const LayoutContext defaultContext =
- const LayoutContext(size: const Size(1280, 800));
+ LayoutContext(size: Size(1280, 800));
/// Constructor
CompositionDelegate({
this.layoutContext = defaultContext,
}) : _hiddenSurfaces = <String>{},
- _surfaceTree = new SurfaceTree();
+ _surfaceTree = SurfaceTree();
/// Add a Surface to the tree. [parentId] is an optional paramater used when
/// this surface has a parent-child relationship with a [Surface] that is
@@ -169,7 +169,7 @@
List<Layer> _splitEvenly(
List<Layer> layout, SurfaceTree spanningTree, int spanningTreeSize) {
- Layer layer = new Layer();
+ Layer layer = Layer();
int surfaceIndex = 0;
double splitSize = layoutContext.size.width / spanningTreeSize;
for (Surface surface in spanningTree) {
diff --git a/public/dart/composition_delegate/lib/src/internal/tree/_surface_node.dart b/public/dart/composition_delegate/lib/src/internal/tree/_surface_node.dart
index 4f204d2..6f50603 100644
--- a/public/dart/composition_delegate/lib/src/internal/tree/_surface_node.dart
+++ b/public/dart/composition_delegate/lib/src/internal/tree/_surface_node.dart
@@ -43,7 +43,7 @@
/// Direct descendents of parent, except this
Iterable<SurfaceNode> get siblings => (_parentNode == null)
- ? new Iterable<SurfaceNode>.empty()
+ ? Iterable<SurfaceNode>.empty()
: _parentNode.childNodes.where((SurfaceNode node) => node != this);
/// Direct ancestors of this, starting at parent to root
diff --git a/public/dart/composition_delegate/lib/src/internal/tree/_surface_tree.dart b/public/dart/composition_delegate/lib/src/internal/tree/_surface_tree.dart
index 3b3a9c3..ff77b38 100644
--- a/public/dart/composition_delegate/lib/src/internal/tree/_surface_tree.dart
+++ b/public/dart/composition_delegate/lib/src/internal/tree/_surface_tree.dart
@@ -150,7 +150,7 @@
} else {
log.warning('node $startNodeId not found in tree, '
'returning empty spanningTree');
- return new SurfaceTree();
+ return SurfaceTree();
}
// find the topmost point of the connected tree where the relationship holds
// (excluding the kRoot, which is not a valid Surface)
@@ -161,7 +161,7 @@
startNode = startNode.parentNode;
}
// then return all the descendents who satisfy condition
- SurfaceTree spanTree = new SurfaceTree()..add(surface: startNode.surface);
+ SurfaceTree spanTree = SurfaceTree()..add(surface: startNode.surface);
__copyTreeWithConditional(
current: startNode, tree: spanTree, condition: condition);
return spanTree;
diff --git a/public/dart/composition_delegate/test/internal/surface_node_test.dart b/public/dart/composition_delegate/test/internal/surface_node_test.dart
index ede4072..b6e312f 100644
--- a/public/dart/composition_delegate/test/internal/surface_node_test.dart
+++ b/public/dart/composition_delegate/test/internal/surface_node_test.dart
@@ -39,18 +39,18 @@
// | child | | sibling | | cousin |
// +---------+ +-----------+ +----------+
//
- uncle = new SurfaceNode(surface: new Surface(surfaceId: 'uncle'));
- cousin = new SurfaceNode(surface: new Surface(surfaceId: 'cousin'));
- sibling = new SurfaceNode(surface: new Surface(surfaceId: 'sibling'));
- child = new SurfaceNode(surface: new Surface(surfaceId: 'child'));
+ uncle = SurfaceNode(surface: Surface(surfaceId: 'uncle'));
+ cousin = SurfaceNode(surface: Surface(surfaceId: 'cousin'));
+ sibling = SurfaceNode(surface: Surface(surfaceId: 'sibling'));
+ child = SurfaceNode(surface: Surface(surfaceId: 'child'));
- aunt = new SurfaceNode(
- surface: new Surface(surfaceId: 'aunt'), childNodes: [cousin]);
- parent = new SurfaceNode(
- surface: new Surface(surfaceId: 'parent'),
+ aunt = SurfaceNode(
+ surface: Surface(surfaceId: 'aunt'), childNodes: [cousin]);
+ parent = SurfaceNode(
+ surface: Surface(surfaceId: 'parent'),
childNodes: [child, sibling]);
- grandparent = new SurfaceNode(
- surface: new Surface(surfaceId: 'grandparent'),
+ grandparent = SurfaceNode(
+ surface: Surface(surfaceId: 'grandparent'),
childNodes: [parent, uncle, aunt]);
detachedParent = <SurfaceNode>[grandparent, uncle, aunt, cousin];
diff --git a/public/dart/composition_delegate/test/internal/surface_tree_test.dart b/public/dart/composition_delegate/test/internal/surface_tree_test.dart
index dee43d6..498258b 100644
--- a/public/dart/composition_delegate/test/internal/surface_tree_test.dart
+++ b/public/dart/composition_delegate/test/internal/surface_tree_test.dart
@@ -22,19 +22,19 @@
setUp(() {
/// Set up a regular tree
- tree = new SurfaceTree();
- grandparent = new Surface(surfaceId: 'grandparent');
- parent = new Surface(surfaceId: 'parent');
- child = new Surface(surfaceId: 'child');
+ tree = SurfaceTree();
+ grandparent = Surface(surfaceId: 'grandparent');
+ parent = Surface(surfaceId: 'parent');
+ child = Surface(surfaceId: 'child');
/// Set up a tree with relationships
- depParent = new Surface(
+ depParent = Surface(
surfaceId: parent.surfaceId,
);
- depChild = new Surface(
+ depChild = Surface(
surfaceId: child.surfaceId,
);
- independent = new Surface(surfaceId: 'independent');
+ independent = Surface(surfaceId: 'independent');
// make tree with dependency relationships:
// gp <-dep- parent <-dep- child <-indep- independent
depTree = SurfaceTree()
diff --git a/public/dart/composition_delegate/test/layout_test.dart b/public/dart/composition_delegate/test/layout_test.dart
index 78d4083..64d97b9 100644
--- a/public/dart/composition_delegate/test/layout_test.dart
+++ b/public/dart/composition_delegate/test/layout_test.dart
@@ -7,8 +7,8 @@
void main() {
CompositionDelegate setupCompositionDelegate() {
- CompositionDelegate compDelegate = new CompositionDelegate(
- layoutContext: new LayoutContext(size: Size(1280, 800)));
+ CompositionDelegate compDelegate = CompositionDelegate(
+ layoutContext: LayoutContext(size: Size(1280, 800)));
return compDelegate;
}
diff --git a/public/dart/fidl/lib/src/codec.dart b/public/dart/fidl/lib/src/codec.dart
index ce0d94d..1d60e90 100644
--- a/public/dart/fidl/lib/src/codec.dart
+++ b/public/dart/fidl/lib/src/codec.dart
@@ -21,7 +21,7 @@
void _throwIfNegative(int value) {
if (value < 0) {
- throw new FidlError(
+ throw FidlError(
'Cannot encode a negative value for an unsigned type: $value');
}
}
@@ -30,16 +30,16 @@
class Encoder {
Message get message {
- final ByteData trimmed = new ByteData.view(data.buffer, 0, _extent);
- return new Message(trimmed, _handles, _extent, _handles.length);
+ final ByteData trimmed = ByteData.view(data.buffer, 0, _extent);
+ return Message(trimmed, _handles, _extent, _handles.length);
}
- ByteData data = new ByteData(_kInitialBufferSize);
+ ByteData data = ByteData(_kInitialBufferSize);
final List<Handle> _handles = <Handle>[];
int _extent = 0;
void _grow(int newSize) {
- final Uint8List newList = new Uint8List(newSize)
+ final Uint8List newList = Uint8List(newSize)
..setRange(0, data.lengthInBytes, data.buffer.asUint8List());
data = newList.buffer.asByteData();
}
@@ -144,7 +144,7 @@
final int result = _nextOffset;
_nextOffset += _align(size);
if (_nextOffset > _message.dataLength) {
- throw new FidlError('Cannot access out of range memory');
+ throw FidlError('Cannot access out of range memory');
}
return result;
}
@@ -155,7 +155,7 @@
Handle claimHandle() {
if (_nextHandle >= _message.handlesLength) {
- throw new FidlError('Cannot access out of range handle');
+ throw FidlError('Cannot access out of range handle');
}
return _message.handles[_nextHandle++];
}
diff --git a/public/dart/fidl/lib/src/interface.dart b/public/dart/fidl/lib/src/interface.dart
index 60c7e8e..5763994 100644
--- a/public/dart/fidl/lib/src/interface.dart
+++ b/public/dart/fidl/lib/src/interface.dart
@@ -146,9 +146,9 @@
class InterfacePair<T> {
InterfacePair() {
- ChannelPair pair = new ChannelPair();
- request = new InterfaceRequest<T>(pair.first);
- handle = new InterfaceHandle<T>(pair.second);
+ ChannelPair pair = ChannelPair();
+ request = InterfaceRequest<T>(pair.first);
+ handle = InterfaceHandle<T>(pair.second);
}
InterfaceRequest<T> request;
@@ -198,7 +198,7 @@
/// The `impl` parameter must not be null.
InterfaceHandle<T> wrap(T impl) {
assert(!isBound);
- ChannelPair pair = new ChannelPair();
+ ChannelPair pair = ChannelPair();
if (pair.status != ZX.OK) {
return null;
}
@@ -209,7 +209,7 @@
onBind();
}
- return new InterfaceHandle<T>(pair.second);
+ return InterfaceHandle<T>(pair.second);
}
/// Binds the given implementation to the given interface request.
@@ -245,7 +245,7 @@
InterfaceRequest<T> unbind() {
assert(isBound);
final InterfaceRequest<T> result =
- new InterfaceRequest<T>(_reader.unbind());
+ InterfaceRequest<T>(_reader.unbind());
_impl = null;
if (onUnbind != null) {
@@ -293,10 +293,10 @@
void _handleReadable() {
final ReadResult result = _reader.channel.queryAndRead();
if ((result.bytes == null) || (result.bytes.lengthInBytes == 0))
- throw new FidlError('Unexpected empty message or error: $result '
+ throw FidlError('Unexpected empty message or error: $result '
'from channel ${_reader.channel}');
- final Message message = new Message.fromReadResult(result);
+ final Message message = Message.fromReadResult(result);
handleMessage(message, sendMessage);
}
@@ -320,7 +320,7 @@
_reader.channel.write(response.data, response.handles);
}
- final ChannelReader _reader = new ChannelReader();
+ final ChannelReader _reader = ChannelReader();
}
/// The object that [ProxyController<T>.error] completes with when there is
@@ -398,7 +398,7 @@
/// The proxy must not already have been bound.
InterfaceRequest<T> request() {
assert(!isBound);
- ChannelPair pair = new ChannelPair();
+ ChannelPair pair = ChannelPair();
assert(pair.status == ZX.OK);
_reader.bind(pair.first);
@@ -407,7 +407,7 @@
onBind();
}
- return new InterfaceRequest<T>(pair.second);
+ return InterfaceRequest<T>(pair.second);
}
/// Binds the proxy to the given interface handle.
@@ -448,7 +448,7 @@
}
// TODO(rosswang): Do we need to _reset() here?
- return new InterfaceHandle<T>(_reader.unbind());
+ return InterfaceHandle<T>(_reader.unbind());
}
/// Whether this object is bound to a channel.
@@ -481,27 +481,27 @@
/// Used by subclasses of [Proxy<T>] to receive responses to messages.
MessageSink onResponse;
- final ChannelReader _reader = new ChannelReader();
- final HashMap<int, Function> _callbackMap = new HashMap<int, Function>();
+ final ChannelReader _reader = ChannelReader();
+ final HashMap<int, Function> _callbackMap = HashMap<int, Function>();
/// A future that completes when an error is generated by the proxy.
Future<ProxyError> get error => _errorCompleter.future;
- Completer<ProxyError> _errorCompleter = new Completer<ProxyError>();
+ Completer<ProxyError> _errorCompleter = Completer<ProxyError>();
/// A future that completes when the proxy is bound.
Future<Null> get bound => _boundCompleter.future;
- Completer<Null> _boundCompleter = new Completer<Null>();
+ Completer<Null> _boundCompleter = Completer<Null>();
int _nextTxid = 1;
int _pendingResponsesCount = 0;
void _reset() {
_callbackMap.clear();
- _errorCompleter = new Completer<ProxyError>();
+ _errorCompleter = Completer<ProxyError>();
if (!_boundCompleter.isCompleted) {
_boundCompleter.completeError('Proxy<${$interfaceName}> closed.');
}
- _boundCompleter = new Completer<Null>();
+ _boundCompleter = Completer<Null>();
_nextTxid = 1;
_pendingResponsesCount = 0;
}
@@ -515,7 +515,7 @@
try {
_pendingResponsesCount--;
if (onResponse != null) {
- onResponse(new Message.fromReadResult(result));
+ onResponse(Message.fromReadResult(result));
}
} on FidlError catch (e) {
if (result.handles != null) {
@@ -601,9 +601,9 @@
print(fullMessage);
if (!_errorCompleter.isCompleted) {
error.whenComplete(() {
- _errorCompleter = new Completer<ProxyError>();
+ _errorCompleter = Completer<ProxyError>();
});
- _errorCompleter.complete(new ProxyError(fullMessage));
+ _errorCompleter.complete(ProxyError(fullMessage));
}
}
}
diff --git a/public/dart/fidl/lib/src/interface_async.dart b/public/dart/fidl/lib/src/interface_async.dart
index 01900bf..f99ee6d 100644
--- a/public/dart/fidl/lib/src/interface_async.dart
+++ b/public/dart/fidl/lib/src/interface_async.dart
@@ -38,7 +38,7 @@
/// The controller for the stream of state changes.
final StreamController<InterfaceState> _streamController =
- new StreamController.broadcast();
+ StreamController.broadcast();
/// Gets the current state.
InterfaceState get state => _currentState;
@@ -51,7 +51,7 @@
return;
}
if (newState.index < _currentState.index) {
- throw new FidlStateException(
+ throw FidlStateException(
"Can't change InterfaceState from $_currentState to $newState.");
}
_currentState = newState;
@@ -73,10 +73,10 @@
return stateChanges.firstWhere((s) => s == InterfaceState.bound);
}
if (_currentState == InterfaceState.bound) {
- return new Future.value();
+ return Future.value();
}
- return new Future.error(
- new FidlStateException('Interface will never become bound'));
+ return Future.error(
+ FidlStateException('Interface will never become bound'));
}
/// Is this interface closed?
@@ -85,7 +85,7 @@
/// A future that completes when the interface is closed.
Future<void> get whenClosed {
if (_currentState == InterfaceState.closed) {
- return new Future.value();
+ return Future.value();
}
return stateChanges.firstWhere((s) => s == InterfaceState.closed);
}
@@ -118,12 +118,12 @@
/// The `impl` parameter must not be null.
InterfaceHandle<T> wrap(T impl) {
if (!isUnbound) {
- throw new FidlStateException(
+ throw FidlStateException(
"AsyncBinding<${$interfaceName}> isn't unbound");
}
- ChannelPair pair = new ChannelPair();
+ ChannelPair pair = ChannelPair();
if (pair.status != ZX.OK) {
- throw new Exception(
+ throw Exception(
"AsyncBinding<${$interfaceName}> couldn't create channel: ${getStringForStatus(pair.status)}");
}
_impl = impl;
@@ -131,7 +131,7 @@
state = InterfaceState.bound;
- return new InterfaceHandle<T>(pair.second);
+ return InterfaceHandle<T>(pair.second);
}
/// Binds the given implementation to the given interface request.
@@ -145,21 +145,21 @@
/// `channel` property of the given `interfaceRequest` must not be `null`.
void bind(T impl, InterfaceRequest<T> interfaceRequest) {
if (!isUnbound) {
- throw new FidlStateException(
+ throw FidlStateException(
"AsyncBinding<${$interfaceName}> isn't unbound");
}
if (impl == null) {
- throw new FidlError(
+ throw FidlError(
"AsyncBinding<${$interfaceName}> can't bind to a null impl");
}
if (interfaceRequest == null) {
- throw new FidlError(
+ throw FidlError(
"AsyncBinding<${$interfaceName}> can't bind to a null InterfaceRequest");
}
Channel channel = interfaceRequest.passChannel();
if (channel == null) {
- throw new FidlError(
+ throw FidlError(
"AsyncBinding<${$interfaceName}> can't bind to a null InterfaceRequest channel");
}
@@ -178,11 +178,11 @@
/// The object must have previously been bound (e.g., using [bind]).
InterfaceRequest<T> unbind() {
if (!isBound) {
- throw new FidlStateException(
+ throw FidlStateException(
"AsyncBinding<${$interfaceName}> isn't bound");
}
final InterfaceRequest<T> result =
- new InterfaceRequest<T>(_reader.unbind());
+ InterfaceRequest<T>(_reader.unbind());
_impl = null;
state = InterfaceState.closed;
@@ -218,10 +218,10 @@
void _handleReadable() {
final ReadResult result = _reader.channel.queryAndRead();
if ((result.bytes == null) || (result.bytes.lengthInBytes == 0))
- throw new FidlError(
+ throw FidlError(
'AsyncBinding<${$interfaceName}> Unexpected empty message or error: $result');
- final Message message = new Message.fromReadResult(result);
+ final Message message = Message.fromReadResult(result);
handleMessage(message, sendMessage);
}
@@ -243,7 +243,7 @@
_reader.channel.write(response.data, response.handles);
}
- final ChannelReader _reader = new ChannelReader();
+ final ChannelReader _reader = ChannelReader();
}
/// Representation of a service that all [T] implementations should extend from.
@@ -284,9 +284,9 @@
/// A controller for Future based proxies.
class AsyncProxyController<T> extends _Stateful {
- final ChannelReader _reader = new ChannelReader();
+ final ChannelReader _reader = ChannelReader();
- final HashMap<int, Completer<dynamic>> _completerMap = new HashMap();
+ final HashMap<int, Completer<dynamic>> _completerMap = HashMap();
int _nextTxid = 1;
/// Creates proxy controller.
@@ -301,7 +301,7 @@
whenClosed.then((_) {
for (final Completer completer in _completerMap.values) {
if (!completer.isCompleted) {
- completer.completeError(new FidlError(
+ completer.completeError(FidlError(
'AsyncProxyController<${$interfaceName}> connection closed'));
}
}
@@ -335,19 +335,19 @@
/// The proxy must not already have been bound.
InterfaceRequest<T> request() {
if (!isUnbound) {
- throw new FidlStateException(
+ throw FidlStateException(
"AsyncProxyController<${$interfaceName}> isn't unbound");
}
- ChannelPair pair = new ChannelPair();
+ ChannelPair pair = ChannelPair();
if (pair.status != ZX.OK) {
- throw new FidlError(
+ throw FidlError(
"AsyncProxyController<${$interfaceName}> couldn't create channel: ${getStringForStatus(pair.status)}");
}
_reader.bind(pair.first);
state = InterfaceState.bound;
- return new InterfaceRequest<T>(pair.second);
+ return InterfaceRequest<T>(pair.second);
}
/// Binds the proxy to the given interface handle.
@@ -361,15 +361,15 @@
/// of the given `interfaceHandle` must not be null.
void bind(InterfaceHandle<T> interfaceHandle) {
if (!isUnbound) {
- throw new FidlStateException(
+ throw FidlStateException(
"AsyncProxyController<${$interfaceName}> isn't unbound");
}
if (interfaceHandle == null) {
- throw new FidlError(
+ throw FidlError(
"AsyncProxyController<${$interfaceName}> can't bind to null InterfaceHandle");
}
if (interfaceHandle.channel == null) {
- throw new FidlError(
+ throw FidlError(
"AsyncProxyController<${$interfaceName}> can't bind to null InterfaceHandle channel");
}
@@ -385,17 +385,17 @@
/// The proxy must have previously been bound (e.g., using [bind]).
InterfaceHandle<T> unbind() {
if (!isBound) {
- throw new FidlStateException(
+ throw FidlStateException(
"AsyncProxyController<${$interfaceName}> isn't bound");
}
if (!_reader.isBound) {
- throw new FidlError(
+ throw FidlError(
"AsyncProxyController<${$interfaceName}> reader isn't bound");
}
state = InterfaceState.closed;
- return new InterfaceHandle<T>(_reader.unbind());
+ return InterfaceHandle<T>(_reader.unbind());
}
/// Close the channel bound to the proxy.
@@ -406,7 +406,7 @@
_reader.close();
state = InterfaceState.closed;
_completerMap.forEach((_, Completer<dynamic> completer) =>
- completer.completeError(new FidlStateException(
+ completer.completeError(FidlStateException(
'AsyncProxyController<${$interfaceName}> is closed.')));
}
}
@@ -425,13 +425,13 @@
void _handleReadable() {
final ReadResult result = _reader.channel.queryAndRead();
if ((result.bytes == null) || (result.bytes.lengthInBytes == 0)) {
- proxyError(new FidlError(
+ proxyError(FidlError(
'AsyncProxyController<${$interfaceName}>: Read from channel failed'));
return;
}
try {
if (onResponse != null) {
- onResponse(new Message.fromReadResult(result));
+ onResponse(Message.fromReadResult(result));
}
} on FidlError catch (e) {
if (result.handles != null) {
@@ -445,7 +445,7 @@
/// Always called when the channel underneath closes.
void _handleError(ChannelReaderError error) {
- proxyError(new FidlError(error.toString()));
+ proxyError(FidlError(error.toString()));
}
/// Sends the given messages over the bound channel.
@@ -453,13 +453,13 @@
/// Used by subclasses of [Proxy<T>] to send encoded messages.
void sendMessage(Message message) {
if (!_reader.isBound) {
- proxyError(new FidlStateException(
+ proxyError(FidlStateException(
'AsyncProxyController<${$interfaceName}> is closed.'));
return;
}
final int status = _reader.channel.write(message.data, message.handles);
if (status != ZX.OK) {
- proxyError(new FidlError(
+ proxyError(FidlError(
'AsyncProxyController<${$interfaceName}> failed to write to channel: ${_reader.channel} (status: $status)'));
}
}
@@ -470,7 +470,7 @@
/// Used by subclasses of [AsyncProxy<T>] to send encoded messages.
void sendMessageWithResponse(Message message, Completer<dynamic> completer) {
if (!_reader.isBound) {
- proxyError(new FidlStateException(
+ proxyError(FidlStateException(
'AsyncProxyController<${$interfaceName}> is closed.'));
return;
}
@@ -485,7 +485,7 @@
final int status = _reader.channel.write(message.data, message.handles);
if (status != ZX.OK) {
- proxyError(new FidlError(
+ proxyError(FidlError(
'AsyncProxyController<${$interfaceName}> failed to write to channel: ${_reader.channel} (status: $status)'));
return;
}
@@ -498,7 +498,7 @@
Completer getCompleter(int txid) {
final Completer result = _completerMap.remove(txid);
if (result == null) {
- proxyError(new FidlError('Message had unknown request id: $txid'));
+ proxyError(FidlError('Message had unknown request id: $txid'));
}
return result;
}
diff --git a/public/dart/fidl/lib/src/message.dart b/public/dart/fidl/lib/src/message.dart
index 744c836..3190ec0 100644
--- a/public/dart/fidl/lib/src/message.dart
+++ b/public/dart/fidl/lib/src/message.dart
@@ -34,12 +34,12 @@
void hexDump() {
const int width = 16;
- Uint8List list = new Uint8List.view(data.buffer, 0);
- StringBuffer buffer = new StringBuffer();
- final RegExp isPrintable = new RegExp(r'\w');
+ Uint8List list = Uint8List.view(data.buffer, 0);
+ StringBuffer buffer = StringBuffer();
+ final RegExp isPrintable = RegExp(r'\w');
for (int i = 0; i < dataLength; i += width) {
- StringBuffer hex = new StringBuffer();
- StringBuffer printable = new StringBuffer();
+ StringBuffer hex = StringBuffer();
+ StringBuffer printable = StringBuffer();
for (int j = 0; j < width && i + j < dataLength; j++) {
int v = list[i + j];
String s = v.toRadixString(16);
@@ -48,7 +48,7 @@
else
hex.write('$s ');
- s = new String.fromCharCode(v);
+ s = String.fromCharCode(v);
if (isPrintable.hasMatch(s)) {
printable.write(s);
} else {
diff --git a/public/dart/fidl/lib/src/types.dart b/public/dart/fidl/lib/src/types.dart
index 1a5313b..61b0679 100644
--- a/public/dart/fidl/lib/src/types.dart
+++ b/public/dart/fidl/lib/src/types.dart
@@ -21,27 +21,27 @@
void _throwIfNotNullable(bool nullable) {
if (!nullable) {
- throw new FidlError('Found null for a non-nullable type');
+ throw FidlError('Found null for a non-nullable type');
}
}
void _throwIfExceedsLimit(int count, int limit) {
if (limit != null && count > limit) {
- throw new FidlError(
+ throw FidlError(
'Found an object wth $count elements. Limited to $limit.');
}
}
void _throwIfCountMismatch(int count, int expectedCount) {
if (count != expectedCount) {
- throw new FidlError(
+ throw FidlError(
'Found an array of count $count. Expected $expectedCount.');
}
}
void _throwIfNotZero(int value) {
if (value != 0) {
- throw new FidlError('Expected zero, got: $value');
+ throw FidlError('Expected zero, got: $value');
}
}
@@ -145,7 +145,7 @@
}
List<T> decodeArray(Decoder decoder, int count, int offset) {
- final List<T> list = new List<T>(count);
+ final List<T> list = List<T>(count);
for (int i = 0; i < count; ++i) {
list[i] = decode(decoder, offset + i * encodedSize);
}
@@ -401,7 +401,7 @@
} else if (encoded == kHandlePresent) {
// Nothing to validate.
} else {
- throw new FidlError('Invalid handle encoding: $encoded.');
+ throw FidlError('Invalid handle encoding: $encoded.');
}
}
@@ -420,7 +420,7 @@
_validateEncodedHandle(encoded, nullable);
return encoded == kHandlePresent
? decoder.claimHandle()
- : new Handle.invalid();
+ : Handle.invalid();
}
// TODO(pascallouis): By having _HandleWrapper exported, we could DRY this code
@@ -459,7 +459,7 @@
@override
Channel decode(Decoder decoder, int offset) =>
- new Channel(_decodeHandle(decoder, offset, nullable));
+ Channel(_decodeHandle(decoder, offset, nullable));
}
class EventPairType extends NullableFidlType<EventPair> {
@@ -474,7 +474,7 @@
@override
EventPair decode(Decoder decoder, int offset) =>
- new EventPair(_decodeHandle(decoder, offset, nullable));
+ EventPair(_decodeHandle(decoder, offset, nullable));
}
class SocketType extends NullableFidlType<Socket> {
@@ -489,7 +489,7 @@
@override
Socket decode(Decoder decoder, int offset) =>
- new Socket(_decodeHandle(decoder, offset, nullable));
+ Socket(_decodeHandle(decoder, offset, nullable));
}
class VmoType extends NullableFidlType<Vmo> {
@@ -504,7 +504,7 @@
@override
Vmo decode(Decoder decoder, int offset) =>
- new Vmo(_decodeHandle(decoder, offset, nullable));
+ Vmo(_decodeHandle(decoder, offset, nullable));
}
class InterfaceHandleType<T> extends NullableFidlType<InterfaceHandle<T>> {
@@ -520,7 +520,7 @@
@override
InterfaceHandle<T> decode(Decoder decoder, int offset) {
final Handle handle = _decodeHandle(decoder, offset, nullable);
- return new InterfaceHandle<T>(handle.isValid ? new Channel(handle) : null);
+ return InterfaceHandle<T>(handle.isValid ? Channel(handle) : null);
}
}
@@ -537,7 +537,7 @@
@override
InterfaceRequest<T> decode(Decoder decoder, int offset) {
final Handle handle = _decodeHandle(decoder, offset, nullable);
- return new InterfaceRequest<T>(handle.isValid ? new Channel(handle) : null);
+ return InterfaceRequest<T>(handle.isValid ? Channel(handle) : null);
}
}
@@ -560,7 +560,7 @@
..encodeUint64(kAllocAbsent, offset + 8); // data
return null;
}
- final bytes = const Utf8Encoder().convert(value);
+ final bytes = Utf8Encoder().convert(value);
final int size = bytes.length;
encoder
..encodeUint64(size, offset) // size
@@ -601,7 +601,7 @@
} else if (data == kAllocPresent) {
_throwIfExceedsLimit(size, maybeElementCount);
} else {
- throw new FidlError('Invalid string encoding: $data.');
+ throw FidlError('Invalid string encoding: $data.');
}
}
}
@@ -636,7 +636,7 @@
void validateEncoded(int encoded) {
if (encoded != kAllocAbsent && encoded != kAllocPresent) {
- throw new FidlError('Invalid pointer encoding: $encoded.');
+ throw FidlError('Invalid pointer encoding: $encoded.');
}
}
}
@@ -674,7 +674,7 @@
final int count = members.length;
final List<Object> values = value.$fields;
if (values.length != count) {
- throw new FidlError(
+ throw FidlError(
'Unexpected number of members for $T. Expected $count. Got ${values.length}');
}
for (int i = 0; i < count; ++i) {
@@ -685,7 +685,7 @@
@override
T decode(Decoder decoder, int offset) {
final int argc = members.length;
- final List<Object> argv = new List<Object>(argc);
+ final List<Object> argv = List<Object>(argc);
for (int i = 0; i < argc; ++i) {
argv[i] = members[i].decode(decoder, offset);
}
@@ -727,7 +727,7 @@
switch (fieldPresent) {
case kAllocPresent:
if (mode == _envelopeMode.kMustBeAbsent)
- throw new FidlError('expected empty envelope');
+ throw FidlError('expected empty envelope');
final fieldKnown = fieldType != null;
if (fieldKnown) {
final fieldOffset = decoder.claimMemory(fieldType.encodedSize);
@@ -737,9 +737,9 @@
final numHandlesConsumed =
decoder.countClaimedHandles() - claimedHandles;
if (numBytes != numBytesConsumed)
- throw new FidlError('field was mis-sized');
+ throw FidlError('field was mis-sized');
if (numHandles != numHandlesConsumed)
- throw new FidlError('handles were mis-sized');
+ throw FidlError('handles were mis-sized');
return field;
} else if (mode == _envelopeMode.kAllowUnknown) {
decoder.claimMemory(numBytes);
@@ -754,17 +754,17 @@
}
return null;
} else {
- throw new FidlError('unknown field');
+ throw FidlError('unknown field');
}
break;
case kAllocAbsent:
if (numBytes != 0)
- throw new FidlError('absent envelope with non-zero bytes');
+ throw FidlError('absent envelope with non-zero bytes');
if (numHandles != 0)
- throw new FidlError('absent envelope with non-zero handles');
+ throw FidlError('absent envelope with non-zero handles');
return null;
default:
- throw new FidlError('Bad reference encoding');
+ throw FidlError('Bad reference encoding');
}
}
@@ -784,7 +784,7 @@
int maxOrdinal = 0;
value.$fields.forEach((ordinal, field) {
if (!members.containsKey(ordinal)) {
- throw new FidlError(
+ throw FidlError(
'Cannot encode unknown table member with ordinal: $ordinal');
}
if (field != null) {
@@ -830,9 +830,9 @@
case kAllocPresent:
break; // good
case kAllocAbsent:
- throw new FidlError('Unexpected null reference');
+ throw FidlError('Unexpected null reference');
default:
- throw new FidlError('Bad reference encoding');
+ throw FidlError('Bad reference encoding');
}
// Early exit on empty table.
@@ -872,7 +872,7 @@
void encode(Encoder encoder, T value, int offset) {
final int index = value.$index;
if (index < 0 || index >= members.length)
- throw new FidlError('Bad union tag index: $index');
+ throw FidlError('Bad union tag index: $index');
encoder.encodeUint32(index, offset);
members[index].encode(encoder, value.$data, offset);
}
@@ -881,7 +881,7 @@
T decode(Decoder decoder, int offset) {
final int index = decoder.decodeUint32(offset);
if (index < 0 || index >= members.length)
- throw new FidlError('Bad union tag index: $index');
+ throw FidlError('Bad union tag index: $index');
return ctor(index, members[index].decode(decoder, offset));
}
}
@@ -910,7 +910,7 @@
final int ordinal = value.$ordinal;
final FidlType fieldType = members[ordinal];
if (fieldType == null)
- throw new FidlError('Bad xunion ordinal: $ordinal');
+ throw FidlError('Bad xunion ordinal: $ordinal');
encoder.encodeUint32(ordinal, offset);
_encodeEnvelopePresent(encoder, envelopeOffset, value.$data, fieldType);
}
@@ -922,7 +922,7 @@
final int ordinal = decoder.decodeUint32(offset);
if (ordinal == 0) {
if (!nullable) {
- throw new FidlError('Zero xunion ordinal on non-nullable');
+ throw FidlError('Zero xunion ordinal on non-nullable');
}
_decodeEnvelope(
decoder, envelopeOffset, _envelopeMode.kMustBeAbsent, null);
@@ -930,11 +930,11 @@
} else {
final fieldType = members[ordinal];
if (fieldType == null)
- throw new FidlError('Bad xunion ordinal: $ordinal');
+ throw FidlError('Bad xunion ordinal: $ordinal');
final field = _decodeEnvelope(
decoder, envelopeOffset, _envelopeMode.kDisallowUnknown, fieldType);
if (field == null)
- throw new FidlError('Bad xunion: missing content');
+ throw FidlError('Bad xunion: missing content');
return ctor(ordinal, field);
}
}
@@ -976,12 +976,12 @@
@override
void encode(Encoder encoder, Null value, int offset) {
- throw new FidlError('Cannot encode a method.');
+ throw FidlError('Cannot encode a method.');
}
@override
Null decode(Decoder decoder, int offset) {
- throw new FidlError('Cannot decode a method.');
+ throw FidlError('Cannot decode a method.');
}
}
@@ -1039,7 +1039,7 @@
} else if (data == kAllocPresent) {
_throwIfExceedsLimit(count, maybeElementCount);
} else {
- throw new FidlError('Invalid vector encoding: $data.');
+ throw FidlError('Invalid vector encoding: $data.');
}
}
}
diff --git a/public/dart/fuchsia/lib/src/fakes/fuchsia_fakes.dart b/public/dart/fuchsia/lib/src/fakes/fuchsia_fakes.dart
index 6551caf..a1e7c40 100644
--- a/public/dart/fuchsia/lib/src/fakes/fuchsia_fakes.dart
+++ b/public/dart/fuchsia/lib/src/fakes/fuchsia_fakes.dart
@@ -11,9 +11,9 @@
// ignore_for_file: public_member_api_docs
class MxStartupInfo {
- static Handle takeEnvironment() => new Handle.invalid();
+ static Handle takeEnvironment() => Handle.invalid();
- static Handle takeOutgoingServices() => new Handle.invalid();
+ static Handle takeOutgoingServices() => Handle.invalid();
}
void exit(int returnCode) {
diff --git a/public/dart/fuchsia_inspect/lib/src/vmo_fields.dart b/public/dart/fuchsia_inspect/lib/src/vmo_fields.dart
index 938796e..fcaddf5 100644
--- a/public/dart/fuchsia_inspect/lib/src/vmo_fields.dart
+++ b/public/dart/fuchsia_inspect/lib/src/vmo_fields.dart
@@ -77,46 +77,46 @@
const BlockType._(this.value, this.name);
/// Empty block, ready to be used.
- static const BlockType free = const BlockType._(0, 'free');
+ static const BlockType free = BlockType._(0, 'free');
/// In transition toward being used.
- static const BlockType reserved = const BlockType._(1, 'reserved');
+ static const BlockType reserved = BlockType._(1, 'reserved');
/// One block to rule them all. Index 0.
- static const BlockType header = const BlockType._(2, 'header');
+ static const BlockType header = BlockType._(2, 'header');
/// An entry in the Inspect tree, which may hold child Values: Nodes,
/// Metrics, or Properties.
- static const BlockType nodeValue = const BlockType._(3, 'nodeValue');
+ static const BlockType nodeValue = BlockType._(3, 'nodeValue');
/// An int Metric.
- static const BlockType intValue = const BlockType._(4, 'intValue');
+ static const BlockType intValue = BlockType._(4, 'intValue');
/// A uint Metric.
- static const BlockType uintValue = const BlockType._(5, 'uintValue');
+ static const BlockType uintValue = BlockType._(5, 'uintValue');
/// A double Metric.
- static const BlockType doubleValue = const BlockType._(6, 'doubleValue');
+ static const BlockType doubleValue = BlockType._(6, 'doubleValue');
/// The header of a string or byte-vector Property.
- static const BlockType propertyValue = const BlockType._(7, 'propertyValue');
+ static const BlockType propertyValue = BlockType._(7, 'propertyValue');
/// The contents of a string Property (in a singly linked list, if necessary).
- static const BlockType extent = const BlockType._(8, 'extent');
+ static const BlockType extent = BlockType._(8, 'extent');
/// The name of a Value (Property, Metric, or Node) stored as utf8.
///
/// Name must be contained in this one block. This may truncate utf8 strings
/// in the middle of a multibyte character.
- static const BlockType nameUtf8 = const BlockType._(9, 'nameUtf8');
+ static const BlockType nameUtf8 = BlockType._(9, 'nameUtf8');
/// A property that's been deleted but still has live children.
- static const BlockType tombstone = const BlockType._(10, 'tombstone');
+ static const BlockType tombstone = BlockType._(10, 'tombstone');
/// *_VALUE type, for internal use.
///
/// Not valid if written to VMO.
- static const BlockType anyValue = const BlockType._(11, 'anyValue');
+ static const BlockType anyValue = BlockType._(11, 'anyValue');
}
/// Order defines the block size: 1 << (order + 4).
diff --git a/public/dart/fuchsia_inspect/lib/src/vmo_holder.dart b/public/dart/fuchsia_inspect/lib/src/vmo_holder.dart
index 1e54c81..a1747db 100644
--- a/public/dart/fuchsia_inspect/lib/src/vmo_holder.dart
+++ b/public/dart/fuchsia_inspect/lib/src/vmo_holder.dart
@@ -15,7 +15,7 @@
VmoHolder(this.size) {
HandleResult result = System.vmoCreate(size);
if (result.status != ZX.OK) {
- throw new ZxStatusException(
+ throw ZxStatusException(
result.status, getStringForStatus(result.status));
}
_vmo = Vmo(result.handle);
@@ -36,7 +36,7 @@
void write(int offset, ByteData data) {
int status = _vmo.write(data, offset);
if (status != ZX.OK) {
- throw new ZxStatusException(status, getStringForStatus(status));
+ throw ZxStatusException(status, getStringForStatus(status));
}
}
@@ -44,7 +44,7 @@
ByteData read(int offset, int size) {
ReadResult result = _vmo.read(size, offset);
if (result.status != ZX.OK) {
- throw new ZxStatusException(
+ throw ZxStatusException(
result.status, getStringForStatus(result.status));
}
return result.bytes;
diff --git a/public/dart/fuchsia_inspect/test/util.dart b/public/dart/fuchsia_inspect/test/util.dart
index 9a98af3..a6759ae 100644
--- a/public/dart/fuchsia_inspect/test/util.dart
+++ b/public/dart/fuchsia_inspect/test/util.dart
@@ -196,7 +196,7 @@
return false;
}
- var listEquals = const ListEquality().equals;
+ var listEquals = ListEquality().equals;
ByteData byteData = item;
return listEquals(
diff --git a/public/dart/fuchsia_logger/lib/src/internal/_log_message.dart b/public/dart/fuchsia_logger/lib/src/internal/_log_message.dart
index 43600d7..92238f3 100644
--- a/public/dart/fuchsia_logger/lib/src/internal/_log_message.dart
+++ b/public/dart/fuchsia_logger/lib/src/internal/_log_message.dart
@@ -46,7 +46,7 @@
/// The time that this message was created
final int systemTime = Platform.isFuchsia
? System.clockGet(_zxClockMonotonic)
- : new DateTime.now().microsecondsSinceEpoch * 1000;
+ : DateTime.now().microsecondsSinceEpoch * 1000;
/// The default constructor
LogMessage({
diff --git a/public/dart/fuchsia_logger/lib/src/internal/_log_writer.dart b/public/dart/fuchsia_logger/lib/src/internal/_log_writer.dart
index 5512599..2deab8f 100644
--- a/public/dart/fuchsia_logger/lib/src/internal/_log_writer.dart
+++ b/public/dart/fuchsia_logger/lib/src/internal/_log_writer.dart
@@ -20,7 +20,7 @@
/// The base class for which log writers will inherit from. This class is
/// used to pipe logs from the onRecord stream
abstract class LogWriter {
- List<String> _globalTags = const [];
+ List<String> _globalTags = [];
StreamController<LogMessage> _controller;
diff --git a/public/dart/fuchsia_logger/test/internal/log_message_test.dart b/public/dart/fuchsia_logger/test/internal/log_message_test.dart
index ad18571..627afb9 100644
--- a/public/dart/fuchsia_logger/test/internal/log_message_test.dart
+++ b/public/dart/fuchsia_logger/test/internal/log_message_test.dart
@@ -138,7 +138,7 @@
/// Convert from little endian format bytes to an unsiged 32 bit int.
int _bytesToInt32(List<int> bytes) {
- ByteData byteData = new ByteData(4);
+ ByteData byteData = ByteData(4);
for (int i = 0; i < 4; i++) {
byteData.setInt8(i, bytes[i]);
}
@@ -147,7 +147,7 @@
/// Convert from little endian format bytes to an unsiged 64 bit int.
int _bytesToUint64(List<int> bytes) {
- ByteData byteData = new ByteData(8);
+ ByteData byteData = ByteData(8);
for (int i = 0; i < 8; i++) {
byteData.setInt8(i, bytes[i]);
}
@@ -176,7 +176,7 @@
// Log time should be within the last 30 seconds
int nowNanos = Platform.isFuchsia
? System.clockGet(_zxClockMonotonic)
- : new DateTime.now().microsecondsSinceEpoch * 1000;
+ : DateTime.now().microsecondsSinceEpoch * 1000;
int logNanos = _bytesToUint64(data.sublist(16, 24));
expect(logNanos, lessThanOrEqualTo(nowNanos));
diff --git a/public/dart/fuchsia_modular/examples/multilevel_mod/lib/src/handlers/root_intent_handler.dart b/public/dart/fuchsia_modular/examples/multilevel_mod/lib/src/handlers/root_intent_handler.dart
index 4297cb0..7a044d6 100644
--- a/public/dart/fuchsia_modular/examples/multilevel_mod/lib/src/handlers/root_intent_handler.dart
+++ b/public/dart/fuchsia_modular/examples/multilevel_mod/lib/src/handlers/root_intent_handler.dart
@@ -5,7 +5,7 @@
import 'package:flutter/material.dart';
import 'package:fuchsia_modular/module.dart';
-const List<Color> _colors = const <Color>[
+const List<Color> _colors = <Color>[
Colors.red,
Colors.orange,
Colors.yellow,
@@ -29,7 +29,7 @@
backgroundColor: Colors.black54,
body: Center(
child: Stack(
- alignment: const Alignment(0.0, 0.0),
+ alignment: Alignment(0.0, 0.0),
children: _createLayers(_numTotalLayers)),
),
),
diff --git a/public/dart/fuchsia_modular/examples/slider_mod/lib/src/widgets/value_slider.dart b/public/dart/fuchsia_modular/examples/slider_mod/lib/src/widgets/value_slider.dart
index 744c337..c2470ab 100644
--- a/public/dart/fuchsia_modular/examples/slider_mod/lib/src/widgets/value_slider.dart
+++ b/public/dart/fuchsia_modular/examples/slider_mod/lib/src/widgets/value_slider.dart
@@ -33,7 +33,7 @@
),
Container(
alignment: Alignment.center,
- child: new Text('Value: ${snapshot.data.toInt()}',
+ child: Text('Value: ${snapshot.data.toInt()}',
style: Theme.of(context).textTheme.display1),
),
],
@@ -64,7 +64,7 @@
} else {
return Container(
alignment: Alignment.center,
- child: new Text('Result: ${snapshot.data}',
+ child: Text('Result: ${snapshot.data}',
style: Theme.of(context).textTheme.display1),
key: Key('fib-result-widget-key'),
);
diff --git a/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart b/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart
index 7ff78a6..9c0ddf1 100644
--- a/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart
+++ b/public/dart/fuchsia_modular/lib/src/module/internal/_module_impl.dart
@@ -139,7 +139,7 @@
}
final moduleController = modular.ModuleControllerProxy();
- final viewOwner = new InterfacePair<deprecated.ViewOwner>();
+ final viewOwner = InterfacePair<deprecated.ViewOwner>();
final status = await _getContext().embedModule(
name, intent, moduleController.ctrl.request(), viewOwner.passRequest());
diff --git a/public/dart/fuchsia_modular/lib/src/module/internal/_ongoing_activity_impl.dart b/public/dart/fuchsia_modular/lib/src/module/internal/_ongoing_activity_impl.dart
index de34803..a282724 100644
--- a/public/dart/fuchsia_modular/lib/src/module/internal/_ongoing_activity_impl.dart
+++ b/public/dart/fuchsia_modular/lib/src/module/internal/_ongoing_activity_impl.dart
@@ -27,7 +27,7 @@
throw Exception(
'It is an error to call OngoingActivity.done more than once. '
'An ongoing activity can only be used one time. If you need to start '
- 'a new activity use the methods on Module to do so.');
+ 'a activity use the methods on Module to do so.');
}
_hasCalledDone = true;
diff --git a/public/dart/fuchsia_modular/lib/src/module/module.dart b/public/dart/fuchsia_modular/lib/src/module/module.dart
index 7dda862..2966958 100644
--- a/public/dart/fuchsia_modular/lib/src/module/module.dart
+++ b/public/dart/fuchsia_modular/lib/src/module/module.dart
@@ -41,7 +41,7 @@
/// a default relation is used. Note, [surfaceRelation] is an optional
/// parameter so a default value will be provided:
/// ```
- /// modular.SurfaceRelation surfaceRelation = const modular.SurfaceRelation(
+ /// modular.SurfaceRelation surfaceRelation = modular.SurfaceRelation(
/// arrangement: modular.SurfaceArrangement.copresent,
/// dependency: modular.SurfaceDependency.dependent,
/// emphasis: 0.5,
diff --git a/public/dart/fuchsia_modular/test/matchers.dart b/public/dart/fuchsia_modular/test/matchers.dart
index 5bb7e39..f518df9 100644
--- a/public/dart/fuchsia_modular/test/matchers.dart
+++ b/public/dart/fuchsia_modular/test/matchers.dart
@@ -8,7 +8,7 @@
/// A matcher which matches on the ModuleStateException type.
const Matcher isModuleStateException =
- const TypeMatcher<ModuleStateException>();
+ TypeMatcher<ModuleStateException>();
/// A matcher which matches on the module ModuleStateException type.
Matcher throwsModuleStateException = throwsA(isModuleStateException);
diff --git a/public/dart/fuchsia_modular/test/module/internal/fidl_transformers_test.dart b/public/dart/fuchsia_modular/test/module/internal/fidl_transformers_test.dart
index acc0f48..3b1a101 100644
--- a/public/dart/fuchsia_modular/test/module/internal/fidl_transformers_test.dart
+++ b/public/dart/fuchsia_modular/test/module/internal/fidl_transformers_test.dart
@@ -37,7 +37,7 @@
test('Intents with const parameter lists can still be modified', () {
final fidlIntent = fidl.Intent(
action: 'action',
- parameters: const [],
+ parameters: [],
);
// Should be able to modify the parameters on the intent.
// note: there are helper methods for this task but we want to
diff --git a/public/dart/fuchsia_scenic_flutter/lib/src/child_view_connection.dart b/public/dart/fuchsia_scenic_flutter/lib/src/child_view_connection.dart
index 6ac24dc..894acec 100644
--- a/public/dart/fuchsia_scenic_flutter/lib/src/child_view_connection.dart
+++ b/public/dart/fuchsia_scenic_flutter/lib/src/child_view_connection.dart
@@ -159,11 +159,11 @@
assert(!_available);
assert(_sceneHost == null);
- final EventPairPair sceneTokens = new EventPairPair();
+ final EventPairPair sceneTokens = EventPairPair();
assert(sceneTokens.status == ZX.OK);
// Analyzer doesn't know Handle must be dart:zircon's Handle
- _sceneHost = new SceneHost(sceneTokens.first.passHandle());
+ _sceneHost = SceneHost(sceneTokens.first.passHandle());
_viewKey = shared.nextGlobalViewKey();
shared.globalViewContainer
.addChild2(_viewKey, _viewHolderToken.value, sceneTokens.second);
@@ -229,7 +229,7 @@
assert(_sceneHost != null);
assert(ViewContainerListenerImpl.instance.getConnectionForKey(_viewKey) ==
this);
- final EventPairPair viewTokens = new EventPairPair();
+ final EventPairPair viewTokens = EventPairPair();
assert(viewTokens.status == ZX.OK);
ViewContainerListenerImpl.instance.removeConnectionForKey(_viewKey);
_viewHolderToken = ViewHolderToken(value: viewTokens.first);
@@ -397,7 +397,7 @@
assert(() {
if (shared.globalViewContainer == null) {
context.canvas
- .drawRect(offset & size, Paint()..color = const Color(0xFF0000FF));
+ .drawRect(offset & size, Paint()..color = Color(0xFF0000FF));
_debugErrorMessage.paint(context.canvas, offset);
}
return true;
@@ -430,7 +430,7 @@
assert(() {
if (shared.globalViewContainer == null) {
_debugErrorMessage ??= TextPainter(
- text: const TextSpan(
+ text: TextSpan(
text:
'Child views are supported only when running in Scenic.'));
_debugErrorMessage.layout(minWidth: size.width, maxWidth: size.width);
diff --git a/public/dart/fuchsia_scenic_flutter/lib/src/internal/fakes/mozart_fakes.dart b/public/dart/fuchsia_scenic_flutter/lib/src/internal/fakes/mozart_fakes.dart
index 47a3f3d..a6a1c50 100644
--- a/public/dart/fuchsia_scenic_flutter/lib/src/internal/fakes/mozart_fakes.dart
+++ b/public/dart/fuchsia_scenic_flutter/lib/src/internal/fakes/mozart_fakes.dart
@@ -16,7 +16,7 @@
class Scenic {
static void offerServiceProvider(Handle handle, List<String> services) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'offerServiceProvider is not implemented on this platform.');
}
}
diff --git a/public/dart/fuchsia_scenic_flutter/lib/src/view_container.dart b/public/dart/fuchsia_scenic_flutter/lib/src/view_container.dart
index 63d815a..1c7b47f 100644
--- a/public/dart/fuchsia_scenic_flutter/lib/src/view_container.dart
+++ b/public/dart/fuchsia_scenic_flutter/lib/src/view_container.dart
@@ -17,8 +17,8 @@
if (handle == null) {
return null;
}
- final ViewContainerProxy proxy = new ViewContainerProxy()
- ..ctrl.bind(new InterfaceHandle<ViewContainer>(new Channel(handle)))
+ final ViewContainerProxy proxy = ViewContainerProxy()
+ ..ctrl.bind(InterfaceHandle<ViewContainer>(Channel(handle)))
..setListener(ViewContainerListenerImpl.instance.createInterfaceHandle());
assert(() {
diff --git a/public/dart/fuchsia_scenic_flutter/lib/src/view_container_listener_impl.dart b/public/dart/fuchsia_scenic_flutter/lib/src/view_container_listener_impl.dart
index 0a93be1..c2d4d01 100644
--- a/public/dart/fuchsia_scenic_flutter/lib/src/view_container_listener_impl.dart
+++ b/public/dart/fuchsia_scenic_flutter/lib/src/view_container_listener_impl.dart
@@ -21,7 +21,7 @@
class ViewContainerListenerImpl extends ViewContainerListener {
/// The shared [ViewContainerListenerImpl] instance.
static final ViewContainerListenerImpl instance =
- new ViewContainerListenerImpl._();
+ ViewContainerListenerImpl._();
ViewContainerListenerImpl._() : super();
diff --git a/public/dart/fuchsia_vfs/lib/src/pseudo_file.dart b/public/dart/fuchsia_vfs/lib/src/pseudo_file.dart
index 710d0d8..5c13b45 100644
--- a/public/dart/fuchsia_vfs/lib/src/pseudo_file.dart
+++ b/public/dart/fuchsia_vfs/lib/src/pseudo_file.dart
@@ -205,7 +205,7 @@
///
/// This class should not be used directly, but by [fuchsia_vfs.PseudoFile].
class _FileConnection extends File {
- final FileBinding _binding = new FileBinding();
+ final FileBinding _binding = FileBinding();
/// open file connection flags
final int flags;
diff --git a/public/dart/fuchsia_vfs/lib/src/vmo_file.dart b/public/dart/fuchsia_vfs/lib/src/vmo_file.dart
index 018189e..b9aaadc 100644
--- a/public/dart/fuchsia_vfs/lib/src/vmo_file.dart
+++ b/public/dart/fuchsia_vfs/lib/src/vmo_file.dart
@@ -54,7 +54,7 @@
return null;
}
- return NodeInfo.withVmofile(new Vmofile(
+ return NodeInfo.withVmofile(Vmofile(
vmo: duplicatedVmo, offset: 0, length: _vmo.getSize().size));
}
diff --git a/public/dart/fuchsia_vfs/test/pseudo_dir_test.dart b/public/dart/fuchsia_vfs/test/pseudo_dir_test.dart
index 1bdb58e..be3117e 100644
--- a/public/dart/fuchsia_vfs/test/pseudo_dir_test.dart
+++ b/public/dart/fuchsia_vfs/test/pseudo_dir_test.dart
@@ -639,7 +639,7 @@
_validateExpectedDirents(expectedDirents, response);
});
- test('readdir works when new node is added', () async {
+ test('readdir works when node is added', () async {
PseudoDir dir = PseudoDir();
PseudoDir subDir = PseudoDir();
var file1 = PseudoFile.readOnlyStr(() => 'file1');
@@ -663,7 +663,7 @@
_validateExpectedDirents(expectedDirents, response);
});
- test('readdir works when new node is added and only first node was read',
+ test('readdir works when node is added and only first node was read',
() async {
PseudoDir dir = PseudoDir();
PseudoDir subDir = PseudoDir();
diff --git a/public/dart/fuchsia_vfs/test/service_test.dart b/public/dart/fuchsia_vfs/test/service_test.dart
index 0ac039d..88b8273 100644
--- a/public/dart/fuchsia_vfs/test/service_test.dart
+++ b/public/dart/fuchsia_vfs/test/service_test.dart
@@ -39,7 +39,7 @@
test('connect to service fails for bad flags and check status', () async {
for (var unsupportedFlag in unsupportedFlags) {
- _EchoImpl echo = new _EchoImpl();
+ _EchoImpl echo = _EchoImpl();
Service<Echo> service = Service.withConnector(echo.bind);
EchoProxy echoProxy = EchoProxy();
var expectedStatus = ZX.ERR_NOT_SUPPORTED;
@@ -143,7 +143,7 @@
class _FsWithEchoService {
final io_fidl.DirectoryProxy dirProxy = io_fidl.DirectoryProxy();
final PseudoDir _dir = PseudoDir();
- _EchoImpl echo = new _EchoImpl();
+ _EchoImpl echo = _EchoImpl();
_FsWithEchoService() {
Service<Echo> service = Service.withConnector(echo.bind);
@@ -155,7 +155,7 @@
}
class _EchoImpl extends Echo {
- final EchoBinding _binding = new EchoBinding();
+ final EchoBinding _binding = EchoBinding();
void bind(InterfaceRequest<Echo> request) {
_binding.bind(this, request);
diff --git a/public/dart/fuchsia_vfs/test/vmo_file_test.dart b/public/dart/fuchsia_vfs/test/vmo_file_test.dart
index e499e83..0acf73e 100644
--- a/public/dart/fuchsia_vfs/test/vmo_file_test.dart
+++ b/public/dart/fuchsia_vfs/test/vmo_file_test.dart
@@ -22,7 +22,7 @@
SizedVmo.fromUint8List(Uint8List.fromList(str.codeUnits));
_ReadOnlyFile file = _ReadOnlyFile()
- ..vmoFile = VmoFile.readOnly(new Vmo(sizedVmo.handle), mode)
+ ..vmoFile = VmoFile.readOnly(Vmo(sizedVmo.handle), mode)
..proxy = FileProxy();
expect(
file.vmoFile
diff --git a/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver.dart b/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver.dart
index a22e0d7..8fc23bf 100644
--- a/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver.dart
+++ b/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver.dart
@@ -35,8 +35,8 @@
InterfaceHandle<ledger.PageSnapshot> commonVersion,
InterfaceHandle<ledger.MergeResultProvider> newResultProvider) async {
// Obtain the left and right snapshots.
- ledger.PageSnapshotProxy leftPageSnapshot = new ledger.PageSnapshotProxy();
- ledger.PageSnapshotProxy rightPageSnapshot = new ledger.PageSnapshotProxy();
+ ledger.PageSnapshotProxy leftPageSnapshot = ledger.PageSnapshotProxy();
+ ledger.PageSnapshotProxy rightPageSnapshot = ledger.PageSnapshotProxy();
leftPageSnapshot.ctrl.bind(left);
rightPageSnapshot.ctrl.bind(right);
@@ -45,7 +45,7 @@
await getMapOfAllSchemas(leftPageSnapshot, rightPageSnapshot);
// Find all the KVs that changed.
- final resultProviderProxy = new ledger.MergeResultProviderProxy();
+ final resultProviderProxy = ledger.MergeResultProviderProxy();
resultProviderProxy.ctrl.bind(newResultProvider);
List<ledger.DiffEntry> diffs =
await getConflictingDiff(resultProviderProxy);
diff --git a/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver_factory.dart b/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver_factory.dart
index 91b0688..3a6e90a 100644
--- a/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver_factory.dart
+++ b/public/dart/sledge/lib/src/conflict_resolver/conflict_resolver_factory.dart
@@ -17,12 +17,12 @@
// factory as been succesfully set.
static Completer<bool> _setUpCompleted;
static final ledger.ConflictResolverFactoryBinding _factoryBinding =
- new ledger.ConflictResolverFactoryBinding();
+ ledger.ConflictResolverFactoryBinding();
final ledger.ConflictResolverBinding _conflictResolverBinding =
- new ledger.ConflictResolverBinding();
+ ledger.ConflictResolverBinding();
// The conflict resolver that resolves conflicts for all the pages.
- final ConflictResolver _conflictResolver = new ConflictResolver();
+ final ConflictResolver _conflictResolver = ConflictResolver();
ConflictResolverFactory._internal();
@@ -32,12 +32,12 @@
if (_setUpCompleted != null) {
return _setUpCompleted.future;
}
- _setUpCompleted = new Completer<bool>();
+ _setUpCompleted = Completer<bool>();
final wrapper =
- _factoryBinding.wrap(new ConflictResolverFactory._internal());
+ _factoryBinding.wrap(ConflictResolverFactory._internal());
ledgerInstance.setConflictResolverFactory(wrapper, (ledger.Status status) {
if (status != ledger.Status.ok) {
- throw new Exception(
+ throw Exception(
'Sledge failed to SetConflictResolverFactory (status: $status).');
_setUpCompleted.complete(false);
} else {
diff --git a/public/dart/sledge/lib/src/conflict_resolver/document_conflict_resolver.dart b/public/dart/sledge/lib/src/conflict_resolver/document_conflict_resolver.dart
index e7a19ef..c3bf03b 100644
--- a/public/dart/sledge/lib/src/conflict_resolver/document_conflict_resolver.dart
+++ b/public/dart/sledge/lib/src/conflict_resolver/document_conflict_resolver.dart
@@ -13,7 +13,7 @@
Map<DocumentId, List<ledger.DiffEntry>> documentChangeMap(
List<ledger.DiffEntry> diffs, Map<Uint8List, Schema> map) {
// TODO: implement.
- throw new UnimplementedError(
+ throw UnimplementedError(
'The method `documentChangeMap` is not yet implemented.');
return <DocumentId, List<ledger.DiffEntry>>{};
}
diff --git a/public/dart/sledge/lib/src/conflict_resolver/schemas_obtainer.dart b/public/dart/sledge/lib/src/conflict_resolver/schemas_obtainer.dart
index 0e5868e..e6d1f5d 100644
--- a/public/dart/sledge/lib/src/conflict_resolver/schemas_obtainer.dart
+++ b/public/dart/sledge/lib/src/conflict_resolver/schemas_obtainer.dart
@@ -36,7 +36,7 @@
sledge_storage.prefixForType(sledge_storage.KeyValueType.schema);
final List<KeyValue> kvs =
await getEntriesFromSnapshotWithPrefix(snapshot, schemaPrefix);
- return new Set.from(kvs);
+ return Set.from(kvs);
}
/// Returns a map between the hash of the individual schemas and the schemas.
@@ -46,7 +46,7 @@
final schemaHash = getSublistView(schemaKeyValue.key,
start: sledge_storage.typePrefixLength);
String jsonString = utf8.decode(schemaKeyValue.value);
- map[schemaHash] = new Schema.fromJson(json.decode(jsonString));
+ map[schemaHash] = Schema.fromJson(json.decode(jsonString));
}
return map;
}
diff --git a/public/dart/sledge/lib/src/document/change.dart b/public/dart/sledge/lib/src/document/change.dart
index d8d19ca..82d91b3 100644
--- a/public/dart/sledge/lib/src/document/change.dart
+++ b/public/dart/sledge/lib/src/document/change.dart
@@ -28,10 +28,10 @@
/// Returns a new Change with prefix attached to all entries.
Change withPrefix(Uint8List prefix) {
- Change result = new Change();
+ Change result = Change();
for (final change in changedEntries) {
result.changedEntries.add(
- new KeyValue(concatUint8Lists(prefix, change.key), change.value));
+ KeyValue(concatUint8Lists(prefix, change.key), change.value));
}
for (final key in deletedKeys) {
result.deletedKeys.add(concatUint8Lists(prefix, key));
@@ -44,13 +44,13 @@
final splittedChanges = newUint8ListMap<Change>();
for (final change in changedEntries) {
final prefix = getSublistView(change.key, end: prefixLen);
- final newChange = splittedChanges.putIfAbsent(prefix, () => new Change());
- newChange.changedEntries.add(new KeyValue(
+ final newChange = splittedChanges.putIfAbsent(prefix, () => Change());
+ newChange.changedEntries.add(KeyValue(
getSublistView(change.key, start: prefixLen), change.value));
}
for (final deletion in deletedKeys) {
final prefix = getSublistView(deletion, end: prefixLen);
- final newChange = splittedChanges.putIfAbsent(prefix, () => new Change());
+ final newChange = splittedChanges.putIfAbsent(prefix, () => Change());
newChange.deletedKeys.add(getSublistView(deletion, start: prefixLen));
}
return splittedChanges;
diff --git a/public/dart/sledge/lib/src/document/document.dart b/public/dart/sledge/lib/src/document/document.dart
index 45926e2..a7ff806 100644
--- a/public/dart/sledge/lib/src/document/document.dart
+++ b/public/dart/sledge/lib/src/document/document.dart
@@ -41,12 +41,12 @@
final ConnectionId _connectionId;
static const int _identifierLength = 21;
final StreamController<void> _changeController =
- new StreamController<void>.broadcast();
+ StreamController<void>.broadcast();
/// A value that is set to true for all documents that exist.
/// If the Document object was created in a rollbacked transaction, then this
/// field is false and all operations on this object are invalid.
- final LastOneWinsValue<bool> _documentExists = new LastOneWinsValue<bool>();
+ final LastOneWinsValue<bool> _documentExists = LastOneWinsValue<bool>();
DocumentState _state = DocumentState.available;
@@ -82,7 +82,7 @@
Uint8List _createIdentifierForField(String key, _DocumentFieldType type) {
Uint8List hashOfKey = hash(getUint8ListFromString(key));
- Uint8List prefix = new Uint8List.fromList([type.index]);
+ Uint8List prefix = Uint8List.fromList([type.index]);
return concatUint8Lists(prefix, hashOfKey);
}
@@ -94,7 +94,7 @@
/// Gets the change for all fields of this document.
Change getChange() {
- Change result = new Change();
+ Change result = Change();
for (final field in _fields.entries) {
result.addAll(field.value.getChange().withPrefix(field.key));
}
@@ -144,10 +144,10 @@
/// Throws an exception if the document is in an invalid state.
void _checkExistsState() {
if (!_documentExists.value) {
- throw new StateError('Value access to a non-existing document.');
+ throw StateError('Value access to a non-existing document.');
}
if (_state != DocumentState.available) {
- throw new StateError("Can't access a document that is deleted.");
+ throw StateError("Can't access a document that is deleted.");
}
}
@@ -155,7 +155,7 @@
_checkExistsState();
Transaction currentTransaction = _sledge.currentTransaction;
if (currentTransaction == null) {
- throw new StateError('Document was changed outside of a transaction.');
+ throw StateError('Document was changed outside of a transaction.');
}
currentTransaction.documentWasModified(this);
}
diff --git a/public/dart/sledge/lib/src/document/document_id.dart b/public/dart/sledge/lib/src/document/document_id.dart
index 4217555..12c3c42 100644
--- a/public/dart/sledge/lib/src/document/document_id.dart
+++ b/public/dart/sledge/lib/src/document/document_id.dart
@@ -26,24 +26,24 @@
DocumentId(this.schema, [Uint8List identifier]) {
identifier ??= _randomByteArrayForSubIds();
if (identifier.length != _subIdByteCount) {
- throw new ArgumentError(
+ throw ArgumentError(
'Identifier does not contain $_subIdByteCount bytes.'
'Found ${identifier.length} bytes instead.');
}
- _subId = new Uint8List.fromList(identifier);
+ _subId = Uint8List.fromList(identifier);
}
/// Convenience factory that builds a DocumentId from the [identifier]'s 8 lowest bytes.
factory DocumentId.fromIntId(Schema schema, int identifier) {
- Uint8List bytes = new Uint8List(_subIdByteCount)
+ Uint8List bytes = Uint8List(_subIdByteCount)
..buffer.asByteData().setUint64(0, identifier, Endian.little);
- return new DocumentId(schema, bytes);
+ return DocumentId(schema, bytes);
}
/// Returns the [prefixLength] bytes long prefix to be used to store in Ledger the
/// document identified with this DocumentId.
Uint8List get prefix {
- Uint8List prefix = new Uint8List(_schemahashByteCount + _subIdByteCount);
+ Uint8List prefix = Uint8List(_schemahashByteCount + _subIdByteCount);
Uint8List schemaHash = schema.hash;
assert(schemaHash.length == _schemahashByteCount);
prefix..setAll(0, schemaHash)..setAll(_schemahashByteCount, _subId);
@@ -51,7 +51,7 @@
}
/// Returns the identifier that can be used to create the same DocumentId.
- Uint8List get subId => new Uint8List.fromList(_subId);
+ Uint8List get subId => Uint8List.fromList(_subId);
static Uint8List _randomByteArrayForSubIds() =>
utils.randomUint8List(_subIdByteCount);
diff --git a/public/dart/sledge/lib/src/document/node_value.dart b/public/dart/sledge/lib/src/document/node_value.dart
index 72b5a48..39afdae 100644
--- a/public/dart/sledge/lib/src/document/node_value.dart
+++ b/public/dart/sledge/lib/src/document/node_value.dart
@@ -48,7 +48,7 @@
dynamic operator [](String fieldName) {
Value value = _childValues[fieldName];
if (value == null) {
- throw new ArgumentError('Field `$fieldName` does not exist.');
+ throw ArgumentError('Field `$fieldName` does not exist.');
}
return value;
}
diff --git a/public/dart/sledge/lib/src/document/values/compressor.dart b/public/dart/sledge/lib/src/document/values/compressor.dart
index 8ecdf1b..5e65344 100644
--- a/public/dart/sledge/lib/src/document/values/compressor.dart
+++ b/public/dart/sledge/lib/src/document/values/compressor.dart
@@ -16,7 +16,7 @@
/// ({hash(key)}, {|key|}{key}{value}).
/// {|key|} is an Uint64 and takes 8 bytes to store.
class Compressor {
- static const _listEquality = const ListEquality();
+ static const _listEquality = ListEquality();
final Map<Uint8List, Uint8List> _keyByHash = newUint8ListMap<Uint8List>();
/// Compress Key
@@ -28,18 +28,18 @@
KeyValue compressKeyInEntry(KeyValue entry) {
Uint8List newKey = compressKey(entry.key);
Uint8List newValue = concatListOfUint8Lists([
- new Uint8List(8)..buffer.asByteData().setUint64(0, entry.key.length),
+ Uint8List(8)..buffer.asByteData().setUint64(0, entry.key.length),
entry.key,
entry.value
]);
- return new KeyValue(newKey, newValue);
+ return KeyValue(newKey, newValue);
}
/// Uncompress key.
Uint8List uncompressKey(Uint8List keyHash) {
final key = _keyByHash[keyHash];
if (key == null) {
- throw new InternalSledgeError('Unable to uncompress key `$keyHash`.');
+ throw InternalSledgeError('Unable to uncompress key `$keyHash`.');
}
return key;
}
@@ -47,13 +47,13 @@
/// Uncompress KeyValue.
KeyValue uncompressKeyInEntry(KeyValue entry) {
if (entry.value.length < 8) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
'In a hashed key mode, the value size must be '
'>= 8. Found ${entry.value.length} instead for entry `$entry`.');
}
final keyLength = entry.value.buffer.asByteData().getUint64(0);
if (entry.value.length < 8 + keyLength) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
'Incorrect format for value of given entry: '
'The parsed length ($keyLength) is larger than the value content\'s '
'length (${entry.value.length - 8}). Entry: `$entry`');
@@ -65,10 +65,10 @@
// Important side effect: result.key is added to _keyByHash.
final hash = _getAndSaveHashOfKey(key);
if (!_listEquality.equals(hash, entry.key)) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
'Hash of parsed key is not equal to passed hash (expected `$hash`, got `${entry.key}`).');
}
- return new KeyValue(key, value);
+ return KeyValue(key, value);
}
/// Returns hash of key, and adds (hash, key) pair to caching map.
diff --git a/public/dart/sledge/lib/src/document/values/converted_change.dart b/public/dart/sledge/lib/src/document/values/converted_change.dart
index b2b6509..bdc406d 100644
--- a/public/dart/sledge/lib/src/document/values/converted_change.dart
+++ b/public/dart/sledge/lib/src/document/values/converted_change.dart
@@ -16,8 +16,8 @@
/// Constructor from ConvertedChange.
MapChange(ConvertedChange<K, V> change)
- : changedEntries = new Map<K, V>.from(change.changedEntries),
- deletedKeys = new Set<K>.from(change.deletedKeys);
+ : changedEntries = Map<K, V>.from(change.changedEntries),
+ deletedKeys = Set<K>.from(change.deletedKeys);
}
/// Interface to get changes applied to SetValue.
@@ -31,7 +31,7 @@
/// Constructor from MapChange.
SetChange(ConvertedChange<E, E> change)
: insertedElements = change.changedEntries.keys.toSet(),
- deletedElements = new Set<E>.from(change.deletedKeys);
+ deletedElements = Set<E>.from(change.deletedKeys);
}
/// Interface to get changes applied to OrderedList.
@@ -64,8 +64,8 @@
/// Copy constructor.
ConvertedChange.from(ConvertedChange<K, V> change)
- : changedEntries = new Map.from(change.changedEntries),
- deletedKeys = new Set.from(change.deletedKeys);
+ : changedEntries = Map.from(change.changedEntries),
+ deletedKeys = Set.from(change.deletedKeys);
/// Clears all changes.
void clear() {
diff --git a/public/dart/sledge/lib/src/document/values/converter.dart b/public/dart/sledge/lib/src/document/values/converter.dart
index 3e6fc4d..ad1ae77 100644
--- a/public/dart/sledge/lib/src/document/values/converter.dart
+++ b/public/dart/sledge/lib/src/document/values/converter.dart
@@ -16,7 +16,7 @@
factory Converter() {
final result = _converters[T];
if (result == null) {
- throw new InternalSledgeError('No converter found for type `$T`.');
+ throw InternalSledgeError('No converter found for type `$T`.');
}
return result;
}
@@ -35,17 +35,17 @@
class MapToKVListConverter<K, V> {
final Converter<K> _keyConverter;
final Converter<V> _valueConverter;
- final Compressor _compressor = new Compressor();
+ final Compressor _compressor = Compressor();
/// Constructor.
MapToKVListConverter({Converter<K> keyConverter, Converter<V> valueConverter})
- : _keyConverter = keyConverter ?? new Converter<K>(),
- _valueConverter = valueConverter ?? new Converter<V>();
+ : _keyConverter = keyConverter ?? Converter<K>(),
+ _valueConverter = valueConverter ?? Converter<V>();
/// Converts from List<KeyValue> to Map<K, V>.
ConvertedChange<K, V> deserialize(final Change _input) {
final input = _uncompressKeysInChange(_input);
- final result = new ConvertedChange<K, V>();
+ final result = ConvertedChange<K, V>();
for (var keyValue in input.changedEntries) {
result.changedEntries[_keyConverter.deserialize(keyValue.key)] =
_valueConverter.deserialize(keyValue.value);
@@ -58,9 +58,9 @@
/// Converts from Map<K, V> to List<KeyValue>.
Change serialize(final ConvertedChange<K, V> input) {
- final Change result = new Change();
+ final Change result = Change();
for (final changedEntry in input.changedEntries.entries) {
- result.changedEntries.add(new KeyValue(
+ result.changedEntries.add(KeyValue(
_keyConverter.serialize(changedEntry.key),
_valueConverter.serialize(changedEntry.value)));
}
@@ -72,7 +72,7 @@
/// Restores (key, value)s from stored in Ledger state.
Change _uncompressKeysInChange(final Change input) {
- Change result = new Change();
+ Change result = Change();
for (final entry in input.changedEntries) {
result.changedEntries.add(_compressor.uncompressKeyInEntry(entry));
}
@@ -84,7 +84,7 @@
/// Prepares (key, value)s to store in Ledger. (getting rid of long keys)
Change _compressKeysInChange(final Change input) {
- Change result = new Change();
+ Change result = Change();
for (final entry in input.changedEntries) {
result.changedEntries.add(_compressor.compressKeyInEntry(entry));
}
@@ -106,16 +106,16 @@
@override
String deserialize(final Uint8List x) {
if (x.length.isOdd) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
'Cannot parse String. Length should be even.');
}
- return new String.fromCharCodes(
+ return String.fromCharCodes(
x.buffer.asUint16List(x.offsetInBytes, x.lengthInBytes ~/ 2));
}
@override
Uint8List serialize(final String x) {
- return new Uint16List.fromList(x.codeUnits).buffer.asUint8List();
+ return Uint16List.fromList(x.codeUnits).buffer.asUint8List();
}
}
@@ -132,7 +132,7 @@
@override
int deserialize(final Uint8List x) {
if (x.length != _serializationLength) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
"Can't parse int: Length should be $_serializationLength, "
'found ${x.length} instead for input: `$x`.');
}
@@ -141,7 +141,7 @@
@override
Uint8List serialize(final int x) =>
- new Uint8List(_serializationLength)..buffer.asByteData().setInt64(0, x);
+ Uint8List(_serializationLength)..buffer.asByteData().setInt64(0, x);
}
/// Converter for double.
@@ -157,7 +157,7 @@
@override
double deserialize(final Uint8List x) {
if (x.length != _serializationLength) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
"Can't parse double: Length should be $_serializationLength, "
'found ${x.length} instead for input: `$x`.');
}
@@ -166,7 +166,7 @@
@override
Uint8List serialize(final double x) =>
- new Uint8List(_serializationLength)..buffer.asByteData().setFloat64(0, x);
+ Uint8List(_serializationLength)..buffer.asByteData().setFloat64(0, x);
}
/// Converter for bool.
@@ -180,12 +180,12 @@
@override
bool deserialize(final Uint8List x) {
if (x.lengthInBytes != 1) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
"Can't parse bool. Length should be 1,"
'found ${x.lengthInBytes} bytes instead.');
}
if (x[0] != 0 && x[0] != 1) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
"Can't parse bool. Value should be 0 or 1, "
'found ${x[0]} bytes instead.');
}
@@ -195,7 +195,7 @@
@override
// ignore: avoid_positional_boolean_parameters
Uint8List serialize(final bool x) {
- return new Uint8List.fromList([x ? 1 : 0]);
+ return Uint8List.fromList([x ? 1 : 0]);
}
}
@@ -205,7 +205,7 @@
const Uint8ListConverter();
@override
- Uint8List get defaultValue => new Uint8List(0);
+ Uint8List get defaultValue => Uint8List(0);
@override
Uint8List deserialize(final Uint8List x) => x;
@@ -233,13 +233,13 @@
@override
num deserialize(final Uint8List x) {
if (x.length != _serializationLength) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
"Can't parse double: Length should be $_serializationLength, "
'found ${x.length} instead for input: `$x`.');
}
if (x[0] >= _NumInternalType.values.length) {
- throw new InternalSledgeError(
+ throw InternalSledgeError(
"Can't parse double: First byte should be 0 or 1, "
'found ${x[0]} instead.');
}
@@ -259,7 +259,7 @@
@override
Uint8List serialize(final num x) {
- final list = new Uint8List(_serializationLength);
+ final list = Uint8List(_serializationLength);
final byteData = list.buffer.asByteData();
if (x.runtimeType == int) {
byteData
@@ -274,11 +274,11 @@
}
}
-const _converters = const <Type, Converter>{
- int: const IntConverter(),
- String: const StringConverter(),
- double: const DoubleConverter(),
- bool: const BoolConverter(),
- Uint8List: const Uint8ListConverter(),
- num: const NumConverter(),
+const _converters = <Type, Converter>{
+ int: IntConverter(),
+ String: StringConverter(),
+ double: DoubleConverter(),
+ bool: BoolConverter(),
+ Uint8List: Uint8ListConverter(),
+ num: NumConverter(),
};
diff --git a/public/dart/sledge/lib/src/document/values/key_value_storage.dart b/public/dart/sledge/lib/src/document/values/key_value_storage.dart
index 02027d7..7ff5691 100644
--- a/public/dart/sledge/lib/src/document/values/key_value_storage.dart
+++ b/public/dart/sledge/lib/src/document/values/key_value_storage.dart
@@ -20,10 +20,10 @@
/// Creates a storage using the provided [equals] as equality.
KeyValueStorage({bool equals(K key1, K key2), int hashCode(K key)})
- : _storage = new HashMap<K, V>(equals: equals, hashCode: hashCode),
- _changeToRollback = new ConvertedChange(
- new HashMap<K, V>(equals: equals, hashCode: hashCode),
- new HashSet<K>(equals: equals, hashCode: hashCode));
+ : _storage = HashMap<K, V>(equals: equals, hashCode: hashCode),
+ _changeToRollback = ConvertedChange(
+ HashMap<K, V>(equals: equals, hashCode: hashCode),
+ HashSet<K>(equals: equals, hashCode: hashCode));
@override
V operator [](Object key) => _storage[key];
@@ -59,7 +59,7 @@
/// Retrieves the current transaction's data.
ConvertedChange<K, V> getChange() {
- final change = new ConvertedChange<K, V>();
+ final change = ConvertedChange<K, V>();
// [_changeToRollback.deletedKeys] is a collection of keys that were not in
// [_storage] when the transaction started, but were affected by this
// transaction.
diff --git a/public/dart/sledge/lib/src/document/values/last_one_wins_value.dart b/public/dart/sledge/lib/src/document/values/last_one_wins_value.dart
index b5aafca..fe6c9ab 100644
--- a/public/dart/sledge/lib/src/document/values/last_one_wins_value.dart
+++ b/public/dart/sledge/lib/src/document/values/last_one_wins_value.dart
@@ -14,7 +14,7 @@
T _value;
T _valueToRollback;
final StreamController<T> _changeController =
- new StreamController<T>.broadcast();
+ StreamController<T>.broadcast();
_LastOneWinsValue(this._value);
@@ -30,9 +30,9 @@
ConvertedChange<int, T> getChange() {
if (_valueToRollback == null) {
// If there's nothing to rollback, no changes have been done.
- return new ConvertedChange<int, T>();
+ return ConvertedChange<int, T>();
}
- return new ConvertedChange<int, T>(<int, T>{0: _value});
+ return ConvertedChange<int, T>(<int, T>{0: _value});
}
void applyChange(ConvertedChange<int, T> change) {
@@ -40,13 +40,13 @@
return;
}
if (change.deletedKeys.isNotEmpty) {
- throw new FormatException(
+ throw FormatException(
'There should be no deleted keys. Found `${change.deletedKeys}`.',
change);
}
if (change.changedEntries.length != 1 ||
!change.changedEntries.containsKey(0)) {
- throw new FormatException('Changes have unsupported format.', change);
+ throw FormatException('Changes have unsupported format.', change);
}
_value = change.changedEntries[0];
_changeController.add(_value);
@@ -72,9 +72,9 @@
/// Default constructor.
LastOneWinsValue([Change init])
- : _converter = new MapToKVListConverter<int, T>(),
- _value = new _LastOneWinsValue<T>(new Converter<T>().defaultValue) {
- applyChange(init ?? new Change());
+ : _converter = MapToKVListConverter<int, T>(),
+ _value = _LastOneWinsValue<T>(Converter<T>().defaultValue) {
+ applyChange(init ?? Change());
}
@override
diff --git a/public/dart/sledge/lib/src/document/values/map_value.dart b/public/dart/sledge/lib/src/document/values/map_value.dart
index f8aedac..c4c8993 100644
--- a/public/dart/sledge/lib/src/document/values/map_value.dart
+++ b/public/dart/sledge/lib/src/document/values/map_value.dart
@@ -18,13 +18,13 @@
implements LeafValue {
final KeyValueStorage<K, V> _map;
final StreamController<MapChange<K, V>> _changeController =
- new StreamController<MapChange<K, V>>.broadcast();
+ StreamController<MapChange<K, V>>.broadcast();
final MapToKVListConverter _converter;
/// Creates a MapValue with provided [equals] as equality.
MapValue({bool equals(K key1, K key2), int hashCode(K key)})
- : _converter = new MapToKVListConverter<K, V>(),
- _map = new KeyValueStorage<K, V>(equals: equals, hashCode: hashCode);
+ : _converter = MapToKVListConverter<K, V>(),
+ _map = KeyValueStorage<K, V>(equals: equals, hashCode: hashCode);
@override
Change getChange() => _converter.serialize(_map.getChange());
@@ -38,7 +38,7 @@
void applyChange(Change input) {
final change = _converter.deserialize(input);
_map.applyChange(change);
- _changeController.add(new MapChange<K, V>(change));
+ _changeController.add(MapChange<K, V>(change));
}
@override
diff --git a/public/dart/sledge/lib/src/document/values/ordered_list_tree_path.dart b/public/dart/sledge/lib/src/document/values/ordered_list_tree_path.dart
index 8536cfc..c0ca647 100644
--- a/public/dart/sledge/lib/src/document/values/ordered_list_tree_path.dart
+++ b/public/dart/sledge/lib/src/document/values/ordered_list_tree_path.dart
@@ -13,7 +13,7 @@
// Length of a bytelist, written on edge to value node.
// Bytelist content is: {1}{timetamp}, {timestamp} is 8 bytes long.
const _nodeValueSuffixLength = 9;
-const _listEquality = const ListEquality();
+const _listEquality = ListEquality();
/// Type of child.
enum ChildType {
@@ -40,7 +40,7 @@
: this(concatListOfUint8Lists([parent._data]..addAll(labels)));
/// Creates OrderedListTreePath corresponding to tree root.
- OrderedListTreePath.root() : this(new Uint8List(_nodeValueSuffixLength));
+ OrderedListTreePath.root() : this(Uint8List(_nodeValueSuffixLength));
/// Checks if node is a child of a [parent].
bool isDescendant(OrderedListTreePath parent) {
@@ -59,27 +59,27 @@
/// Returns path to parent implicit node, for value node.
OrderedListTreePath parentPath() {
// Remove appendix corresponding to value from path.
- return new OrderedListTreePath(new Uint8List.fromList(
+ return OrderedListTreePath(Uint8List.fromList(
_data.getRange(0, _data.length - _nodeValueSuffixLength).toList()));
}
/// Returns OrderedListTreePath representing child of this.
OrderedListTreePath getChild(
ChildType side, Uint8List instanceId, Uint8List timestamp) {
- return new OrderedListTreePath.fromParent(
+ return OrderedListTreePath.fromParent(
// ----------------
// Path to implicit node:
// 1. path to parent implicit node
parentPath(),
[
// 2. direction ([left] or [right]).
- new Uint8List.fromList([side.index]),
+ Uint8List.fromList([side.index]),
// 3. id of current instance
instanceId,
// ----------------
// Appendix for path to value:
// 1. direction ([value])
- new Uint8List.fromList([ChildType.value.index]),
+ Uint8List.fromList([ChildType.value.index]),
// 2. timestamp
timestamp
]);
@@ -109,11 +109,11 @@
@override
OrderedListTreePath get defaultValue =>
- new OrderedListTreePath(new Uint8List(0));
+ OrderedListTreePath(Uint8List(0));
@override
OrderedListTreePath deserialize(final Uint8List x) =>
- new OrderedListTreePath(x);
+ OrderedListTreePath(x);
@override
Uint8List serialize(final OrderedListTreePath x) => x._data;
@@ -121,4 +121,4 @@
/// Public const instance of OrderedListTreePathConverter.
const OrderedListTreePathConverter orderedListTreePathConverter =
- const OrderedListTreePathConverter();
+ OrderedListTreePathConverter();
diff --git a/public/dart/sledge/lib/src/document/values/ordered_list_value.dart b/public/dart/sledge/lib/src/document/values/ordered_list_value.dart
index 6651927..d0cc5c5 100644
--- a/public/dart/sledge/lib/src/document/values/ordered_list_value.dart
+++ b/public/dart/sledge/lib/src/document/values/ordered_list_value.dart
@@ -127,17 +127,17 @@
final KeyValueStorage<OrderedListTreePath, E> _storage;
final Uint8List _instanceId;
int _incrementalTime = 0;
- final OrderedListTreePath _root = new OrderedListTreePath.root();
+ final OrderedListTreePath _root = OrderedListTreePath.root();
final StreamController<OrderedListChange<E>> _changeController =
- new StreamController<OrderedListChange<E>>.broadcast();
+ StreamController<OrderedListChange<E>>.broadcast();
final MapToKVListConverter _converter;
final bool Function(E, E) _equals;
/// Default constructor.
OrderedListValue(this._instanceId, {bool equals(E element1, E element2)})
- : _converter = new MapToKVListConverter<OrderedListTreePath, E>(
+ : _converter = MapToKVListConverter<OrderedListTreePath, E>(
keyConverter: orderedListTreePathConverter),
- _storage = new KeyValueStorage<OrderedListTreePath, E>(),
+ _storage = KeyValueStorage<OrderedListTreePath, E>(),
_equals = equals ?? ((E element1, E element2) => element1 == element2);
@override
@@ -147,7 +147,7 @@
void insert(int index, E element) {
final sortedKeys = _sortedKeysList();
if (index < 0 || index > sortedKeys.length) {
- throw new RangeError.value(index, 'index', 'Index is out of range.');
+ throw RangeError.value(index, 'index', 'Index is out of range.');
}
OrderedListTreePath newKey;
@@ -172,7 +172,7 @@
@override
void insertAll(int index, Iterable<E> iterable) {
if (index < 0 || index > length) {
- throw new RangeError.value(index, 'index', 'Index is out of range.');
+ throw RangeError.value(index, 'index', 'Index is out of range.');
}
int insertIndex = index;
for (final element in iterable) {
@@ -269,7 +269,7 @@
set length(int newLength) {
// This list is not fixed length.
// However, it does not support the length setter because [null] cannot be stored.
- throw new UnsupportedError('Length setter is not supported.');
+ throw UnsupportedError('Length setter is not supported.');
}
@override
@@ -315,7 +315,7 @@
final keys = _sortedKeysList();
// We are add deleted keys in case this change is done on our
// connection. In other cases deletedKeys should be in keys.
- final startKeys = (new SplayTreeSet<OrderedListTreePath>()
+ final startKeys = (SplayTreeSet<OrderedListTreePath>()
..addAll(keys)
..addAll(change.deletedKeys))
.toList();
@@ -328,14 +328,14 @@
}
_storage.applyChange(change);
final keysFinal = _sortedKeysList();
- final insertedElements = new SplayTreeMap<int, E>();
+ final insertedElements = SplayTreeMap<int, E>();
for (int i = 0; i < keysFinal.length; i++) {
if (change.changedEntries.containsKey(keysFinal[i])) {
insertedElements[i] = change.changedEntries[keysFinal[i]];
}
}
_changeController
- .add(new OrderedListChange(deletedPositions, insertedElements));
+ .add(OrderedListChange(deletedPositions, insertedElements));
}
@override
@@ -350,6 +350,6 @@
Uint8List get _timestamp {
_incrementalTime += 1;
- return new Uint8List(8)..buffer.asByteData().setUint64(0, _incrementalTime);
+ return Uint8List(8)..buffer.asByteData().setUint64(0, _incrementalTime);
}
}
diff --git a/public/dart/sledge/lib/src/document/values/pos_neg_counter_value.dart b/public/dart/sledge/lib/src/document/values/pos_neg_counter_value.dart
index fc4830c..8fdf2d6 100644
--- a/public/dart/sledge/lib/src/document/values/pos_neg_counter_value.dart
+++ b/public/dart/sledge/lib/src/document/values/pos_neg_counter_value.dart
@@ -29,23 +29,23 @@
T _sum;
final T _defaultValue;
final StreamController<T> _changeController =
- new StreamController<T>.broadcast();
- static final _listEquality = new ListEquality();
+ StreamController<T>.broadcast();
+ static final _listEquality = ListEquality();
final MapToKVListConverter<Uint8List, T> _converter;
/// Default constructor.
PosNegCounterValue(this._currentInstanceId)
- : _defaultValue = new Converter<T>().defaultValue,
- _converter = new MapToKVListConverter<Uint8List, T>(),
- _storage = new KeyValueStorage<Uint8List, T>(
+ : _defaultValue = Converter<T>().defaultValue,
+ _converter = MapToKVListConverter<Uint8List, T>(),
+ _storage = KeyValueStorage<Uint8List, T>(
equals: _listEquality.equals, hashCode: _listEquality.hash) {
_sum = _defaultValue;
}
Uint8List get _positiveKey =>
- concatUint8Lists(new Uint8List.fromList([0]), _currentInstanceId);
+ concatUint8Lists(Uint8List.fromList([0]), _currentInstanceId);
Uint8List get _negativeKey =>
- concatUint8Lists(new Uint8List.fromList([1]), _currentInstanceId);
+ concatUint8Lists(Uint8List.fromList([1]), _currentInstanceId);
bool _isKeyPositive(Uint8List key) => key[0] == 0;
@override
diff --git a/public/dart/sledge/lib/src/document/values/set_value.dart b/public/dart/sledge/lib/src/document/values/set_value.dart
index 94a8216..305c8c4 100644
--- a/public/dart/sledge/lib/src/document/values/set_value.dart
+++ b/public/dart/sledge/lib/src/document/values/set_value.dart
@@ -19,14 +19,14 @@
final KeyValueStorage<E, E> _map;
final MapToKVListConverter<E, bool> _converter;
final StreamController<SetChange<E>> _changeController =
- new StreamController<SetChange<E>>.broadcast();
+ StreamController<SetChange<E>>.broadcast();
// TODO: consider Converter as a provider of [equals] and [hashCode] methods.
/// Creates a SetValue with provided [equals] as equality.
/// It should be coherent with encoding of [E] done by Converter.
SetValue({bool equals(E entry1, E entry2), int hashCode(E entry)})
- : _map = new KeyValueStorage<E, E>(equals: equals, hashCode: hashCode),
- _converter = new MapToKVListConverter<E, bool>();
+ : _map = KeyValueStorage<E, E>(equals: equals, hashCode: hashCode),
+ _converter = MapToKVListConverter<E, bool>();
@override
Change getChange() => _converter.serialize(_removeValue(_map.getChange()));
@@ -40,7 +40,7 @@
void applyChange(Change input) {
final change = _copyKeyToValue(_converter.deserialize(input));
_map.applyChange(change);
- _changeController.add(new SetChange<E>(change));
+ _changeController.add(SetChange<E>(change));
}
@override
@@ -94,15 +94,15 @@
Stream<SetChange<E>> get onChange => _changeController.stream;
ConvertedChange<E, bool> _removeValue(ConvertedChange<E, E> change) {
- return new ConvertedChange<E, bool>(
- new Map<E, bool>.fromIterable(change.changedEntries.keys,
+ return ConvertedChange<E, bool>(
+ Map<E, bool>.fromIterable(change.changedEntries.keys,
value: (item) => true),
change.deletedKeys);
}
ConvertedChange<E, E> _copyKeyToValue(ConvertedChange<E, bool> change) {
- return new ConvertedChange<E, E>(
- new Map<E, E>.fromIterable(change.changedEntries.keys),
+ return ConvertedChange<E, E>(
+ Map<E, E>.fromIterable(change.changedEntries.keys),
change.deletedKeys);
}
}
diff --git a/public/dart/sledge/lib/src/ledger_helpers.dart b/public/dart/sledge/lib/src/ledger_helpers.dart
index 52ff8d9..5b4cd48 100644
--- a/public/dart/sledge/lib/src/ledger_helpers.dart
+++ b/public/dart/sledge/lib/src/ledger_helpers.dart
@@ -27,17 +27,17 @@
class LedgerObjectsFactoryImpl implements LedgerObjectsFactory {
@override
ledger.PageSnapshotProxy newPageSnapshotProxy() =>
- new ledger.PageSnapshotProxy();
+ ledger.PageSnapshotProxy();
@override
ledger.PageWatcherBinding newPageWatcherBinding() =>
- new ledger.PageWatcherBinding();
+ ledger.PageWatcherBinding();
}
/// Throws an exception containing [operation] if the status is not `ok`.
void checkStatus(ledger.Status status, String operation) {
if (status != ledger.Status.ok) {
- throw new Exception('Ledger operation `$operation` failed.');
+ throw Exception('Ledger operation `$operation` failed.');
}
}
@@ -45,12 +45,12 @@
Uint8List readBuffer(Buffer buffer) {
ReadResult readResult = buffer.vmo.read(buffer.size);
if (readResult.status != ZX.OK) {
- throw new Exception('Unable to read from vmo `${readResult.status}`.');
+ throw Exception('Unable to read from vmo `${readResult.status}`.');
}
if (readResult.bytes.lengthInBytes != buffer.size) {
- throw new Exception('Unexpected count of bytes read.');
+ throw Exception('Unexpected count of bytes read.');
}
- return new Uint8List.view(readResult.bytes.buffer);
+ return Uint8List.view(readResult.bytes.buffer);
}
/// Helper method for the [getFullEntries] method.
@@ -60,11 +60,11 @@
List<int> keyPrefix, {
ledger.Token token,
}) async {
- Completer<ledger.Status> statusCompleter = new Completer<ledger.Status>();
+ Completer<ledger.Status> statusCompleter = Completer<ledger.Status>();
List<ledger.Entry> entries;
ledger.Token nextToken;
- snapshot.getEntries(keyPrefix ?? new Uint8List(0), token,
+ snapshot.getEntries(keyPrefix ?? Uint8List(0), token,
(ledger.Status status, List<ledger.Entry> entriesResult,
ledger.Token nextTokenResult) {
entries = entriesResult;
@@ -75,7 +75,7 @@
ledger.Status status = await statusCompleter.future;
if (status != ledger.Status.ok && status != ledger.Status.partialResult) {
- throw new Exception(
+ throw Exception(
'PageSnapshot::GetEntries() returned an error status: $status');
}
@@ -116,17 +116,17 @@
for (final entry in entries) {
Uint8List k = entry.key;
Uint8List v = readBuffer(entry.value);
- keyValues.add(new KeyValue(k, v));
+ keyValues.add(KeyValue(k, v));
}
return keyValues;
}
/// Returns Change with the same content as a pageChange.
Change getChangeFromPageChange(ledger.PageChange pageChange) {
- return new Change(
+ return Change(
pageChange.changedEntries
.map((ledger.Entry entry) =>
- new KeyValue(entry.key, readBuffer(entry.value)))
+ KeyValue(entry.key, readBuffer(entry.value)))
.toList(),
pageChange.deletedKeys);
}
diff --git a/public/dart/sledge/lib/src/modification_queue.dart b/public/dart/sledge/lib/src/modification_queue.dart
index 2eb2699..8515748 100644
--- a/public/dart/sledge/lib/src/modification_queue.dart
+++ b/public/dart/sledge/lib/src/modification_queue.dart
@@ -14,7 +14,7 @@
/// Holds a Modification and a Completer. The [completer] completes
/// when [modification] has been ran.
class _Task {
- final Completer<bool> completer = new Completer<bool>();
+ final Completer<bool> completer = Completer<bool>();
final Modification modification;
_Task(this.modification);
}
@@ -22,7 +22,7 @@
/// A queue of modifications that gets ran in transactions.
class ModificationQueue {
Transaction _currentTransaction;
- final Queue<_Task> _tasks = new ListQueue<_Task>();
+ final Queue<_Task> _tasks = ListQueue<_Task>();
final Sledge _sledge;
final LedgerObjectsFactory _ledgerObjectsFactory;
final ledger.PageProxy _pageProxy;
@@ -42,7 +42,7 @@
taskToAwait = _tasks.last;
}
- final task = new _Task(modification);
+ final task = _Task(modification);
_tasks.add(task);
// If some task was in the queue, await its completion.
@@ -54,7 +54,7 @@
// Create a transaction from [modifications], run it, and await its end.
_currentTransaction =
- new Transaction(_sledge, _pageProxy, _ledgerObjectsFactory);
+ Transaction(_sledge, _pageProxy, _ledgerObjectsFactory);
try {
return await _currentTransaction.saveModification(modification);
diff --git a/public/dart/sledge/lib/src/query/field_value.dart b/public/dart/sledge/lib/src/query/field_value.dart
index c2241bb..ce475e5 100644
--- a/public/dart/sledge/lib/src/query/field_value.dart
+++ b/public/dart/sledge/lib/src/query/field_value.dart
@@ -24,7 +24,7 @@
/// Template to ease the implementation of FieldValue specializations.
abstract class _TemplatedFieldValue<T extends Comparable<T>>
implements FieldValue {
- final _converter = new Converter<T>();
+ final _converter = Converter<T>();
T _value;
_TemplatedFieldValue(this._value);
@@ -70,6 +70,6 @@
if (documentValue is LastOneWinsValue<double>) {
return documentValue.value;
}
- throw new ArgumentError('`documentValue` does not store a num.');
+ throw ArgumentError('`documentValue` does not store a num.');
}
}
diff --git a/public/dart/sledge/lib/src/query/index_definition.dart b/public/dart/sledge/lib/src/query/index_definition.dart
index f57d1c9..a9a5079 100644
--- a/public/dart/sledge/lib/src/query/index_definition.dart
+++ b/public/dart/sledge/lib/src/query/index_definition.dart
@@ -20,7 +20,7 @@
/// Stores the name of the field concerned by the index, and what kind of comparison is
/// done over the said field.
- final _filterMap = new SplayTreeMap<String, _ComparisonType>();
+ final _filterMap = SplayTreeMap<String, _ComparisonType>();
static const _jsonFieldsMapKey = 'fields';
static const _jsonSchemaKey = 'schema';
@@ -36,11 +36,11 @@
for (final fieldWithEquality in fieldsWithEquality) {
_checkBelongsToSchema(fieldWithEquality);
if (_filterMap.containsKey(fieldWithEquality)) {
- throw new ArgumentError(
+ throw ArgumentError(
'Field `$fieldWithEquality` must not appear multiple times in fieldsWithEquality.');
}
if (fieldWithInequality == fieldWithEquality) {
- throw new ArgumentError(
+ throw ArgumentError(
'Field `$fieldWithEquality` must not be part of both fieldsWithEquality and fieldWithInequality.');
}
_filterMap[fieldWithEquality] = _ComparisonType.equality;
@@ -67,7 +67,7 @@
}
});
Schema schema = Schema.fromJson(map[_jsonSchemaKey]);
- return new IndexDefinition(schema,
+ return IndexDefinition(schema,
fieldsWithEquality: fieldsWithEquality,
fieldWithInequality: fieldWithInequality);
}
@@ -76,7 +76,7 @@
/// Called by dart:convert's JsonCodec.
dynamic toJson() {
Map<String, int> jsonFieldMap = _filterMap
- .map((key, value) => new MapEntry<String, int>(key, value.index));
+ .map((key, value) => MapEntry<String, int>(key, value.index));
final jsonMap = <String, dynamic>{
_jsonFieldsMapKey: jsonFieldMap,
_jsonSchemaKey: _schema
@@ -86,7 +86,7 @@
void _checkBelongsToSchema(String field) {
if (!_schema.schemaDescription.containsKey(field)) {
- throw new ArgumentError('Field `$field` is not part of the schema.');
+ throw ArgumentError('Field `$field` is not part of the schema.');
}
}
diff --git a/public/dart/sledge/lib/src/query/query.dart b/public/dart/sledge/lib/src/query/query.dart
index bde8feb..75a12ef 100644
--- a/public/dart/sledge/lib/src/query/query.dart
+++ b/public/dart/sledge/lib/src/query/query.dart
@@ -35,11 +35,11 @@
_checkComparisonWithField(fieldPath, comparison);
});
if (fieldsWithInequalities.length > 1) {
- throw new ArgumentError(
+ throw ArgumentError(
'Queries can have at most one inequality. Inequalities founds: $fieldsWithInequalities.');
}
_comparisons =
- new SplayTreeMap<String, QueryFieldComparison>.from(comparisons);
+ SplayTreeMap<String, QueryFieldComparison>.from(comparisons);
}
/// The Schema of documents returned by this query.
@@ -67,7 +67,7 @@
utils.hash(utils.concatListOfUint8Lists(equalityValueHashes));
// TODO: get the correct index hash.
- Uint8List indexHash = new Uint8List(20);
+ Uint8List indexHash = Uint8List(20);
// TODO: take into account the inequality to compute the prefix.
Uint8List prefix = utils.concatListOfUint8Lists([
@@ -84,7 +84,7 @@
/// with.
bool documentMatchesQuery(Document doc) {
if (doc.documentId.schema != _schema) {
- throw new ArgumentError(
+ throw ArgumentError(
'The Document `doc` is of an incorrect Schema type.');
}
for (final fieldName in _comparisons.keys) {
@@ -100,7 +100,7 @@
final expectedType = _schema.fieldAtPath(fieldPath);
if (!comparison.comparisonValue.comparableTo(expectedType)) {
String runtimeType = expectedType.runtimeType.toString();
- throw new ArgumentError(
+ throw ArgumentError(
'Field `$fieldPath` of type `$runtimeType` is not comparable with `$comparison.comparisonValue`.');
}
}
diff --git a/public/dart/sledge/lib/src/query/query_builder.dart b/public/dart/sledge/lib/src/query/query_builder.dart
index d66b287..0e59365 100644
--- a/public/dart/sledge/lib/src/query/query_builder.dart
+++ b/public/dart/sledge/lib/src/query/query_builder.dart
@@ -15,15 +15,15 @@
void _addFieldComparison(
String fieldPath, dynamic value, ComparisonType comparison) {
if (_comparisons.containsKey(fieldPath)) {
- throw new ArgumentError(
+ throw ArgumentError(
"Can't add multiple restrictions to the same field ($fieldPath).");
}
if (value is num) {
_comparisons[fieldPath] =
- new QueryFieldComparison(new NumFieldValue(value), comparison);
+ QueryFieldComparison(NumFieldValue(value), comparison);
return;
}
- throw new ArgumentError(
+ throw ArgumentError(
'The type `${value.runtimeType.toString()}` used on field `$fieldPath` is not supported in queries.');
}
@@ -74,6 +74,6 @@
/// Returns a new Query possessing all the filters previously added to this.
Query build() {
- return new Query(_schema, comparisons: _comparisons);
+ return Query(_schema, comparisons: _comparisons);
}
}
diff --git a/public/dart/sledge/lib/src/schema/schema.dart b/public/dart/sledge/lib/src/schema/schema.dart
index 1bb5618..2b531e8 100644
--- a/public/dart/sledge/lib/src/schema/schema.dart
+++ b/public/dart/sledge/lib/src/schema/schema.dart
@@ -42,18 +42,18 @@
final SplayTreeMap<String, BaseType> _schemaDescription;
static final Map<String, BaseType> _jsonToType =
_buildJsonToTypeMap(<BaseType>[
- new Boolean(),
- new Integer(),
- new Double(),
- new LastOneWinsString(),
- new LastOneWinsUint8List(),
- new IntCounter(),
- new DoubleCounter(),
- new BytelistMap(),
- new BytelistSet(),
- new OrderedList()
+ Boolean(),
+ Integer(),
+ Double(),
+ LastOneWinsString(),
+ LastOneWinsUint8List(),
+ IntCounter(),
+ DoubleCounter(),
+ BytelistMap(),
+ BytelistSet(),
+ OrderedList()
]);
- static const _listEquality = const ListEquality();
+ static const _listEquality = ListEquality();
/// The length of the hash of Schema, as returned by the hash getter.
static const int hashLength = 20;
@@ -62,10 +62,10 @@
/// schemas.
/// Throws an error if a field's name contains the '.' character.
Schema(Map<String, BaseType> schemaDescription)
- : _schemaDescription = new SplayTreeMap.from(schemaDescription) {
+ : _schemaDescription = SplayTreeMap.from(schemaDescription) {
_schemaDescription.forEach((String name, dynamic value) {
if (name.contains('.')) {
- throw new ArgumentError(
+ throw ArgumentError(
'The field `$name` must not contain the `.` character.');
}
});
@@ -73,15 +73,15 @@
/// Builds a Schema from a JSON object.
Schema.fromJson(Map<String, dynamic> map)
- : _schemaDescription = new SplayTreeMap<String, BaseType>() {
+ : _schemaDescription = SplayTreeMap<String, BaseType>() {
map.forEach((String name, dynamic value) {
BaseType type;
if (value is Map) {
- type = new Schema.fromJson(value);
+ type = Schema.fromJson(value);
} else if (value is String) {
type = _baseTypeFromString(value);
} else {
- throw new ArgumentError('Invalid JSON.');
+ throw ArgumentError('Invalid JSON.');
}
_schemaDescription[name] = type;
});
@@ -89,11 +89,11 @@
@override
Map<String, dynamic> toJson() =>
- new SplayTreeMap<String, dynamic>.from(_schemaDescription);
+ SplayTreeMap<String, dynamic>.from(_schemaDescription);
@override
Value newValue(ConnectionId id) {
- return new NodeValue(_schemaDescription, id);
+ return NodeValue(_schemaDescription, id);
}
/// Returns a description of the schema.
@@ -147,7 +147,7 @@
static BaseType _baseTypeFromString(String typeName) {
if (!_jsonToType.containsKey(typeName)) {
- throw new ArgumentError('Unknown type.');
+ throw ArgumentError('Unknown type.');
}
return _jsonToType[typeName];
}
diff --git a/public/dart/sledge/lib/src/schema/types/map_type.dart b/public/dart/sledge/lib/src/schema/types/map_type.dart
index 95b070d..90917e3 100644
--- a/public/dart/sledge/lib/src/schema/types/map_type.dart
+++ b/public/dart/sledge/lib/src/schema/types/map_type.dart
@@ -17,5 +17,5 @@
@override
Value newValue(ConnectionId connectionId) =>
- new MapValue<String, Uint8List>();
+ MapValue<String, Uint8List>();
}
diff --git a/public/dart/sledge/lib/src/schema/types/ordered_list_type.dart b/public/dart/sledge/lib/src/schema/types/ordered_list_type.dart
index 9ae68ce..2c2e67a 100644
--- a/public/dart/sledge/lib/src/schema/types/ordered_list_type.dart
+++ b/public/dart/sledge/lib/src/schema/types/ordered_list_type.dart
@@ -13,13 +13,13 @@
/// The Sledge type for Ordered Set of [Uint8List].
class OrderedList implements BaseType {
- static const _listEquality = const ListEquality<int>();
+ static const _listEquality = ListEquality<int>();
@override
String toJson() => 'OrderedList';
@override
Value newValue(ConnectionId connectionId) =>
- new OrderedListValue<Uint8List>(connectionId.id,
+ OrderedListValue<Uint8List>(connectionId.id,
equals: _listEquality.equals);
}
diff --git a/public/dart/sledge/lib/src/schema/types/pos_neg_counter_type.dart b/public/dart/sledge/lib/src/schema/types/pos_neg_counter_type.dart
index 6571623..e0d5729 100644
--- a/public/dart/sledge/lib/src/schema/types/pos_neg_counter_type.dart
+++ b/public/dart/sledge/lib/src/schema/types/pos_neg_counter_type.dart
@@ -14,7 +14,7 @@
@override
Value newValue(ConnectionId connectionId) =>
- new PosNegCounterValue<int>(connectionId.id);
+ PosNegCounterValue<int>(connectionId.id);
}
/// The Sledge type for positive-negative counter
@@ -24,5 +24,5 @@
@override
Value newValue(ConnectionId connectionId) =>
- new PosNegCounterValue<double>(connectionId.id);
+ PosNegCounterValue<double>(connectionId.id);
}
diff --git a/public/dart/sledge/lib/src/schema/types/set_type.dart b/public/dart/sledge/lib/src/schema/types/set_type.dart
index 9f51a86..6acd1fc 100644
--- a/public/dart/sledge/lib/src/schema/types/set_type.dart
+++ b/public/dart/sledge/lib/src/schema/types/set_type.dart
@@ -14,12 +14,12 @@
/// The Sledge type for Set of [Uint8List].
/// Last One Wins strategy is applied for conflict resolution per entry.
class BytelistSet implements BaseType {
- static const _listEquality = const ListEquality<int>();
+ static const _listEquality = ListEquality<int>();
@override
String toJson() => 'BytelistSet';
@override
- Value newValue(ConnectionId connectionId) => new SetValue<Uint8List>(
+ Value newValue(ConnectionId connectionId) => SetValue<Uint8List>(
equals: _listEquality.equals, hashCode: _listEquality.hash);
}
diff --git a/public/dart/sledge/lib/src/schema/types/trivial_types.dart b/public/dart/sledge/lib/src/schema/types/trivial_types.dart
index e771090..7212931 100644
--- a/public/dart/sledge/lib/src/schema/types/trivial_types.dart
+++ b/public/dart/sledge/lib/src/schema/types/trivial_types.dart
@@ -15,7 +15,7 @@
String toJson() => 'Boolean';
@override
- Value newValue(ConnectionId connectionId) => new LastOneWinsValue<bool>();
+ Value newValue(ConnectionId connectionId) => LastOneWinsValue<bool>();
}
/// The Sledge type to store integers.
@@ -24,7 +24,7 @@
String toJson() => 'Integer';
@override
- Value newValue(ConnectionId connectionId) => new LastOneWinsValue<int>();
+ Value newValue(ConnectionId connectionId) => LastOneWinsValue<int>();
}
/// The Sledge type to store doubles.
@@ -33,7 +33,7 @@
String toJson() => 'Double';
@override
- Value newValue(ConnectionId connectionId) => new LastOneWinsValue<double>();
+ Value newValue(ConnectionId connectionId) => LastOneWinsValue<double>();
}
/// The Sledge type to store strings with LWW merging strategy.
@@ -42,7 +42,7 @@
String toJson() => 'LastOneWinsString';
@override
- Value newValue(ConnectionId connectionId) => new LastOneWinsValue<String>();
+ Value newValue(ConnectionId connectionId) => LastOneWinsValue<String>();
}
/// The Sledge type to store byte data with LWW merging strategy.
@@ -52,5 +52,5 @@
@override
Value newValue(ConnectionId connectionId) =>
- new LastOneWinsValue<Uint8List>();
+ LastOneWinsValue<Uint8List>();
}
diff --git a/public/dart/sledge/lib/src/sledge.dart b/public/dart/sledge/lib/src/sledge.dart
index ac41193..8d3c40e 100644
--- a/public/dart/sledge/lib/src/sledge.dart
+++ b/public/dart/sledge/lib/src/sledge.dart
@@ -29,9 +29,9 @@
/// The interface to the Sledge library.
class Sledge {
- final ledger.LedgerProxy _ledgerProxy = new ledger.LedgerProxy();
+ final ledger.LedgerProxy _ledgerProxy = ledger.LedgerProxy();
final ledger.PageProxy _pageProxy;
- final ConnectionId _connectionId = new ConnectionId.random();
+ final ConnectionId _connectionId = ConnectionId.random();
// Cache to get document by documentId.prefix.
final Map<Uint8List, Future<Document>> _documentByPrefix =
@@ -46,17 +46,17 @@
/// Default constructor.
factory Sledge(ComponentContext componentContext, [SledgePageId pageId]) {
- fidl.InterfacePair<ledger.Ledger> ledgerPair = new fidl.InterfacePair();
+ fidl.InterfacePair<ledger.Ledger> ledgerPair = fidl.InterfacePair();
componentContext.getLedger(ledgerPair.passRequest());
- return new Sledge._(ledgerPair.passHandle(), pageId);
+ return Sledge._(ledgerPair.passHandle(), pageId);
}
/// Internal constructor
Sledge._(fidl.InterfaceHandle<ledger.Ledger> ledgerHandle,
[SledgePageId pageId])
- : _pageProxy = new ledger.PageProxy(),
- _ledgerObjectsFactory = new LedgerObjectsFactoryImpl() {
- pageId ??= new SledgePageId();
+ : _pageProxy = ledger.PageProxy(),
+ _ledgerObjectsFactory = LedgerObjectsFactoryImpl() {
+ pageId ??= SledgePageId();
// The initialization sequence consists of:
// 1/ Obtaining a LedgerProxy from the LedgerHandle.
@@ -72,30 +72,30 @@
_ledgerProxy.getPage(pageId.id, _pageProxy.ctrl.request());
_modificationQueue =
- new ModificationQueue(this, _ledgerObjectsFactory, _pageProxy);
+ ModificationQueue(this, _ledgerObjectsFactory, _pageProxy);
_subscribtion = _subscribe();
}
/// Constructor that takes a new-style binding of ComponentContext
factory Sledge.forAsync(modular_async.ComponentContext componentContext,
[SledgePageId pageId]) {
- final pair = new ChannelPair();
- componentContext.getLedger(new fidl.InterfaceRequest(pair.first));
- return new Sledge._(new fidl.InterfaceHandle(pair.second), pageId);
+ final pair = ChannelPair();
+ componentContext.getLedger(fidl.InterfaceRequest(pair.first));
+ return Sledge._(fidl.InterfaceHandle(pair.second), pageId);
}
/// Convenience factory for modules.
factory Sledge.fromModule(final ModuleContext moduleContext,
[SledgePageId pageId]) {
- ComponentContextProxy componentContextProxy = new ComponentContextProxy();
+ ComponentContextProxy componentContextProxy = ComponentContextProxy();
moduleContext.getComponentContext(componentContextProxy.ctrl.request());
- return new Sledge(componentContextProxy, pageId);
+ return Sledge(componentContextProxy, pageId);
}
/// Convenience constructor for tests.
Sledge.testing(this._pageProxy, this._ledgerObjectsFactory) {
_modificationQueue =
- new ModificationQueue(this, _ledgerObjectsFactory, _pageProxy);
+ ModificationQueue(this, _ledgerObjectsFactory, _pageProxy);
_subscribtion = _subscribe();
}
@@ -123,7 +123,7 @@
/// Execution of the transaction does not continue past this point.
void abortAndRollback() {
if (currentTransaction == null) {
- throw new StateError('No transaction started.');
+ throw StateError('No transaction started.');
}
currentTransaction.abortAndRollback();
}
@@ -179,7 +179,7 @@
// Select the changes that concern documents.
final documentChange = splittedChange[sledge_storage
.prefixForType(sledge_storage.KeyValueType.document)] ??
- new Change();
+ Change();
// Split the changes according to the document they belong to.
final splittedDocumentChange =
documentChange.splitByPrefix(DocumentId.prefixLength);
@@ -195,12 +195,12 @@
Subscription _subscribe() {
assert(_modificationQueue.currentTransaction == null,
'`_subscribe` must be called before any transaction can start.');
- return new Subscription(_pageProxy, _ledgerObjectsFactory, _applyChange);
+ return Subscription(_pageProxy, _ledgerObjectsFactory, _applyChange);
}
void _verifyThatTransactionHasStarted() {
if (currentTransaction == null) {
- throw new StateError('No transaction started.');
+ throw StateError('No transaction started.');
}
}
}
diff --git a/public/dart/sledge/lib/src/sledge_page_id.dart b/public/dart/sledge/lib/src/sledge_page_id.dart
index 5379397..6a3325b 100644
--- a/public/dart/sledge/lib/src/sledge_page_id.dart
+++ b/public/dart/sledge/lib/src/sledge_page_id.dart
@@ -24,14 +24,14 @@
SledgePageId([String pageName = '']) {
pageName ??= '';
- final Uint8List hashedPageName = hash(new Utf8Encoder().convert(pageName));
+ final Uint8List hashedPageName = hash(Utf8Encoder().convert(pageName));
final encodedPageName = concatUint8Lists(prefix, hashedPageName);
final trimmedEncodedPageName = encodedPageName.sublist(0, 16);
assert(trimmedEncodedPageName.length == 16);
- _id = new ledger.PageId(id: trimmedEncodedPageName);
+ _id = ledger.PageId(id: trimmedEncodedPageName);
}
/// The Ledger's PageId.
@@ -48,6 +48,6 @@
/// version of Sledge.
static bool pageIsManagedBySledge(ledger.PageId pageId) {
final pageIdPrefix = getSublistView(pageId.id, end: prefix.length);
- return new ListEquality<int>().equals(pageIdPrefix, prefix);
+ return ListEquality<int>().equals(pageIdPrefix, prefix);
}
}
diff --git a/public/dart/sledge/lib/src/storage/kv_encoding.dart b/public/dart/sledge/lib/src/storage/kv_encoding.dart
index 358273a..84199df 100644
--- a/public/dart/sledge/lib/src/storage/kv_encoding.dart
+++ b/public/dart/sledge/lib/src/storage/kv_encoding.dart
@@ -34,7 +34,7 @@
/// Returns the prefix for the KV storing in Ledger items of type [type].
Uint8List prefixForType(KeyValueType type) {
assert(type.index >= 0 && type.index <= 255);
- return new Uint8List.fromList([type.index]);
+ return Uint8List.fromList([type.index]);
}
/// Returns the document subId stored in `key`.
diff --git a/public/dart/sledge/lib/src/subscription/subscription.dart b/public/dart/sledge/lib/src/subscription/subscription.dart
index fd6594e..7f929bd 100644
--- a/public/dart/sledge/lib/src/subscription/subscription.dart
+++ b/public/dart/sledge/lib/src/subscription/subscription.dart
@@ -16,7 +16,7 @@
final ledger.PageSnapshotProxy _snapshotProxy;
final ledger.PageWatcherBinding _pageWatcherBinding;
final void Function(Change change) _applyChangeCallback;
- final Change _currentChange = new Change();
+ final Change _currentChange = Change();
/// Register a watcher for Ledger page, which pass all changes to
/// _applyChangeCallback.
@@ -26,7 +26,7 @@
_pageWatcherBinding = ledgerObjectsFactory.newPageWatcherBinding() {
_pageProxy.getSnapshotNew(
_snapshotProxy.ctrl.request(),
- new Uint8List(0),
+ Uint8List(0),
_pageWatcherBinding.wrap(this),
);
}
diff --git a/public/dart/sledge/lib/src/transaction.dart b/public/dart/sledge/lib/src/transaction.dart
index ed91cfd..576eaf8 100644
--- a/public/dart/sledge/lib/src/transaction.dart
+++ b/public/dart/sledge/lib/src/transaction.dart
@@ -47,7 +47,7 @@
// All the read operations in |modification| will read from that snapshot.
..getSnapshotNew(
_pageSnapshotProxy.ctrl.request(),
- new Uint8List(0),
+ Uint8List(0),
null,
);
@@ -105,7 +105,7 @@
/// Returns the document identified with [documentId].
/// If the document does not exist, a new document is returned.
Future<Document> getDocument(DocumentId documentId) async {
- final document = new Document(_sledge, documentId);
+ final document = Document(_sledge, documentId);
Uint8List keyPrefix = concatUint8Lists(
sledge_storage.prefixForType(sledge_storage.KeyValueType.document),
documentId.prefix);
@@ -114,14 +114,14 @@
// Strip the document prefix from the KVs.
for (int i = 0; i < kvs.length; i++) {
- kvs[i] = new KeyValue(
+ kvs[i] = KeyValue(
getSublistView(kvs[i].key,
start: DocumentId.prefixLength + sledge_storage.typePrefixLength),
kvs[i].value);
}
if (kvs.isNotEmpty) {
- final change = new Change(kvs);
+ final change = Change(kvs);
document.applyChange(change);
}
@@ -141,12 +141,12 @@
List<KeyValue> keyValues = await getEntriesFromSnapshotWithPrefix(
_pageSnapshotProxy, keyPrefix);
for (KeyValue keyValue in keyValues) {
- documentIds.add(new DocumentId(query.schema, keyValue.value));
+ documentIds.add(DocumentId(query.schema, keyValue.value));
}
} else {
print('getDocumentIds called with missing index');
List<DocumentId> documentIds =
- await getDocumentIds(new Query(query.schema));
+ await getDocumentIds(Query(query.schema));
final filteredDocumentIds = <DocumentId>[];
for (final documentId in documentIds) {
// TODO(LE-638): Avoid discarding the documents after reading them.
@@ -173,7 +173,7 @@
final newDocumentSubId =
sledge_storage.documentSubIdFromKey(keyValue.key);
if (!uint8ListsAreEqual(currentDocumentSubId, newDocumentSubId)) {
- documentIds.add(new DocumentId(query.schema, newDocumentSubId));
+ documentIds.add(DocumentId(query.schema, newDocumentSubId));
currentDocumentSubId = newDocumentSubId;
}
}
diff --git a/public/dart/sledge/lib/src/uint8list_ops.dart b/public/dart/sledge/lib/src/uint8list_ops.dart
index 4b439b0..ba30645 100644
--- a/public/dart/sledge/lib/src/uint8list_ops.dart
+++ b/public/dart/sledge/lib/src/uint8list_ops.dart
@@ -16,7 +16,7 @@
/// Concatenate two byte arrays.
Uint8List concatUint8Lists(Uint8List a, Uint8List b) {
- return new Uint8List(a.length + b.length)..setAll(0, a)..setAll(a.length, b);
+ return Uint8List(a.length + b.length)..setAll(0, a)..setAll(a.length, b);
}
// TODO: consider using Iterable instead of List.
@@ -26,7 +26,7 @@
for (final x in list) {
sumLength += x.length;
}
- final result = new Uint8List(sumLength);
+ final result = Uint8List(sumLength);
int pos = 0;
for (final x in list) {
result.setAll(pos, x);
@@ -39,27 +39,27 @@
/// ending at [end] (exclusive).
Uint8List getSublistView(Uint8List x, {int start = 0, int end}) {
end ??= x.length;
- return new UnmodifiableUint8ListView(
+ return UnmodifiableUint8ListView(
x.buffer.asUint8List(x.offsetInBytes + start, end - start));
}
/// Returns a Uint8List created from the utf8 encoding of [string].
/// [string] must be non-null.
Uint8List getUint8ListFromString(String string) {
- return new Uint8List.fromList(utf8.encode(string));
+ return Uint8List.fromList(utf8.encode(string));
}
/// Returns a Uint8List created from the binary encoding of [number].
Uint8List getUint8ListFromNumber(num number) {
- IntConverter converter = new IntConverter();
+ IntConverter converter = IntConverter();
return converter.serialize(number);
}
/// Returns a new HashMap with Uint8Lists as a keys.
/// Note: The type T is enforced only at compile time.
HashMap<Uint8List, T> newUint8ListMap<T>() {
- const listEquality = const ListEquality<int>();
- return new HashMap<Uint8List, T>(
+ const listEquality = ListEquality<int>();
+ return HashMap<Uint8List, T>(
equals: listEquality.equals, hashCode: listEquality.hash);
}
@@ -69,7 +69,7 @@
if (a == b) {
return true;
}
- const listEquality = const ListEquality<int>();
+ const listEquality = ListEquality<int>();
return listEquality.equals(a, b);
}
@@ -91,20 +91,20 @@
/// Returns a new ordered HashMap with Uint8Lists as a keys.
/// Note: The type T is enforced only at compile time.
SplayTreeMap<Uint8List, T> newUint8ListOrderedMap<T>() {
- return new SplayTreeMap<Uint8List, T>(_compareLists);
+ return SplayTreeMap<Uint8List, T>(_compareLists);
}
/// Returns a 20 bytes long hash of [data].
Uint8List hash(Uint8List data) {
final iterable = sha256.convert(data).bytes.getRange(0, 20);
- return new Uint8List.fromList(new List.from(iterable));
+ return Uint8List.fromList(List.from(iterable));
}
-final _random = new Random.secure();
+final _random = Random.secure();
/// Returns a list of random bytes of a given [length].
Uint8List randomUint8List(int length) {
- final result = new Uint8List(length);
+ final result = Uint8List(length);
for (int i = 0; i < length; i++) {
result[i] = _random.nextInt(256);
}
diff --git a/public/dart/sledge/test/crdt_test_framework/computational_graph.dart b/public/dart/sledge/test/crdt_test_framework/computational_graph.dart
index e8dddca..df0d882 100644
--- a/public/dart/sledge/test/crdt_test_framework/computational_graph.dart
+++ b/public/dart/sledge/test/crdt_test_framework/computational_graph.dart
@@ -16,7 +16,7 @@
class ComputationalGraph {
final List<Node> nodes = <Node>[];
final List<List<int>> _allChoices = <List<int>>[];
- final Random random = new Random(0);
+ final Random random = Random(0);
void addNode(Node v) {
// TODO: remove O(n) part.
@@ -64,7 +64,7 @@
_allChoices.clear();
List<int> choices = <int>[];
while (_moveNextChoiceList(choices)) {
- _allChoices.add(new List<int>.from(choices));
+ _allChoices.add(List<int>.from(choices));
}
return _allChoices.length;
}
@@ -98,7 +98,7 @@
Map<Node, int> known = <Node, int>{};
for (int i = 0; i < nodes.length; i++) {
if (ready.isEmpty) {
- throw new StateError('Computational graph should be acyclic.');
+ throw StateError('Computational graph should be acyclic.');
}
int curChoice = 0;
if (i < choices.length) {
@@ -124,12 +124,12 @@
}
}
}
- return new EvaluationOrder(order);
+ return EvaluationOrder(order);
}
EvaluationOrder _getNthOrder(int index) {
if (index < 0 || index >= _allChoices.length) {
- throw new ArgumentError.value(index, 'index', 'Index is out of range.');
+ throw ArgumentError.value(index, 'index', 'Index is out of range.');
}
return _getOrder(_allChoices[index]);
}
@@ -139,5 +139,5 @@
// Returns all correct topological orders of this graph.
Iterable<EvaluationOrder> get orders =>
- new Iterable<EvaluationOrder>.generate(_countOrders(), _getNthOrder);
+ Iterable<EvaluationOrder>.generate(_countOrders(), _getNthOrder);
}
diff --git a/public/dart/sledge/test/crdt_test_framework/evaluation_order.dart b/public/dart/sledge/test/crdt_test_framework/evaluation_order.dart
index 7279811..888e9ee 100644
--- a/public/dart/sledge/test/crdt_test_framework/evaluation_order.dart
+++ b/public/dart/sledge/test/crdt_test_framework/evaluation_order.dart
@@ -19,18 +19,18 @@
EvaluationOrder.fromIds(Iterable<String> ids, Iterable<Node> graphNodes,
{bool allowPartial = false, allowGenerated = false})
: nodes = <Node>[] {
- final idToNode = new Map<String, Node>.fromIterable(graphNodes,
+ final idToNode = Map<String, Node>.fromIterable(graphNodes,
key: (node) => node.nodeId);
final setIds = ids.toSet();
if (setIds.length != ids.length) {
- throw new ArgumentError('Elements of ids ($ids) must be unique.');
+ throw ArgumentError('Elements of ids ($ids) must be unique.');
}
if (!allowPartial) {
for (final node in graphNodes) {
if (!setIds.contains(node.nodeId)) {
- throw new ArgumentError(
+ throw ArgumentError(
'ids ($ids) must contain all nodes from `$graphNodes`.');
}
}
@@ -40,7 +40,7 @@
Node node = idToNode[id];
if (node == null) {
if (!allowGenerated || !id.startsWith('g-')) {
- throw new ArgumentError(
+ throw ArgumentError(
'`$id` is not an id of a node from `$graphNodes`.');
}
// Can throw FormatException
@@ -49,7 +49,7 @@
int secondDash = id.indexOf('-', underscore + 1);
int id1 = int.parse(id.substring(firstDash + 1, underscore));
int id2 = int.parse(id.substring(underscore + 1, secondDash));
- node = new SynchronizationNode.generated(
+ node = SynchronizationNode.generated(
id.substring(secondDash + 1), id1, id2);
}
nodes.add(node);
@@ -58,7 +58,7 @@
@override
String toString() {
- StringBuffer nodesString = new StringBuffer()
+ StringBuffer nodesString = StringBuffer()
..writeAll(nodes.map((node) => "'$node'"), ', ');
return '[$nodesString]';
}
diff --git a/public/dart/sledge/test/crdt_test_framework/fleet.dart b/public/dart/sledge/test/crdt_test_framework/fleet.dart
index ff62518..581a33f 100644
--- a/public/dart/sledge/test/crdt_test_framework/fleet.dart
+++ b/public/dart/sledge/test/crdt_test_framework/fleet.dart
@@ -40,16 +40,16 @@
class Fleet<T extends dynamic> {
int _fleetSize;
List<Node> _lastModifications;
- final Node _initialModification = new Node('init');
- final ComputationalGraph graph = new ComputationalGraph();
+ final Node _initialModification = Node('init');
+ final ComputationalGraph graph = ComputationalGraph();
final T Function(int) _instanceGenerator;
final List<CheckerGenerator<T>> _checkerGenerators = <CheckerGenerator<T>>[];
double _expectedSyncsPerAction = 0.0;
- final Random random = new Random(1);
+ final Random random = Random(1);
Fleet(this._fleetSize, this._instanceGenerator) {
_lastModifications =
- new List<Node>.filled(_fleetSize, _initialModification);
+ List<Node>.filled(_fleetSize, _initialModification);
graph.addNode(_initialModification);
}
@@ -73,7 +73,7 @@
}
final list = <int>[]..addAll(group)..addAll(group.reversed.skip(2));
for (int i = 0; i < list.length - 1; i++) {
- Node node = new SynchronizationNode(
+ Node node = SynchronizationNode(
'${list[i]}_${list[i + 1]}-n${graph.nodes.length}',
list[i],
list[i + 1]);
@@ -84,7 +84,7 @@
void runInTransaction(int id, Future Function(T) modification) {
final node =
- new ModificationNode<T>('$id-n${graph.nodes.length}', id, modification);
+ ModificationNode<T>('$id-n${graph.nodes.length}', id, modification);
_addNode(node, id);
}
@@ -99,7 +99,7 @@
/// [expectedSyncsPerAction].
void setRandomSynchronizationsRate(double expectedSyncsPerAction) {
if (expectedSyncsPerAction < 0) {
- throw new ArgumentError(
+ throw ArgumentError(
'Number of synchronizations must be greater or equal to 0. Got $expectedSyncsPerAction.');
}
_expectedSyncsPerAction = expectedSyncsPerAction;
@@ -111,7 +111,7 @@
Future testSingleOrder(
{EvaluationOrder order, bool enableRandomSyncronization = true}) async {
order ??= graph.orders.first;
- final fleetState = new FleetState<T>(_fleetSize, _instanceGenerator);
+ final fleetState = FleetState<T>(_fleetSize, _instanceGenerator);
for (final newChecker in _checkerGenerators) {
fleetState.addChecker(newChecker());
}
@@ -122,7 +122,7 @@
if (enableRandomSyncronization &&
_fleetSize > 1 &&
_expectedSyncsPerAction > 0) {
- completedOrder = new EvaluationOrder([]);
+ completedOrder = EvaluationOrder([]);
for (final node in order.nodes) {
completedOrder.nodes.add(node);
// Geometric distribution (the probability distribution of the number Y
@@ -141,7 +141,7 @@
if (instanceId2 >= instanceId1) {
instanceId2++;
}
- completedOrder.nodes.add(new SynchronizationNode.generated(
+ completedOrder.nodes.add(SynchronizationNode.generated(
'${completedOrder.nodes.length}', instanceId1, instanceId2));
}
}
@@ -152,7 +152,7 @@
await fleetState.applyNode(completedOrder.nodes[i], i);
} on TestFailure catch (failure) {
// ignore: only_throw_errors
- throw new SingleOrderTestFailure(
+ throw SingleOrderTestFailure(
failure, completedOrder, completedOrder.nodes[i]);
}
}
@@ -169,7 +169,7 @@
Future testFixedOrder(Iterable<String> nodeIds,
{bool allowPartial = false, bool allowGenerated = true}) async {
await testSingleOrder(
- order: new EvaluationOrder.fromIds(nodeIds, graph.nodes,
+ order: EvaluationOrder.fromIds(nodeIds, graph.nodes,
allowPartial: allowPartial, allowGenerated: allowGenerated),
enableRandomSyncronization: false);
}
diff --git a/public/dart/sledge/test/crdt_test_framework/fleet_state.dart b/public/dart/sledge/test/crdt_test_framework/fleet_state.dart
index 83ad580..8643956 100644
--- a/public/dart/sledge/test/crdt_test_framework/fleet_state.dart
+++ b/public/dart/sledge/test/crdt_test_framework/fleet_state.dart
@@ -24,19 +24,19 @@
FleetState(int size, T instanceGenerator(int index))
: _fleetSize = size,
- _storageStates = new List<StorageState>.generate(
- size, (index) => new StorageState(),
+ _storageStates = List<StorageState>.generate(
+ size, (index) => StorageState(),
growable: false),
_instances =
- new List<T>.generate(size, instanceGenerator, growable: false) {
+ List<T>.generate(size, instanceGenerator, growable: false) {
for (int i = 0; i < size; i++) {
if (T == Sledge) {
_storageStates[i] = _instances[i].fakeLedgerPage.storageState;
} else if (T == Document) {
- _storageStates[i] = new StorageState(
+ _storageStates[i] = StorageState(
(change) => _instances.cast<Document>()[i].applyChange(change));
} else {
- _storageStates[i] = new StorageState(_instances[i].applyChange);
+ _storageStates[i] = StorageState(_instances[i].applyChange);
}
}
}
diff --git a/public/dart/sledge/test/crdt_test_framework/node.dart b/public/dart/sledge/test/crdt_test_framework/node.dart
index 0d9f9b9..1acd883 100644
--- a/public/dart/sledge/test/crdt_test_framework/node.dart
+++ b/public/dart/sledge/test/crdt_test_framework/node.dart
@@ -17,10 +17,10 @@
/// already contains type prefix.
Node._internal(this.nodeId) {
if (nodeId.contains("'")) {
- throw new ArgumentError("[nodeId] should not contain character <'>.");
+ throw ArgumentError("[nodeId] should not contain character <'>.");
}
if (nodeId.startsWith(r'[\w]+-')) {
- throw new ArgumentError('[nodeId] should start with the type prefix.');
+ throw ArgumentError('[nodeId] should start with the type prefix.');
}
}
diff --git a/public/dart/sledge/test/crdt_test_framework/storage_state.dart b/public/dart/sledge/test/crdt_test_framework/storage_state.dart
index 36c1f47..ecac39f 100644
--- a/public/dart/sledge/test/crdt_test_framework/storage_state.dart
+++ b/public/dart/sledge/test/crdt_test_framework/storage_state.dart
@@ -29,10 +29,10 @@
timestamp ??= globalIncrementalTimer++;
for (final entry in change.changedEntries) {
- _storage[entry.key] = new Entry(entry.value, timestamp);
+ _storage[entry.key] = Entry(entry.value, timestamp);
}
for (final key in change.deletedKeys) {
- _storage[key] = new Entry.deleted(timestamp);
+ _storage[key] = Entry.deleted(timestamp);
}
// TODO: check that changedEntries and deletedKeys do not intersect.
_onChangeCallback?.call(change);
@@ -62,12 +62,12 @@
_storage[entry.key] = entry.value;
}
} else {
- changedEntries.add(new KeyValue(entry.key, entry.value.value));
+ changedEntries.add(KeyValue(entry.key, entry.value.value));
_storage[entry.key] = other._storage[entry.key];
}
}
}
- final change = new Change(changedEntries, deletedKeys);
+ final change = Change(changedEntries, deletedKeys);
if (change.changedEntries.isNotEmpty || change.deletedKeys.isNotEmpty) {
_onChangeCallback?.call(change);
}
@@ -79,7 +79,7 @@
for (final key in _storage.keys) {
Entry value = _storage[key];
if (!value.isDeleted && hasPrefix(key, keyPrefix)) {
- entries.add(new KeyValue(key, value.value));
+ entries.add(KeyValue(key, value.value));
}
}
return entries;
diff --git a/public/dart/sledge/test/crdt_test_framework_test/checker_test.dart b/public/dart/sledge/test/crdt_test_framework_test/checker_test.dart
index b341cf9..0951fd8 100644
--- a/public/dart/sledge/test/crdt_test_framework_test/checker_test.dart
+++ b/public/dart/sledge/test/crdt_test_framework_test/checker_test.dart
@@ -15,13 +15,13 @@
const LastOneWinsFleetFactory();
Fleet<LastOneWinsValue<T>> newFleet(int count) {
- return new Fleet<LastOneWinsValue<T>>(
- count, (index) => new LastOneWinsValue<T>());
+ return Fleet<LastOneWinsValue<T>>(
+ count, (index) => LastOneWinsValue<T>());
}
}
const LastOneWinsFleetFactory<bool> boolLastOneWinsFleetFactory =
- const LastOneWinsFleetFactory<bool>();
+ LastOneWinsFleetFactory<bool>();
class FalseChecker extends Checker<LastOneWinsValue<bool>> {
@override
@@ -42,7 +42,7 @@
b.value = false;
})
..synchronize([0, 1])
- ..addChecker(() => new FalseChecker());
+ ..addChecker(() => FalseChecker());
await fleet.testAllOrders();
});
@@ -51,7 +51,7 @@
..runInTransaction(0, (LastOneWinsValue<bool> b) async {
b.value = true;
})
- ..addChecker(() => new FalseChecker());
- expect(fleet.testAllOrders(), throwsA(new TypeMatcher<TestFailure>()));
+ ..addChecker(() => FalseChecker());
+ expect(fleet.testAllOrders(), throwsA(TypeMatcher<TestFailure>()));
});
}
diff --git a/public/dart/sledge/test/crdt_test_framework_test/computational_graph_test.dart b/public/dart/sledge/test/crdt_test_framework_test/computational_graph_test.dart
index 0ba1c59..ebfb766 100644
--- a/public/dart/sledge/test/crdt_test_framework_test/computational_graph_test.dart
+++ b/public/dart/sledge/test/crdt_test_framework_test/computational_graph_test.dart
@@ -14,11 +14,11 @@
setupLogger();
test('Build and get orders.', () {
- ComputationalGraph G = new ComputationalGraph();
- final n1 = new Node('1');
- final n2 = new Node('2');
- final n3 = new Node('3');
- final n4 = new Node('4');
+ ComputationalGraph G = ComputationalGraph();
+ final n1 = Node('1');
+ final n2 = Node('2');
+ final n3 = Node('3');
+ final n4 = Node('4');
G
..addNode(n1)
..addNode(n2)
@@ -32,16 +32,16 @@
expect(
orders,
unorderedEquals([
- new EvaluationOrder([n1, n2, n3, n4]),
- new EvaluationOrder([n1, n2, n4, n3])
+ EvaluationOrder([n1, n2, n3, n4]),
+ EvaluationOrder([n1, n2, n4, n3])
]));
});
test('Build and get orders not connected.', () {
- ComputationalGraph G = new ComputationalGraph();
- final n1 = new Node('1');
- final n2 = new Node('2');
- final n3 = new Node('3');
+ ComputationalGraph G = ComputationalGraph();
+ final n1 = Node('1');
+ final n2 = Node('2');
+ final n3 = Node('3');
G
..addNode(n1)
..addNode(n2)
@@ -52,19 +52,19 @@
expect(
orders,
unorderedEquals([
- new EvaluationOrder([n1, n2, n3]),
- new EvaluationOrder([n2, n1, n3]),
- new EvaluationOrder([n2, n3, n1])
+ EvaluationOrder([n1, n2, n3]),
+ EvaluationOrder([n2, n1, n3]),
+ EvaluationOrder([n2, n3, n1])
]));
});
test('Build and get orders.', () {
- ComputationalGraph G = new ComputationalGraph();
- final n1 = new Node('1');
- final n2 = new Node('2');
- final n3 = new Node('3');
- final n4 = new Node('4');
- final n5 = new Node('5');
+ ComputationalGraph G = ComputationalGraph();
+ final n1 = Node('1');
+ final n2 = Node('2');
+ final n3 = Node('3');
+ final n4 = Node('4');
+ final n5 = Node('5');
G
..addNode(n1)
..addNode(n2)
@@ -81,17 +81,17 @@
expect(
orders,
unorderedEquals([
- new EvaluationOrder([n1, n2, n3, n4, n5]),
- new EvaluationOrder([n1, n2, n4, n3, n5]),
- new EvaluationOrder([n1, n4, n2, n3, n5])
+ EvaluationOrder([n1, n2, n3, n4, n5]),
+ EvaluationOrder([n1, n2, n4, n3, n5]),
+ EvaluationOrder([n1, n4, n2, n3, n5])
]));
});
test('Build and get orders, cyclic graph.', () {
- ComputationalGraph G = new ComputationalGraph();
- final n1 = new Node('1');
- final n2 = new Node('2');
- final n3 = new Node('3');
+ ComputationalGraph G = ComputationalGraph();
+ final n1 = Node('1');
+ final n2 = Node('2');
+ final n3 = Node('3');
G
..addNode(n1)
..addNode(n2)
@@ -104,9 +104,9 @@
});
test('Check that random orders differs.', () {
- ComputationalGraph G = new ComputationalGraph();
- final n1 = new Node('1');
- final n2 = new Node('2');
+ ComputationalGraph G = ComputationalGraph();
+ final n1 = Node('1');
+ final n2 = Node('2');
G..addNode(n1)..addNode(n2);
final orders = <EvaluationOrder>[];
for (int i = 0; i < 31; i++) {
@@ -117,18 +117,18 @@
expect(
orders,
containsAll([
- new EvaluationOrder([n1, n2]),
- new EvaluationOrder([n2, n1])
+ EvaluationOrder([n1, n2]),
+ EvaluationOrder([n2, n1])
]));
});
test('Check getRandomOrder in linear graph.', () {
- ComputationalGraph G = new ComputationalGraph();
- final n1 = new Node('1');
- final n2 = new Node('2');
- final n3 = new Node('3');
- final n4 = new Node('4');
- final n5 = new Node('5');
+ ComputationalGraph G = ComputationalGraph();
+ final n1 = Node('1');
+ final n2 = Node('2');
+ final n3 = Node('3');
+ final n4 = Node('4');
+ final n5 = Node('5');
G
..addNode(n1)
..addNode(n2)
@@ -141,6 +141,6 @@
..addRelation(n4, n5);
final order = G.getRandomOrder();
- expect(order, equals(new EvaluationOrder([n1, n2, n3, n4, n5])));
+ expect(order, equals(EvaluationOrder([n1, n2, n3, n4, n5])));
});
}
diff --git a/public/dart/sledge/test/crdt_test_framework_test/evaluation_order_test.dart b/public/dart/sledge/test/crdt_test_framework_test/evaluation_order_test.dart
index ec05059..8178f68 100644
--- a/public/dart/sledge/test/crdt_test_framework_test/evaluation_order_test.dart
+++ b/public/dart/sledge/test/crdt_test_framework_test/evaluation_order_test.dart
@@ -13,40 +13,40 @@
setupLogger();
test('EvaluationOrder operator ==', () {
- final n1 = new Node('1');
- final n2 = new Node('2');
- final n3 = new Node('3');
- expect(new EvaluationOrder([n1, n2, n3]),
- equals(new EvaluationOrder([n1, n2, n3])));
- expect(new EvaluationOrder([n1, n2, n3]),
- isNot(equals(new EvaluationOrder([n2, n1, n3]))));
+ final n1 = Node('1');
+ final n2 = Node('2');
+ final n3 = Node('3');
+ expect(EvaluationOrder([n1, n2, n3]),
+ equals(EvaluationOrder([n1, n2, n3])));
+ expect(EvaluationOrder([n1, n2, n3]),
+ isNot(equals(EvaluationOrder([n2, n1, n3]))));
});
- final argumentErrorMatcher = throwsA(new TypeMatcher<ArgumentError>());
+ final argumentErrorMatcher = throwsA(TypeMatcher<ArgumentError>());
test('Node restricted name', () {
- expect(() => new Node("f'o'o"), argumentErrorMatcher);
+ expect(() => Node("f'o'o"), argumentErrorMatcher);
});
test('EvaluationOrder from list of ids', () {
- final n1 = new Node('1');
- final n2 = new Node('2');
- final n3 = new Node('3');
+ final n1 = Node('1');
+ final n2 = Node('2');
+ final n3 = Node('3');
final order132 =
- new EvaluationOrder.fromIds(['n-1', 'n-3', 'n-2'], [n1, n2, n3]);
- expect(order132, equals(new EvaluationOrder([n1, n3, n2])));
- expect(() => new EvaluationOrder.fromIds(['n-1', 'n-2'], [n1, n2, n3]),
+ EvaluationOrder.fromIds(['n-1', 'n-3', 'n-2'], [n1, n2, n3]);
+ expect(order132, equals(EvaluationOrder([n1, n3, n2])));
+ expect(() => EvaluationOrder.fromIds(['n-1', 'n-2'], [n1, n2, n3]),
argumentErrorMatcher);
expect(
- () => new EvaluationOrder.fromIds(
+ () => EvaluationOrder.fromIds(
['n-1', 'n-2', 'n-3', 'n-1'], [n1, n2, n3]),
argumentErrorMatcher);
expect(
- () => new EvaluationOrder.fromIds(['n-1', 'n-2', 'n-1'], [n1, n2, n3]),
+ () => EvaluationOrder.fromIds(['n-1', 'n-2', 'n-1'], [n1, n2, n3]),
argumentErrorMatcher);
expect(
- new EvaluationOrder.fromIds(['n-1', 'n-3'], [n1, n2, n3],
+ EvaluationOrder.fromIds(['n-1', 'n-3'], [n1, n2, n3],
allowPartial: true),
- equals(new EvaluationOrder([n1, n3])));
+ equals(EvaluationOrder([n1, n3])));
});
}
diff --git a/public/dart/sledge/test/crdt_test_framework_test/storage_state_test.dart b/public/dart/sledge/test/crdt_test_framework_test/storage_state_test.dart
index 352c06b..95e0126 100644
--- a/public/dart/sledge/test/crdt_test_framework_test/storage_state_test.dart
+++ b/public/dart/sledge/test/crdt_test_framework_test/storage_state_test.dart
@@ -18,7 +18,7 @@
setupLogger();
test('Empty storage state.', () async {
- StorageState storage = new StorageState();
+ StorageState storage = StorageState();
expect(storage.getEntries(getUint8ListFromString('')).length, equals(0));
expect(storage.getEntries(getUint8ListFromString('AA')).length, equals(0));
});
@@ -27,15 +27,15 @@
final List<KeyValue> keyValues = <KeyValue>[];
Uint8List unused = getUint8ListFromString('');
keyValues
- ..add(new KeyValue(getUint8ListFromString('AAB'), unused))
- ..add(new KeyValue(getUint8ListFromString('Z'), unused))
- ..add(new KeyValue(getUint8ListFromString('AABC'), unused))
- ..add(new KeyValue(getUint8ListFromString('ZAA'), unused))
- ..add(new KeyValue(getUint8ListFromString('AAA'), unused))
- ..add(new KeyValue(getUint8ListFromString('ABAA'), unused));
+ ..add(KeyValue(getUint8ListFromString('AAB'), unused))
+ ..add(KeyValue(getUint8ListFromString('Z'), unused))
+ ..add(KeyValue(getUint8ListFromString('AABC'), unused))
+ ..add(KeyValue(getUint8ListFromString('ZAA'), unused))
+ ..add(KeyValue(getUint8ListFromString('AAA'), unused))
+ ..add(KeyValue(getUint8ListFromString('ABAA'), unused));
- StorageState storage = new StorageState()
- ..applyChange(new Change(keyValues));
+ StorageState storage = StorageState()
+ ..applyChange(Change(keyValues));
final entries = storage.getEntries(getUint8ListFromString('AA'));
expect(entries.length, equals(3));
diff --git a/public/dart/sledge/test/crdt_test_framework_test/thrown_error_test.dart b/public/dart/sledge/test/crdt_test_framework_test/thrown_error_test.dart
index 353b56c..84cf0c2 100644
--- a/public/dart/sledge/test/crdt_test_framework_test/thrown_error_test.dart
+++ b/public/dart/sledge/test/crdt_test_framework_test/thrown_error_test.dart
@@ -15,12 +15,12 @@
const MapFleetFactory();
Fleet<MapValue<K, V>> newFleet(int count) {
- return new Fleet<MapValue<K, V>>(count, (index) => new MapValue<K, V>());
+ return Fleet<MapValue<K, V>>(count, (index) => MapValue<K, V>());
}
}
const MapFleetFactory<int, int> intMapFleetFactory =
- const MapFleetFactory<int, int>();
+ MapFleetFactory<int, int>();
class ValuesAreUniqueChecker<K, V> extends Checker<MapValue<K, V>> {
@override
@@ -46,7 +46,7 @@
m1[2] = 2;
})
..synchronize([0, 1])
- ..addChecker(() => new ValuesAreUniqueChecker<int, int>());
+ ..addChecker(() => ValuesAreUniqueChecker<int, int>());
try {
await fleet.testAllOrders();
// If SingleOrderTestFailure wasn't thrown, fail. Note that fail will
@@ -56,7 +56,7 @@
final nodeIds = failure.order.nodes.map((node) => node.nodeId);
// Check that the EvaluationOrder is correctly reproduced with the list of
// nodeIds.
- expect(new EvaluationOrder.fromIds(nodeIds, fleet.graph.nodes),
+ expect(EvaluationOrder.fromIds(nodeIds, fleet.graph.nodes),
equals(failure.order));
try {
@@ -84,7 +84,7 @@
m0[2] = 4;
})
..setRandomSynchronizationsRate(1.0)
- ..addChecker(() => new ValuesAreUniqueChecker<int, int>());
+ ..addChecker(() => ValuesAreUniqueChecker<int, int>());
try {
// 1/2 probability of the correct order.
// 1/2 probability of synchronization after the last modification.
@@ -100,7 +100,7 @@
// Check that the EvaluationOrder is correctly reproduced with the list of
// nodeIds.
expect(
- new EvaluationOrder.fromIds(nodeIds, fleet.graph.nodes,
+ EvaluationOrder.fromIds(nodeIds, fleet.graph.nodes,
allowGenerated: true),
equals(failure.order));
diff --git a/public/dart/sledge/test/document_deletion_test.dart b/public/dart/sledge/test/document_deletion_test.dart
index 40d2be4..f38b656 100644
--- a/public/dart/sledge/test/document_deletion_test.dart
+++ b/public/dart/sledge/test/document_deletion_test.dart
@@ -10,9 +10,9 @@
Schema newSchema() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
+ 'a': Integer(),
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
void main() async {
@@ -20,7 +20,7 @@
test('Test immediate deletions.', () async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
@@ -34,7 +34,7 @@
test('Test deletions.', () async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
// Create document.
@@ -44,14 +44,14 @@
});
// Verify that the document exists and delete it.
await sledge.runInTransaction(() async {
- final query = new Query(schema);
+ final query = Query(schema);
final docs = await sledge.getDocuments(query);
expect(docs.length, equals(1));
docs[0].delete();
});
// Verify that document deos not exist anymore.
await sledge.runInTransaction(() async {
- final query = new Query(schema);
+ final query = Query(schema);
final docs = await sledge.getDocuments(query);
expect(docs.length, equals(0));
});
@@ -59,7 +59,7 @@
test('Test rollbacked deletions.', () async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
Document doc;
// Create document.
diff --git a/public/dart/sledge/test/document_id_test.dart b/public/dart/sledge/test/document_id_test.dart
index 6bc87dc..430ed5b 100644
--- a/public/dart/sledge/test/document_id_test.dart
+++ b/public/dart/sledge/test/document_id_test.dart
@@ -8,10 +8,10 @@
Schema newSchema() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
- 'b': new Integer()
+ 'a': Integer(),
+ 'b': Integer()
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
void main() {
@@ -19,22 +19,22 @@
test('Verify that two unnamed DocumentId have different prefixes', () {
Schema schema = newSchema();
- final id1 = new DocumentId(schema);
- final id2 = new DocumentId(schema);
+ final id1 = DocumentId(schema);
+ final id2 = DocumentId(schema);
expect(id1.prefix, isNot(equals(id2.prefix)));
});
test('Verify that two identically named DocumentId have identical prefixes',
() {
Schema schema = newSchema();
- final id1 = new DocumentId.fromIntId(schema, 42);
- final id2 = new DocumentId.fromIntId(schema, 42);
+ final id1 = DocumentId.fromIntId(schema, 42);
+ final id2 = DocumentId.fromIntId(schema, 42);
expect(id1.prefix, equals(id2.prefix));
});
test('Verify that an incorrect parameter results in an exception', () {
Schema schema = newSchema();
final list = <int>[];
- expect(() => new DocumentId(schema, list), throwsA(anything));
+ expect(() => DocumentId(schema, list), throwsA(anything));
});
}
diff --git a/public/dart/sledge/test/document_ss_test.dart b/public/dart/sledge/test/document_ss_test.dart
index 00322c7..ab8a67d 100644
--- a/public/dart/sledge/test/document_ss_test.dart
+++ b/public/dart/sledge/test/document_ss_test.dart
@@ -16,7 +16,7 @@
const DocumentFleetFactory(this._sledge, this._documentId);
Fleet<Document> newFleet(int count) {
- return new Fleet<Document>(
+ return Fleet<Document>(
count, (index) => _sledge.fakeGetDocument(_documentId));
}
}
@@ -31,13 +31,13 @@
void main() async {
setupLogger();
- final Schema nameLengthSchema = new Schema(<String, BaseType>{
- 'name': new LastOneWinsString(),
- 'length': new Integer()
+ final Schema nameLengthSchema = Schema(<String, BaseType>{
+ 'name': LastOneWinsString(),
+ 'length': Integer()
});
- final documentId = new DocumentId(nameLengthSchema);
+ final documentId = DocumentId(nameLengthSchema);
final fakeSledge = newSledgeForTesting()..startInfiniteTransaction();
- final documentFleetFactory = new DocumentFleetFactory(fakeSledge, documentId);
+ final documentFleetFactory = DocumentFleetFactory(fakeSledge, documentId);
test('Document test with framework', () async {
final fleet = documentFleetFactory.newFleet(3)
@@ -54,7 +54,7 @@
doc['length'].value = 6;
})
..synchronize([0, 1, 2])
- ..addChecker(() => new NameLengthChecker());
+ ..addChecker(() => NameLengthChecker());
await fleet.testAllOrders();
});
diff --git a/public/dart/sledge/test/document_test.dart b/public/dart/sledge/test/document_test.dart
index 107348d..af4bc50 100644
--- a/public/dart/sledge/test/document_test.dart
+++ b/public/dart/sledge/test/document_test.dart
@@ -10,10 +10,10 @@
Schema newSchema() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
- 'b': new Integer()
+ 'a': Integer(),
+ 'b': Integer()
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
void main() async {
@@ -21,7 +21,7 @@
test('Verify that document can be created.', () async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
// ignore: unused_local_variable
Document doc;
@@ -34,7 +34,7 @@
'Verify that by same DocumentId we get the same document object.'
'(different transactions)', () async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
Document doc1, doc2;
await sledge.runInTransaction(() async {
@@ -50,7 +50,7 @@
'Verify that by same documentId we get the same document object.'
'(same transaction)', () async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
Document doc1, doc2;
await sledge.runInTransaction(() async {
@@ -66,7 +66,7 @@
'Verify that by different documentId we get different document objects.'
'(different transactions)', () async {
Schema schema = newSchema();
- final id1 = new DocumentId(schema), id2 = new DocumentId(schema);
+ final id1 = DocumentId(schema), id2 = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
Document doc1, doc2;
await sledge.runInTransaction(() async {
@@ -82,7 +82,7 @@
'Verify that by different documentId we get different document objects.'
'(same transaction)', () async {
Schema schema = newSchema();
- final id1 = new DocumentId(schema), id2 = new DocumentId(schema);
+ final id1 = DocumentId(schema), id2 = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
Document doc1, doc2;
await sledge.runInTransaction(() async {
@@ -96,7 +96,7 @@
'Check that creating then rolling back a document does not prevent from'
'creating it later', () async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
await sledge.runInTransaction(() async {
await sledge.getDocument(id);
@@ -118,7 +118,7 @@
test('Check that operations on non-existing documents throw exceptions',
() async {
Schema schema = newSchema();
- final id = new DocumentId(schema);
+ final id = DocumentId(schema);
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
diff --git a/public/dart/sledge/test/fakes/fake_ledger_object_factories.dart b/public/dart/sledge/test/fakes/fake_ledger_object_factories.dart
index aa3113d..6aae0a2 100644
--- a/public/dart/sledge/test/fakes/fake_ledger_object_factories.dart
+++ b/public/dart/sledge/test/fakes/fake_ledger_object_factories.dart
@@ -18,9 +18,9 @@
@override
ledger.PageWatcherBinding newPageWatcherBinding() =>
- new FakePageWatcherBinding();
+ FakePageWatcherBinding();
@override
ledger.PageSnapshotProxy newPageSnapshotProxy() =>
- new FakeLedgerPageSnapshot(_fakeLedgerPage);
+ FakeLedgerPageSnapshot(_fakeLedgerPage);
}
diff --git a/public/dart/sledge/test/fakes/fake_ledger_page.dart b/public/dart/sledge/test/fakes/fake_ledger_page.dart
index 79627b6..de0c32b 100644
--- a/public/dart/sledge/test/fakes/fake_ledger_page.dart
+++ b/public/dart/sledge/test/fakes/fake_ledger_page.dart
@@ -17,29 +17,29 @@
List<ledger.Entry> convertToEntries(final List<KeyValue> changedEntries) {
final List<ledger.Entry> convertedEntries = <ledger.Entry>[];
for (final keyValue in changedEntries) {
- convertedEntries.add(new ledger.Entry(
+ convertedEntries.add(ledger.Entry(
key: keyValue.key,
- value: new lib$fuchsia_mem.Buffer(
- vmo: new FakeVmo(keyValue.value), size: keyValue.value.length),
- priority: new ledger.Priority(0)));
+ value: lib$fuchsia_mem.Buffer(
+ vmo: FakeVmo(keyValue.value), size: keyValue.value.length),
+ priority: ledger.Priority(0)));
}
return convertedEntries;
}
class FakeLedgerPage extends ledger.PageProxy {
StorageState _storageState;
- final Change _modification = new Change();
+ final Change _modification = Change();
dynamic _watcher;
FakeLedgerPage() {
- _storageState = new StorageState(onChange);
+ _storageState = StorageState(onChange);
}
StorageState get storageState => _storageState;
@override
void putNew(Uint8List key, Uint8List value) {
- _modification.changedEntries.add(new KeyValue(key, value));
+ _modification.changedEntries.add(KeyValue(key, value));
}
@override
@@ -78,7 +78,7 @@
void onChange(Change change) {
_watcher.onChange(
- new ledger.PageChange(
+ ledger.PageChange(
timestamp: null,
changedEntries: convertToEntries(change.changedEntries),
deletedKeys: change.deletedKeys),
diff --git a/public/dart/sledge/test/fakes/fake_ledger_page_snapshot.dart b/public/dart/sledge/test/fakes/fake_ledger_page_snapshot.dart
index a8796f9..25f2ff9 100644
--- a/public/dart/sledge/test/fakes/fake_ledger_page_snapshot.dart
+++ b/public/dart/sledge/test/fakes/fake_ledger_page_snapshot.dart
@@ -24,7 +24,7 @@
@override
ProxyController<FakeLedgerPageSnapshot> get ctrl =>
- new _FakeProxyController<FakeLedgerPageSnapshot>();
+ _FakeProxyController<FakeLedgerPageSnapshot>();
@override
void getEntries(
diff --git a/public/dart/sledge/test/fakes/fake_ledger_page_watcher_binding.dart b/public/dart/sledge/test/fakes/fake_ledger_page_watcher_binding.dart
index 1b797e0..5b82613 100644
--- a/public/dart/sledge/test/fakes/fake_ledger_page_watcher_binding.dart
+++ b/public/dart/sledge/test/fakes/fake_ledger_page_watcher_binding.dart
@@ -23,6 +23,6 @@
@override
fidl.InterfaceHandle<ledger.PageWatcher> wrap(
ledger.PageWatcher pageWatcher) {
- return new FakePageWatcherInterfaceHandle(pageWatcher);
+ return FakePageWatcherInterfaceHandle(pageWatcher);
}
}
diff --git a/public/dart/sledge/test/fakes/fake_vmo.dart b/public/dart/sledge/test/fakes/fake_vmo.dart
index a911782..6a2b691 100644
--- a/public/dart/sledge/test/fakes/fake_vmo.dart
+++ b/public/dart/sledge/test/fakes/fake_vmo.dart
@@ -16,7 +16,7 @@
if (_data == null) {
return super.getSize();
}
- return new GetSizeResult(ZX.OK, _data.length);
+ return GetSizeResult(ZX.OK, _data.length);
}
@override
@@ -30,7 +30,7 @@
if (len < numBytes) {
// TODO: decide on returning status
}
- return new ReadResult(
+ return ReadResult(
ZX.OK, buffer.asByteData(offsetInBytes, len), len, null);
}
}
diff --git a/public/dart/sledge/test/get_documents_test.dart b/public/dart/sledge/test/get_documents_test.dart
index a44e2f7..798f7a7 100644
--- a/public/dart/sledge/test/get_documents_test.dart
+++ b/public/dart/sledge/test/get_documents_test.dart
@@ -10,22 +10,22 @@
import 'helpers.dart';
Schema _newSchema1() {
- final schemaDescription = <String, BaseType>{'s1': new LastOneWinsString()};
- return new Schema(schemaDescription);
+ final schemaDescription = <String, BaseType>{'s1': LastOneWinsString()};
+ return Schema(schemaDescription);
}
Schema _newSchema2() {
- final schemaDescription = <String, BaseType>{'s2': new LastOneWinsString()};
- return new Schema(schemaDescription);
+ final schemaDescription = <String, BaseType>{'s2': LastOneWinsString()};
+ return Schema(schemaDescription);
}
Schema _newSchema3() {
final schemaDescription = <String, BaseType>{
- 'i1': new Integer(),
- 'i2': new Integer(),
- 's3': new LastOneWinsString(),
+ 'i1': Integer(),
+ 'i2': Integer(),
+ 's3': LastOneWinsString(),
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
void main() async {
@@ -36,7 +36,7 @@
Schema schema = _newSchema1();
Sledge sledge = newSledgeForTesting();
await sledge.runInTransaction(() async {
- final query = new Query(schema);
+ final query = Query(schema);
final docs = await sledge.getDocuments(query);
expect(docs.length, equals(0));
});
@@ -51,21 +51,21 @@
Document docB;
// Save 3 documents in Sledge, two of which are instances of schema1.
await sledge.runInTransaction(() async {
- docA = await sledge.getDocument(new DocumentId(schema1));
+ docA = await sledge.getDocument(DocumentId(schema1));
docA['s1'].value = 'foo';
- docB = await sledge.getDocument(new DocumentId(schema1));
+ docB = await sledge.getDocument(DocumentId(schema1));
docB['s1'].value = 'bar';
- final otherDoc = await sledge.getDocument(new DocumentId(schema2));
+ final otherDoc = await sledge.getDocument(DocumentId(schema2));
otherDoc['s2'].value = 'baz';
// Verify that `getDocuments` does not return any documents.
- final docs = await sledge.getDocuments(new Query(schema1));
+ final docs = await sledge.getDocuments(Query(schema1));
expect(docs.length, equals(0));
});
// Verify that `getDocuments` returns all instances of schema1.
await sledge.runInTransaction(() async {
- final docs = await sledge.getDocuments(new Query(schema1));
+ final docs = await sledge.getDocuments(Query(schema1));
expect(docs.length, equals(2));
expect(docs, contains(docA));
expect(docs, contains(docB));
@@ -79,10 +79,10 @@
Sledge sledge = newSledgeForTesting();
await sledge.runInTransaction(() async {
final comparisons = <String, QueryFieldComparison>{
- 'i1': new QueryFieldComparison(
- new NumFieldValue(42), ComparisonType.equal)
+ 'i1': QueryFieldComparison(
+ NumFieldValue(42), ComparisonType.equal)
};
- final query = new Query(schema, comparisons: comparisons);
+ final query = Query(schema, comparisons: comparisons);
final docs = await sledge.getDocuments(query);
expect(docs.length, equals(0));
});
@@ -98,38 +98,38 @@
Document doc4;
Document doc5;
await sledge.runInTransaction(() async {
- doc1 = await sledge.getDocument(new DocumentId(schema));
+ doc1 = await sledge.getDocument(DocumentId(schema));
doc1['i1'].value = 1;
doc1['i2'].value = 10;
- doc2 = await sledge.getDocument(new DocumentId(schema));
+ doc2 = await sledge.getDocument(DocumentId(schema));
doc2['i1'].value = 2;
doc2['i2'].value = 20;
- doc3 = await sledge.getDocument(new DocumentId(schema));
+ doc3 = await sledge.getDocument(DocumentId(schema));
doc3['i1'].value = 1;
doc3['i2'].value = 30;
- doc4 = await sledge.getDocument(new DocumentId(schema));
+ doc4 = await sledge.getDocument(DocumentId(schema));
doc4['i1'].value = 2;
doc4['i2'].value = 30;
- doc5 = await sledge.getDocument(new DocumentId(schema));
+ doc5 = await sledge.getDocument(DocumentId(schema));
doc5['i1'].value = 2;
doc5['i2'].value = 20;
});
// Verify the resuts of queries with equalities.
await sledge.runInTransaction(() async {
{
- QueryBuilder qb = new QueryBuilder(schema)..addEqual('i1', 1);
+ QueryBuilder qb = QueryBuilder(schema)..addEqual('i1', 1);
final docs = await sledge.getDocuments(qb.build());
expect(docs.length, equals(2));
expect(docs, containsAll([doc1, doc3]));
}
{
- QueryBuilder qb = new QueryBuilder(schema)..addEqual('i2', 30);
+ QueryBuilder qb = QueryBuilder(schema)..addEqual('i2', 30);
final docs = await sledge.getDocuments(qb.build());
expect(docs.length, equals(2));
expect(docs, containsAll([doc3, doc4]));
}
{
- QueryBuilder qb = new QueryBuilder(schema)
+ QueryBuilder qb = QueryBuilder(schema)
..addEqual('i1', 2)
..addEqual('i2', 30);
final docs = await sledge.getDocuments(qb.build());
@@ -139,12 +139,12 @@
});
// Verify the resuts of queries with inequalities.
await sledge.runInTransaction(() async {
- final lessQb = new QueryBuilder(schema)..addLess('i2', 20);
- final lessOrEqualQb = new QueryBuilder(schema)
+ final lessQb = QueryBuilder(schema)..addLess('i2', 20);
+ final lessOrEqualQb = QueryBuilder(schema)
..addLessOrEqual('i2', 20);
- final greaterOrEqualQb = new QueryBuilder(schema)
+ final greaterOrEqualQb = QueryBuilder(schema)
..addGreaterOrEqual('i2', 20);
- final greaterQb = new QueryBuilder(schema)..addGreater('i2', 20);
+ final greaterQb = QueryBuilder(schema)..addGreater('i2', 20);
{
final docs = await sledge.getDocuments(lessQb.build());
expect(docs.length, equals(1));
diff --git a/public/dart/sledge/test/helpers.dart b/public/dart/sledge/test/helpers.dart
index bb600fe..ca2ec72 100644
--- a/public/dart/sledge/test/helpers.dart
+++ b/public/dart/sledge/test/helpers.dart
@@ -19,10 +19,10 @@
SledgeForTesting(FakeLedgerPage fakeLedgerPage)
: fakeLedgerPage = fakeLedgerPage,
super.testing(
- fakeLedgerPage, new FakeLedgerObjectsFactory(fakeLedgerPage));
+ fakeLedgerPage, FakeLedgerObjectsFactory(fakeLedgerPage));
Document fakeGetDocument(DocumentId documentId) {
- return new Document(this, documentId);
+ return Document(this, documentId);
}
@override
@@ -32,10 +32,10 @@
void startInfiniteTransaction() {
_fakeTransaction =
- new Transaction(null, null, new FakeLedgerObjectsFactory(null));
+ Transaction(null, null, FakeLedgerObjectsFactory(null));
}
}
SledgeForTesting newSledgeForTesting() {
- return new SledgeForTesting(new FakeLedgerPage());
+ return SledgeForTesting(FakeLedgerPage());
}
diff --git a/public/dart/sledge/test/integration_tests/helpers.dart b/public/dart/sledge/test/integration_tests/helpers.dart
index 507c7dc..a322419 100644
--- a/public/dart/sledge/test/integration_tests/helpers.dart
+++ b/public/dart/sledge/test/integration_tests/helpers.dart
@@ -29,13 +29,13 @@
Future<LedgerTestInstanceProvider> newLedgerTestInstanceProvider() async {
String server =
'fuchsia-pkg://fuchsia.com/ledger_test_instance_provider#meta/ledger_test_instance_provider.cmx';
- final Services services = new Services();
+ final Services services = Services();
final LaunchInfo launchInfo =
- new LaunchInfo(url: server, directoryRequest: services.request());
- final context = new StartupContext.fromStartupInfo();
- final ComponentControllerProxy controller = new ComponentControllerProxy();
+ LaunchInfo(url: server, directoryRequest: services.request());
+ final context = StartupContext.fromStartupInfo();
+ final ComponentControllerProxy controller = ComponentControllerProxy();
await context.launcher.createComponent(launchInfo, controller.ctrl.request());
- return new LedgerTestInstanceProvider(services, controller);
+ return LedgerTestInstanceProvider(services, controller);
}
/// Sledge subclass that makes sure the ComponentControllerProxy does not get GCed.
@@ -54,12 +54,12 @@
Future<Sledge> newSledgeForTesting(
{SledgePageId pageId,
LedgerTestInstanceProvider ledgerInstanceProvider}) async {
- pageId ??= new SledgePageId('');
+ pageId ??= SledgePageId('');
ledgerInstanceProvider ??= await newLedgerTestInstanceProvider();
fidl.InterfaceHandle<ledger.Ledger> ledgerHandle =
await ledgerInstanceProvider.services
.connectToServiceByName<ledger.Ledger>(ledger.Ledger.$serviceName);
- final sledge = new _SledgeForTesting(
+ final sledge = _SledgeForTesting(
ledgerHandle, pageId, ledgerInstanceProvider._controller);
return sledge;
}
diff --git a/public/dart/sledge/test/integration_tests/sledge_integration_test.dart b/public/dart/sledge/test/integration_tests/sledge_integration_test.dart
index 6f8a054..75e477e 100644
--- a/public/dart/sledge/test/integration_tests/sledge_integration_test.dart
+++ b/public/dart/sledge/test/integration_tests/sledge_integration_test.dart
@@ -9,20 +9,20 @@
void main() {
test('Save a document', () async {
- final pageId = new SledgePageId('some page');
+ final pageId = SledgePageId('some page');
final ledgerInstanceProvider = await newLedgerTestInstanceProvider();
final activeSledge = await newSledgeForTesting(
ledgerInstanceProvider: ledgerInstanceProvider, pageId: pageId);
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'someInteger': new Integer()
+ 'someInteger': Integer()
};
- Schema schema = new Schema(schemaDescription);
- DocumentId id = new DocumentId(schema);
+ Schema schema = Schema(schemaDescription);
+ DocumentId id = DocumentId(schema);
// Store a document in Sledge.
await activeSledge.runInTransaction(() async {
final List<Document> documents =
- await activeSledge.getDocuments(new Query(schema));
+ await activeSledge.getDocuments(Query(schema));
assert(documents.isEmpty);
assert(await activeSledge.documentExists(id) == false);
@@ -39,7 +39,7 @@
ledgerInstanceProvider: ledgerInstanceProvider, pageId: pageId);
await passiveSledge.runInTransaction(() async {
final List<Document> documents =
- await passiveSledge.getDocuments(new Query(schema));
+ await passiveSledge.getDocuments(Query(schema));
assert(documents.isNotEmpty);
assert(await passiveSledge.documentExists(id) == true);
Document doc = await passiveSledge.getDocument(id);
@@ -48,13 +48,13 @@
// Verify that the document is not present in a Sledge instance
// created with a different page.
- final unrelatedPageId = new SledgePageId('some other page');
+ final unrelatedPageId = SledgePageId('some other page');
final unrelatedSledge = await newSledgeForTesting(
ledgerInstanceProvider: ledgerInstanceProvider,
pageId: unrelatedPageId);
await unrelatedSledge.runInTransaction(() async {
final List<Document> documents =
- await unrelatedSledge.getDocuments(new Query(schema));
+ await unrelatedSledge.getDocuments(Query(schema));
assert(documents.isEmpty);
});
diff --git a/public/dart/sledge/test/ledger_helpers_test.dart b/public/dart/sledge/test/ledger_helpers_test.dart
index 09ffadd..db81764 100644
--- a/public/dart/sledge/test/ledger_helpers_test.dart
+++ b/public/dart/sledge/test/ledger_helpers_test.dart
@@ -20,29 +20,29 @@
group('Transform ledger types.', () {
test('Convert empty change', () {
- const emptyPageChange = const ledger.PageChange(
+ const emptyPageChange = ledger.PageChange(
timestamp: 0,
- changedEntries: const <ledger.Entry>[],
- deletedKeys: const <Uint8List>[]);
+ changedEntries: <ledger.Entry>[],
+ deletedKeys: <Uint8List>[]);
final change = getChangeFromPageChange(emptyPageChange);
- expect(change, new ChangeMatcher(new Change()));
+ expect(change, ChangeMatcher(Change()));
});
test('Convert non empty change', () {
- final pageChange = new ledger.PageChange(
+ final pageChange = ledger.PageChange(
timestamp: 0,
changedEntries: <ledger.Entry>[],
deletedKeys: <Uint8List>[
- new Uint8List.fromList([0]),
- new Uint8List.fromList([1, 2])
+ Uint8List.fromList([0]),
+ Uint8List.fromList([1, 2])
]);
- final ourChange = new Change([], [
- new Uint8List.fromList([0]),
- new Uint8List.fromList([1, 2])
+ final ourChange = Change([], [
+ Uint8List.fromList([0]),
+ Uint8List.fromList([1, 2])
]);
final change = getChangeFromPageChange(pageChange);
- expect(change, new ChangeMatcher(ourChange));
+ expect(change, ChangeMatcher(ourChange));
});
});
}
diff --git a/public/dart/sledge/test/query/index_definition_test.dart b/public/dart/sledge/test/query/index_definition_test.dart
index 13a8b5a..5c1ec25 100644
--- a/public/dart/sledge/test/query/index_definition_test.dart
+++ b/public/dart/sledge/test/query/index_definition_test.dart
@@ -10,19 +10,19 @@
Schema testSchema1() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
- 'b': new Integer(),
+ 'a': Integer(),
+ 'b': Integer(),
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
Schema testSchema2() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
- 'b': new Integer(),
- 'c': new Integer(),
+ 'a': Integer(),
+ 'b': Integer(),
+ 'c': Integer(),
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
void main() {
@@ -30,29 +30,29 @@
test('IndexDefinition constructor.', () {
final schema = testSchema1();
- new IndexDefinition(schema);
- new IndexDefinition(schema, fieldsWithEquality: <String>['a']);
- new IndexDefinition(schema, fieldsWithEquality: <String>['a', 'b']);
- new IndexDefinition(schema, fieldWithInequality: 'a');
- new IndexDefinition(schema,
+ IndexDefinition(schema);
+ IndexDefinition(schema, fieldsWithEquality: <String>['a']);
+ IndexDefinition(schema, fieldsWithEquality: <String>['a', 'b']);
+ IndexDefinition(schema, fieldWithInequality: 'a');
+ IndexDefinition(schema,
fieldsWithEquality: <String>['a'], fieldWithInequality: 'b');
- expect(() => new IndexDefinition(schema, fieldsWithEquality: <String>['']),
+ expect(() => IndexDefinition(schema, fieldsWithEquality: <String>['']),
throwsArgumentError);
- expect(() => new IndexDefinition(schema, fieldsWithEquality: <String>['z']),
+ expect(() => IndexDefinition(schema, fieldsWithEquality: <String>['z']),
throwsArgumentError);
expect(
() =>
- new IndexDefinition(schema, fieldsWithEquality: <String>['a', 'a']),
+ IndexDefinition(schema, fieldsWithEquality: <String>['a', 'a']),
throwsArgumentError);
expect(
- () => new IndexDefinition(schema,
+ () => IndexDefinition(schema,
fieldsWithEquality: <String>['a'], fieldWithInequality: 'a'),
throwsArgumentError);
});
test('IndexDefinition serialization and deserialization.', () {
final schema1 = testSchema1();
- final i1 = new IndexDefinition(schema1,
+ final i1 = IndexDefinition(schema1,
fieldsWithEquality: <String>['a'], fieldWithInequality: 'b');
String jsonString = json.encode(i1);
print(jsonString);
@@ -63,10 +63,10 @@
test('IndexDefinition hash.', () {
final schema1 = testSchema1();
final schema2 = testSchema2();
- final i1 = new IndexDefinition(schema1, fieldsWithEquality: <String>['a']);
- final i2 = new IndexDefinition(schema1, fieldsWithEquality: <String>['a']);
- final i3 = new IndexDefinition(schema2, fieldsWithEquality: <String>['a']);
- final i4 = new IndexDefinition(schema1, fieldsWithEquality: <String>['b']);
+ final i1 = IndexDefinition(schema1, fieldsWithEquality: <String>['a']);
+ final i2 = IndexDefinition(schema1, fieldsWithEquality: <String>['a']);
+ final i3 = IndexDefinition(schema2, fieldsWithEquality: <String>['a']);
+ final i4 = IndexDefinition(schema1, fieldsWithEquality: <String>['b']);
expect(i1.hash, equals(i2.hash));
expect(i1.hash, isNot(equals(i3.hash)));
expect(i1.hash, isNot(equals(i4.hash)));
diff --git a/public/dart/sledge/test/query/query_builder_test.dart b/public/dart/sledge/test/query/query_builder_test.dart
index ee3ede5..1997e40 100644
--- a/public/dart/sledge/test/query/query_builder_test.dart
+++ b/public/dart/sledge/test/query/query_builder_test.dart
@@ -8,10 +8,10 @@
Schema _newSchema() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
- 'b': new Integer(),
+ 'a': Integer(),
+ 'b': Integer(),
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
void main() {
@@ -19,7 +19,7 @@
test('Verify exceptions', () async {
Schema schema = _newSchema();
- QueryBuilder qb = new QueryBuilder(schema)..addEqual('a', 1);
+ QueryBuilder qb = QueryBuilder(schema)..addEqual('a', 1);
// Test adding multiple restrictions on the same field.
expect(() => qb.addEqual('a', 2), throwsArgumentError);
// Test passing an unsuported type.
diff --git a/public/dart/sledge/test/query/query_test.dart b/public/dart/sledge/test/query/query_test.dart
index ec76216..9bc2b9c 100644
--- a/public/dart/sledge/test/query/query_test.dart
+++ b/public/dart/sledge/test/query/query_test.dart
@@ -11,18 +11,18 @@
Schema _newSchema() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
- 'b': new LastOneWinsString(),
- 'c': new Integer(),
+ 'a': Integer(),
+ 'b': LastOneWinsString(),
+ 'c': Integer(),
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
Schema _newSchema2() {
final schemaDescription = <String, BaseType>{
- 'a': new Integer(),
+ 'a': Integer(),
};
- return new Schema(schemaDescription);
+ return Schema(schemaDescription);
}
void main() {
@@ -34,48 +34,48 @@
// Test invalid comparisons
final comparisonWithNonExistantField = <String, QueryFieldComparison>{
'foo':
- new QueryFieldComparison(new NumFieldValue(42), ComparisonType.equal)
+ QueryFieldComparison(NumFieldValue(42), ComparisonType.equal)
};
- expect(() => new Query(schema, comparisons: comparisonWithNonExistantField),
+ expect(() => Query(schema, comparisons: comparisonWithNonExistantField),
throwsArgumentError);
final comparisonWithWrongType = <String, QueryFieldComparison>{
- 'b': new QueryFieldComparison(new NumFieldValue(42), ComparisonType.equal)
+ 'b': QueryFieldComparison(NumFieldValue(42), ComparisonType.equal)
};
- expect(() => new Query(schema, comparisons: comparisonWithWrongType),
+ expect(() => Query(schema, comparisons: comparisonWithWrongType),
throwsArgumentError);
// Test too many inequalities
final comparisonWithMultipleInequalities = <String, QueryFieldComparison>{
- 'a': new QueryFieldComparison(
- new NumFieldValue(42), ComparisonType.greater),
- 'c': new QueryFieldComparison(
- new NumFieldValue(42), ComparisonType.greater)
+ 'a': QueryFieldComparison(
+ NumFieldValue(42), ComparisonType.greater),
+ 'c': QueryFieldComparison(
+ NumFieldValue(42), ComparisonType.greater)
};
expect(
() =>
- new Query(schema, comparisons: comparisonWithMultipleInequalities),
+ Query(schema, comparisons: comparisonWithMultipleInequalities),
throwsArgumentError);
});
test('Verify `filtersDocuments`', () async {
Schema schema = _newSchema();
- final query1 = new Query(schema);
+ final query1 = Query(schema);
expect(query1.filtersDocuments(), equals(false));
// Test with equalities
final equality = <String, QueryFieldComparison>{
- 'a': new QueryFieldComparison(new NumFieldValue(42), ComparisonType.equal)
+ 'a': QueryFieldComparison(NumFieldValue(42), ComparisonType.equal)
};
- final query2 = new Query(schema, comparisons: equality);
+ final query2 = Query(schema, comparisons: equality);
expect(query2.filtersDocuments(), equals(true));
// Test with inequality
final inequality = <String, QueryFieldComparison>{
- 'a': new QueryFieldComparison(
- new NumFieldValue(42), ComparisonType.greater)
+ 'a': QueryFieldComparison(
+ NumFieldValue(42), ComparisonType.greater)
};
- final query3 = new Query(schema, comparisons: inequality);
+ final query3 = Query(schema, comparisons: inequality);
expect(query3.filtersDocuments(), equals(true));
});
@@ -83,23 +83,23 @@
Sledge sledge = newSledgeForTesting();
Schema schema = _newSchema();
final equality = <String, QueryFieldComparison>{
- 'a': new QueryFieldComparison(new NumFieldValue(42), ComparisonType.equal)
+ 'a': QueryFieldComparison(NumFieldValue(42), ComparisonType.equal)
};
final inequality = <String, QueryFieldComparison>{
- 'a': new QueryFieldComparison(
- new NumFieldValue(42), ComparisonType.greater)
+ 'a': QueryFieldComparison(
+ NumFieldValue(42), ComparisonType.greater)
};
- final queryWithoutFilter = new Query(schema);
- final queryWithEqualities = new Query(schema, comparisons: equality);
- final queryWithInequality = new Query(schema, comparisons: inequality);
+ final queryWithoutFilter = Query(schema);
+ final queryWithEqualities = Query(schema, comparisons: equality);
+ final queryWithInequality = Query(schema, comparisons: inequality);
await sledge.runInTransaction(() async {
- Document doc1 = await sledge.getDocument(new DocumentId(schema));
+ Document doc1 = await sledge.getDocument(DocumentId(schema));
doc1['a'].value = 1;
- Document doc2 = await sledge.getDocument(new DocumentId(schema));
+ Document doc2 = await sledge.getDocument(DocumentId(schema));
doc2['a'].value = 42;
- Document doc3 = await sledge.getDocument(new DocumentId(schema));
+ Document doc3 = await sledge.getDocument(DocumentId(schema));
doc3['a'].value = 43;
- Document doc4 = await sledge.getDocument(new DocumentId(_newSchema2()));
+ Document doc4 = await sledge.getDocument(DocumentId(_newSchema2()));
doc4['a'].value = 42;
expect(queryWithoutFilter.documentMatchesQuery(doc1), equals(true));
expect(queryWithoutFilter.documentMatchesQuery(doc2), equals(true));
diff --git a/public/dart/sledge/test/schema_test.dart b/public/dart/sledge/test/schema_test.dart
index 41dae49..6f64f3e 100644
--- a/public/dart/sledge/test/schema_test.dart
+++ b/public/dart/sledge/test/schema_test.dart
@@ -17,98 +17,98 @@
Map<String, BaseType> flatSchema() {
return <String, BaseType>{
- 'someBool': new Boolean(),
- 'someInteger': new Integer()
+ 'someBool': Boolean(),
+ 'someInteger': Integer()
};
}
Map<String, BaseType> schemaWithEmbeddedSchema() {
- Schema schema = new Schema(flatSchema());
- return <String, BaseType>{'foo': schema, 'bar': new LastOneWinsString()};
+ Schema schema = Schema(flatSchema());
+ return <String, BaseType>{'foo': schema, 'bar': LastOneWinsString()};
}
void main() {
setupLogger();
test('Create flat schema', () {
- new Schema(flatSchema());
+ Schema(flatSchema());
});
test('Create schema with embedded schema.', () {
- new Schema(schemaWithEmbeddedSchema());
+ Schema(schemaWithEmbeddedSchema());
});
test('Serialize and deserialize flat schema', () {
- Schema schema1 = new Schema(flatSchema());
+ Schema schema1 = Schema(flatSchema());
final json1 = json.encode(schema1);
- Schema schema2 = new Schema.fromJson(json.decode(json1));
+ Schema schema2 = Schema.fromJson(json.decode(json1));
final json2 = json.encode(schema2);
expect(json1, equals(json2));
});
test('Serialize and deserialize schema with embedded schema', () {
- Schema schema1 = new Schema(schemaWithEmbeddedSchema());
+ Schema schema1 = Schema(schemaWithEmbeddedSchema());
final json1 = json.encode(schema1);
- Schema schema2 = new Schema.fromJson(json.decode(json1));
+ Schema schema2 = Schema.fromJson(json.decode(json1));
final json2 = json.encode(schema2);
expect(json1, equals(json2));
});
test('Verify that two identical schemes result in identical hashes', () {
Map<String, BaseType> schemaDescription1 = <String, BaseType>{
- 'someBool': new Boolean(),
- 'someInteger': new Integer()
+ 'someBool': Boolean(),
+ 'someInteger': Integer()
};
Map<String, BaseType> schemaDescription2 = <String, BaseType>{
- 'someInteger': new Integer(),
- 'someBool': new Boolean(),
+ 'someInteger': Integer(),
+ 'someBool': Boolean(),
};
- Schema schema1 = new Schema(schemaDescription1);
- Schema schema2 = new Schema(schemaDescription2);
+ Schema schema1 = Schema(schemaDescription1);
+ Schema schema2 = Schema(schemaDescription2);
expect(schema1.hash, equals(schema2.hash));
});
test('Verify that two different schemes result in different hashes', () {
Map<String, BaseType> schemaDescription1 = <String, BaseType>{
- 'someBool': new Boolean(),
- 'someInteger': new Integer()
+ 'someBool': Boolean(),
+ 'someInteger': Integer()
};
Map<String, BaseType> schemaDescription2 = <String, BaseType>{
- 'someBool': new Boolean(),
+ 'someBool': Boolean(),
};
Map<String, BaseType> schemaDescription3 = <String, BaseType>{
- 'someBool_': new Boolean(),
- 'someInteger': new Integer()
+ 'someBool_': Boolean(),
+ 'someInteger': Integer()
};
- Schema schema1 = new Schema(schemaDescription1);
- Schema schema2 = new Schema(schemaDescription2);
- Schema schema3 = new Schema(schemaDescription3);
+ Schema schema1 = Schema(schemaDescription1);
+ Schema schema2 = Schema(schemaDescription2);
+ Schema schema3 = Schema(schemaDescription3);
expect(schema1.hash, isNot(equals(schema2.hash)));
expect(schema1.hash, isNot(equals(schema3.hash)));
});
test('Verify that schemas can not be modified after their creation', () {
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'someBool': new Boolean(),
+ 'someBool': Boolean(),
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
Uint8List hash1 = schema.hash;
- schemaDescription['foo'] = new Integer();
+ schemaDescription['foo'] = Integer();
Uint8List hash2 = schema.hash;
expect(hash1, equals(hash2));
});
test('Verify exception with invalid field names', () {
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'foo.bar': new Boolean(),
+ 'foo.bar': Boolean(),
};
expect(() {
- new Schema(schemaDescription);
+ Schema(schemaDescription);
}, throwsA(const TypeMatcher<ArgumentError>()));
});
test('Verify fieldAtPath', () {
- final schema = new Schema(schemaWithEmbeddedSchema());
+ final schema = Schema(schemaWithEmbeddedSchema());
expect(schema.fieldAtPath(null), equals(null));
expect(schema.fieldAtPath(''), equals(null));
expect(schema.fieldAtPath('.'), equals(null));
@@ -125,20 +125,20 @@
test('Instantiate and initialize a Sledge document', () async {
// Create schemas.
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'someBool': new Boolean(),
- 'someInteger': new Integer()
+ 'someBool': Boolean(),
+ 'someInteger': Integer()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
Map<String, BaseType> schemaDescription2 = <String, BaseType>{
'foo': schema
};
- Schema schema2 = new Schema(schemaDescription2);
+ Schema schema2 = Schema(schemaDescription2);
// Create a new Sledge document.
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema2));
+ doc = await sledge.getDocument(DocumentId(schema2));
});
// Read and write properties of a Sledge document.
expect(doc['foo']['someBool'].value, equals(false));
@@ -154,18 +154,18 @@
test('Last One Wins basic types.', () async {
// Create schemas.
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'someBool': new Boolean(),
- 'someInteger': new Integer(),
- 'someDouble': new Double(),
- 'someString': new LastOneWinsString()
+ 'someBool': Boolean(),
+ 'someInteger': Integer(),
+ 'someDouble': Double(),
+ 'someString': LastOneWinsString()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
// Create a new Sledge document.
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema));
+ doc = await sledge.getDocument(DocumentId(schema));
});
// Read and write properties of a Sledge document.
@@ -190,16 +190,16 @@
test('Integration of PosNegCounter with Sledge', () async {
// Create Schema.
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'cnt': new IntCounter(),
- 'cnt_d': new DoubleCounter()
+ 'cnt': IntCounter(),
+ 'cnt_d': DoubleCounter()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
// Create a new Sledge document.
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema));
+ doc = await sledge.getDocument(DocumentId(schema));
});
// Modify and get value of PosNegCounter.
@@ -225,27 +225,27 @@
test('Integration of OrderedList with Sledge', () async {
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'list': new OrderedList()
+ 'list': OrderedList()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
// Create a new Sledge document.
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema));
+ doc = await sledge.getDocument(DocumentId(schema));
});
// Apply modifications to OrderedList.
expect(doc['list'].toList(), equals([]));
await sledge.runInTransaction(() async {
- doc['list'].insert(0, new Uint8List.fromList([1]));
+ doc['list'].insert(0, Uint8List.fromList([1]));
});
expect(doc['list'].toList().length, equals(1));
expect(doc['list'][0].toList(), equals([1]));
await sledge.runInTransaction(() async {
- doc['list'].insert(1, new Uint8List.fromList([3]));
- doc['list'].insert(1, new Uint8List.fromList([2]));
+ doc['list'].insert(1, Uint8List.fromList([3]));
+ doc['list'].insert(1, Uint8List.fromList([2]));
});
expect(doc['list'].toList().length, equals(3));
expect(doc['list'][0].toList(), equals([1]));
@@ -256,20 +256,20 @@
test('get and apply changes', () async {
// Create Schema.
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'name': new LastOneWinsString(),
- 'number': new Integer(),
- 'cnt': new IntCounter()
+ 'name': LastOneWinsString(),
+ 'number': Integer(),
+ 'cnt': IntCounter()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
// Create two Sledge documents
Sledge sledgeA = newSledgeForTesting(), sledgeB = newSledgeForTesting();
Document docA, docB;
await sledgeA.runInTransaction(() async {
- docA = await sledgeA.getDocument(new DocumentId(schema));
+ docA = await sledgeA.getDocument(DocumentId(schema));
});
await sledgeB.runInTransaction(() async {
- docB = await sledgeB.getDocument(new DocumentId(schema));
+ docB = await sledgeB.getDocument(DocumentId(schema));
});
Change c1;
@@ -292,18 +292,18 @@
test('put large list into set', () async {
// Create Schema.
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'names': new BytelistSet(),
+ 'names': BytelistSet(),
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
// Create two Sledge documents
Sledge sledgeA = newSledgeForTesting(), sledgeB = newSledgeForTesting();
Document docA, docB;
await sledgeA.runInTransaction(() async {
- docA = await sledgeA.getDocument(new DocumentId(schema));
+ docA = await sledgeA.getDocument(DocumentId(schema));
});
await sledgeB.runInTransaction(() async {
- docB = await sledgeB.getDocument(new DocumentId(schema));
+ docB = await sledgeB.getDocument(DocumentId(schema));
});
final largeList = randomUint8List(10000);
@@ -322,16 +322,16 @@
test('rollback LastOneWinsValue', () async {
// Create schemas.
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'someBool': new Boolean(),
- 'someInteger': new Integer()
+ 'someBool': Boolean(),
+ 'someInteger': Integer()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
// Create a new Sledge document.
SledgeForTesting sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema));
+ doc = await sledge.getDocument(DocumentId(schema));
});
// Read and write properties of a Sledge document.
bool transactionSucceed = await sledge.runInTransaction(() async {
@@ -361,27 +361,27 @@
test('rollback BytelistMap', () async {
// Create schemas.
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'map': new BytelistMap(),
+ 'map': BytelistMap(),
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
// Create a new Sledge document.
SledgeForTesting sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema));
+ doc = await sledge.getDocument(DocumentId(schema));
});
// Read and write properties of a Sledge document.
bool transactionSucceed = await sledge.runInTransaction(() async {
- doc['map']['a'] = new Uint8List.fromList([1, 2, 3]);
+ doc['map']['a'] = Uint8List.fromList([1, 2, 3]);
});
expect(transactionSucceed, true);
expect(doc['map'].length, equals(1));
// Test case when transaction fails.
transactionSucceed = await sledge.runInTransaction(() async {
- doc['map']['a'] = new Uint8List.fromList([4]);
- doc['map']['foo'] = new Uint8List.fromList([1, 3]);
+ doc['map']['a'] = Uint8List.fromList([4]);
+ doc['map']['foo'] = Uint8List.fromList([1, 3]);
sledge.abortAndRollback();
});
expect(transactionSucceed, false);
@@ -389,7 +389,7 @@
expect(doc['map']['a'], equals([1, 2, 3]));
transactionSucceed = await sledge.runInTransaction(() async {
- doc['map']['foo'] = new Uint8List.fromList([1, 3]);
+ doc['map']['foo'] = Uint8List.fromList([1, 3]);
});
expect(transactionSucceed, true);
expect(doc['map'].length, equals(2));
@@ -397,7 +397,7 @@
expect(doc['map']['foo'], equals([1, 3]));
transactionSucceed = await sledge.runInTransaction(() async {
- doc['map']['a'] = new Uint8List.fromList([3, 4]);
+ doc['map']['a'] = Uint8List.fromList([3, 4]);
});
expect(transactionSucceed, true);
expect(doc['map']['a'], equals([3, 4]));
diff --git a/public/dart/sledge/test/schemas_obtainer_test.dart b/public/dart/sledge/test/schemas_obtainer_test.dart
index 1083d5b..2f543a5 100644
--- a/public/dart/sledge/test/schemas_obtainer_test.dart
+++ b/public/dart/sledge/test/schemas_obtainer_test.dart
@@ -15,13 +15,13 @@
Map<String, BaseType> schemaDescriptionA() {
return <String, BaseType>{
- 'boolA': new Boolean(),
+ 'boolA': Boolean(),
};
}
Map<String, BaseType> schemaDescriptionB() {
return <String, BaseType>{
- 'boolB': new Boolean(),
+ 'boolB': Boolean(),
};
}
@@ -35,8 +35,8 @@
Set<KeyValue> keyValues = <KeyValue>{};
// Add 2 KeyValues encoding 2 different schemas.
- final schemaA = new Schema(schemaDescriptionA());
- final schemaB = new Schema(schemaDescriptionB());
+ final schemaA = Schema(schemaDescriptionA());
+ final schemaB = Schema(schemaDescriptionB());
final schemaPrefix =
sledge_storage.prefixForType(sledge_storage.KeyValueType.schema);
final keyA = concatUint8Lists(schemaPrefix, schemaA.hash);
@@ -44,8 +44,8 @@
final keyB = concatUint8Lists(schemaPrefix, schemaB.hash);
final valueB = getUint8ListFromString(json.encode(schemaB));
keyValues
- ..add(new KeyValue(keyA, valueA))
- ..add(new KeyValue(keyB, valueB));
+ ..add(KeyValue(keyA, valueA))
+ ..add(KeyValue(keyB, valueB));
Map<Uint8List, Schema> map = createSchemaMap(keyValues);
expect(map.length, equals(2));
diff --git a/public/dart/sledge/test/sledge_page_id_test.dart b/public/dart/sledge/test/sledge_page_id_test.dart
index 9beb06d..4a1344a 100644
--- a/public/dart/sledge/test/sledge_page_id_test.dart
+++ b/public/dart/sledge/test/sledge_page_id_test.dart
@@ -13,10 +13,10 @@
setupLogger();
test('Create SledgePageId objects', () {
- final a = new SledgePageId();
- final b = new SledgePageId('');
- final c = new SledgePageId('foo');
- final d = new SledgePageId(
+ final a = SledgePageId();
+ final b = SledgePageId('');
+ final c = SledgePageId('foo');
+ final d = SledgePageId(
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
expect(a.id.id, equals(b.id.id));
expect(SledgePageId.pageIsManagedBySledge(a.id), equals(true));
@@ -26,8 +26,8 @@
});
test('pageIsManagedBySledge detects PageIds not managed by Sledge', () {
- final bytes = new Uint8List(16);
- final pageId = new ledger.PageId(id: bytes);
+ final bytes = Uint8List(16);
+ final pageId = ledger.PageId(id: bytes);
expect(SledgePageId.pageIsManagedBySledge(pageId), equals(false));
});
@@ -36,7 +36,7 @@
// the SledgePageId, because if the encoding changes then clients of Sledge
// won't be able to read their data back.
// The format of the expected value is described in SledgePageId.
- final sledgePageId = new SledgePageId('foo');
+ final sledgePageId = SledgePageId('foo');
expect(
sledgePageId.id.id,
equals([
diff --git a/public/dart/sledge/test/sledge_ss_test.dart b/public/dart/sledge/test/sledge_ss_test.dart
index e19ef86..86d6ae5 100644
--- a/public/dart/sledge/test/sledge_ss_test.dart
+++ b/public/dart/sledge/test/sledge_ss_test.dart
@@ -10,17 +10,17 @@
class SledgeFleetFactory {
Fleet<Sledge> newFleet(int count) {
- return new Fleet<Sledge>(count, (index) => newSledgeForTesting());
+ return Fleet<Sledge>(count, (index) => newSledgeForTesting());
}
}
void main() async {
- final Schema nameSchema = new Schema(<String, BaseType>{
- 'name': new LastOneWinsString(),
+ final Schema nameSchema = Schema(<String, BaseType>{
+ 'name': LastOneWinsString(),
});
- final documentId = new DocumentId(nameSchema);
+ final documentId = DocumentId(nameSchema);
- final sledgeFleetFactory = new SledgeFleetFactory();
+ final sledgeFleetFactory = SledgeFleetFactory();
test('Sledge test with framework. One instance.', () async {
final fleet = sledgeFleetFactory.newFleet(1)
diff --git a/public/dart/sledge/test/transaction_test.dart b/public/dart/sledge/test/transaction_test.dart
index 2556149..c165cdf 100644
--- a/public/dart/sledge/test/transaction_test.dart
+++ b/public/dart/sledge/test/transaction_test.dart
@@ -34,7 +34,7 @@
List<int> events = <int>[];
// ignore: unawaited_futures
sledge.runInTransaction(() async {
- await new Future(() => events.add(0));
+ await Future(() => events.add(0));
});
expect(events, equals(<int>[]));
await sledge.runInTransaction(() async {
@@ -45,14 +45,14 @@
test('Check that abortAndRollback works', () async {
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'written': new Boolean()
+ 'written': Boolean()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema));
+ doc = await sledge.getDocument(DocumentId(schema));
doc['written'].value = false;
});
expect(doc['written'].value, equals(false));
@@ -67,14 +67,14 @@
test('Check that exceptions rollback transactions', () async {
Map<String, BaseType> schemaDescription = <String, BaseType>{
- 'written': new Boolean()
+ 'written': Boolean()
};
- Schema schema = new Schema(schemaDescription);
+ Schema schema = Schema(schemaDescription);
Sledge sledge = newSledgeForTesting();
Document doc;
await sledge.runInTransaction(() async {
- doc = await sledge.getDocument(new DocumentId(schema));
+ doc = await sledge.getDocument(DocumentId(schema));
doc['written'].value = false;
});
expect(doc['written'].value, equals(false));
diff --git a/public/dart/sledge/test/uint8list_ops_test.dart b/public/dart/sledge/test/uint8list_ops_test.dart
index 6dbd9af..2eb32fe 100644
--- a/public/dart/sledge/test/uint8list_ops_test.dart
+++ b/public/dart/sledge/test/uint8list_ops_test.dart
@@ -11,8 +11,8 @@
import 'package:test/test.dart';
bool _listsAreEqualHelper(a, b) {
- final convertedA = new Uint8List.fromList(a);
- final convertedB = new Uint8List.fromList(b);
+ final convertedA = Uint8List.fromList(a);
+ final convertedB = Uint8List.fromList(b);
return uint8ListsAreEqual(convertedA, convertedB);
}
@@ -21,9 +21,9 @@
test('Concatenation of Uint8Lists', () {
final l1 = [1, 2], l2 = [3, 4, 5], l3 = [6];
final uint8lConcat = concatListOfUint8Lists([
- new Uint8List.fromList(l1),
- new Uint8List.fromList(l2),
- new Uint8List.fromList(l3)
+ Uint8List.fromList(l1),
+ Uint8List.fromList(l2),
+ Uint8List.fromList(l3)
]);
expect(uint8lConcat.toList(), equals([1, 2, 3, 4, 5, 6]));
});
@@ -31,10 +31,10 @@
test('Concatenation of Uint8Lists #2', () {
final l1 = [1], l2 = [10], l3 = [3], l4 = [6];
final uint8lConcat = concatListOfUint8Lists([
- new Uint8List.fromList(l1),
- new Uint8List.fromList(l2),
- new Uint8List.fromList(l3),
- new Uint8List.fromList(l4)
+ Uint8List.fromList(l1),
+ Uint8List.fromList(l2),
+ Uint8List.fromList(l3),
+ Uint8List.fromList(l4)
]);
expect(uint8lConcat.toList(), equals([1, 10, 3, 6]));
});
@@ -48,7 +48,7 @@
test('listsAreEqual', () {
expect(uint8ListsAreEqual(null, null), equals(true));
- expect(uint8ListsAreEqual(new Uint8List.fromList([]), null), equals(false));
+ expect(uint8ListsAreEqual(Uint8List.fromList([]), null), equals(false));
expect(_listsAreEqualHelper(<int>[], <int>[]), equals(true));
expect(_listsAreEqualHelper([1], <int>[]), equals(false));
expect(_listsAreEqualHelper([1], [1]), equals(true));
@@ -58,10 +58,10 @@
test('Ordered map with Uint8List keys of same length', () {
final orderedMap = newUint8ListOrderedMap<int>();
- Random rand = new Random();
+ Random rand = Random();
for (int i = 0; i < 100; i++) {
int value = rand.nextInt(0xffffffff);
- Uint8List key = new Uint8List(8)
+ Uint8List key = Uint8List(8)
..buffer.asByteData().setUint64(0, value, Endian.big);
orderedMap[key] = value;
}
@@ -91,56 +91,56 @@
group('hasPrefix', () {
test('both empty', () {
- expect(hasPrefix(new Uint8List(0), new Uint8List(0)), isTrue);
+ expect(hasPrefix(Uint8List(0), Uint8List(0)), isTrue);
});
test('prefix empty', () {
- expect(hasPrefix(new Uint8List.fromList([1]), new Uint8List(0)), isTrue);
+ expect(hasPrefix(Uint8List.fromList([1]), Uint8List(0)), isTrue);
});
test('key empty', () {
- expect(hasPrefix(new Uint8List(0), new Uint8List.fromList([1])), isFalse);
+ expect(hasPrefix(Uint8List(0), Uint8List.fromList([1])), isFalse);
});
test('prefix equals to key', () {
expect(
hasPrefix(
- new Uint8List.fromList([1, 3]), new Uint8List.fromList([1, 3])),
+ Uint8List.fromList([1, 3]), Uint8List.fromList([1, 3])),
isTrue);
});
test('prefix is a prefix of key', () {
expect(
- hasPrefix(new Uint8List.fromList([1, 3, 2, 5]),
- new Uint8List.fromList([1, 3])),
+ hasPrefix(Uint8List.fromList([1, 3, 2, 5]),
+ Uint8List.fromList([1, 3])),
isTrue);
});
test('key is a prefix of prefix', () {
expect(
- hasPrefix(new Uint8List.fromList([1, 3]),
- new Uint8List.fromList([1, 3, 2, 5])),
+ hasPrefix(Uint8List.fromList([1, 3]),
+ Uint8List.fromList([1, 3, 2, 5])),
isFalse);
});
test('same length, non equal', () {
expect(
- hasPrefix(new Uint8List.fromList([1, 3, 4, 5]),
- new Uint8List.fromList([1, 3, 2, 5])),
+ hasPrefix(Uint8List.fromList([1, 3, 4, 5]),
+ Uint8List.fromList([1, 3, 2, 5])),
isFalse);
});
test('key shorter, not prefix', () {
expect(
- hasPrefix(new Uint8List.fromList([1, 2]),
- new Uint8List.fromList([1, 3, 2, 5])),
+ hasPrefix(Uint8List.fromList([1, 2]),
+ Uint8List.fromList([1, 3, 2, 5])),
isFalse);
});
test('prefix shorter, not prefix', () {
expect(
- hasPrefix(new Uint8List.fromList([1, 2, 4, 2]),
- new Uint8List.fromList([1, 3, 1])),
+ hasPrefix(Uint8List.fromList([1, 2, 4, 2]),
+ Uint8List.fromList([1, 3, 1])),
isFalse);
});
});
diff --git a/public/dart/sledge/test/values/compressor_test.dart b/public/dart/sledge/test/values/compressor_test.dart
index a360a0e..78727d3 100644
--- a/public/dart/sledge/test/values/compressor_test.dart
+++ b/public/dart/sledge/test/values/compressor_test.dart
@@ -18,43 +18,43 @@
group('Correct compression', () {
test('KeyValue', () {
- final c = new Compressor(), c1 = new Compressor();
- final kv = new KeyValue(
- new Uint8List.fromList([1, 2, 3]), new Uint8List.fromList([4, 5]));
+ final c = Compressor(), c1 = Compressor();
+ final kv = KeyValue(
+ Uint8List.fromList([1, 2, 3]), Uint8List.fromList([4, 5]));
final kv2 = c.uncompressKeyInEntry(c1.compressKeyInEntry(kv));
- expect(kv2, new KeyValueMatcher(kv));
+ expect(kv2, KeyValueMatcher(kv));
});
test('Key', () {
- final c = new Compressor();
- final key = new Uint8List.fromList([3, 8, 2]);
+ final c = Compressor();
+ final key = Uint8List.fromList([3, 8, 2]);
final keyUc = c.uncompressKey(c.compressKey(key));
expect(keyUc, equals(key));
- final keyOth = new Uint8List.fromList([3]);
+ final keyOth = Uint8List.fromList([3]);
final keyOthUc = c.uncompressKey(c.compressKey(keyOth));
expect(keyOthUc, equals(keyOth));
});
});
group('Exceptions', () {
- test('Uncompress new key', () {
- final c = new Compressor(), c1 = new Compressor();
+ test('Uncompress key', () {
+ final c = Compressor(), c1 = Compressor();
expect(
- () => c.uncompressKey(c1.compressKey(new Uint8List.fromList([1, 2]))),
+ () => c.uncompressKey(c1.compressKey(Uint8List.fromList([1, 2]))),
throwsInternalError);
});
test('Uncompress short key', () {
- final c = new Compressor();
- expect(() => c.uncompressKey(new Uint8List.fromList([1, 2])),
+ final c = Compressor();
+ expect(() => c.uncompressKey(Uint8List.fromList([1, 2])),
throwsInternalError);
});
test('Uncompress key value with wrong key length', () {
- final c = new Compressor();
- final kv = new KeyValue(
- new Uint8List.fromList([1, 2, 3]), new Uint8List.fromList([4, 5]));
+ final c = Compressor();
+ final kv = KeyValue(
+ Uint8List.fromList([1, 2, 3]), Uint8List.fromList([4, 5]));
final kvC = c.compressKeyInEntry(kv);
kvC.value.buffer.asByteData().setUint64(0, 6);
expect(() => c.uncompressKeyInEntry(kvC), throwsInternalError);
diff --git a/public/dart/sledge/test/values/converter_test.dart b/public/dart/sledge/test/values/converter_test.dart
index f660a5b..e57a262 100644
--- a/public/dart/sledge/test/values/converter_test.dart
+++ b/public/dart/sledge/test/values/converter_test.dart
@@ -13,7 +13,7 @@
import 'matchers.dart';
void _testSerializationAndDeserialization<T>(T value) {
- Converter<T> converter = new Converter<T>();
+ Converter<T> converter = Converter<T>();
expect(converter.deserialize(converter.serialize(value)), equals(value));
}
@@ -24,10 +24,10 @@
void main() {
setupLogger();
- final boolConverter = new Converter<bool>();
- final doubleConverter = new Converter<double>();
- final numConverter = new Converter<num>();
- final stringConverter = new Converter<String>();
+ final boolConverter = Converter<bool>();
+ final doubleConverter = Converter<double>();
+ final numConverter = Converter<num>();
+ final stringConverter = Converter<String>();
group('Correct convertions', () {
test('int converter', () {
@@ -75,19 +75,19 @@
});
test('data converter', () {
- final conv = new MapToKVListConverter<String, int>();
- final longBuffer = new StringBuffer();
+ final conv = MapToKVListConverter<String, int>();
+ final longBuffer = StringBuffer();
for (int i = 0; i < 100; i++) {
longBuffer.write('$i');
}
final long = longBuffer.toString(), short = 'aba';
- final change = new ConvertedChange<String, int>({long: 10, short: 1});
+ final change = ConvertedChange<String, int>({long: 10, short: 1});
final serializedChange = conv.serialize(change);
expect(serializedChange.changedEntries[0].key.length <= 128 + 1, isTrue);
final deserializedChange = conv.deserialize(serializedChange);
expect(deserializedChange.changedEntries[short], equals(1));
expect(deserializedChange.changedEntries[long], equals(10));
- final change2 = new ConvertedChange<String, int>(
+ final change2 = ConvertedChange<String, int>(
<String, int>{}, <String>{short, long});
final deserializedChange2 = conv.deserialize(conv.serialize(change2));
expect(deserializedChange2.deletedKeys.length, equals(2));
@@ -98,13 +98,13 @@
group('Exceptions', () {
test('odd lengthInBytes', () {
- expect(() => stringConverter.deserialize(new Uint8List(1)),
+ expect(() => stringConverter.deserialize(Uint8List(1)),
throwsInternalError);
});
test("double's length", () {
for (int i = 0; i < 10; i++) {
if (i != 8) {
- expect(() => doubleConverter.deserialize(new Uint8List(i)),
+ expect(() => doubleConverter.deserialize(Uint8List(i)),
throwsInternalError);
}
}
@@ -112,18 +112,18 @@
test('bool', () {
for (int i = 0; i < 10; i++) {
if (i != 1) {
- expect(() => boolConverter.deserialize(new Uint8List(i)),
+ expect(() => boolConverter.deserialize(Uint8List(i)),
throwsInternalError);
}
}
- expect(() => boolConverter.deserialize(new Uint8List.fromList([2])),
+ expect(() => boolConverter.deserialize(Uint8List.fromList([2])),
throwsInternalError);
- expect(() => boolConverter.deserialize(new Uint8List.fromList([-1])),
+ expect(() => boolConverter.deserialize(Uint8List.fromList([-1])),
throwsInternalError);
- expect(boolConverter.deserialize(new Uint8List.fromList([0])),
+ expect(boolConverter.deserialize(Uint8List.fromList([0])),
equals(false));
expect(
- boolConverter.deserialize(new Uint8List.fromList([1])), equals(true));
+ boolConverter.deserialize(Uint8List.fromList([1])), equals(true));
});
});
}
diff --git a/public/dart/sledge/test/values/key_value_storage_test.dart b/public/dart/sledge/test/values/key_value_storage_test.dart
index 42fcbd4..1e85a9f 100644
--- a/public/dart/sledge/test/values/key_value_storage_test.dart
+++ b/public/dart/sledge/test/values/key_value_storage_test.dart
@@ -13,13 +13,13 @@
setupLogger();
group('Map API coverage', () {
- new MapApiTester<KeyValueStorage>(() => new KeyValueStorage<int, int>())
+ MapApiTester<KeyValueStorage>(() => KeyValueStorage<int, int>())
..testApi()
..testObserver();
});
test('getChange', () {
- KeyValueStorage kv = new KeyValueStorage<int, int>();
+ KeyValueStorage kv = KeyValueStorage<int, int>();
expect(kv.length, equals(0));
kv[0] = 2;
expect(kv[0], equals(2));
@@ -30,8 +30,8 @@
});
test('getChange + applyChange', () {
- KeyValueStorage kv1 = new KeyValueStorage<int, int>(),
- kv2 = new KeyValueStorage<int, int>();
+ KeyValueStorage kv1 = KeyValueStorage<int, int>(),
+ kv2 = KeyValueStorage<int, int>();
kv1[0] = 2;
kv2.applyChange(kv1.getChange());
expect(kv2[0], equals(2));
diff --git a/public/dart/sledge/test/values/last_one_wins_values_test.dart b/public/dart/sledge/test/values/last_one_wins_values_test.dart
index 64c9281..6c211e9 100644
--- a/public/dart/sledge/test/values/last_one_wins_values_test.dart
+++ b/public/dart/sledge/test/values/last_one_wins_values_test.dart
@@ -18,7 +18,7 @@
setupLogger();
test('Integer', () {
- final cnt = new LastOneWinsValue<int>();
+ final cnt = LastOneWinsValue<int>();
expect(cnt.value, equals(0));
cnt.value = 3;
expect(cnt.value, equals(3));
@@ -27,7 +27,7 @@
});
test('Double', () {
- final cnt = new LastOneWinsValue<double>();
+ final cnt = LastOneWinsValue<double>();
expect(cnt.value, equals(0.0));
cnt.value = 3.5;
expect(cnt.value, equals(3.5));
@@ -36,7 +36,7 @@
});
test('Boolean', () {
- final cnt = new LastOneWinsValue<bool>();
+ final cnt = LastOneWinsValue<bool>();
expect(cnt.value, equals(false));
cnt.value = true;
expect(cnt.value, equals(true));
@@ -45,7 +45,7 @@
});
test('String', () {
- final cnt = new LastOneWinsValue<String>();
+ final cnt = LastOneWinsValue<String>();
expect(cnt.value, equals(''));
cnt.value = 'aba';
expect(cnt.value, equals('aba'));
@@ -54,20 +54,20 @@
});
test('Uint8List', () {
- final cnt = new LastOneWinsValue<Uint8List>();
- expect(cnt.value, equals(new Uint8List(0)));
- cnt.value = new Uint8List.fromList([1, 2, 3]);
- expect(cnt.value, equals(new Uint8List.fromList([1, 2, 3])));
- cnt.value = new Uint8List.fromList([2, 5, 3]);
- expect(cnt.value, equals(new Uint8List.fromList([2, 5, 3])));
+ final cnt = LastOneWinsValue<Uint8List>();
+ expect(cnt.value, equals(Uint8List(0)));
+ cnt.value = Uint8List.fromList([1, 2, 3]);
+ expect(cnt.value, equals(Uint8List.fromList([1, 2, 3])));
+ cnt.value = Uint8List.fromList([2, 5, 3]);
+ expect(cnt.value, equals(Uint8List.fromList([2, 5, 3])));
});
test('Integer oprations', () {
- final conv = new MapToKVListConverter<int, int>();
- final x = new LastOneWinsValue<int>(
- conv.serialize(new ConvertedChange<int, int>({0: -3})));
+ final conv = MapToKVListConverter<int, int>();
+ final x = LastOneWinsValue<int>(
+ conv.serialize(ConvertedChange<int, int>({0: -3})));
expect(x.value, equals(-3));
- x.applyChange(conv.serialize(new ConvertedChange<int, int>({0: 5})));
+ x.applyChange(conv.serialize(ConvertedChange<int, int>({0: 5})));
expect(x.value, equals(5));
x.value = 2;
expect(x.value, equals(2));
@@ -75,16 +75,16 @@
expect(x.value, equals(-1));
x.getChange();
expect(x.value, equals(-1));
- x.applyChange(conv.serialize(new ConvertedChange<int, int>({0: 4})));
+ x.applyChange(conv.serialize(ConvertedChange<int, int>({0: 4})));
expect(x.value, equals(4));
});
test('Double operations', () {
- final conv = new MapToKVListConverter<int, double>();
- final x = new LastOneWinsValue<double>(
- conv.serialize(new ConvertedChange<int, double>({0: -3.5})));
+ final conv = MapToKVListConverter<int, double>();
+ final x = LastOneWinsValue<double>(
+ conv.serialize(ConvertedChange<int, double>({0: -3.5})));
expect(x.value, equals(-3.5));
- x.applyChange(conv.serialize(new ConvertedChange<int, double>({0: 4.2})));
+ x.applyChange(conv.serialize(ConvertedChange<int, double>({0: 4.2})));
expect(x.value, equals(4.2));
x.value = 0.5;
expect(x.value, equals(0.5));
@@ -92,16 +92,16 @@
expect(x.value, equals(-1.0));
x.getChange();
expect(x.value, equals(-1.0));
- x.applyChange(conv.serialize(new ConvertedChange<int, double>({0: 4.25})));
+ x.applyChange(conv.serialize(ConvertedChange<int, double>({0: 4.25})));
expect(x.value, equals(4.25));
});
test('String operations', () {
- final conv = new MapToKVListConverter<int, String>();
- final x = new LastOneWinsValue<String>(
- conv.serialize(new ConvertedChange<int, String>({0: 'bar'})));
+ final conv = MapToKVListConverter<int, String>();
+ final x = LastOneWinsValue<String>(
+ conv.serialize(ConvertedChange<int, String>({0: 'bar'})));
expect(x.value, equals('bar'));
- x.applyChange(conv.serialize(new ConvertedChange<int, String>({0: 'foo'})));
+ x.applyChange(conv.serialize(ConvertedChange<int, String>({0: 'foo'})));
expect(x.value, equals('foo'));
x.value = 'bar';
expect(x.value, equals('bar'));
@@ -109,42 +109,42 @@
expect(x.value, equals('tor'));
x.getChange();
expect(x.value, equals('tor'));
- x.applyChange(conv.serialize(new ConvertedChange<int, String>({0: 'cir'})));
+ x.applyChange(conv.serialize(ConvertedChange<int, String>({0: 'cir'})));
expect(x.value, equals('cir'));
});
test('Boolean operations', () {
- final conv = new MapToKVListConverter<int, bool>();
- final x = new LastOneWinsValue<bool>(
- conv.serialize(new ConvertedChange<int, bool>({0: true})));
+ final conv = MapToKVListConverter<int, bool>();
+ final x = LastOneWinsValue<bool>(
+ conv.serialize(ConvertedChange<int, bool>({0: true})));
expect(x.value, equals(true));
- x.applyChange(conv.serialize(new ConvertedChange<int, bool>({0: false})));
+ x.applyChange(conv.serialize(ConvertedChange<int, bool>({0: false})));
expect(x.value, equals(false));
x.value = true;
expect(x.value, equals(true));
x.getChange();
expect(x.value, equals(true));
- x.applyChange(conv.serialize(new ConvertedChange<int, bool>({0: false})));
+ x.applyChange(conv.serialize(ConvertedChange<int, bool>({0: false})));
expect(x.value, equals(false));
});
test('onChange stream', () {
- final conv = new MapToKVListConverter<int, String>();
- final x = new LastOneWinsValue<String>(
- conv.serialize(new ConvertedChange<int, String>({0: 'aba'})));
+ final conv = MapToKVListConverter<int, String>();
+ final x = LastOneWinsValue<String>(
+ conv.serialize(ConvertedChange<int, String>({0: 'aba'})));
Stream<String> changeStream = x.onChange;
expect(changeStream, emitsInOrder(['bar', 'foo', 'a']));
x
..applyChange(
- conv.serialize(new ConvertedChange<int, String>({0: 'bar'})))
+ conv.serialize(ConvertedChange<int, String>({0: 'bar'})))
..applyChange(
- conv.serialize(new ConvertedChange<int, String>({0: 'foo'})))
- ..applyChange(conv.serialize(new ConvertedChange<int, String>({0: 'a'})));
+ conv.serialize(ConvertedChange<int, String>({0: 'foo'})))
+ ..applyChange(conv.serialize(ConvertedChange<int, String>({0: 'a'})));
});
test('Observer calls', () {
- final x = new LastOneWinsValue<String>();
- final observer = new DummyValueObserver();
+ final x = LastOneWinsValue<String>();
+ final observer = DummyValueObserver();
x.observer = observer;
expect(x.value, equals(''));
observer.expectNotChanged();
diff --git a/public/dart/sledge/test/values/list_api_tester.dart b/public/dart/sledge/test/values/list_api_tester.dart
index 3c95e2c..e2e99fd 100644
--- a/public/dart/sledge/test/values/list_api_tester.dart
+++ b/public/dart/sledge/test/values/list_api_tester.dart
@@ -639,7 +639,7 @@
void testObserver() {
test('Observer calls.', () {
final list = _newList();
- final observer = new DummyValueObserver();
+ final observer = DummyValueObserver();
expect(list, const TypeMatcher<LeafValue>());
dynamic leafValue = list;
leafValue.observer = observer; // ignore: cascade_invocations
@@ -676,7 +676,7 @@
..expectChanged()
..reset();
- list.shuffle(new Random(1));
+ list.shuffle(Random(1));
observer
..expectChanged()
..reset();
diff --git a/public/dart/sledge/test/values/map_api_tester.dart b/public/dart/sledge/test/values/map_api_tester.dart
index ce3f5d8..05cded6 100644
--- a/public/dart/sledge/test/values/map_api_tester.dart
+++ b/public/dart/sledge/test/values/map_api_tester.dart
@@ -163,7 +163,7 @@
void testObserver() {
test('Observer calls.', () {
final dynamic map = _mapCreator();
- final observer = new DummyValueObserver();
+ final observer = DummyValueObserver();
map.observer = observer;
expect(map.containsKey(0), equals(false));
observer.expectNotChanged();
diff --git a/public/dart/sledge/test/values/map_value_ss_test.dart b/public/dart/sledge/test/values/map_value_ss_test.dart
index b22c8d8..53d4f80 100644
--- a/public/dart/sledge/test/values/map_value_ss_test.dart
+++ b/public/dart/sledge/test/values/map_value_ss_test.dart
@@ -16,12 +16,12 @@
// Returns Fleet of [count] MapValues.
Fleet<MapValue<K, V>> newFleet(int count) {
- return new Fleet<MapValue<K, V>>(count, (index) => new MapValue<K, V>());
+ return Fleet<MapValue<K, V>>(count, (index) => MapValue<K, V>());
}
}
const MapFleetFactory<int, int> intMapFleetFactory =
- const MapFleetFactory<int, int>();
+ MapFleetFactory<int, int>();
void main() async {
setupLogger();
diff --git a/public/dart/sledge/test/values/map_value_test.dart b/public/dart/sledge/test/values/map_value_test.dart
index cae1717..5b7d10f 100644
--- a/public/dart/sledge/test/values/map_value_test.dart
+++ b/public/dart/sledge/test/values/map_value_test.dart
@@ -13,13 +13,13 @@
setupLogger();
group('Map API coverage', () {
- new MapApiTester<MapValue>(() => new MapValue<int, int>())
+ MapApiTester<MapValue>(() => MapValue<int, int>())
..testApi()
..testObserver();
});
test('MapValue get and set.', () {
- var m = new MapValue<int, int>();
+ var m = MapValue<int, int>();
expect(m[0], equals(null));
expect(m[3], equals(null));
m[2] = 1;
@@ -32,7 +32,7 @@
});
test('MapValue get, set and remove.', () {
- var m = new MapValue<int, int>();
+ var m = MapValue<int, int>();
expect(m[0], equals(null));
m[0] = 3;
expect(m[0], equals(3));
diff --git a/public/dart/sledge/test/values/matchers.dart b/public/dart/sledge/test/values/matchers.dart
index f217661..05e7fc7 100644
--- a/public/dart/sledge/test/values/matchers.dart
+++ b/public/dart/sledge/test/values/matchers.dart
@@ -12,7 +12,7 @@
import 'package:sledge/src/sledge_errors.dart';
import 'package:test/test.dart';
-const Equality<List<int>> _listEquality = const ListEquality<int>();
+const Equality<List<int>> _listEquality = ListEquality<int>();
class KeyValueEquality implements Equality<KeyValue> {
// Default constructor;
@@ -35,11 +35,11 @@
}
}
-const _keyValueEquality = const KeyValueEquality();
+const _keyValueEquality = KeyValueEquality();
const ListEquality _keyValueListEquality =
- const ListEquality<KeyValue>(_keyValueEquality);
+ ListEquality<KeyValue>(_keyValueEquality);
const ListEquality _keysListEquality =
- const ListEquality<List<int>>(_listEquality);
+ ListEquality<List<int>>(_listEquality);
class KeyValueMatcher extends Matcher {
final KeyValue _kv;
@@ -98,4 +98,4 @@
/// Matcher for InternalSledgeErrors.
final Matcher throwsInternalError =
- throwsA(new TypeMatcher<InternalSledgeError>());
+ throwsA(TypeMatcher<InternalSledgeError>());
diff --git a/public/dart/sledge/test/values/ordered_list_ss_test.dart b/public/dart/sledge/test/values/ordered_list_ss_test.dart
index 7aeab4b..356c3bb 100644
--- a/public/dart/sledge/test/values/ordered_list_ss_test.dart
+++ b/public/dart/sledge/test/values/ordered_list_ss_test.dart
@@ -24,13 +24,13 @@
// Returns Fleet of [count] OrderedListValues with pairwise different
// instanceIds.
Fleet<OrderedListValue<T>> newFleet(int count) {
- return new Fleet<OrderedListValue<T>>(count,
- (index) => new OrderedListValue<T>(new Uint8List.fromList([index])));
+ return Fleet<OrderedListValue<T>>(count,
+ (index) => OrderedListValue<T>(Uint8List.fromList([index])));
}
}
const OrderedListFleetFactory<int> integerOrderedListFleetFactory =
- const OrderedListFleetFactory<int>();
+ OrderedListFleetFactory<int>();
// Checks that relative orders of elements do not change.
// Throws an error if some pair of elements [a] and [b] appear in both orders,
@@ -83,11 +83,11 @@
'Check relative order '
'(i: $countInstances, e: $countEpochs, ins: $countInsertions, seed: $seed).',
() async {
- final random = new Random(seed);
+ final random = Random(seed);
int incValue = 0;
final fleet = integerOrderedListFleetFactory.newFleet(countInstances);
final instanceIdList =
- new List<int>.generate(countInstances, (index) => index);
+ List<int>.generate(countInstances, (index) => index);
for (int epoch = 0; epoch < countEpochs; epoch++) {
for (int instance = 0; instance < countInstances; instance++) {
@@ -100,7 +100,7 @@
}
fleet.synchronize(instanceIdList);
}
- fleet.addChecker(() => new RelativeOrderChecker<int>());
+ fleet.addChecker(() => RelativeOrderChecker<int>());
await fleet.testAllOrders();
});
}
@@ -135,7 +135,7 @@
l2..insert(0, 5)..insert(1, 6);
})
..synchronize([0, 1, 2])
- ..addChecker(() => new RelativeOrderChecker<int>());
+ ..addChecker(() => RelativeOrderChecker<int>());
await fleet.testAllOrders();
});
@@ -161,14 +161,14 @@
expect(
cnt.onChange,
emitsInOrder([
- new OrderedListChangeMatcher(new OrderedListChange<int>(
- [], new SplayTreeMap<int, int>.fromIterables([0], [1]))),
- new OrderedListChangeMatcher(new OrderedListChange<int>([],
- new SplayTreeMap<int, int>.fromIterables([0, 2], [2, 3]))),
- new OrderedListChangeMatcher(new OrderedListChange<int>(
- [1, 2], new SplayTreeMap<int, int>.fromIterables([], []))),
- new OrderedListChangeMatcher(new OrderedListChange<int>(
- [], new SplayTreeMap<int, int>.fromIterables([0], [5]))),
+ OrderedListChangeMatcher(OrderedListChange<int>(
+ [], SplayTreeMap<int, int>.fromIterables([0], [1]))),
+ OrderedListChangeMatcher(OrderedListChange<int>([],
+ SplayTreeMap<int, int>.fromIterables([0, 2], [2, 3]))),
+ OrderedListChangeMatcher(OrderedListChange<int>(
+ [1, 2], SplayTreeMap<int, int>.fromIterables([], []))),
+ OrderedListChangeMatcher(OrderedListChange<int>(
+ [], SplayTreeMap<int, int>.fromIterables([0], [5]))),
]));
});
}
diff --git a/public/dart/sledge/test/values/ordered_list_tree_path_test.dart b/public/dart/sledge/test/values/ordered_list_tree_path_test.dart
index 3ac105e..1763656 100644
--- a/public/dart/sledge/test/values/ordered_list_tree_path_test.dart
+++ b/public/dart/sledge/test/values/ordered_list_tree_path_test.dart
@@ -13,7 +13,7 @@
int _incrementalTime = 0;
Uint8List get timestamp {
_incrementalTime += 1;
- return new Uint8List(8)..buffer.asByteData().setUint64(0, _incrementalTime);
+ return Uint8List(8)..buffer.asByteData().setUint64(0, _incrementalTime);
}
}
@@ -21,8 +21,8 @@
setupLogger();
test('isDescendant.', () {
- var time = new IncrementalTime();
- var root = new OrderedListTreePath.root();
+ var time = IncrementalTime();
+ var root = OrderedListTreePath.root();
expect(root.isDescendant(root), isFalse);
// root -
@@ -30,7 +30,7 @@
// - - -> p(v1) - - -> v1
var v1 = root.getChild(
- ChildType.right, new Uint8List.fromList([1]), time.timestamp);
+ ChildType.right, Uint8List.fromList([1]), time.timestamp);
expect(v1.isDescendant(root), isTrue);
expect(v1.isDescendant(v1), isFalse);
expect(root.isDescendant(v1), isFalse);
@@ -42,7 +42,7 @@
// - - -> p(v2) - - -> v2
var v2 = root.getChild(
- ChildType.right, new Uint8List.fromList([2]), time.timestamp);
+ ChildType.right, Uint8List.fromList([2]), time.timestamp);
expect(v2.isDescendant(root), isTrue);
expect(v2.isDescendant(v2), isFalse);
expect(v1.isDescendant(v2), isFalse);
@@ -55,7 +55,7 @@
// -----> p(v2) -----> v2
var v3 = v1.getChild(
- ChildType.left, new Uint8List.fromList([0, 1, 2]), time.timestamp);
+ ChildType.left, Uint8List.fromList([0, 1, 2]), time.timestamp);
expect(v3.isDescendant(root), isTrue);
expect(v3.isDescendant(v1), isTrue);
expect(v3.isDescendant(v2), isFalse);
diff --git a/public/dart/sledge/test/values/ordered_list_value_test.dart b/public/dart/sledge/test/values/ordered_list_value_test.dart
index 8c4379f..8fe61a9 100644
--- a/public/dart/sledge/test/values/ordered_list_value_test.dart
+++ b/public/dart/sledge/test/values/ordered_list_value_test.dart
@@ -16,27 +16,27 @@
void main() {
setupLogger();
- final id1 = new Uint8List.fromList([1]);
+ final id1 = Uint8List.fromList([1]);
group('List API coverage', () {
- new ListApiTester<OrderedListValue, int>(
- () => new OrderedListValue<int>(id1), (int id) => id)
+ ListApiTester<OrderedListValue, int>(
+ () => OrderedListValue<int>(id1), (int id) => id)
..testApi()
..testObserver();
- new ListApiTester<OrderedListValue, String>(
- () => new OrderedListValue<String>(id1), (int id) => id.toString())
+ ListApiTester<OrderedListValue, String>(
+ () => OrderedListValue<String>(id1), (int id) => id.toString())
..testApi()
..testObserver();
- new ListApiTester<OrderedListValue, Uint8List>(
- () => new OrderedListValue<Uint8List>(id1,
- equals: new ListEquality().equals),
- (int id) => new Uint8List.fromList([id]))
+ ListApiTester<OrderedListValue, Uint8List>(
+ () => OrderedListValue<Uint8List>(id1,
+ equals: ListEquality().equals),
+ (int id) => Uint8List.fromList([id]))
..testApi()
..testObserver();
});
test('Add to end of list and check content.', () {
- var s = new OrderedListValue<int>(id1);
+ var s = OrderedListValue<int>(id1);
expect(s.toList(), equals([]));
s.insert(0, 1);
expect(s.toList(), equals([1]));
@@ -47,7 +47,7 @@
});
test('Insert into random positions of list and check content.', () {
- var s = new OrderedListValue<int>(id1);
+ var s = OrderedListValue<int>(id1);
expect(s.toList(), equals([]));
s.insert(0, 1);
expect(s.toList(), equals([1]));
@@ -62,7 +62,7 @@
});
test('Insert into random positions, delete from list and check content.', () {
- var s = new OrderedListValue<int>(id1);
+ var s = OrderedListValue<int>(id1);
expect(s.toList(), equals([]));
s.insert(0, 1);
expect(s.toList(), equals([1]));
@@ -83,7 +83,7 @@
});
test('Simple operations.', () {
- var s = new OrderedListValue<int>(id1);
+ var s = OrderedListValue<int>(id1);
expect(s.toList(), equals([]));
s.insert(0, 1);
expect(s[0], equals(1));
@@ -101,7 +101,7 @@
group('Exceptions', () {
test('Insert out of range', () {
- var s = new OrderedListValue<int>(id1);
+ var s = OrderedListValue<int>(id1);
expect(() => s.insert(1, 1), throwsRangeError);
s.insert(0, 1);
expect(() => s.insert(2, 0), throwsRangeError);
@@ -109,7 +109,7 @@
});
test('[] out of range', () {
- var s = new OrderedListValue<int>(id1);
+ var s = OrderedListValue<int>(id1);
expect(() => s[1], throwsRangeError);
expect(() => s[4], throwsRangeError);
s.insert(0, 1);
@@ -118,7 +118,7 @@
});
test('Remove out of range', () {
- var s = new OrderedListValue<int>(id1);
+ var s = OrderedListValue<int>(id1);
expect(() => s.removeAt(0), throwsRangeError);
expect(() => s.removeAt(1), throwsRangeError);
s.insert(0, 1);
@@ -130,8 +130,8 @@
test('Insert into random positions of list and check content. Large test.',
() {
- final random = new Random(1);
- var s = new OrderedListValue<int>(id1);
+ final random = Random(1);
+ var s = OrderedListValue<int>(id1);
var list = <int>[];
expect(s.toList(), equals(<int>[]));
for (int value = 0; value < 100; value++) {
@@ -143,7 +143,7 @@
});
test('Complex example of inserting in the list.', () {
- var s = new OrderedListValue<int>(id1)
+ var s = OrderedListValue<int>(id1)
..insert(0, 0)
..insert(0, 1)
..insert(1, 2)
diff --git a/public/dart/sledge/test/values/pos_neg_counter_ss_test.dart b/public/dart/sledge/test/values/pos_neg_counter_ss_test.dart
index 689a1d3..6e90961 100644
--- a/public/dart/sledge/test/values/pos_neg_counter_ss_test.dart
+++ b/public/dart/sledge/test/values/pos_neg_counter_ss_test.dart
@@ -16,24 +16,24 @@
const PosNegCounterFleetFactory();
Fleet<PosNegCounterValue<T>> newFleet(int count) {
- return new Fleet<PosNegCounterValue<T>>(count,
- (index) => new PosNegCounterValue<T>(new Uint8List.fromList([index])));
+ return Fleet<PosNegCounterValue<T>>(count,
+ (index) => PosNegCounterValue<T>(Uint8List.fromList([index])));
}
}
const PosNegCounterFleetFactory<int> integerCounterFleetFactory =
- const PosNegCounterFleetFactory<int>();
+ PosNegCounterFleetFactory<int>();
void main() async {
setupLogger();
test('PosNegCounterValue with StorageState', () {
- var cnt1 = new PosNegCounterValue<int>(new Uint8List.fromList([1])),
- cnt2 = new PosNegCounterValue<int>(new Uint8List.fromList([2])),
- cnt3 = new PosNegCounterValue<int>(new Uint8List.fromList([3]));
- var ss1 = new StorageState(),
- ss2 = new StorageState(),
- ss3 = new StorageState();
+ var cnt1 = PosNegCounterValue<int>(Uint8List.fromList([1])),
+ cnt2 = PosNegCounterValue<int>(Uint8List.fromList([2])),
+ cnt3 = PosNegCounterValue<int>(Uint8List.fromList([3]));
+ var ss1 = StorageState(),
+ ss2 = StorageState(),
+ ss3 = StorageState();
cnt1.add(4);
cnt2.add(2);
ss1.applyChange(cnt1.getChange(), 1);
diff --git a/public/dart/sledge/test/values/pos_neg_counter_test.dart b/public/dart/sledge/test/values/pos_neg_counter_test.dart
index fcd359f..924631d 100644
--- a/public/dart/sledge/test/values/pos_neg_counter_test.dart
+++ b/public/dart/sledge/test/values/pos_neg_counter_test.dart
@@ -21,10 +21,10 @@
void main() {
setupLogger();
- final id1 = new Uint8List.fromList([1]);
+ final id1 = Uint8List.fromList([1]);
test('PosNegCounterValue accumulate additions', () {
- final cnt = new PosNegCounterValue<int>(id1);
+ final cnt = PosNegCounterValue<int>(id1);
expect(cnt.value, equals(0));
cnt.add(1);
expect(cnt.value, equals(1));
@@ -35,7 +35,7 @@
});
test('PosNegCounterValue accumulate subtractions', () {
- final cnt = new PosNegCounterValue<int>(id1);
+ final cnt = PosNegCounterValue<int>(id1);
expect(cnt.value, equals(0));
cnt.add(-1);
expect(cnt.value, equals(-1));
@@ -46,7 +46,7 @@
});
test('PosNegCounterValue accumulate', () {
- final cnt = new PosNegCounterValue<int>(id1);
+ final cnt = PosNegCounterValue<int>(id1);
expect(cnt.value, equals(0));
cnt.add(-3);
expect(cnt.value, equals(-3));
@@ -57,7 +57,7 @@
});
test('PosNegCounterValue accumulate', () {
- final cnt = new PosNegCounterValue<double>(id1);
+ final cnt = PosNegCounterValue<double>(id1);
expect(cnt.value, equals(0.0));
cnt.add(-3.2);
expect(cnt.value, equals(-3.2));
@@ -68,75 +68,75 @@
});
test('PosNegCounterValue construction', () {
- final conv = new MapToKVListConverter<Uint8List, int>();
- final cnt = new PosNegCounterValue<int>(id1)
- ..applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
+ final conv = MapToKVListConverter<Uint8List, int>();
+ final cnt = PosNegCounterValue<int>(id1)
+ ..applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
_newIntMap()
- ..putIfAbsent(new Uint8List.fromList([0, 1]), () => 4)
- ..putIfAbsent(new Uint8List.fromList([1, 1]), () => 3))));
+ ..putIfAbsent(Uint8List.fromList([0, 1]), () => 4)
+ ..putIfAbsent(Uint8List.fromList([1, 1]), () => 3))));
expect(cnt.value, equals(1));
});
test('PosNegCounterValue construction 2', () {
- final conv = new MapToKVListConverter<Uint8List, int>();
- final cnt = new PosNegCounterValue<int>(id1)
- ..applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
+ final conv = MapToKVListConverter<Uint8List, int>();
+ final cnt = PosNegCounterValue<int>(id1)
+ ..applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
_newIntMap()
- ..putIfAbsent(new Uint8List.fromList([0, 1]), () => 4)
- ..putIfAbsent(new Uint8List.fromList([1, 1]), () => 3)
- ..putIfAbsent(new Uint8List.fromList([0, 3]), () => 5)
- ..putIfAbsent(new Uint8List.fromList([1, 3]), () => 2))));
+ ..putIfAbsent(Uint8List.fromList([0, 1]), () => 4)
+ ..putIfAbsent(Uint8List.fromList([1, 1]), () => 3)
+ ..putIfAbsent(Uint8List.fromList([0, 3]), () => 5)
+ ..putIfAbsent(Uint8List.fromList([1, 3]), () => 2))));
expect(cnt.value, equals(4));
});
test('PosNegCounterValue construction double', () {
- final conv = new MapToKVListConverter<Uint8List, double>();
- final cnt = new PosNegCounterValue<double>(id1)
- ..applyChange(conv.serialize(new ConvertedChange<Uint8List, double>(
+ final conv = MapToKVListConverter<Uint8List, double>();
+ final cnt = PosNegCounterValue<double>(id1)
+ ..applyChange(conv.serialize(ConvertedChange<Uint8List, double>(
newUint8ListMap<double>()
- ..putIfAbsent(new Uint8List.fromList([0, 1]), () => 4.25)
- ..putIfAbsent(new Uint8List.fromList([1, 1]), () => 3.0)
- ..putIfAbsent(new Uint8List.fromList([0, 3]), () => 2.5)
- ..putIfAbsent(new Uint8List.fromList([1, 4]), () => 4.125))));
+ ..putIfAbsent(Uint8List.fromList([0, 1]), () => 4.25)
+ ..putIfAbsent(Uint8List.fromList([1, 1]), () => 3.0)
+ ..putIfAbsent(Uint8List.fromList([0, 3]), () => 2.5)
+ ..putIfAbsent(Uint8List.fromList([1, 4]), () => 4.125))));
expect(cnt.value, equals(-0.375));
});
test('PosNegCounterValue applyChange', () {
- final conv = new MapToKVListConverter<Uint8List, int>();
- final cnt = new PosNegCounterValue<int>(id1);
+ final conv = MapToKVListConverter<Uint8List, int>();
+ final cnt = PosNegCounterValue<int>(id1);
expect(cnt.value, equals(0));
- cnt.applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
- _newIntMap()..putIfAbsent(new Uint8List.fromList([0, 1]), () => 4))));
+ cnt.applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
+ _newIntMap()..putIfAbsent(Uint8List.fromList([0, 1]), () => 4))));
expect(cnt.value, equals(4));
- cnt.applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
- _newIntMap()..putIfAbsent(new Uint8List.fromList([0, 1]), () => 1))));
+ cnt.applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
+ _newIntMap()..putIfAbsent(Uint8List.fromList([0, 1]), () => 1))));
expect(cnt.value, equals(1));
- cnt.applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
- _newIntMap()..putIfAbsent(new Uint8List.fromList([1, 2]), () => 5))));
+ cnt.applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
+ _newIntMap()..putIfAbsent(Uint8List.fromList([1, 2]), () => 5))));
expect(cnt.value, equals(-4));
});
test('PosNegCounterValue onChange stream', () {
- final conv = new MapToKVListConverter<Uint8List, int>();
- final cnt = new PosNegCounterValue<int>(id1)
- ..applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
+ final conv = MapToKVListConverter<Uint8List, int>();
+ final cnt = PosNegCounterValue<int>(id1)
+ ..applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
_newIntMap()
- ..putIfAbsent(new Uint8List.fromList([0, 1]), () => 1)
- ..putIfAbsent(new Uint8List.fromList([1, 1]), () => 2))));
+ ..putIfAbsent(Uint8List.fromList([0, 1]), () => 1)
+ ..putIfAbsent(Uint8List.fromList([1, 1]), () => 2))));
Stream<int> changeStream = cnt.onChange;
expect(changeStream, emitsInOrder([2, 4, -3]));
cnt
- ..applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
- _newIntMap()..putIfAbsent(new Uint8List.fromList([0, 2]), () => 3))))
- ..applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
- _newIntMap()..putIfAbsent(new Uint8List.fromList([0, 1]), () => 3))))
- ..applyChange(conv.serialize(new ConvertedChange<Uint8List, int>(
- _newIntMap()..putIfAbsent(new Uint8List.fromList([1, 1]), () => 9))));
+ ..applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
+ _newIntMap()..putIfAbsent(Uint8List.fromList([0, 2]), () => 3))))
+ ..applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
+ _newIntMap()..putIfAbsent(Uint8List.fromList([0, 1]), () => 3))))
+ ..applyChange(conv.serialize(ConvertedChange<Uint8List, int>(
+ _newIntMap()..putIfAbsent(Uint8List.fromList([1, 1]), () => 9))));
});
test('Observer calls.', () {
- final cnt = new PosNegCounterValue<int>(id1);
- final observer = new DummyValueObserver();
+ final cnt = PosNegCounterValue<int>(id1);
+ final observer = DummyValueObserver();
cnt.observer = observer;
expect(cnt.value, equals(0));
observer.expectNotChanged();
diff --git a/public/dart/sledge/test/values/set_api_tester.dart b/public/dart/sledge/test/values/set_api_tester.dart
index dedf0c9..1b68c4b 100644
--- a/public/dart/sledge/test/values/set_api_tester.dart
+++ b/public/dart/sledge/test/values/set_api_tester.dart
@@ -221,7 +221,7 @@
void testObserver() {
test('Observer calls.', () {
final s = _setCreator();
- final observer = new DummyValueObserver();
+ final observer = DummyValueObserver();
expect(s, const TypeMatcher<LeafValue>());
dynamic leafValue = s;
leafValue.observer = observer; // ignore: cascade_invocations
diff --git a/public/dart/sledge/test/values/set_value_ss_test.dart b/public/dart/sledge/test/values/set_value_ss_test.dart
index 27f271e..ead90e7 100644
--- a/public/dart/sledge/test/values/set_value_ss_test.dart
+++ b/public/dart/sledge/test/values/set_value_ss_test.dart
@@ -16,11 +16,11 @@
// Returns Fleet of [count] SetValues.
Fleet<SetValue<E>> newFleet(int count) {
- return new Fleet<SetValue<E>>(count, (index) => new SetValue<E>());
+ return Fleet<SetValue<E>>(count, (index) => SetValue<E>());
}
}
-const SetFleetFactory<int> intSetFleetFactory = const SetFleetFactory<int>();
+const SetFleetFactory<int> intSetFleetFactory = SetFleetFactory<int>();
void main() async {
setupLogger();
diff --git a/public/dart/sledge/test/values/set_value_test.dart b/public/dart/sledge/test/values/set_value_test.dart
index a07a182..fe4cecc 100644
--- a/public/dart/sledge/test/values/set_value_test.dart
+++ b/public/dart/sledge/test/values/set_value_test.dart
@@ -13,20 +13,20 @@
setupLogger();
group('Set API coverage', () {
- new SetApiTester<SetValue>(() => new SetValue<int>())
+ SetApiTester<SetValue>(() => SetValue<int>())
..testApi()
..testObserver();
});
test('SetValue add and contains.', () {
- var s = new SetValue<int>();
+ var s = SetValue<int>();
expect(s.contains(0), equals(false));
expect(s.add(0), equals(true));
expect(s.contains(0), equals(true));
});
test('SetValue add twice and contains.', () {
- var s = new SetValue<int>();
+ var s = SetValue<int>();
expect(s.contains(0), equals(false));
expect(s.add(0), equals(true));
expect(s.add(0), equals(false));
@@ -34,7 +34,7 @@
});
test('SetValue remove.', () {
- var s = new SetValue<int>();
+ var s = SetValue<int>();
expect(s.remove(2), equals(false));
expect(s.add(2), equals(true));
expect(s.remove(2), equals(true));
@@ -43,7 +43,7 @@
});
test('SetValue add, put, contains, remove.', () {
- var s = new SetValue<String>();
+ var s = SetValue<String>();
expect(s.contains('-'), equals(false));
expect(s.add('-'), equals(true));
expect(s.add('-'), equals(false));
diff --git a/public/dart/widgets/lib/src/application/application_widget.dart b/public/dart/widgets/lib/src/application/application_widget.dart
index c74edca..fbf8412 100644
--- a/public/dart/widgets/lib/src/application/application_widget.dart
+++ b/public/dart/widgets/lib/src/application/application_widget.dart
@@ -42,7 +42,7 @@
}) : super(key: key);
@override
- _ApplicationWidgetState createState() => new _ApplicationWidgetState();
+ _ApplicationWidgetState createState() => _ApplicationWidgetState();
}
class _ApplicationWidgetState extends State<ApplicationWidget> {
@@ -73,7 +73,7 @@
}
@override
- Widget build(BuildContext context) => new ChildView(
+ Widget build(BuildContext context) => ChildView(
connection: _connection,
hitTestable: widget.hitTestable,
focusable: widget.focusable,
@@ -85,11 +85,11 @@
}
void _launchApp() {
- _applicationController = new ComponentControllerProxy();
+ _applicationController = ComponentControllerProxy();
- Services incomingServices = new Services();
+ Services incomingServices = Services();
widget.launcher.createComponent(
- new LaunchInfo(
+ LaunchInfo(
url: widget.url, directoryRequest: incomingServices.request()),
_applicationController.ctrl.request(),
);
diff --git a/public/dart/widgets/lib/src/application/application_widget_deprecated.dart b/public/dart/widgets/lib/src/application/application_widget_deprecated.dart
index bfea44b..7ccdced 100644
--- a/public/dart/widgets/lib/src/application/application_widget_deprecated.dart
+++ b/public/dart/widgets/lib/src/application/application_widget_deprecated.dart
@@ -42,7 +42,7 @@
}) : super(key: key);
@override
- _ApplicationWidgetState createState() => new _ApplicationWidgetState();
+ _ApplicationWidgetState createState() => _ApplicationWidgetState();
}
class _ApplicationWidgetState extends State<ApplicationWidget> {
@@ -73,7 +73,7 @@
}
@override
- Widget build(BuildContext context) => new ChildView(
+ Widget build(BuildContext context) => ChildView(
connection: _connection,
hitTestable: widget.hitTestable,
focusable: widget.focusable,
@@ -85,11 +85,11 @@
}
void _launchApp() {
- _applicationController = new ComponentControllerProxy();
+ _applicationController = ComponentControllerProxy();
- Services incomingServices = new Services();
+ Services incomingServices = Services();
widget.launcher.createComponent(
- new LaunchInfo(
+ LaunchInfo(
url: widget.url, directoryRequest: incomingServices.request()),
_applicationController.ctrl.request(),
);
diff --git a/public/dart/widgets/lib/src/model/spring_model.dart b/public/dart/widgets/lib/src/model/spring_model.dart
index 5334ce5..a503d0c 100644
--- a/public/dart/widgets/lib/src/model/spring_model.dart
+++ b/public/dart/widgets/lib/src/model/spring_model.dart
@@ -8,7 +8,7 @@
export 'ticking_model.dart' show ScopedModel, Model, ScopedModelDescendant;
const RK4SpringDescription _kSimulationDesc =
- const RK4SpringDescription(tension: 450.0, friction: 50.0);
+ RK4SpringDescription(tension: 450.0, friction: 50.0);
/// Models the progress of a spring simulation.
class SpringModel extends TickingModel {
@@ -19,7 +19,7 @@
/// Constructor.
SpringModel({this.springDescription = _kSimulationDesc}) {
- _simulation = new RK4SpringSimulation(
+ _simulation = RK4SpringSimulation(
initValue: 0.0,
desc: springDescription,
);
@@ -27,7 +27,7 @@
/// Jumps the simulation to [value].
void jump(double value) {
- _simulation = new RK4SpringSimulation(
+ _simulation = RK4SpringSimulation(
initValue: value,
desc: springDescription,
);
diff --git a/public/dart/widgets/lib/src/model/ticking_model.dart b/public/dart/widgets/lib/src/model/ticking_model.dart
index 2336549..e11f9f4 100644
--- a/public/dart/widgets/lib/src/model/ticking_model.dart
+++ b/public/dart/widgets/lib/src/model/ticking_model.dart
@@ -21,7 +21,7 @@
return;
}
if (handleTick(0.0)) {
- _ticker = new Ticker(_onTick);
+ _ticker = Ticker(_onTick);
_lastTick = Duration.zero;
_ticker.start();
}
diff --git a/public/dart/widgets/lib/src/model/tracing_spring_model.dart b/public/dart/widgets/lib/src/model/tracing_spring_model.dart
index 541f465..42bf224 100644
--- a/public/dart/widgets/lib/src/model/tracing_spring_model.dart
+++ b/public/dart/widgets/lib/src/model/tracing_spring_model.dart
@@ -11,7 +11,7 @@
export 'spring_model.dart' show ScopedModel, Model, ScopedModelDescendant;
const RK4SpringDescription _kSimulationDesc =
- const RK4SpringDescription(tension: 450.0, friction: 50.0);
+ RK4SpringDescription(tension: 450.0, friction: 50.0);
/// Models the progress of a spring simulation.
class TracingSpringModel extends SpringModel {
@@ -24,7 +24,7 @@
String traceName = 'TracingSpringModel',
Logger cobaltLogger,
Map<double, int> targetToCobaltMetricIdMap = const <double, int>{},
- }) : _frameRateTracer = new FrameRateTracer(
+ }) : _frameRateTracer = FrameRateTracer(
name: traceName,
cobaltLogger: cobaltLogger,
),
diff --git a/public/dart/widgets/lib/src/utils/frame_rate_tracer.dart b/public/dart/widgets/lib/src/utils/frame_rate_tracer.dart
index 19f5814..b826759 100644
--- a/public/dart/widgets/lib/src/utils/frame_rate_tracer.dart
+++ b/public/dart/widgets/lib/src/utils/frame_rate_tracer.dart
@@ -17,7 +17,7 @@
/// an observation to cobalt.
final cobalt.Logger cobaltLogger;
- DateTime _animationStart = new DateTime.now();
+ DateTime _animationStart = DateTime.now();
int _frames = 0;
String _currentTargetName;
int _currentCobaltMetricId;
@@ -29,7 +29,7 @@
void start({String targetName, int cobaltMetricId}) {
_currentTargetName = targetName;
_currentCobaltMetricId = cobaltMetricId;
- _animationStart = new DateTime.now();
+ _animationStart = DateTime.now();
_frames = 0;
}
@@ -44,7 +44,7 @@
return;
}
int microSeconds =
- new DateTime.now().difference(_animationStart).inMicroseconds;
+ DateTime.now().difference(_animationStart).inMicroseconds;
double frameRate = _frames.toDouble() * 1000000.0 / microSeconds.toDouble();
String prefix = _currentTargetName?.isEmpty ?? true
? '$name'
diff --git a/public/dart/widgets/lib/src/utils/pointer_events_listener.dart b/public/dart/widgets/lib/src/utils/pointer_events_listener.dart
index 9370ce9..33c5dc1 100644
--- a/public/dart/widgets/lib/src/utils/pointer_events_listener.dart
+++ b/public/dart/widgets/lib/src/utils/pointer_events_listener.dart
@@ -15,7 +15,7 @@
class PointerEventsListener extends PointerCaptureListenerHack {
// Holds the fidl binding to receive pointer events.
final PointerCaptureListenerHackBinding _pointerCaptureListenerBinding =
- new PointerCaptureListenerHackBinding();
+ PointerCaptureListenerHackBinding();
// Holds the last [PointerEvent] mapped to its pointer id. This is used to
// determine the correct [PointerDataPacket] to generate at boundary condition
@@ -69,7 +69,7 @@
}
PointerEvent _clone(PointerEvent event, [PointerEventPhase phase]) {
- return new PointerEvent(
+ return PointerEvent(
buttons: event.buttons,
deviceId: event.deviceId,
eventTime: event.eventTime,
@@ -184,10 +184,10 @@
}
// Convert from PointerEvent to PointerData.
- final data = new ui.PointerData(
+ final data = ui.PointerData(
buttons: event.buttons,
device: event.pointerId,
- timeStamp: new Duration(microseconds: event.eventTime ~/ 1000),
+ timeStamp: Duration(microseconds: event.eventTime ~/ 1000),
change: _changeFromPointerEvent(event),
kind: _kindFromPointerEvent(event),
physicalX: event.x * ui.window.devicePixelRatio,
diff --git a/public/dart/widgets/lib/src/utils/pointer_events_listener_deprecated.dart b/public/dart/widgets/lib/src/utils/pointer_events_listener_deprecated.dart
index ab73c9e..a659d13 100644
--- a/public/dart/widgets/lib/src/utils/pointer_events_listener_deprecated.dart
+++ b/public/dart/widgets/lib/src/utils/pointer_events_listener_deprecated.dart
@@ -13,7 +13,7 @@
class PointerEventsListener implements PointerCaptureListenerHack {
// Holds the fidl binding to receive pointer events.
final PointerCaptureListenerHackBinding _pointerCaptureListenerBinding =
- new PointerCaptureListenerHackBinding();
+ PointerCaptureListenerHackBinding();
// Holds the last [PointerEvent] mapped to its pointer id. This is used to
// determine the correct [PointerDataPacket] to generate at boundary condition
@@ -64,7 +64,7 @@
}
PointerEvent _clone(PointerEvent event, [PointerEventPhase phase]) {
- return new PointerEvent(
+ return PointerEvent(
buttons: event.buttons,
deviceId: event.deviceId,
eventTime: event.eventTime,
@@ -91,7 +91,7 @@
Timeline.startSync('PointerEventsListener.onPointerEvent');
final packet = _getPacket(event);
if (packet != null) {
- _originalCallback(new ui.PointerDataPacket(data: [packet]));
+ _originalCallback(ui.PointerDataPacket(data: [packet]));
}
Timeline.finishSync();
}
@@ -179,10 +179,10 @@
}
// Convert from PointerEvent to PointerData.
- final data = new ui.PointerData(
+ final data = ui.PointerData(
buttons: event.buttons,
device: event.pointerId,
- timeStamp: new Duration(microseconds: event.eventTime ~/ 1000),
+ timeStamp: Duration(microseconds: event.eventTime ~/ 1000),
change: _changeFromPointerEvent(event),
kind: _kindFromPointerEvent(event),
physicalX: event.x * ui.window.devicePixelRatio,
diff --git a/public/dart/widgets/lib/src/widgets/alphatar.dart b/public/dart/widgets/lib/src/widgets/alphatar.dart
index ac7cc61..64b1610 100644
--- a/public/dart/widgets/lib/src/widgets/alphatar.dart
+++ b/public/dart/widgets/lib/src/widgets/alphatar.dart
@@ -72,19 +72,19 @@
}) {
assert(avatarUrl != null || letter != null);
assert(retry != null);
- return new Alphatar(
+ return Alphatar(
key: key,
avatarImage: avatarUrl != null && avatarUrl.isNotEmpty
? avatarUrl.startsWith('http')
- ? new Image(
+ ? Image(
image: retry
- ? new NetworkImageWithRetry(avatarUrl)
- : new NetworkImage(avatarUrl),
+ ? NetworkImageWithRetry(avatarUrl)
+ : NetworkImage(avatarUrl),
width: size,
height: size,
fit: BoxFit.cover,
)
- : new Image.asset(
+ : Image.asset(
avatarUrl,
width: size,
height: size,
@@ -106,7 +106,7 @@
Color backgroundColor,
}) {
assert(name != null);
- return new Alphatar(
+ return Alphatar(
key: key,
avatarImage: avatarImage,
letter: name.isNotEmpty ? name[0] : '',
@@ -125,7 +125,7 @@
bool retry = true,
}) {
assert(name != null);
- return new Alphatar.withUrl(
+ return Alphatar.withUrl(
key: key,
avatarUrl: avatarUrl,
letter: name.isNotEmpty ? name[0] : '',
@@ -146,7 +146,7 @@
// https://github.com/flutter/flutter/issues/6229
Widget image;
if (avatarImage != null) {
- image = new Stack(
+ image = Stack(
fit: StackFit.passthrough,
children: <Widget>[
_buildLetter(),
@@ -157,10 +157,10 @@
image = _buildLetter();
}
- return new Container(
+ return Container(
width: size,
height: size,
- child: new ClipOval(
+ child: ClipOval(
child: image,
),
);
@@ -169,21 +169,21 @@
Widget _buildLetter() {
String text = letter?.toUpperCase() ?? '';
- return new Container(
+ return Container(
alignment: FractionalOffset.center,
- decoration: new BoxDecoration(
+ decoration: BoxDecoration(
color: text.isNotEmpty ? backgroundColor : Colors.transparent,
shape: BoxShape.circle,
),
child: text.isNotEmpty
- ? new Text(
+ ? Text(
text,
- style: new TextStyle(
+ style: TextStyle(
color: Colors.white,
fontSize: size / 2.0,
),
)
- : new Icon(
+ : Icon(
Icons.error,
size: size,
color: Colors.red,
@@ -192,7 +192,7 @@
}
static Color _pickRandomColor() {
- return _kAllowedColors[new Random().nextInt(_kAllowedColors.length)];
+ return _kAllowedColors[Random().nextInt(_kAllowedColors.length)];
}
static Color _pickColorForString(String str) {
diff --git a/public/dart/widgets/lib/src/widgets/fuchsia_spinner.dart b/public/dart/widgets/lib/src/widgets/fuchsia_spinner.dart
index 8a5d4f0..c43c4cc 100644
--- a/public/dart/widgets/lib/src/widgets/fuchsia_spinner.dart
+++ b/public/dart/widgets/lib/src/widgets/fuchsia_spinner.dart
@@ -11,9 +11,9 @@
const double _kInitialFractionalDiameter = 1.0 / 1.2;
const double _kTargetFractionalDiameter = 1.0;
const double _kRotationRadians = 6 * math.pi;
-const Curve _kDefaultCurve = const Cubic(0.3, 0.1, 0.3, 0.9);
+const Curve _kDefaultCurve = Cubic(0.3, 0.1, 0.3, 0.9);
-const Duration _kAnimationDuration = const Duration(seconds: 2);
+const Duration _kAnimationDuration = Duration(seconds: 2);
/// The spinner used by fuchsia flutter apps.
class FuchsiaSpinner extends StatefulWidget {
@@ -26,21 +26,21 @@
});
@override
- _FuchsiaSpinnerState createState() => new _FuchsiaSpinnerState();
+ _FuchsiaSpinnerState createState() => _FuchsiaSpinnerState();
}
class _FuchsiaSpinnerState extends State<FuchsiaSpinner>
with SingleTickerProviderStateMixin {
- final Tween<double> _fractionalWidthTween = new Tween<double>(
+ final Tween<double> _fractionalWidthTween = Tween<double>(
begin: _kInitialFractionalDiameter,
end: _kTargetFractionalDiameter,
);
- final Tween<double> _fractionalHeightTween = new Tween<double>(
+ final Tween<double> _fractionalHeightTween = Tween<double>(
begin: _kInitialFractionalDiameter,
end: _kInitialFractionalDiameter * 2 / 3,
);
- final Curve _firstHalfCurve = const Cubic(0.75, 0.25, 0.25, 1.0);
+ final Curve _firstHalfCurve = Cubic(0.75, 0.25, 0.25, 1.0);
final Curve _secondHalfCurve = _kDefaultCurve;
AnimationController _controller;
@@ -48,7 +48,7 @@
@override
void initState() {
super.initState();
- _controller = new AnimationController(
+ _controller = AnimationController(
vsync: this,
duration: _kAnimationDuration,
)..repeat(period: _kAnimationDuration);
@@ -61,13 +61,13 @@
}
@override
- Widget build(BuildContext context) => new LayoutBuilder(
+ Widget build(BuildContext context) => LayoutBuilder(
builder: (_, BoxConstraints constraints) {
double maxDiameter = math.min(
constraints.maxWidth,
constraints.maxHeight,
);
- return new AnimatedBuilder(
+ return AnimatedBuilder(
animation: _controller,
builder: (_, __) {
double tweenProgress = _tweenValue;
@@ -79,24 +79,24 @@
_fractionalHeightTween.transform(
tweenProgress,
);
- return new Transform(
+ return Transform(
alignment: FractionalOffset.center,
- transform: new Matrix4.rotationZ(
+ transform: Matrix4.rotationZ(
_kDefaultCurve.transform(_controller.value) *
_kRotationRadians,
),
- child: new Center(
- child: new Container(
+ child: Center(
+ child: Container(
width: width,
height: height,
- child: new Material(
+ child: Material(
elevation: tweenProgress * 10.0,
color: Color.lerp(
widget.color.withOpacity(0.8),
widget.color,
tweenProgress,
),
- borderRadius: new BorderRadius.circular(width / 2),
+ borderRadius: BorderRadius.circular(width / 2),
),
),
),
diff --git a/public/dart/widgets/lib/src/widgets/future_widget.dart b/public/dart/widgets/lib/src/widgets/future_widget.dart
index 8fd063d..9b5d8b9 100644
--- a/public/dart/widgets/lib/src/widgets/future_widget.dart
+++ b/public/dart/widgets/lib/src/widgets/future_widget.dart
@@ -31,7 +31,7 @@
}) : assert(child != null);
@override
- _FutureWidgetState createState() => new _FutureWidgetState();
+ _FutureWidgetState createState() => _FutureWidgetState();
}
class _FutureWidgetState extends State<FutureWidget> {
diff --git a/public/dart/widgets/lib/src/widgets/lottie_player.dart b/public/dart/widgets/lib/src/widgets/lottie_player.dart
index 7b47d2b..59b694e 100644
--- a/public/dart/widgets/lib/src/widgets/lottie_player.dart
+++ b/public/dart/widgets/lib/src/widgets/lottie_player.dart
@@ -51,7 +51,7 @@
}) : super(key: key);
@override
- _LottiePlayerState createState() => new _LottiePlayerState();
+ _LottiePlayerState createState() => _LottiePlayerState();
}
class _LottiePlayerState extends State<LottiePlayer> {
diff --git a/public/dart/widgets/lib/src/widgets/settings_item.dart b/public/dart/widgets/lib/src/widgets/settings_item.dart
index b8292ba..49f3ab2 100644
--- a/public/dart/widgets/lib/src/widgets/settings_item.dart
+++ b/public/dart/widgets/lib/src/widgets/settings_item.dart
@@ -33,23 +33,23 @@
@override
Widget build(BuildContext context) {
- return new InkWell(
+ return InkWell(
onTap: onTap,
- child: new Container(
+ child: Container(
height: 64.0 * scale,
width: 480.0 * scale,
- child: new Row(
+ child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[_buildLogo(), _buildText()],
)));
}
Widget _buildLogo() {
- return new Container(
- padding: new EdgeInsets.only(
+ return Container(
+ padding: EdgeInsets.only(
right: 16.0 * scale,
),
- child: new Image.asset(
+ child: Image.asset(
iconUrl,
height: 48.0 * scale,
width: 48.0 * scale,
@@ -57,25 +57,25 @@
}
Widget _buildText() {
- final Text text = new Text(label, style: _textStyle(scale));
+ final Text text = Text(label, style: _textStyle(scale));
if (details == null) {
return text;
}
- return new Column(
+ return Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
text,
- new Text(details, style: _textStyle(scale, isError: isError))
+ Text(details, style: _textStyle(scale, isError: isError))
],
);
}
}
-TextStyle _textStyle(double scale, {bool isError = false}) => new TextStyle(
+TextStyle _textStyle(double scale, {bool isError = false}) => TextStyle(
color: isError ? Colors.grey[900] : Colors.redAccent,
fontSize: 24.0 * scale,
fontWeight: FontWeight.w200,
diff --git a/public/dart/widgets/lib/src/widgets/window_media_query.dart b/public/dart/widgets/lib/src/widgets/window_media_query.dart
index ac9a3f2..efa36ce 100644
--- a/public/dart/widgets/lib/src/widgets/window_media_query.dart
+++ b/public/dart/widgets/lib/src/widgets/window_media_query.dart
@@ -18,7 +18,7 @@
const WindowMediaQuery({this.onWindowMetricsChanged, this.child});
@override
- _WindowMediaQueryState createState() => new _WindowMediaQueryState();
+ _WindowMediaQueryState createState() => _WindowMediaQueryState();
}
class _WindowMediaQueryState extends State<WindowMediaQuery>
@@ -36,8 +36,8 @@
}
@override
- Widget build(BuildContext context) => new MediaQuery(
- data: new MediaQueryData.fromWindow(ui.window),
+ Widget build(BuildContext context) => MediaQuery(
+ data: MediaQueryData.fromWindow(ui.window),
child: widget.child,
);
diff --git a/public/dart/widgets/test/alphatar_test.dart b/public/dart/widgets/test/alphatar_test.dart
index b4fd594..23e5d7d 100644
--- a/public/dart/widgets/test/alphatar_test.dart
+++ b/public/dart/widgets/test/alphatar_test.dart
@@ -20,9 +20,9 @@
await HttpOverrides.runZoned(() async {
// First, try without providing a letter.
await tester.pumpWidget(
- new MaterialApp(
- home: new Material(
- child: new Alphatar.withUrl(
+ MaterialApp(
+ home: Material(
+ child: Alphatar.withUrl(
avatarUrl: profileUrl,
retry: false,
),
@@ -35,9 +35,9 @@
// Try again with a letter provided.
await tester.pumpWidget(
- new MaterialApp(
- home: new Material(
- child: new Alphatar.withUrl(
+ MaterialApp(
+ home: Material(
+ child: Alphatar.withUrl(
avatarUrl: profileUrl,
letter: 'L',
retry: false,
@@ -55,9 +55,9 @@
'Alphatar should display the fall-back letter, '
'when the image is not provided', (WidgetTester tester) async {
await tester.pumpWidget(
- new MaterialApp(
- home: new Material(
- child: new Alphatar(letter: 'L'),
+ MaterialApp(
+ home: Material(
+ child: Alphatar(letter: 'L'),
),
),
);
@@ -69,8 +69,8 @@
test('Alphtars for the same name should have the same background color.', () {
String name = 'John Doe';
- Alphatar a1 = new Alphatar.fromName(name: name);
- Alphatar a2 = new Alphatar.fromName(name: name);
+ Alphatar a1 = Alphatar.fromName(name: name);
+ Alphatar a2 = Alphatar.fromName(name: name);
expect(a1.backgroundColor, equals(a2.backgroundColor));
});
}
diff --git a/public/dart/widgets/test/providers_test.dart b/public/dart/widgets/test/providers_test.dart
index d1afc33..5151650 100644
--- a/public/dart/widgets/test/providers_test.dart
+++ b/public/dart/widgets/test/providers_test.dart
@@ -61,14 +61,14 @@
// Must wait one async cycle for value to propagate.
streamController.add('stream');
- await new Future.delayed(Duration.zero);
+ await Future.delayed(Duration.zero);
expect(providers.getFromType(String).get(buildContext), 'stream');
expect(providers.getFromType(String).get(buildContext), 'stream');
// Must wait one async cycle for value to propagate.
streamController.add('stream2');
- await new Future.delayed(Duration.zero);
+ await Future.delayed(Duration.zero);
expect(providers.getFromType(String).get(buildContext), 'stream2');
diff --git a/public/dart/widgets/test/rk4_spring_simulation_test.dart b/public/dart/widgets/test/rk4_spring_simulation_test.dart
index 9a5767b..2e72d0a 100644
--- a/public/dart/widgets/test/rk4_spring_simulation_test.dart
+++ b/public/dart/widgets/test/rk4_spring_simulation_test.dart
@@ -7,12 +7,12 @@
void main() {
test('initial value', () {
- final RK4SpringSimulation x = new RK4SpringSimulation(initValue: 0.0);
+ final RK4SpringSimulation x = RK4SpringSimulation(initValue: 0.0);
expect(x.value, equals(0.0));
});
test('interim value', () {
- final RK4SpringSimulation x = new RK4SpringSimulation(initValue: 0.0);
+ final RK4SpringSimulation x = RK4SpringSimulation(initValue: 0.0);
expect(x.value, equals(0.0));
x.target = 1.0;
expect(x.value, equals(0.0));
@@ -22,7 +22,7 @@
});
test('final value', () {
- final RK4SpringSimulation x = new RK4SpringSimulation(initValue: 0.0);
+ final RK4SpringSimulation x = RK4SpringSimulation(initValue: 0.0);
expect(x.value, equals(0.0));
x.target = 1.0;
expect(x.value, equals(0.0));
@@ -31,10 +31,10 @@
});
test('more friction takes longer to complete', () {
- final RK4SpringSimulation x1 = new RK4SpringSimulation(
- desc: const RK4SpringDescription(tension: 100.0, friction: 10.0));
- final RK4SpringSimulation x2 = new RK4SpringSimulation(
- desc: const RK4SpringDescription(tension: 100.0, friction: 50.0));
+ final RK4SpringSimulation x1 = RK4SpringSimulation(
+ desc: RK4SpringDescription(tension: 100.0, friction: 10.0));
+ final RK4SpringSimulation x2 = RK4SpringSimulation(
+ desc: RK4SpringDescription(tension: 100.0, friction: 50.0));
x1.target = 100.0;
x2.target = 100.0;
x1.elapseTime(1.0);
@@ -43,10 +43,10 @@
});
test('less tension takes longer to complete', () {
- final RK4SpringSimulation x1 = new RK4SpringSimulation(
- desc: const RK4SpringDescription(tension: 1000.0, friction: 50.0));
- final RK4SpringSimulation x2 = new RK4SpringSimulation(
- desc: const RK4SpringDescription(tension: 500.0, friction: 50.0));
+ final RK4SpringSimulation x1 = RK4SpringSimulation(
+ desc: RK4SpringDescription(tension: 1000.0, friction: 50.0));
+ final RK4SpringSimulation x2 = RK4SpringSimulation(
+ desc: RK4SpringDescription(tension: 500.0, friction: 50.0));
x1.target = 100.0;
x2.target = 100.0;
x1.elapseTime(0.1);
diff --git a/public/dart/zircon/lib/src/channel.dart b/public/dart/zircon/lib/src/channel.dart
index 2d2cdd6..427bed8 100644
--- a/public/dart/zircon/lib/src/channel.dart
+++ b/public/dart/zircon/lib/src/channel.dart
@@ -17,9 +17,9 @@
factory Channel.fromFile(String path) {
HandleResult r = System.channelFromFile(path);
if (r.status != ZX.OK) {
- throw new ZxStatusException(r.status, getStringForStatus(r.status));
+ throw ZxStatusException(r.status, getStringForStatus(r.status));
}
- return new Channel(r.handle);
+ return Channel(r.handle);
}
// Signals
@@ -56,10 +56,10 @@
factory ChannelPair() {
final HandlePairResult result = System.channelCreate();
if (result.status == ZX.OK) {
- return new ChannelPair._(
- result.status, new Channel(result.first), new Channel(result.second));
+ return ChannelPair._(
+ result.status, Channel(result.first), Channel(result.second));
} else {
- return new ChannelPair._(result.status, null, null);
+ return ChannelPair._(result.status, null, null);
}
}
diff --git a/public/dart/zircon/lib/src/channel_reader.dart b/public/dart/zircon/lib/src/channel_reader.dart
index 3457eaa..2386c52 100644
--- a/public/dart/zircon/lib/src/channel_reader.dart
+++ b/public/dart/zircon/lib/src/channel_reader.dart
@@ -32,7 +32,7 @@
void bind(Channel channel) {
if (isBound) {
- throw new ZirconApiError('ChannelReader is already bound.');
+ throw ZirconApiError('ChannelReader is already bound.');
}
_channel = channel;
_asyncWait();
@@ -40,7 +40,7 @@
Channel unbind() {
if (!isBound) {
- throw new ZirconApiError('ChannelReader is not bound');
+ throw ZirconApiError('ChannelReader is not bound');
}
_waiter?.cancel();
final Channel result = _channel;
@@ -82,7 +82,7 @@
assert(isBound);
if (status != ZX.OK) {
close();
- _errorSoon(new ChannelReaderError(
+ _errorSoon(ChannelReaderError(
'Wait completed with status ${getStringForStatus(status)} ($status)',
null));
return;
@@ -99,7 +99,7 @@
}
} else if ((pending & Channel.PEER_CLOSED) != 0) {
close();
- _errorSoon(new ChannelReaderError('Peer unexpectedly closed', null));
+ _errorSoon(ChannelReaderError('Peer unexpectedly closed', null));
}
// ignore: avoid_catching_errors
} on Error catch (_) {
@@ -111,7 +111,7 @@
} catch (e, s) {
print(e);
close();
- _errorSoon(new ChannelReaderError(e, s));
+ _errorSoon(ChannelReaderError(e, s));
}
}
}
diff --git a/public/dart/zircon/lib/src/fakes/handle.dart b/public/dart/zircon/lib/src/fakes/handle.dart
index 546d9e3..71e7cd4 100644
--- a/public/dart/zircon/lib/src/fakes/handle.dart
+++ b/public/dart/zircon/lib/src/fakes/handle.dart
@@ -32,12 +32,12 @@
}
HandleWaiter asyncWait(int signals, AsyncWaitCallback callback) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'Handle.asyncWait() is not implemented on this platform.');
}
Handle duplicate(int options) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'Handle.duplicate() is not implemented on this platform.');
}
}
diff --git a/public/dart/zircon/lib/src/fakes/system.dart b/public/dart/zircon/lib/src/fakes/system.dart
index 8c838a3..dfcb77b 100644
--- a/public/dart/zircon/lib/src/fakes/system.dart
+++ b/public/dart/zircon/lib/src/fakes/system.dart
@@ -104,92 +104,92 @@
// Channel operations.
static HandlePairResult channelCreate([int options = 0]) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.channelCreate() is not implemented on this platform.');
}
static HandleResult channelFromFile(String path) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.channelFromFile() is not implemented on this platform.');
}
static int channelWrite(Handle channel, ByteData data, List<Handle> handles) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.channelWrite() is not implemented on this platform.');
}
static ReadResult channelQueryAndRead(Handle channel) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.channelQueryAndRead() is not implemented on this platform.');
}
// Eventpair operations.
static HandlePairResult eventpairCreate([int options = 0]) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.eventpairCreate() is not implemented on this platform.');
}
// Socket operations.
static HandlePairResult socketCreate([int options = 0]) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.socketCreate() is not implemented on this platform.');
}
static WriteResult socketWrite(Handle socket, ByteData data, int options) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.socketWrite() is not implemented on this platform.');
}
static ReadResult socketRead(Handle socket, int size) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.socketRead() is not implemented on this platform.');
}
// Vmo operations.
static HandleResult vmoCreate(int size, [int options = 0]) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.vmoCreate() is not implemented on this platform.');
}
static FromFileResult vmoFromFile(String path) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.vmoFromFile() is not implemented on this platform.');
}
static GetSizeResult vmoGetSize(Handle vmo) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.vmoGetSize() is not implemented on this platform.');
}
static int vmoSetSize(Handle vmo, int size) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.vmoSetSize() is not implemented on this platform.');
}
static int vmoWrite(Handle vmo, int offset, ByteData bytes) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.vmoWrite() is not implemented on this platform.');
}
static ReadResult vmoRead(Handle vmo, int offset, int size) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.vmoRead() is not implemented on this platform.');
}
static MapResult vmoMap(Handle vmo) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.vmoMap() is not implemented on this platform.');
}
// Time operations.
static int clockGet(int clockId) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.timeGet() is not implemented on this platform.');
}
// System operations.
static int reboot() {
- throw new UnimplementedError(
+ throw UnimplementedError(
'System.reboot() is not implemented on this platform.');
}
}
diff --git a/public/dart/zircon/lib/src/socket.dart b/public/dart/zircon/lib/src/socket.dart
index 549986e..d5dab12 100644
--- a/public/dart/zircon/lib/src/socket.dart
+++ b/public/dart/zircon/lib/src/socket.dart
@@ -55,10 +55,10 @@
factory SocketPair([int options = Socket.STREAM]) {
final HandlePairResult result = System.socketCreate(options);
if (result.status == ZX.OK) {
- return new SocketPair._(
- result.status, new Socket(result.first), new Socket(result.second));
+ return SocketPair._(
+ result.status, Socket(result.first), Socket(result.second));
} else {
- return new SocketPair._(result.status, null, null);
+ return SocketPair._(result.status, null, null);
}
}
diff --git a/public/dart/zircon/lib/src/socket_reader.dart b/public/dart/zircon/lib/src/socket_reader.dart
index 7231b0c..ef2068b 100644
--- a/public/dart/zircon/lib/src/socket_reader.dart
+++ b/public/dart/zircon/lib/src/socket_reader.dart
@@ -32,7 +32,7 @@
void bind(Socket socket) {
if (isBound) {
- throw new ZirconApiError('SocketReader is already bound.');
+ throw ZirconApiError('SocketReader is already bound.');
}
_socket = socket;
_asyncWait();
@@ -40,7 +40,7 @@
Socket unbind() {
if (!isBound) {
- throw new ZirconApiError('SocketReader is not bound');
+ throw ZirconApiError('SocketReader is not bound');
}
_waiter.cancel();
final Socket result = _socket;
@@ -82,7 +82,7 @@
assert(isBound);
if (status != ZX.OK) {
close();
- _errorSoon(new SocketReaderError(
+ _errorSoon(SocketReaderError(
'Wait completed with status ${getStringForStatus(status)} ($status)',
null));
return;
@@ -110,7 +110,7 @@
// ignore: avoid_catches_without_on_clauses
} catch (e, s) {
close();
- _errorSoon(new SocketReaderError(e, s));
+ _errorSoon(SocketReaderError(e, s));
}
}
}
diff --git a/public/dart/zircon/lib/src/vmo.dart b/public/dart/zircon/lib/src/vmo.dart
index 3f10736..25139b3 100644
--- a/public/dart/zircon/lib/src/vmo.dart
+++ b/public/dart/zircon/lib/src/vmo.dart
@@ -55,13 +55,13 @@
Uint8List map() {
if (handle == null) {
const int status = ZX.ERR_INVALID_ARGS;
- throw new ZxStatusException(status, getStringForStatus(status));
+ throw ZxStatusException(status, getStringForStatus(status));
}
MapResult r = System.vmoMap(handle);
if (r.status != ZX.OK) {
- throw new ZxStatusException(r.status, getStringForStatus(r.status));
+ throw ZxStatusException(r.status, getStringForStatus(r.status));
}
- return new UnmodifiableUint8ListView(r.data);
+ return UnmodifiableUint8ListView(r.data);
}
}
@@ -78,18 +78,18 @@
factory SizedVmo.fromFile(String path) {
FromFileResult r = System.vmoFromFile(path);
if (r.status != ZX.OK) {
- throw new ZxStatusException(r.status, getStringForStatus(r.status));
+ throw ZxStatusException(r.status, getStringForStatus(r.status));
}
- return new SizedVmo(r.handle, r.numBytes);
+ return SizedVmo(r.handle, r.numBytes);
}
/// Constructs a VMO using the given [bytes]. The returned Vmo is read-only.
factory SizedVmo.fromUint8List(Uint8List bytes) {
HandleResult r = System.vmoCreate(bytes.length);
if (r.status != ZX.OK) {
- throw new ZxStatusException(r.status, getStringForStatus(r.status));
+ throw ZxStatusException(r.status, getStringForStatus(r.status));
}
- return new SizedVmo(r.handle, bytes.length)
+ return SizedVmo(r.handle, bytes.length)
..write(bytes.buffer.asByteData());
}
diff --git a/public/lib/app/dart/app.dart b/public/lib/app/dart/app.dart
index eabf9bd..68f4c64 100644
--- a/public/lib/app/dart/app.dart
+++ b/public/lib/app/dart/app.dart
@@ -26,10 +26,10 @@
StartupContext();
- final EnvironmentProxy environment = new EnvironmentProxy();
- final LauncherProxy launcher = new LauncherProxy();
- final ServiceProviderProxy environmentServices = new ServiceProviderProxy();
- final Outgoing outgoingServices = new Outgoing();
+ final EnvironmentProxy environment = EnvironmentProxy();
+ final LauncherProxy launcher = LauncherProxy();
+ final ServiceProviderProxy environmentServices = ServiceProviderProxy();
+ final Outgoing outgoingServices = Outgoing();
factory StartupContext.fromStartupInfo() {
if (_context != null) {
@@ -37,13 +37,13 @@
}
initialTrace = StackTrace.current;
- final StartupContext context = new StartupContext();
+ final StartupContext context = StartupContext();
final Handle environmentHandle = MxStartupInfo.takeEnvironment();
if (environmentHandle != null) {
context.environment
..ctrl.bind(
- new InterfaceHandle<Environment>(new Channel(environmentHandle)))
+ InterfaceHandle<Environment>(Channel(environmentHandle)))
..getLauncher(context.launcher.ctrl.request())
..getServices(context.environmentServices.ctrl.request());
}
@@ -90,9 +90,9 @@
/// Deprecated! Use package:fuchsia_services/services.dart instead
InterfaceHandle<T> connectToServiceByName<T>(
ServiceProvider serviceProvider, String serviceName) {
- final ChannelPair pair = new ChannelPair();
+ final ChannelPair pair = ChannelPair();
serviceProvider.connectToService(serviceName, pair.first);
- return new InterfaceHandle<T>(pair.second);
+ return InterfaceHandle<T>(pair.second);
}
typedef ServiceConnector<T> = void Function(InterfaceRequest<T> request);
@@ -103,7 +103,7 @@
/// Deprecated! Use package:fuchsia_services/services.dart instead
class ServiceProviderImpl extends ServiceProvider {
- final ServiceProviderBinding _binding = new ServiceProviderBinding();
+ final ServiceProviderBinding _binding = ServiceProviderBinding();
void bind(InterfaceRequest<ServiceProvider> interfaceRequest) {
_binding.bind(this, interfaceRequest);
@@ -120,7 +120,7 @@
void addServiceForName<T>(ServiceConnector<T> connector, String serviceName) {
_connectorThunks[serviceName] = (Channel channel) {
- connector(new InterfaceRequest<T>(channel));
+ connector(InterfaceRequest<T>(channel));
};
}
@@ -130,7 +130,7 @@
if (connectorThunk != null) {
connectorThunk(channel);
} else if (defaultConnector != null) {
- defaultConnector(serviceName, new InterfaceRequest<dynamic>(channel));
+ defaultConnector(serviceName, InterfaceRequest<dynamic>(channel));
} else {
channel.close();
}
@@ -160,10 +160,10 @@
}
InterfaceHandle<T> connectToServiceByName<T>(String serviceName) {
- final ChannelPair pair = new ChannelPair();
+ final ChannelPair pair = ChannelPair();
_proxy.open(
_openFlags, _openMode, serviceName, InterfaceRequest<Node>(pair.first));
- return new InterfaceHandle<T>(pair.second);
+ return InterfaceHandle<T>(pair.second);
}
void close() {
diff --git a/public/lib/app/dart/app_async.dart b/public/lib/app/dart/app_async.dart
index 3305c69..b48ce38 100644
--- a/public/lib/app/dart/app_async.dart
+++ b/public/lib/app/dart/app_async.dart
@@ -22,10 +22,10 @@
StartupContext();
- final EnvironmentProxy environment = new EnvironmentProxy();
- final LauncherProxy launcher = new LauncherProxy();
- final ServiceProviderProxy environmentServices = new ServiceProviderProxy();
- final Outgoing outgoingServices = new Outgoing();
+ final EnvironmentProxy environment = EnvironmentProxy();
+ final LauncherProxy launcher = LauncherProxy();
+ final ServiceProviderProxy environmentServices = ServiceProviderProxy();
+ final Outgoing outgoingServices = Outgoing();
factory StartupContext.fromStartupInfo() {
if (_context != null) {
@@ -37,13 +37,13 @@
"WARNING: app.dart's StartupContext was created at:\n${sync_app.StartupContext.initialTrace}");
}
- final StartupContext context = new StartupContext();
+ final StartupContext context = StartupContext();
final Handle environmentHandle = MxStartupInfo.takeEnvironment();
if (environmentHandle != null) {
context.environment
..ctrl.bind(
- new InterfaceHandle<Environment>(new Channel(environmentHandle)))
+ InterfaceHandle<Environment>(Channel(environmentHandle)))
..getLauncher(context.launcher.ctrl.request())
..getServices(context.environmentServices.ctrl.request());
}
@@ -82,7 +82,7 @@
ServiceProvider serviceProvider, AsyncProxyController<T> controller) async {
final String serviceName = controller.$serviceName;
if (serviceName == null) {
- throw new Exception(
+ throw Exception(
"${controller.$interfaceName}'s controller.\$serviceName"
' must not be null. Check the FIDL file for a missing [Discoverable]');
}
@@ -93,9 +93,9 @@
/// Deprecated! Use package:fuchsia_services/services.dart instead
InterfaceHandle<T> connectToServiceByName<T>(
ServiceProvider serviceProvider, String serviceName) {
- final ChannelPair pair = new ChannelPair();
+ final ChannelPair pair = ChannelPair();
serviceProvider.connectToService(serviceName, pair.first);
- return new InterfaceHandle<T>(pair.second);
+ return InterfaceHandle<T>(pair.second);
}
typedef ServiceConnector<T> = void Function(InterfaceRequest<T> request);
@@ -106,7 +106,7 @@
/// Deprecated! Use package:fuchsia_services/services.dart instead
class ServiceProviderImpl extends ServiceProvider {
- final ServiceProviderBinding _binding = new ServiceProviderBinding();
+ final ServiceProviderBinding _binding = ServiceProviderBinding();
void bind(InterfaceRequest<ServiceProvider> interfaceRequest) {
_binding.bind(this, interfaceRequest);
@@ -123,7 +123,7 @@
void addServiceForName<T>(ServiceConnector<T> connector, String serviceName) {
_connectorThunks[serviceName] = (Channel channel) {
- connector(new InterfaceRequest<T>(channel));
+ connector(InterfaceRequest<T>(channel));
};
}
@@ -133,7 +133,7 @@
if (connectorThunk != null) {
connectorThunk(channel);
} else if (defaultConnector != null) {
- defaultConnector(serviceName, new InterfaceRequest<dynamic>(channel));
+ defaultConnector(serviceName, InterfaceRequest<dynamic>(channel));
} else {
channel.close();
}
@@ -158,7 +158,7 @@
Future<void> connectToService<T>(AsyncProxyController<T> controller) async {
final String serviceName = controller.$serviceName;
if (serviceName == null) {
- throw new Exception(
+ throw Exception(
"${controller.$interfaceName}'s controller.\$serviceName"
' must not be null. Check the FIDL file for a missing [Discoverable]');
}
@@ -168,11 +168,11 @@
Future<InterfaceHandle<T>> connectToServiceByName<T>(
String serviceName) async {
- final ChannelPair pair = new ChannelPair();
+ final ChannelPair pair = ChannelPair();
await _proxy.open(
_openFlags, _openMode, serviceName, InterfaceRequest<Node>(pair.first));
- return new InterfaceHandle<T>(pair.second);
+ return InterfaceHandle<T>(pair.second);
}
Future<void> close() async {
diff --git a/public/lib/app/dart/src/frame_rate_tracer.dart b/public/lib/app/dart/src/frame_rate_tracer.dart
index 3632958..3217c9f 100644
--- a/public/lib/app/dart/src/frame_rate_tracer.dart
+++ b/public/lib/app/dart/src/frame_rate_tracer.dart
@@ -17,7 +17,7 @@
/// an observation to cobalt.
final Logger cobaltLogger;
- DateTime _animationStart = new DateTime.now();
+ DateTime _animationStart = DateTime.now();
int _frames = 0;
String _currentTargetName;
int _currentCobaltMetricId;
@@ -29,7 +29,7 @@
void start({String targetName, int cobaltMetricId}) {
_currentTargetName = targetName;
_currentCobaltMetricId = cobaltMetricId;
- _animationStart = new DateTime.now();
+ _animationStart = DateTime.now();
_frames = 0;
}
@@ -44,7 +44,7 @@
return;
}
int microSeconds =
- new DateTime.now().difference(_animationStart).inMicroseconds;
+ DateTime.now().difference(_animationStart).inMicroseconds;
double frameRate = _frames.toDouble() * 1000000.0 / microSeconds.toDouble();
String prefix = _currentTargetName?.isEmpty ?? true
? '$name'
diff --git a/public/lib/app/dart/src/fuchsia_logger.dart b/public/lib/app/dart/src/fuchsia_logger.dart
index 2383d14..b519f9d 100644
--- a/public/lib/app/dart/src/fuchsia_logger.dart
+++ b/public/lib/app/dart/src/fuchsia_logger.dart
@@ -167,7 +167,7 @@
}
int systemTime = Platform.isFuchsia
? System.clockGet(_zxClockMonotonic)
- : new DateTime.now().microsecondsSinceEpoch * 1000;
+ : DateTime.now().microsecondsSinceEpoch * 1000;
String logMsg;
if (message is Function) {
logMsg = message();
@@ -177,13 +177,13 @@
Object object = message;
logMsg = object.toString();
}
- _publish(new FuchsiaLogRecord(logLevel, logMsg, systemTime,
+ _publish(FuchsiaLogRecord(logLevel, logMsg, systemTime,
localTag: localTag, error: error, stackTrace: stackTrace));
}
Stream<FuchsiaLogRecord> _getStream() {
_controller ??=
- new StreamController<FuchsiaLogRecord>.broadcast(sync: true);
+ StreamController<FuchsiaLogRecord>.broadcast(sync: true);
return _controller.stream;
}
diff --git a/public/lib/app/dart/src/logging.dart b/public/lib/app/dart/src/logging.dart
index 439bff7..5466f59 100644
--- a/public/lib/app/dart/src/logging.dart
+++ b/public/lib/app/dart/src/logging.dart
@@ -58,13 +58,13 @@
FutureOr<zircon.Socket> sock;
if (logSocket == null) {
final socketPair = zircon.SocketPair(zircon.Socket.DATAGRAM);
- final logSinkProxy = new logger_async.LogSinkProxy();
+ final logSinkProxy = logger_async.LogSinkProxy();
final completer = Completer<zircon.Socket>();
app_async
.connectToService(
- new app_async.StartupContext.fromStartupInfo().environmentServices,
+ app_async.StartupContext.fromStartupInfo().environmentServices,
logSinkProxy.ctrl,
)
.then((_) => logSinkProxy.connect(socketPair.second))
@@ -125,7 +125,7 @@
Platform.script?.pathSegments?.lastWhere((_) => true, orElse: () => null);
final List<String> approvedTags = _verifyGlobalTags(globalTags);
- log = new FuchsiaLogger(level ?? Level.ALL);
+ log = FuchsiaLogger(level ?? Level.ALL);
// This code decides how to log messages. Here's the why:
// If not running on zircon, there is no sys_logger so must use stdout.
@@ -152,7 +152,7 @@
log.onRecord.listen((FuchsiaLogRecord rec) {
String codeLocation;
if (forceShowCodeLocation ?? inCheckedMode) {
- final Trace trace = new Trace.current();
+ final Trace trace = Trace.current();
final Frame callerFrame = _findCallerFrame(trace);
if (callerFrame != null) {
if (callerFrame.uri.pathSegments.isNotEmpty) {
@@ -164,7 +164,7 @@
}
}
- activeLogWriter(new LogWriterMessage(
+ activeLogWriter(LogWriterMessage(
logRecord: rec,
scopeName: scopeName,
codeLocation: codeLocation,
@@ -176,9 +176,9 @@
/// Create a Socket and connect it to the FIDL logger
zircon.Socket _connectToLoggerSocket() {
final socketPair = zircon.SocketPair(zircon.Socket.DATAGRAM);
- final logSinkProxy = new LogSinkProxy();
+ final logSinkProxy = LogSinkProxy();
connectToService(
- new StartupContext.fromStartupInfo().environmentServices,
+ StartupContext.fromStartupInfo().environmentServices,
logSinkProxy.ctrl,
);
logSinkProxy.connect(socketPair.second);
@@ -207,7 +207,7 @@
/// The default logger to be used by dart applications. Each application should
/// call [setupLogger()] in their main function to properly configure it.
-FuchsiaLogger log = new FuchsiaLogger(Level.ALL)
+FuchsiaLogger log = FuchsiaLogger(Level.ALL)
..onRecord.listen((FuchsiaLogRecord rec) {
print('WARNING: The logger is not initialized properly.');
print('WARNING: Please call setupLogger() from your main function.');
@@ -272,7 +272,7 @@
/// Format log message zircon socket connected to Log Viewer
void writeLogToSocket(LogWriterMessage message) {
- ByteData bytes = new ByteData(_socketBufferLength)
+ ByteData bytes = ByteData(_socketBufferLength)
..setUint64(0, pid, Endian.little)
..setUint64(8, Isolate.current.hashCode, Endian.little)
..setUint64(16, message.logRecord.systemTime, Endian.little)
@@ -324,7 +324,7 @@
assert(byteOffset <= _socketBufferLength);
void writeBytes(zircon.Socket sock) {
- sock.write(new ByteData.view(bytes.buffer, 0, byteOffset));
+ sock.write(ByteData.view(bytes.buffer, 0, byteOffset));
}
if (_logSocket is Future) {
@@ -375,7 +375,7 @@
/// A convenient function for displaying the stack trace of the caller in the
/// console.
void showStackTrace() {
- print(new Trace.current(1).toString());
+ print(Trace.current(1).toString());
}
/// Emits an instant trace with [name] prefixed with [log]'s name
diff --git a/public/lib/app/dart/test/fuchsia_log_record_test.dart b/public/lib/app/dart/test/fuchsia_log_record_test.dart
index 1307b1c..854f27b 100644
--- a/public/lib/app/dart/test/fuchsia_log_record_test.dart
+++ b/public/lib/app/dart/test/fuchsia_log_record_test.dart
@@ -28,7 +28,7 @@
}
void _testSimpleMessage() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
);
@@ -40,7 +40,7 @@
int now = Platform.isFuchsia
? System.clockGet(_zxClockMonotonic)
- : new DateTime.now().microsecondsSinceEpoch * 1000;
+ : DateTime.now().microsecondsSinceEpoch * 1000;
expect(underTest.systemTime, lessThanOrEqualTo(now));
expect(underTest.systemTime, greaterThanOrEqualTo(now - _lookBackTimeGap));
@@ -59,13 +59,13 @@
}
void _testMessageWithException() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
);
expect(logger.logMessages.isEmpty, true);
- Exception exception = new Exception('cause');
+ Exception exception = Exception('cause');
log.infoT('hello',
tag: 'tag', error: exception, stackTrace: StackTrace.current);
expect(logger.logMessages.length, equals(1));
@@ -73,7 +73,7 @@
int now = Platform.isFuchsia
? System.clockGet(_zxClockMonotonic)
- : new DateTime.now().microsecondsSinceEpoch * 1000;
+ : DateTime.now().microsecondsSinceEpoch * 1000;
expect(underTest.systemTime, lessThanOrEqualTo(now));
expect(underTest.systemTime, greaterThanOrEqualTo(now - _lookBackTimeGap));
diff --git a/public/lib/app/dart/test/legacy_logger_test.dart b/public/lib/app/dart/test/legacy_logger_test.dart
index 585b698..aded451 100644
--- a/public/lib/app/dart/test/legacy_logger_test.dart
+++ b/public/lib/app/dart/test/legacy_logger_test.dart
@@ -20,7 +20,7 @@
}
void _testLegacyLogger() {
- MockSocket mockSocket = new MockSocket();
+ MockSocket mockSocket = MockSocket();
setupLogger(
name: 'TEST',
forceShowCodeLocation: false,
diff --git a/public/lib/app/dart/test/log_writer_test.dart b/public/lib/app/dart/test/log_writer_test.dart
index 08f6a6a..5237c7d 100644
--- a/public/lib/app/dart/test/log_writer_test.dart
+++ b/public/lib/app/dart/test/log_writer_test.dart
@@ -38,7 +38,7 @@
}
void _testSimpleMessage() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
);
@@ -55,7 +55,7 @@
}
void _constructorOptions1() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
name: 'LOGGER_NAME',
@@ -80,7 +80,7 @@
}
void _constructorOptions2() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
level: Level.WARNING,
@@ -110,7 +110,7 @@
final List<String> stdoutLines = <String>[];
runZoned<void>(
() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
level: Level.WARNING,
@@ -134,7 +134,7 @@
stdoutLines[0], equals('WARNING: Logger initialized with > 3 tags.'));
expect(stdoutLines[1], equals('WARNING: Later tags will be ignored.'));
},
- zoneSpecification: new ZoneSpecification(
+ zoneSpecification: ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
stdoutLines.add(line);
},
@@ -146,7 +146,7 @@
final List<String> stdoutLines = <String>[];
runZoned<void>(
() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
level: Level.WARNING,
@@ -169,7 +169,7 @@
equals('WARNING: Logger tags limited to 63 characters.'));
expect(stdoutLines[1], startsWith('WARNING: Tag "'));
},
- zoneSpecification: new ZoneSpecification(
+ zoneSpecification: ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
stdoutLines.add(line);
},
@@ -178,7 +178,7 @@
}
void _testInfoLevels() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
level: Level.INFO,
@@ -203,7 +203,7 @@
}
void _testDefaultLevels() {
- LoggerStub logger = new LoggerStub();
+ LoggerStub logger = LoggerStub();
setupLogger(
logWriter: logger.writeLogMessage,
);
diff --git a/public/lib/app/dart/test/socket_redirect_to_stdout_test.dart b/public/lib/app/dart/test/socket_redirect_to_stdout_test.dart
index fe0b5b1..9c56b69 100644
--- a/public/lib/app/dart/test/socket_redirect_to_stdout_test.dart
+++ b/public/lib/app/dart/test/socket_redirect_to_stdout_test.dart
@@ -27,7 +27,7 @@
expect(logOutput.length, equals(1));
expect(logOutput[0], equals('[INFO:TEST] foo'));
},
- zoneSpecification: new ZoneSpecification(
+ zoneSpecification: ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
logOutput.add(line);
},
diff --git a/public/lib/app/dart/test/socket_test.dart b/public/lib/app/dart/test/socket_test.dart
index ccc4309..e44b1a6 100644
--- a/public/lib/app/dart/test/socket_test.dart
+++ b/public/lib/app/dart/test/socket_test.dart
@@ -19,7 +19,7 @@
}
void _testlogToSocket() {
- MockSocket mockSocket = new MockSocket();
+ MockSocket mockSocket = MockSocket();
setupLogger(
name: 'TEST',
forceShowCodeLocation: false,
diff --git a/public/lib/app/dart/test/socket_validate.dart b/public/lib/app/dart/test/socket_validate.dart
index 14bdb96..42016cf 100644
--- a/public/lib/app/dart/test/socket_validate.dart
+++ b/public/lib/app/dart/test/socket_validate.dart
@@ -15,7 +15,7 @@
/// Convert from little endian format bytes to an unsiged 32 bit int.
int bytesToInt32(List<int> bytes) {
- ByteData byteData = new ByteData(4);
+ ByteData byteData = ByteData(4);
for (int i = 0; i < 4; i++) {
byteData.setInt8(i, bytes[i]);
}
@@ -24,7 +24,7 @@
/// Convert from little endian format bytes to an unsiged 64 bit int.
int bytesToUint64(List<int> bytes) {
- ByteData byteData = new ByteData(8);
+ ByteData byteData = ByteData(8);
for (int i = 0; i < 8; i++) {
byteData.setInt8(i, bytes[i]);
}
@@ -42,7 +42,7 @@
// Log time should be within the last 30 seconds
int nowNanos = Platform.isFuchsia
? System.clockGet(_zxClockMonotonic)
- : new DateTime.now().microsecondsSinceEpoch * 1000;
+ : DateTime.now().microsecondsSinceEpoch * 1000;
int logNanos = bytesToUint64(data.sublist(16, 24));
expect(logNanos, lessThanOrEqualTo(nowNanos));
expect(logNanos + _lookBackTimeGap, greaterThan(nowNanos));
diff --git a/public/lib/app/dart/test/socket_with_exception_test.dart b/public/lib/app/dart/test/socket_with_exception_test.dart
index 6b52721..f71fb3c 100644
--- a/public/lib/app/dart/test/socket_with_exception_test.dart
+++ b/public/lib/app/dart/test/socket_with_exception_test.dart
@@ -19,13 +19,13 @@
}
void _testLogToSocketWithException() {
- MockSocket mockSocket = new MockSocket();
+ MockSocket mockSocket = MockSocket();
setupLogger(
name: 'TEST',
forceShowCodeLocation: false,
logSocket: mockSocket,
);
- log.shout('error', new Exception('cause'));
+ log.shout('error', Exception('cause'));
ByteData byteData = verify(mockSocket.write(captureAny)).captured.single;
List<int> logged = byteData.buffer.asInt8List(0, byteData.lengthInBytes);
diff --git a/public/lib/app/dart/test/socket_with_location_test.dart b/public/lib/app/dart/test/socket_with_location_test.dart
index 4e3f28a..8800af8 100644
--- a/public/lib/app/dart/test/socket_with_location_test.dart
+++ b/public/lib/app/dart/test/socket_with_location_test.dart
@@ -21,7 +21,7 @@
}
void _testLogToSocketWithLocation() {
- MockSocket mockSocket = new MockSocket();
+ MockSocket mockSocket = MockSocket();
setupLogger(
name: 'TEST',
level: Level.ALL,
diff --git a/public/lib/app/dart/test/socket_with_stacktrace_test.dart b/public/lib/app/dart/test/socket_with_stacktrace_test.dart
index 57d89b2..9f9f826 100644
--- a/public/lib/app/dart/test/socket_with_stacktrace_test.dart
+++ b/public/lib/app/dart/test/socket_with_stacktrace_test.dart
@@ -24,13 +24,13 @@
'messages works properly';
void _testLogToSocketWithStacktrace() {
- MockSocket mockSocket = new MockSocket();
+ MockSocket mockSocket = MockSocket();
setupLogger(
name: 'TEST',
forceShowCodeLocation: false,
logSocket: mockSocket,
);
- log.severe(_errorMsg, new Exception('because'), StackTrace.current);
+ log.severe(_errorMsg, Exception('because'), StackTrace.current);
ByteData byteData = verify(mockSocket.write(captureAny)).captured.single;
List<int> logged = byteData.buffer.asInt8List(0, byteData.lengthInBytes);
diff --git a/public/lib/app/dart/test/socket_with_tags_test.dart b/public/lib/app/dart/test/socket_with_tags_test.dart
index 048bc0d..7adab2a 100644
--- a/public/lib/app/dart/test/socket_with_tags_test.dart
+++ b/public/lib/app/dart/test/socket_with_tags_test.dart
@@ -26,7 +26,7 @@
}
void _testlogToSocketWithTags() {
- MockSocket mockSocket = new MockSocket();
+ MockSocket mockSocket = MockSocket();
setupLogger(
name: 'TEST',
level: Level.ALL,
diff --git a/public/lib/app/dart/test/stdout_test.dart b/public/lib/app/dart/test/stdout_test.dart
index a4bb82a..b8d1599 100644
--- a/public/lib/app/dart/test/stdout_test.dart
+++ b/public/lib/app/dart/test/stdout_test.dart
@@ -27,7 +27,7 @@
expect(logOutput[0], equals('[INFO:TEST] foo'));
expect(logOutput[1], equals('[WARNING:TEST] bar'));
},
- zoneSpecification: new ZoneSpecification(
+ zoneSpecification: ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
logOutput.add(line);
},
diff --git a/public/lib/app/dart/test/stdout_with_exception.dart b/public/lib/app/dart/test/stdout_with_exception.dart
index 6eb855d..248c4a0 100644
--- a/public/lib/app/dart/test/stdout_with_exception.dart
+++ b/public/lib/app/dart/test/stdout_with_exception.dart
@@ -20,18 +20,18 @@
level: Level.ALL,
forceShowCodeLocation: false,
);
- log.shout('foo', new Exception('cause'));
+ log.shout('foo', Exception('cause'));
expect(logOutput.length, equals(1));
expect(logOutput[0], equals('[FATAL:TEST] foo: Exception: cause'));
- log.severe('bar', new Exception('because'), StackTrace.current);
+ log.severe('bar', Exception('because'), StackTrace.current);
expect(logOutput.length, equals(3));
expect(logOutput[1], equals('[ERROR:TEST] bar: Exception: because'));
expect(logOutput[2], matches(r'.*_testLogToStdoutWithError.*'));
},
- zoneSpecification: new ZoneSpecification(
+ zoneSpecification: ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
logOutput.add(line);
},
diff --git a/public/lib/app/dart/test/stdout_with_location.dart b/public/lib/app/dart/test/stdout_with_location.dart
index 08ccf6e..751b495 100644
--- a/public/lib/app/dart/test/stdout_with_location.dart
+++ b/public/lib/app/dart/test/stdout_with_location.dart
@@ -26,7 +26,7 @@
expect(logOutput.length, equals(1));
expect(logOutput[0], matches('\\[INFO:TEST:$_fileName\\(\\d+\\)\\] foo'));
},
- zoneSpecification: new ZoneSpecification(
+ zoneSpecification: ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
logOutput.add(line);
},
diff --git a/public/lib/app/dart/test/test_startup_context_test.dart b/public/lib/app/dart/test/test_startup_context_test.dart
index 7221f66..4b01ee4 100644
--- a/public/lib/app/dart/test/test_startup_context_test.dart
+++ b/public/lib/app/dart/test/test_startup_context_test.dart
@@ -8,22 +8,22 @@
import 'package:zircon/zircon.dart';
void main() {
- TestStartupContext testContext = new TestStartupContext();
+ TestStartupContext testContext = TestStartupContext();
StartupContext.provideStartupContext(testContext);
group('Fake context', () {
test('can be obtained through fromStartupInfo', () {
- expect(new StartupContext.fromStartupInfo(), testContext);
+ expect(StartupContext.fromStartupInfo(), testContext);
});
test('should not crash with normal calls', () {
- final context = new StartupContext.fromStartupInfo();
+ final context = StartupContext.fromStartupInfo();
context.outgoingServices.addServiceForName((req) {}, 'service');
context.environmentServices.ctrl.close();
context.close();
});
test('should connect a service when connected', () {
- final context = new StartupContext.fromStartupInfo();
+ final context = StartupContext.fromStartupInfo();
var wasConnected = false;
testContext.withTestService((req) {
@@ -31,7 +31,7 @@
}, 'connectedService');
context.environmentServices.connectToService(
- 'connectedService', new Channel(new Handle.invalid()));
+ 'connectedService', Channel(Handle.invalid()));
expect(wasConnected, true);
}, skip: 'TODO(tvolkert): re-enable this test');
diff --git a/public/lib/app/dart/testing/test_startup_context.dart b/public/lib/app/dart/testing/test_startup_context.dart
index 5938021..2fdfedb 100644
--- a/public/lib/app/dart/testing/test_startup_context.dart
+++ b/public/lib/app/dart/testing/test_startup_context.dart
@@ -14,16 +14,16 @@
/// provideStartupContext(startupContext);
class TestStartupContext implements StartupContext {
@override
- MockEnvironmentProxy environment = new MockEnvironmentProxy();
+ MockEnvironmentProxy environment = MockEnvironmentProxy();
@override
- TestServiceProvider environmentServices = new TestServiceProvider();
+ TestServiceProvider environmentServices = TestServiceProvider();
@override
- final MockLauncherProxy launcher = new MockLauncherProxy();
+ final MockLauncherProxy launcher = MockLauncherProxy();
@override
- final MockOutgoing outgoingServices = new MockOutgoing();
+ final MockOutgoing outgoingServices = MockOutgoing();
@override
void close() {
@@ -35,12 +35,12 @@
}
class TestServiceProvider implements ServiceProviderProxy {
- final ServiceProviderImpl _testServices = new ServiceProviderImpl();
+ final ServiceProviderImpl _testServices = ServiceProviderImpl();
final Set<String> _serviceNames = <String>{};
void _withTestService<T>(ServiceConnector<T> connector, String serviceName) {
if (_serviceNames.contains(serviceName)) {
- throw new TestEnvironmentException('Duplicate $serviceName provided');
+ throw TestEnvironmentException('Duplicate $serviceName provided');
}
_serviceNames.add(serviceName);
_testServices.addServiceForName(connector, serviceName);
@@ -48,12 +48,12 @@
@override
MockProxyController<ServiceProvider> ctrl =
- new MockProxyController<ServiceProvider>();
+ MockProxyController<ServiceProvider>();
@override
void connectToService(String serviceName, Channel channel) {
if (!_serviceNames.contains(serviceName)) {
- throw new TestEnvironmentException(
+ throw TestEnvironmentException(
'No service provider for $serviceName in test environment.');
}
diff --git a/public/lib/component/dart/lib/src/component_context_client.dart b/public/lib/component/dart/lib/src/component_context_client.dart
index f95dac7..1fef677 100644
--- a/public/lib/component/dart/lib/src/component_context_client.dart
+++ b/public/lib/component/dart/lib/src/component_context_client.dart
@@ -16,9 +16,9 @@
class ComponentContextClient {
/// The underlying [Proxy] used to send client requests to the
/// [fidl.ComponentContextProxy] service.
- final fidl.ComponentContextProxy proxy = new fidl.ComponentContextProxy();
+ final fidl.ComponentContextProxy proxy = fidl.ComponentContextProxy();
- final EntityResolverClient _entityResolver = new EntityResolverClient();
+ final EntityResolverClient _entityResolver = EntityResolverClient();
// Keep track of agent controllers created to close the channels onTerminate
final List<fidl.AgentControllerProxy> _agentControllers =
@@ -35,11 +35,11 @@
/// A future that completes when the [proxy] is bound.
Future<Null> get bound => _bind.future;
- final Completer<Null> _bind = new Completer<Null>();
+ final Completer<Null> _bind = Completer<Null>();
/// See [fidl.ComponentContext#createEntityWithData].
Future<String> createEntityWithData(List<fidl.TypeToDataEntry> typeToData) {
- Completer<String> completer = new Completer<String>();
+ Completer<String> completer = Completer<String>();
// ignore: unawaited_futures
proxy.ctrl.error.then((ProxyError err) {
@@ -53,7 +53,7 @@
if (value != null) {
completer.complete(value);
} else {
- completer.completeError(new Exception('entity reference is null'));
+ completer.completeError(Exception('entity reference is null'));
}
}
}
@@ -74,7 +74,7 @@
}
Completer<EntityResolverClient> completer =
- new Completer<EntityResolverClient>();
+ Completer<EntityResolverClient>();
try {
await bound;
@@ -116,7 +116,7 @@
{@required String name,
@required MessageReceiverCallback onMessage,
@required MessageQueueErrorCallback onConnectionError}) {
- var mq = new MessageQueueClient(
+ var mq = MessageQueueClient(
onMessage: onMessage, onConnectionError: onConnectionError);
proxy.obtainMessageQueue(name, mq.newRequest());
return mq;
@@ -126,7 +126,7 @@
MessageSenderClient getMessageSender(
{@required String queueToken,
@required MessageSenderErrorCallback onConnectionError}) {
- var sender = new MessageSenderClient(onConnectionError: onConnectionError);
+ var sender = MessageSenderClient(onConnectionError: onConnectionError);
proxy.getMessageSender(queueToken, sender.newRequest());
return sender;
}
@@ -134,12 +134,12 @@
/// Connect to an agent
Future<fidl.ServiceProviderProxy> connectToAgent(String url) {
Completer<fidl.ServiceProviderProxy> serviceCompleter =
- new Completer<fidl.ServiceProviderProxy>();
+ Completer<fidl.ServiceProviderProxy>();
// Connect to the agent and save off the agent controller proxy to be
// closed on terminate
fidl.ServiceProviderProxy serviceProviderProxy =
- new fidl.ServiceProviderProxy();
+ fidl.ServiceProviderProxy();
serviceProviderProxy.ctrl.error.then((ProxyError err) {
if (!serviceCompleter.isCompleted) {
serviceCompleter.completeError(err);
@@ -147,7 +147,7 @@
});
fidl.AgentControllerProxy agentControllerProxy =
- new fidl.AgentControllerProxy();
+ fidl.AgentControllerProxy();
_agentControllers.add(agentControllerProxy);
agentControllerProxy.ctrl.error.then((ProxyError err) {
if (!serviceCompleter.isCompleted) {
@@ -172,7 +172,7 @@
/// See [fidl.ComponentContext#getPackageName].
Future<String> getPackageName() {
- Completer<String> completer = new Completer<String>();
+ Completer<String> completer = Completer<String>();
try {
proxy.getPackageName(completer.complete);
} on Exception catch (err, stackTrace) {
diff --git a/public/lib/component/dart/lib/src/message_queue_client.dart b/public/lib/component/dart/lib/src/message_queue_client.dart
index 08bab20..87b3b56 100644
--- a/public/lib/component/dart/lib/src/message_queue_client.dart
+++ b/public/lib/component/dart/lib/src/message_queue_client.dart
@@ -31,7 +31,7 @@
/// Helper class for receiving messages on a given message queue.
class MessageQueueClient extends MessageReader {
MessageQueueProxy _queue;
- final MessageReaderBinding _readerBinding = new MessageReaderBinding();
+ final MessageReaderBinding _readerBinding = MessageReaderBinding();
/// [onMessage] is called when there is a new message.
final MessageReceiverCallback onMessage;
@@ -56,7 +56,7 @@
/// Binds a new MessageQueue proxy and returns the request-side interface.
InterfaceRequest<MessageQueue> newRequest() {
_queue?.ctrl?.close();
- _queue ??= new MessageQueueProxy();
+ _queue ??= MessageQueueProxy();
_queue.ctrl.error.then((ProxyError err) {
if (onConnectionError != null) {
onConnectionError(MessageQueueError.unavailable,
@@ -74,7 +74,7 @@
Future<String> getToken() {
assert(_queue.ctrl.isBound);
- Completer<String> result = new Completer();
+ Completer<String> result = Completer();
_queue.getToken((String token) {
result.complete(token);
});
@@ -92,7 +92,7 @@
/// Not public; implements [MessageReader.onReceive].
@override
void onReceive(fuchsia_mem.Buffer message, void Function() ack) {
- var dataVmo = new SizedVmo(message.vmo.handle, message.size);
+ var dataVmo = SizedVmo(message.vmo.handle, message.size);
var readResult = dataVmo.read(message.size);
dataVmo.close();
onMessage.call(readResult.bytesAsUint8List(), ack);
diff --git a/public/lib/component/dart/lib/src/message_sender_client.dart b/public/lib/component/dart/lib/src/message_sender_client.dart
index 904c257..a0b4c2e 100644
--- a/public/lib/component/dart/lib/src/message_sender_client.dart
+++ b/public/lib/component/dart/lib/src/message_sender_client.dart
@@ -45,8 +45,8 @@
/// Send the given [message].
void sendUint8List(Uint8List message) {
- _messageSenderProxy.send(new fuchsia_mem.Buffer(
- vmo: new SizedVmo.fromUint8List(message),
+ _messageSenderProxy.send(fuchsia_mem.Buffer(
+ vmo: SizedVmo.fromUint8List(message),
size: message.length,
));
}
@@ -63,7 +63,7 @@
_messageSenderProxy.ctrl.close();
}
- _messageSenderProxy = new MessageSenderProxy();
+ _messageSenderProxy = MessageSenderProxy();
_messageSenderProxy.ctrl.error.then((ProxyError err) {
if (_onConnectionError != null) {
_onConnectionError(MessageSenderError.unavailable,
diff --git a/public/lib/component/dart/lib/src/message_sender_client_async.dart b/public/lib/component/dart/lib/src/message_sender_client_async.dart
index 0e71783..abd10d2 100644
--- a/public/lib/component/dart/lib/src/message_sender_client_async.dart
+++ b/public/lib/component/dart/lib/src/message_sender_client_async.dart
@@ -31,8 +31,8 @@
/// Send the given [message].
Future<void> sendUint8List(Uint8List message) {
- return _messageSenderProxy.send(new fuchsia_mem.Buffer(
- vmo: new SizedVmo.fromUint8List(message),
+ return _messageSenderProxy.send(fuchsia_mem.Buffer(
+ vmo: SizedVmo.fromUint8List(message),
size: message.length,
));
}
@@ -49,7 +49,7 @@
_messageSenderProxy.ctrl.close();
}
- _messageSenderProxy = new MessageSenderProxy();
+ _messageSenderProxy = MessageSenderProxy();
return _messageSenderProxy.ctrl.request();
}
}
diff --git a/public/lib/device/dart/lib/src/base_shell_impl.dart b/public/lib/device/dart/lib/src/base_shell_impl.dart
index 8824c8b..cdef730 100644
--- a/public/lib/device/dart/lib/src/base_shell_impl.dart
+++ b/public/lib/device/dart/lib/src/base_shell_impl.dart
@@ -20,9 +20,9 @@
/// operate.
class BaseShellImpl extends BaseShell implements Lifecycle {
final BaseShellContextProxy _baseShellContextProxy =
- new BaseShellContextProxy();
- final UserProviderProxy _userProviderProxy = new UserProviderProxy();
- final PresentationProxy _presentationProxy = new PresentationProxy();
+ BaseShellContextProxy();
+ final UserProviderProxy _userProviderProxy = UserProviderProxy();
+ final PresentationProxy _presentationProxy = PresentationProxy();
final Set<AuthenticationUiContextBinding> _authUiContextBindingSet =
<AuthenticationUiContextBinding>{};
@@ -73,7 +73,7 @@
InterfaceRequest<AuthenticationUiContext> request,
) async {
AuthenticationUiContextBinding binding =
- new AuthenticationUiContextBinding()
+ AuthenticationUiContextBinding()
..bind(authenticationUiContext, request);
_authUiContextBindingSet.add(binding);
}
diff --git a/public/lib/display/flutter/test/display_policy_brightness_model_test.dart b/public/lib/display/flutter/test/display_policy_brightness_model_test.dart
index 53e982b..aa1432f 100644
--- a/public/lib/display/flutter/test/display_policy_brightness_model_test.dart
+++ b/public/lib/display/flutter/test/display_policy_brightness_model_test.dart
@@ -12,20 +12,20 @@
void main() {
test('testGetBrightness', () {
- final Display display = new MockDisplay();
+ final Display display = MockDisplay();
final DisplayPolicyBrightnessModel model =
- new DisplayPolicyBrightnessModel(display);
+ DisplayPolicyBrightnessModel(display);
- final double brightness = new Random().nextDouble();
+ final double brightness = Random().nextDouble();
// Make sure brightness is passed through.
when(display.brightness).thenReturn(brightness);
expect(model.brightness, brightness);
});
test('testBrightnessSanitation', () {
- final Display display = new MockDisplay();
+ final Display display = MockDisplay();
final DisplayPolicyBrightnessModel model =
- new DisplayPolicyBrightnessModel(display);
+ DisplayPolicyBrightnessModel(display);
// When no brightness is available, 0 should be returned.
expect(model.brightness, DisplayPolicyBrightnessModel.minLevel);
@@ -42,9 +42,9 @@
});
test('testPropagation', () async {
- final Display display = new MockDisplay();
+ final Display display = MockDisplay();
final DisplayPolicyBrightnessModel model =
- new DisplayPolicyBrightnessModel(display);
+ DisplayPolicyBrightnessModel(display);
void Function(double val) listenMethod =
verify(display.addListener(captureAny)).captured.single;
@@ -60,13 +60,13 @@
// Needed to make sure notification is propagated through
// [Model#notifyListeners].
- await new Future<Null>.delayed(const Duration(seconds: 0));
+ await Future<Null>.delayed(const Duration(seconds: 0));
// Verify notification occurred.
expect(notificationCount, 1);
// Make sure brightness set on model reaches display.
- final double setBrightness = new Random().nextDouble();
+ final double setBrightness = Random().nextDouble();
model.brightness = setBrightness;
expect(verify(display.setBrightness(captureAny)).captured.single,
setBrightness);
diff --git a/public/lib/entity/dart/lib/src/entity_client.dart b/public/lib/entity/dart/lib/src/entity_client.dart
index 4548021..ce3bff4 100644
--- a/public/lib/entity/dart/lib/src/entity_client.dart
+++ b/public/lib/entity/dart/lib/src/entity_client.dart
@@ -19,7 +19,7 @@
final fidl.EntityProxy proxy;
/// Constructor.
- EntityClient() : proxy = new fidl.EntityProxy() {
+ EntityClient() : proxy = fidl.EntityProxy() {
proxy.ctrl
..onBind = _handleBind
..onClose = _handleClose
@@ -32,7 +32,7 @@
/// List of types this entity supports.
Future<List<String>> getTypes() {
- Completer<List<String>> result = new Completer<List<String>>();
+ Completer<List<String>> result = Completer<List<String>>();
proxy.getTypes(result.complete);
return result.future;
}
@@ -51,7 +51,7 @@
}
Future<fuchsia_mem.Buffer> _getVmoData(String type) {
- Completer<fuchsia_mem.Buffer> result = new Completer<fuchsia_mem.Buffer>();
+ Completer<fuchsia_mem.Buffer> result = Completer<fuchsia_mem.Buffer>();
proxy.getData(type, result.complete);
return result.future;
}
@@ -59,7 +59,7 @@
/// Returns the data associated with the given type without validating it.
Future<String> getData(String type) async {
var buffer = await _getVmoData(type);
- var dataVmo = new SizedVmo(buffer.vmo.handle, buffer.size);
+ var dataVmo = SizedVmo(buffer.vmo.handle, buffer.size);
var data = dataVmo.read(buffer.size);
dataVmo.close();
return utf8.decode(data.bytesAsUint8List());
diff --git a/public/lib/entity/dart/lib/src/entity_resolver_client.dart b/public/lib/entity/dart/lib/src/entity_resolver_client.dart
index 94a52f8..212e61e 100644
--- a/public/lib/entity/dart/lib/src/entity_resolver_client.dart
+++ b/public/lib/entity/dart/lib/src/entity_resolver_client.dart
@@ -14,7 +14,7 @@
class EntityResolverClient {
/// The underlying [Proxy] used to send client requests to the
/// [fidl.EntityResolver] service.
- final fidl.EntityResolverProxy proxy = new fidl.EntityResolverProxy();
+ final fidl.EntityResolverProxy proxy = fidl.EntityResolverProxy();
final List<EntityClient> _entities = <EntityClient>[];
@@ -29,11 +29,11 @@
/// A future that completes when the [proxy] is bound.
Future<Null> get bound => _bind.future;
- final Completer<Null> _bind = new Completer<Null>();
+ final Completer<Null> _bind = Completer<Null>();
/// See [fidl.EntityResolver#resolveEntity].
Future<EntityClient> resolveEntity(String ref) async {
- Completer<EntityClient> completer = new Completer<EntityClient>();
+ Completer<EntityClient> completer = Completer<EntityClient>();
try {
await bound;
@@ -41,7 +41,7 @@
completer.completeError(err, stackTrace);
}
- EntityClient entity = new EntityClient();
+ EntityClient entity = EntityClient();
// ignore: unawaited_futures
proxy.ctrl.error.then((ProxyError err) {
diff --git a/public/lib/fuchsia_driver/lib/fuchsia_driver.dart b/public/lib/fuchsia_driver/lib/fuchsia_driver.dart
index 54de991..d9ceff0 100644
--- a/public/lib/fuchsia_driver/lib/fuchsia_driver.dart
+++ b/public/lib/fuchsia_driver/lib/fuchsia_driver.dart
@@ -109,7 +109,7 @@
String interface = '',
String configFile,
]) async {
- return new _DummyPortForwarder(remotePort, remotePort);
+ return _DummyPortForwarder(remotePort, remotePort);
}
/// Utility class for creating connections to the Fuchsia Device.
@@ -144,7 +144,7 @@
await FuchsiaDriver._init();
return FuchsiaRemoteConnection
// ignore: invalid_use_of_visible_for_testing_member
- .connectWithSshCommandRunner(new _DummySshCommandRunner());
+ .connectWithSshCommandRunner(_DummySshCommandRunner());
}
return FuchsiaRemoteConnection.connect();
}
diff --git a/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart b/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart
index 6bb0c15..d891c66 100644
--- a/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart
+++ b/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart
@@ -17,7 +17,7 @@
/// Hosts a [LifecycleImpl] and manages the underlying [binding] connection.
class LifecycleHost {
/// The underlying [Binding] that connects the [impl] to client requests.
- final fidl.LifecycleBinding binding = new fidl.LifecycleBinding();
+ final fidl.LifecycleBinding binding = fidl.LifecycleBinding();
/// Callback for when the system starts to shutdown this process.
final LifecycleTerminateCallback onTerminate;
@@ -30,7 +30,7 @@
LifecycleHost({
@required this.onTerminate,
}) : assert(onTerminate != null) {
- impl = new LifecycleImpl(
+ impl = LifecycleImpl(
onTerminate: _handleTerminate,
);
@@ -55,11 +55,11 @@
// Do not create an error by rebinding if, for some reason, this method has been called already.
if (_addService != null) {
Exception err =
- new Exception('#addService() should only be called once.');
+ Exception('#addService() should only be called once.');
_addService.completeError(err);
return _addService.future;
} else {
- _addService = new Completer<Null>();
+ _addService = Completer<Null>();
}
startupContext.outgoingServices.addServiceForName(
@@ -88,7 +88,7 @@
}
void _handleConnectionError() {
- Exception err = new Exception('binding connection failed');
+ Exception err = Exception('binding connection failed');
if (_addService != null && !_addService.isCompleted) {
_addService.completeError(err);
diff --git a/public/lib/media/dart/audio.dart b/public/lib/media/dart/audio.dart
index 02f4788..7d85a9a 100644
--- a/public/lib/media/dart/audio.dart
+++ b/public/lib/media/dart/audio.dart
@@ -22,7 +22,7 @@
static const double _minDbDiff = 0.006;
static const double _minPerceivedDiff = 0.0001;
- final AudioProxy _audioService = new AudioProxy();
+ final AudioProxy _audioService = AudioProxy();
double _systemAudioGainDb = _initialGainDb;
bool _systemAudioMuted = false;
diff --git a/public/lib/mediaplayer/dart/audio_player_controller.dart b/public/lib/mediaplayer/dart/audio_player_controller.dart
index 33c8cc7..ae541fc 100644
--- a/public/lib/mediaplayer/dart/audio_player_controller.dart
+++ b/public/lib/mediaplayer/dart/audio_player_controller.dart
@@ -53,15 +53,15 @@
/// every HTTP/S request issued to the URI.
void open(Uri uri, {HttpHeaders headers}) {
if (uri == null) {
- throw new ArgumentError.notNull('uri');
+ throw ArgumentError.notNull('uri');
}
if (uri.isScheme('FILE')) {
if (headers != null) {
- throw new ArgumentError.value(headers,
+ throw ArgumentError.value(headers,
'headers', 'Not valid for FILE URIs.');
}
} else if (!uri.isScheme('HTTP') && !uri.isScheme('HTTPS')) {
- throw new ArgumentError.value(uri,
+ throw ArgumentError.value(uri,
'uri', 'Only HTTP/S and FILE protocols are supported.');
}
@@ -107,7 +107,7 @@
_player.ctrl.onConnectionError = null;
}
- _player = new PlayerProxy();
+ _player = PlayerProxy();
_playing = false;
_ended = false;
@@ -137,7 +137,7 @@
void _setSource(Uri uri, HttpHeaders headers) {
if (uri.isScheme('FILE')) {
_player.setFileSource(
- new Channel.fromFile(uri.toFilePath()));
+ Channel.fromFile(uri.toFilePath()));
} else {
_player.setHttpSource(uri.toString(), _convertHeaders(headers));
}
@@ -148,7 +148,7 @@
if (headers != null) {
headers.forEach((name, values) {
for (String value in values) {
- HttpHeader header = new HttpHeader(name: name, value: value);
+ HttpHeader header = HttpHeader(name: name, value: value);
result.add(header);
}
});
@@ -185,7 +185,7 @@
/// Gets the duration of the content.
Duration get duration =>
- new Duration(microseconds: _durationNanoseconds ~/ 1000);
+ Duration(microseconds: _durationNanoseconds ~/ 1000);
/// Gets current playback progress.
Duration get progress {
@@ -193,7 +193,7 @@
return Duration.zero;
}
- return new Duration(
+ return Duration(
microseconds:
_progressNanoseconds.clamp(0, _durationNanoseconds) ~/ 1000);
}
@@ -216,7 +216,7 @@
return 0;
}
- int microseconds = (new DateTime.now()).microsecondsSinceEpoch -
+ int microseconds = (DateTime.now()).microsecondsSinceEpoch -
_progressBarMicrosecondsSinceEpoch;
int referenceNanoseconds = microseconds * 1000 + _progressBarReferenceTime;
return _timelineFunction(referenceNanoseconds);
@@ -265,7 +265,7 @@
return;
}
- seek(new Duration(
+ seek(Duration(
microseconds: (normalizedPosition * durationInMicroseconds).round()));
}
@@ -290,7 +290,7 @@
tl.TimelineFunction oldTimelineFunction = _timelineFunction;
_timelineFunction =
- new tl.TimelineFunction.fromFidl(status.timelineFunction);
+ tl.TimelineFunction.fromFidl(status.timelineFunction);
prepare = oldTimelineFunction != _timelineFunction;
}
@@ -305,7 +305,7 @@
_problem = status.problem;
if (status.metadata != null) {
- _metadata = new Map.fromIterable(status.metadata.properties,
+ _metadata = Map.fromIterable(status.metadata.properties,
key: (property) => property.label,
value: (property) => property.value);
} else {
@@ -351,7 +351,7 @@
/// Called when the connection to the NetMediaPlayer fails.
void _handleConnectionError() {
- _problem = const Problem(type: problemConnectionFailed);
+ _problem = Problem(type: problemConnectionFailed);
if (updateCallback != null) {
scheduleMicrotask(() {
@@ -370,7 +370,7 @@
// TODO(dalesat): Fix once we're given access to presentation time.
// https://fuchsia.atlassian.net/browse/US-130
_progressBarMicrosecondsSinceEpoch =
- (new DateTime.now()).microsecondsSinceEpoch;
+ (DateTime.now()).microsecondsSinceEpoch;
_progressBarReferenceTime = _timelineFunction.referenceTime;
_progressBarReady = true;
}
diff --git a/public/lib/mediaplayer/dart/timeline.dart b/public/lib/mediaplayer/dart/timeline.dart
index 58a6525..2732d6f 100644
--- a/public/lib/mediaplayer/dart/timeline.dart
+++ b/public/lib/mediaplayer/dart/timeline.dart
@@ -25,18 +25,18 @@
}) {
assert(referenceDelta != 0);
int gcd = subjectDelta.gcd(referenceDelta);
- return new TimelineRate._(subjectDelta ~/ gcd, referenceDelta ~/ gcd);
+ return TimelineRate._(subjectDelta ~/ gcd, referenceDelta ~/ gcd);
}
/// Constructs a TimelineRate from a double.
factory TimelineRate.fromDouble(double asDouble) {
if (asDouble > 1.0) {
- return new TimelineRate(
+ return TimelineRate(
subjectDelta: _floatFactor,
referenceDelta: (_floatFactor * asDouble).toInt(),
);
} else {
- return new TimelineRate(
+ return TimelineRate(
subjectDelta: _floatFactor ~/ asDouble,
referenceDelta: _floatFactor,
);
@@ -47,20 +47,20 @@
const TimelineRate._(this.subjectDelta, this.referenceDelta);
/// A rate of 0 / 1.
- static const TimelineRate zero = const TimelineRate._(0, 1);
+ static const TimelineRate zero = TimelineRate._(0, 1);
/// The number of nanoseconds in a second.
static const TimelineRate nanosecondsPerSecond =
- const TimelineRate._(1000000000, 1);
+ TimelineRate._(1000000000, 1);
/// The inverse of this rate. Asserts if this.subjectDelta is zero.
- TimelineRate get inverse => new TimelineRate(
+ TimelineRate get inverse => TimelineRate(
subjectDelta: referenceDelta,
referenceDelta: subjectDelta,
);
/// Returns the product of this TimelineRate with another TimelineRate.
- TimelineRate product(TimelineRate other) => new TimelineRate(
+ TimelineRate product(TimelineRate other) => TimelineRate(
subjectDelta: subjectDelta * other.subjectDelta,
referenceDelta: referenceDelta * other.referenceDelta,
);
@@ -105,7 +105,7 @@
TimelineFunction.fromFidl(media.TimelineFunction timelineFunction)
: subjectTime = timelineFunction.subjectTime,
referenceTime = timelineFunction.referenceTime,
- rate = new TimelineRate(
+ rate = TimelineRate(
subjectDelta: timelineFunction.subjectDelta,
referenceDelta: timelineFunction.referenceDelta,
);
@@ -133,7 +133,7 @@
/// Gets the inverse of this function. sserts if subjectDelta is zero.
TimelineFunction get inverse {
assert(rate.subjectDelta != 0);
- return new TimelineFunction(
+ return TimelineFunction(
subjectTime: referenceTime,
referenceTime: subjectTime,
rate: rate.inverse,
@@ -141,7 +141,7 @@
}
/// Composes this TimelineFunction with another TimelineFunction.
- TimelineFunction operator *(TimelineFunction other) => new TimelineFunction(
+ TimelineFunction operator *(TimelineFunction other) => TimelineFunction(
subjectTime: apply(other.subjectTime),
referenceTime: other.referenceTime,
rate: rate.product(other.rate),
diff --git a/public/lib/mediaplayer/flutter/media_player.dart b/public/lib/mediaplayer/flutter/media_player.dart
index ee4b6b7..2f713ae 100644
--- a/public/lib/mediaplayer/flutter/media_player.dart
+++ b/public/lib/mediaplayer/flutter/media_player.dart
@@ -18,7 +18,7 @@
const MediaPlayer(this.controller, {Key key}) : super(key: key);
@override
- _MediaPlayerState createState() => new _MediaPlayerState();
+ _MediaPlayerState createState() => _MediaPlayerState();
}
/// The state of a MediaPlayer widget.
@@ -51,8 +51,8 @@
/// Adds notification hooks to |controller|.
void _hookController(MediaPlayerController controller) {
controller.addListener(_handleControllerChanged);
- _secondsNotifier = new ProgressNotifier(controller);
- _sliderNotifier = new ProgressNotifier(controller);
+ _secondsNotifier = ProgressNotifier(controller);
+ _sliderNotifier = ProgressNotifier(controller);
}
/// Removes notification hooks from |controller|.
@@ -91,7 +91,7 @@
Size size = widget.controller.videoPhysicalSize;
if (size.width == 0) {
- size = const Size(320.0, 45.0);
+ size = Size(320.0, 45.0);
} else {
size = size / MediaQuery.of(context).devicePixelRatio;
}
@@ -103,21 +103,21 @@
Widget _buildControlOverlay() {
assert(debugCheckHasMaterial(context));
- return new Stack(
+ return Stack(
children: <Widget>[
- new Center(
- child: new PhysicalModel(
+ Center(
+ child: PhysicalModel(
elevation: 2.0,
color: Colors.transparent,
- borderRadius: new BorderRadius.circular(60.0),
- child: new IconButton(
+ borderRadius: BorderRadius.circular(60.0),
+ child: IconButton(
icon: widget.controller.problem != null
? const Icon(Icons.error_outline)
: widget.controller.loading
? const Icon(Icons.hourglass_empty)
: widget.controller.playing
? const Icon(Icons.pause)
- : const Icon(Icons.play_arrow),
+ : Icon(Icons.play_arrow),
iconSize: 60.0,
onPressed: () {
if (widget.controller.playing) {
@@ -130,40 +130,40 @@
),
),
),
- new Positioned(
+ Positioned(
left: 2.0,
bottom: 8.0,
- child: new PhysicalModel(
+ child: PhysicalModel(
elevation: 2.0,
color: Colors.transparent,
- borderRadius: new BorderRadius.circular(10.0),
- child: new AnimatedBuilder(
+ borderRadius: BorderRadius.circular(10.0),
+ child: AnimatedBuilder(
animation:
_secondsNotifier.withResolution(const Duration(seconds: 1)),
- builder: (BuildContext context, Widget child) => new Container(
+ builder: (BuildContext context, Widget child) => Container(
width: 65.0,
- child: new Text(
+ child: Text(
_durationToString(widget.controller.progress),
- style: const TextStyle(color: Colors.white),
+ style: TextStyle(color: Colors.white),
textAlign: TextAlign.center,
),
),
),
),
),
- new Positioned(
+ Positioned(
left: 48.0,
right: 48.0,
bottom: 0.0,
- child: new PhysicalModel(
+ child: PhysicalModel(
elevation: 3.0,
color: Colors.transparent,
- child: new LayoutBuilder(
+ child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) =>
- new AnimatedBuilder(
+ AnimatedBuilder(
animation: _sliderNotifier.withExcursion(
constraints.maxWidth, context),
- builder: (BuildContext context, Widget child) => new Slider(
+ builder: (BuildContext context, Widget child) => Slider(
min: 0.0,
max: 1.0,
activeColor: Colors.red[900],
@@ -174,18 +174,18 @@
),
),
),
- new Positioned(
+ Positioned(
right: 2.0,
bottom: 8.0,
- child: new PhysicalModel(
+ child: PhysicalModel(
elevation: 2.0,
color: Colors.transparent,
- borderRadius: new BorderRadius.circular(10.0),
- child: new Container(
+ borderRadius: BorderRadius.circular(10.0),
+ child: Container(
width: 65.0,
- child: new Text(
+ child: Text(
_durationToString(widget.controller.duration),
- style: const TextStyle(color: Colors.white),
+ style: TextStyle(color: Colors.white),
textAlign: TextAlign.center,
),
),
@@ -197,16 +197,16 @@
@override
Widget build(BuildContext context) {
- return new AspectRatio(
+ return AspectRatio(
aspectRatio: _layoutSize.width / _layoutSize.height,
- child: new Stack(
+ child: Stack(
children: <Widget>[
- new GestureDetector(
+ GestureDetector(
onTap: widget.controller.brieflyShowControlOverlay,
- child: new ChildView(
+ child: ChildView(
connection: widget.controller.videoViewConnection),
),
- new Offstage(
+ Offstage(
offstage: !widget.controller.shouldShowControlOverlay,
child: _buildControlOverlay(),
),
diff --git a/public/lib/mediaplayer/flutter/media_player_controller.dart b/public/lib/mediaplayer/flutter/media_player_controller.dart
index a49c9ec..f9b189a 100644
--- a/public/lib/mediaplayer/flutter/media_player_controller.dart
+++ b/public/lib/mediaplayer/flutter/media_player_controller.dart
@@ -48,7 +48,7 @@
@override
void onMediaPlayerCreated(PlayerProxy player) {
if (!_wasActive) {
- final EventPairPair viewTokens = new EventPairPair();
+ final EventPairPair viewTokens = EventPairPair();
assert(viewTokens.status == ZX.OK);
player.createView2(viewTokens.first);
@@ -71,7 +71,7 @@
@override
void addListener(VoidCallback listener) {
if (_disposed) {
- throw new StateError('Object disposed');
+ throw StateError('Object disposed');
}
_listeners.add(listener);
@@ -80,7 +80,7 @@
@override
void removeListener(VoidCallback listener) {
if (_disposed) {
- throw new StateError('Object disposed');
+ throw StateError('Object disposed');
}
_listeners.remove(listener);
@@ -114,7 +114,7 @@
_hideTimer?.cancel();
- _hideTimer = new Timer(overlayAutoHideDuration, () {
+ _hideTimer = Timer(overlayAutoHideDuration, () {
_hideTimer = null;
if (!shouldShowControlOverlay) {
_notifyListeners();
@@ -128,7 +128,7 @@
/// The duration to show the control overlay when [brieflyShowControlOverlay]
/// is called. The default is 3 seconds.
- Duration overlayAutoHideDuration = const Duration(seconds: 3);
+ Duration overlayAutoHideDuration = Duration(seconds: 3);
/// Gets the physical size of the video.
Size get videoPhysicalSize => hasVideo ? _videoSize : Size.zero;
@@ -146,7 +146,7 @@
double ratio =
pixelAspectRatio.width.toDouble() / pixelAspectRatio.height.toDouble();
- _videoSize = new Size(
+ _videoSize = Size(
videoSize.width.toDouble() * ratio, videoSize.height.toDouble());
scheduleMicrotask(_notifyListeners);
diff --git a/public/lib/mediaplayer/flutter/media_progress.dart b/public/lib/mediaplayer/flutter/media_progress.dart
index d42a718..f9afcd2 100644
--- a/public/lib/mediaplayer/flutter/media_progress.dart
+++ b/public/lib/mediaplayer/flutter/media_progress.dart
@@ -18,7 +18,7 @@
/// Generate and Entity object capable of being sent over a Link
MediaProgressEntityData toEntity() =>
- new MediaProgressEntityData(_durationMsec, _normalizedProgress);
+ MediaProgressEntityData(_durationMsec, _normalizedProgress);
/// Progress through media in the range [0..1]
double _normalizedProgress;
@@ -27,7 +27,7 @@
int _durationMsec;
/// Progress through media as an absolute Duration.
- Duration get position => new Duration(milliseconds: positionMsec);
+ Duration get position => Duration(milliseconds: positionMsec);
/// Progress through media as absolute milliseconds.
int get positionMsec => (_durationMsec * _normalizedProgress).floor();
diff --git a/public/lib/mediaplayer/flutter/progress_notifier.dart b/public/lib/mediaplayer/flutter/progress_notifier.dart
index 251c488..5aa85c1 100644
--- a/public/lib/mediaplayer/flutter/progress_notifier.dart
+++ b/public/lib/mediaplayer/flutter/progress_notifier.dart
@@ -48,7 +48,7 @@
int delayMicroseconds = resolutionMicroseconds -
(_controller.progress.inMicroseconds % resolutionMicroseconds);
- _timer = new Timer(new Duration(microseconds: delayMicroseconds), () {
+ _timer = Timer(Duration(microseconds: delayMicroseconds), () {
_timer = null;
if (_disposed || !_controller.playing) {
@@ -86,7 +86,7 @@
ProgressNotifier withExcursion(double excursion, BuildContext context) {
double effectiveExcursion =
excursion * MediaQuery.of(context).devicePixelRatio;
- return withResolution(new Duration(
+ return withResolution(Duration(
microseconds:
(_controller.duration.inMicroseconds / effectiveExcursion).ceil()));
}
diff --git a/public/lib/module/dart/lib/src/module_context_client.dart b/public/lib/module/dart/lib/src/module_context_client.dart
index cb0c023..849451b 100644
--- a/public/lib/module/dart/lib/src/module_context_client.dart
+++ b/public/lib/module/dart/lib/src/module_context_client.dart
@@ -60,11 +60,11 @@
/// TODO(SO-1125): implement all methods for ModuleContextClient
class ModuleContextClient {
ComponentContextClient _componentContext;
- final OngoingActivityProxy _ongoingActivityProxy = new OngoingActivityProxy();
+ final OngoingActivityProxy _ongoingActivityProxy = OngoingActivityProxy();
/// The underlying [Proxy] used to send client requests to the
/// [fidl.ModuleContext] service.
- final fidl.ModuleContextProxy proxy = new fidl.ModuleContextProxy();
+ final fidl.ModuleContextProxy proxy = fidl.ModuleContextProxy();
final List<LinkClient> _links = <LinkClient>[];
/// Constructor.
@@ -76,7 +76,7 @@
..onUnbind = _handleUnbind;
}
- final Completer<Null> _bind = new Completer<Null>();
+ final Completer<Null> _bind = Completer<Null>();
/// A future that completes when the [proxy] is bound.
Future<Null> get bound => _bind.future;
@@ -98,7 +98,7 @@
// client is.
_links.add(linkClient);
- Completer<Null> completer = new Completer<Null>();
+ Completer<Null> completer = Completer<Null>();
try {
await bound;
@@ -139,11 +139,11 @@
if (_componentContext != null) {
return _componentContext;
} else {
- _componentContext = new ComponentContextClient();
+ _componentContext = ComponentContextClient();
}
Completer<ComponentContextClient> completer =
- new Completer<ComponentContextClient>();
+ Completer<ComponentContextClient>();
// ignore: unawaited_futures
proxy.ctrl.error.then((ProxyError err) {
@@ -185,10 +185,10 @@
assert(surfaceRelation != null);
Completer<ModuleControllerClient> completer =
- new Completer<ModuleControllerClient>();
+ Completer<ModuleControllerClient>();
// TODO(): map results and reuse for subsequent calls, see getLink.
- ModuleControllerClient controller = new ModuleControllerClient();
+ ModuleControllerClient controller = ModuleControllerClient();
// ignore: unawaited_futures
proxy.ctrl.error.then((ProxyError err) {
@@ -210,11 +210,11 @@
completer.complete(controller);
break;
case fidl.StartModuleStatus.noModulesFound:
- completer.completeError(new ResolutionException('no modules found'));
+ completer.completeError(ResolutionException('no modules found'));
break;
default:
completer.completeError(
- new ResolutionException('unknown status: $status'));
+ ResolutionException('unknown status: $status'));
}
}
@@ -241,9 +241,9 @@
assert(name != null && name.isNotEmpty);
assert(intent != null);
- Completer<EmbeddedModule> completer = new Completer<EmbeddedModule>();
- InterfacePair<ViewOwner> viewOwner = new InterfacePair<ViewOwner>();
- ModuleControllerClient controller = new ModuleControllerClient();
+ Completer<EmbeddedModule> completer = Completer<EmbeddedModule>();
+ InterfacePair<ViewOwner> viewOwner = InterfacePair<ViewOwner>();
+ ModuleControllerClient controller = ModuleControllerClient();
void handleIntentStatus(fidl.StartModuleStatus status) {
log.fine('resolved "$name" with status "$status"');
@@ -257,19 +257,19 @@
value: EventPair(viewOwner.passHandle().passChannel().passHandle()),
));
- EmbeddedModule result = new EmbeddedModule(
+ EmbeddedModule result = EmbeddedModule(
controller: controller,
connection: connection,
- view: new ChildView(connection: connection),
+ view: ChildView(connection: connection),
);
completer.complete(result);
break;
case fidl.StartModuleStatus.noModulesFound:
- completer.completeError(new ResolutionException('no modules found'));
+ completer.completeError(ResolutionException('no modules found'));
break;
default:
completer.completeError(
- new ResolutionException('unknown status: $status'));
+ ResolutionException('unknown status: $status'));
}
}
@@ -304,7 +304,7 @@
/// See [fidl.ModuleContext#getStoryId].
Future<String> getStoryId() async {
- Completer<String> completer = new Completer<String>();
+ Completer<String> completer = Completer<String>();
try {
await bound;
@@ -324,7 +324,7 @@
/// See [fidl:ModuleContext#active].
Future<Null> active() async {
- Completer<Null> completer = new Completer<Null>();
+ Completer<Null> completer = Completer<Null>();
try {
await bound;
@@ -345,7 +345,7 @@
/// See [fidl:ModuleContext#done]
Future<void> done() async {
- Completer completer = new Completer();
+ Completer completer = Completer();
try {
await bound;
@@ -368,7 +368,7 @@
Future<void> requestStoryVisibilityState(
fidl.StoryVisibilityState state) async {
log.fine('requestStoryVisibilityState requesting state $state');
- Completer completer = new Completer();
+ Completer completer = Completer();
try {
await bound;
@@ -392,7 +392,7 @@
OngoingActivityType type) async {
await bound;
Completer<OngoingActivityProxy> completer =
- new Completer<OngoingActivityProxy>();
+ Completer<OngoingActivityProxy>();
try {
if (!_ongoingActivityProxy.ctrl.isBound) {
diff --git a/public/lib/module/dart/lib/src/module_controller_client.dart b/public/lib/module/dart/lib/src/module_controller_client.dart
index 4c7fa71..2b47261 100644
--- a/public/lib/module/dart/lib/src/module_controller_client.dart
+++ b/public/lib/module/dart/lib/src/module_controller_client.dart
@@ -14,7 +14,7 @@
class ModuleControllerClient {
/// The underlying [fidl.ModuleControllerProxy] used to send client requests
/// to the [fidl.ModuleController] service.
- final fidl.ModuleControllerProxy proxy = new fidl.ModuleControllerProxy();
+ final fidl.ModuleControllerProxy proxy = fidl.ModuleControllerProxy();
/// Constructor.
ModuleControllerClient() {
@@ -25,7 +25,7 @@
..onUnbind = _handleUnbind;
}
- final Completer<Null> _bind = new Completer<Null>();
+ final Completer<Null> _bind = Completer<Null>();
/// A future that completes when the [proxy] is bound.
Future<Null> get bound => _bind.future;
@@ -49,7 +49,7 @@
/// Focus the module.
Future<Null> focus() async {
- Completer<Null> completer = new Completer<Null>();
+ Completer<Null> completer = Completer<Null>();
// ignore: unawaited_futures
proxy.ctrl.error.then((ProxyError err) {
@@ -70,7 +70,7 @@
/// Defocus the module.
Future<Null> defocus() async {
- Completer<Null> completer = new Completer<Null>();
+ Completer<Null> completer = Completer<Null>();
// ignore: unawaited_futures
proxy.ctrl.error.then((ProxyError err) {
@@ -91,7 +91,7 @@
/// Stop the module.
Future<Null> stop() async {
- Completer<Null> completer = new Completer<Null>();
+ Completer<Null> completer = Completer<Null>();
// ignore: unawaited_futures
proxy.ctrl.error.then((ProxyError err) {
diff --git a/public/lib/module_resolver/dart/intent_builder.dart b/public/lib/module_resolver/dart/intent_builder.dart
index b1e40d7..55e6afa 100644
--- a/public/lib/module_resolver/dart/intent_builder.dart
+++ b/public/lib/module_resolver/dart/intent_builder.dart
@@ -15,18 +15,18 @@
// Creates a new intent builder with both an action and a handler.
IntentBuilder({String action, String handler})
- : _intent = new Intent(
+ : _intent = Intent(
action: action, handler: handler, parameters: <IntentParameter>[]);
// Creates a new intent builder where the intent's action is set to the
// provided name.
IntentBuilder.action(String name)
- : _intent = new Intent(action: name, parameters: <IntentParameter>[]);
+ : _intent = Intent(action: name, parameters: <IntentParameter>[]);
// Creates a new intent builder where the intent's handler is set to the
// provided handler string.
IntentBuilder.handler(String handler)
- : _intent = new Intent(
+ : _intent = Intent(
action: '', handler: handler, parameters: <IntentParameter>[]);
// Converts |value| to a JSON object and adds it to the Intent. For typed
@@ -35,15 +35,15 @@
String jsonString = json.encode(value);
var jsonList = Uint8List.fromList(utf8.encode(jsonString));
var data = fuchsia_mem.Buffer(
- vmo: new SizedVmo.fromUint8List(jsonList),
+ vmo: SizedVmo.fromUint8List(jsonList),
size: jsonList.length,
);
- _addParameter(name, new IntentParameterData.withJson(data));
+ _addParameter(name, IntentParameterData.withJson(data));
}
// Adds a parameter that containts an entity reference to the intent.
void addParameterFromEntityReference(String name, String reference) {
- _addParameter(name, new IntentParameterData.withEntityReference(reference));
+ _addParameter(name, IntentParameterData.withEntityReference(reference));
}
// The intent being built.
@@ -55,6 +55,6 @@
void _addParameter(String name, IntentParameterData parameterData) {
_addParameterFromIntentParameter(
- new IntentParameter(name: name, data: parameterData));
+ IntentParameter(name: name, data: parameterData));
}
}
diff --git a/public/lib/proposal/dart/lib/src/proposal_builder.dart b/public/lib/proposal/dart/lib/src/proposal_builder.dart
index c49fade..fa1caad 100644
--- a/public/lib/proposal/dart/lib/src/proposal_builder.dart
+++ b/public/lib/proposal/dart/lib/src/proposal_builder.dart
@@ -157,7 +157,7 @@
}
HandleResult result = System.vmoCreate(response.bodyBytes.lengthInBytes);
if (result.status == 0 && result.handle != null) {
- SizedVmo vmo = new SizedVmo(
+ SizedVmo vmo = SizedVmo(
result.handle,
response.bodyBytes.lengthInBytes,
);
@@ -172,7 +172,7 @@
String modifiedUrl =
url.startsWith('file://') ? url.substring('file://'.length) : url;
try {
- return new SizedVmo.fromFile(modifiedUrl);
+ return SizedVmo.fromFile(modifiedUrl);
// ignore: avoid_catching_errors
} on ZxStatusException catch (e) {
log.severe('Caught exception reading \'$modifiedUrl\' (\'$url\')! $e');
@@ -190,8 +190,8 @@
if (image == null) {
return null;
}
- return new SuggestionDisplayImage(
- image: new EncodedImage(vmo: image, size: image.size),
+ return SuggestionDisplayImage(
+ image: EncodedImage(vmo: image, size: image.size),
imageType: imageType,
);
}
diff --git a/public/lib/proposal/dart/lib/src/proposal_builder_async.dart b/public/lib/proposal/dart/lib/src/proposal_builder_async.dart
index ec46f9e..2e2b632 100644
--- a/public/lib/proposal/dart/lib/src/proposal_builder_async.dart
+++ b/public/lib/proposal/dart/lib/src/proposal_builder_async.dart
@@ -157,7 +157,7 @@
}
HandleResult result = System.vmoCreate(response.bodyBytes.lengthInBytes);
if (result.status == 0 && result.handle != null) {
- SizedVmo vmo = new SizedVmo(
+ SizedVmo vmo = SizedVmo(
result.handle,
response.bodyBytes.lengthInBytes,
);
@@ -172,7 +172,7 @@
String modifiedUrl =
url.startsWith('file://') ? url.substring('file://'.length) : url;
try {
- return new SizedVmo.fromFile(modifiedUrl);
+ return SizedVmo.fromFile(modifiedUrl);
// ignore: avoid_catching_errors
} on ZxStatusException catch (e) {
log.severe('Caught exception reading \'$modifiedUrl\' (\'$url\')! $e');
@@ -190,8 +190,8 @@
if (image == null) {
return null;
}
- return new SuggestionDisplayImage(
- image: new EncodedImage(vmo: image, size: image.size),
+ return SuggestionDisplayImage(
+ image: EncodedImage(vmo: image, size: image.size),
imageType: imageType,
);
}
diff --git a/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart b/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart
index ffae64c..0d3398e 100644
--- a/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart
@@ -80,14 +80,14 @@
case _kMovieType:
return _movieFromMap(map);
default:
- throw new FormatException(
+ throw FormatException(
'Converting AssetSpecifierEntityData with unsupported type: ${map[_kAssetTypeKey]}');
}
}
static AssetSpecifierEntityData _movieFromMap(Map<String, dynamic> map) {
if (map[_kAssetUriKey] == null || map[_kAssetUriKey] is! String) {
- throw new FormatException(
+ throw FormatException(
'Converting AssetSpecifierEntityData with invalid Uri: ${map[_kAssetUriKey]}');
}
String uri = map[_kAssetUriKey];
@@ -95,6 +95,6 @@
throw const FormatException(
'Converting AssetSpecifierEntityData with null Uri');
}
- return new AssetSpecifierEntityData.movie(uri: uri);
+ return AssetSpecifierEntityData.movie(uri: uri);
}
}
diff --git a/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart b/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart
index 6e93160..6393e81 100644
--- a/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart
@@ -50,7 +50,7 @@
map[_kProgressKey] is! double) {
throw const FormatException('Converting Entity with invalid values');
}
- return new MediaProgressEntityData(map[_kDurationKey], map[_kProgressKey]);
+ return MediaProgressEntityData(map[_kDurationKey], map[_kProgressKey]);
}
// Convert to a json string suitable for sending over a Link
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart
index b43d3e6..4f87d00 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart
@@ -33,5 +33,5 @@
assert(data.isNotEmpty);
final int value = parseInt(data);
- return new ColorEntityData(value: value);
+ return ColorEntityData(value: value);
}
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart
index cfdf4b7..ab93b68 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart
@@ -25,8 +25,8 @@
/// Encodes [ContactEntityData] into a [String]
String _encode(ContactEntityData contact) {
Map<String, Object> data = <String, Object>{};
- EmailEntityCodec emailCodec = new EmailEntityCodec();
- PhoneNumberEntityCodec phoneCodec = new PhoneNumberEntityCodec();
+ EmailEntityCodec emailCodec = EmailEntityCodec();
+ PhoneNumberEntityCodec phoneCodec = PhoneNumberEntityCodec();
data['id'] = contact.id;
data['displayName'] = contact.displayName;
@@ -49,9 +49,9 @@
try {
Map<String, dynamic> decodedJson = json.decode(data);
- EmailEntityCodec emailCodec = new EmailEntityCodec();
- PhoneNumberEntityCodec phoneNumberCodec = new PhoneNumberEntityCodec();
- return new ContactEntityData(
+ EmailEntityCodec emailCodec = EmailEntityCodec();
+ PhoneNumberEntityCodec phoneNumberCodec = PhoneNumberEntityCodec();
+ return ContactEntityData(
id: decodedJson['id'],
displayName: decodedJson['displayName'],
givenName: decodedJson['givenName'] ?? '',
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart
index 895e679..4b6b421 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart
@@ -45,9 +45,9 @@
List<PhoneNumberEntityData> phoneNumbers,
}) : assert(id != null && id.isNotEmpty),
assert(displayName != null && displayName.isNotEmpty),
- emailAddresses = new List<EmailEntityData>.unmodifiable(
+ emailAddresses = List<EmailEntityData>.unmodifiable(
emailAddresses ?? <EmailEntityData>[]),
- phoneNumbers = new List<PhoneNumberEntityData>.unmodifiable(
+ phoneNumbers = List<PhoneNumberEntityData>.unmodifiable(
phoneNumbers ?? <PhoneNumberEntityData>[]);
/// The primary email is the first entry in the list of emails
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart
index 7144e01..ce9ec28 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart
@@ -38,7 +38,7 @@
assert(data.isNotEmpty);
try {
Map<String, String> decodedJson = json.decode(data);
- return new EmailEntityData(
+ return EmailEntityData(
value: decodedJson['value'],
label: decodedJson['label'] ?? '',
);
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart
index 401ba6f..d7dabb5 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart
@@ -36,7 +36,7 @@
return null;
}
- FilterEntityData filter = new FilterEntityData();
+ FilterEntityData filter = FilterEntityData();
try {
Map<String, String> decoded = json.decode(data).cast<String, String>();
filter.prefix = decoded['prefix'];
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart
index cd10edc..edf51d1 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart
@@ -38,7 +38,7 @@
try {
Map<String, String> decodedJson = json.decode(data);
- return new PhoneNumberEntityData(
+ return PhoneNumberEntityData(
number: decodedJson['number'],
label: decodedJson['label'] ?? '',
);
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart
index 49a7123..ecac792 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart
@@ -29,5 +29,5 @@
/// Decodes [String] into a structured [DocumentsIdEntityData].
DocumentsIdEntityData _decode(String data) {
- return new DocumentsIdEntityData(id: data);
+ return DocumentsIdEntityData(id: data);
}
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart
index 552a082..f8169f7 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart
@@ -42,15 +42,15 @@
try {
Map<String, dynamic> decodedJson = json.decode(data);
if (!decodedJson.containsKey('action') && !decodedJson.containsKey('handler')) {
- throw new Exception('Invalid IntentEntityData: data does not contain action'
+ throw Exception('Invalid IntentEntityData: data does not contain action'
' or handler.');
}
IntentEntityData entity;
if (decodedJson.containsKey('action')) {
- entity = new IntentEntityData.fromAction(decodedJson['action']);
+ entity = IntentEntityData.fromAction(decodedJson['action']);
} else {
- entity = new IntentEntityData.fromHandler(decodedJson['handler']);
+ entity = IntentEntityData.fromHandler(decodedJson['handler']);
}
entity.parameters.addAll(decodedJson['parameters'].cast<String, String>());
return entity;
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart
index 6a5c876..c30788d 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart
@@ -41,7 +41,7 @@
/// Decodes [String] into a structured [GeolocationEntityCodec].
GeolocationEntityData _decode(String data) {
if (data == null || data.isEmpty || data == 'null') {
- throw new FormatException('Entity data is null: "$data"');
+ throw FormatException('Entity data is null: "$data"');
}
// TODO(MS-1428): use a schema to validate decoded value.
@@ -60,10 +60,10 @@
} catch (err, stackTrace) {
log.warning(
'Exception occured during JSON destructuring: \n$err\n$stackTrace');
- throw new FormatException('Invalid JSON data: "$map"');
+ throw FormatException('Invalid JSON data: "$map"');
}
- return new GeolocationEntityData(
+ return GeolocationEntityData(
lat: lat,
long: long,
accuracy: accuracy,
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart
index 66e3a6c..f34b7bb 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart
@@ -40,7 +40,7 @@
/// Decodes [String] into a structured [StreetLocationEntityCodec].
StreetLocationEntityData _decode(String data) {
if (data == null || data.isEmpty || data == 'null') {
- throw new FormatException('Entity data is null: "$data"');
+ throw FormatException('Entity data is null: "$data"');
}
// TODO(MS-1428): use a schema to validate decoded value.
@@ -57,10 +57,10 @@
} catch (err, stackTrace) {
log.warning(
'Exception occured during JSON destructuring: \n$err\n$stackTrace');
- throw new FormatException('Invalid JSON data: "$map"');
+ throw FormatException('Invalid JSON data: "$map"');
}
- return new StreetLocationEntityData(
+ return StreetLocationEntityData(
streetAddress: streetAddress,
locality: locality,
);
diff --git a/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart b/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart
index 94e07df..1d7a49f 100644
--- a/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart
@@ -31,5 +31,5 @@
assert(data != null);
assert(data.isNotEmpty);
- return new StatusEntityData(value: data);
+ return StatusEntityData(value: data);
}
diff --git a/public/lib/schemas/dart/lib/src/entity_codec.dart b/public/lib/schemas/dart/lib/src/entity_codec.dart
index 737d21e..8ce73cd 100644
--- a/public/lib/schemas/dart/lib/src/entity_codec.dart
+++ b/public/lib/schemas/dart/lib/src/entity_codec.dart
@@ -39,8 +39,8 @@
assert(type.isEmpty == false),
assert(encode != null),
assert(decode != null),
- _encoder = new _EntityEncoder<T>(encode),
- _decoder = new _EntityDecoder<T>(decode);
+ _encoder = _EntityEncoder<T>(encode),
+ _decoder = _EntityDecoder<T>(decode);
@override
_EntityEncoder<T> get encoder => _encoder;
@@ -75,9 +75,9 @@
@override
Stream<T> bind(Stream<String> source) {
EntityDecoderSink<T> map(EventSink<T> out) =>
- new EntityDecoderSink<T>(out, this);
+ EntityDecoderSink<T>(out, this);
- return new Stream<T>.eventTransformed(source, map);
+ return Stream<T>.eventTransformed(source, map);
}
}
diff --git a/public/lib/schemas/dart/test/entity_codec_test.dart b/public/lib/schemas/dart/test/entity_codec_test.dart
index 3e8bc83..a5a7444 100644
--- a/public/lib/schemas/dart/test/entity_codec_test.dart
+++ b/public/lib/schemas/dart/test/entity_codec_test.dart
@@ -9,16 +9,16 @@
void main() {
group('EntityCodec<T> streaming transform', () {
- final EntityCodec<BasicExample> codec = new EntityCodec<BasicExample>(
+ final EntityCodec<BasicExample> codec = EntityCodec<BasicExample>(
type: 'com.example.basic',
encode: (BasicExample value) => value.name,
- decode: (String data) => new BasicExample(data),
+ decode: (String data) => BasicExample(data),
);
test('stream.transform(codec)', () async {
List<String> list = <String>['foo', 'bar', 'baz'];
- Stream<String> stream = new Stream<String>.fromIterable(list);
+ Stream<String> stream = Stream<String>.fromIterable(list);
List<String> results = await stream
.transform(codec.decoder)
.map((BasicExample e) => e.name)
diff --git a/public/lib/settings/lib/audio.pb.dart b/public/lib/settings/lib/audio.pb.dart
index c41a078..6437941 100644
--- a/public/lib/settings/lib/audio.pb.dart
+++ b/public/lib/settings/lib/audio.pb.dart
@@ -10,7 +10,7 @@
import 'package:protobuf/protobuf.dart' as $pb;
class Audio extends $pb.GeneratedMessage {
- static final $pb.BuilderInfo _i = new $pb.BuilderInfo('Audio')
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo('Audio')
..a<double>(1, 'gain', $pb.PbFieldType.OD)
..aOB(2, 'muted')
..hasRequiredFields = false
@@ -19,12 +19,12 @@
Audio() : super();
Audio.fromBuffer(List<int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromBuffer(i, r);
Audio.fromJson(String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) : super.fromJson(i, r);
- Audio clone() => new Audio()..mergeFromMessage(this);
+ Audio clone() => Audio()..mergeFromMessage(this);
Audio copyWith(void Function(Audio) updates) => super.copyWith((message) => updates(message as Audio));
$pb.BuilderInfo get info_ => _i;
- static Audio create() => new Audio();
+ static Audio create() => Audio();
Audio createEmptyInstance() => create();
- static $pb.PbList<Audio> createRepeated() => new $pb.PbList<Audio>();
+ static $pb.PbList<Audio> createRepeated() => $pb.PbList<Audio>();
static Audio getDefault() => _defaultInstance ??= create()..freeze();
static Audio _defaultInstance;
static void $checkItem(Audio v) {
diff --git a/public/lib/settings/lib/audio.pbjson.dart b/public/lib/settings/lib/audio.pbjson.dart
index b963c5c..ebda0b2 100644
--- a/public/lib/settings/lib/audio.pbjson.dart
+++ b/public/lib/settings/lib/audio.pbjson.dart
@@ -4,9 +4,9 @@
///
// ignore_for_file: non_constant_identifier_names,library_prefixes,unused_import
-const Audio$json = const {
+const Audio$json = {
'1': 'Audio',
- '2': const [
+ '2': [
const {'1': 'gain', '3': 1, '4': 1, '5': 1, '10': 'gain'},
const {'1': 'muted', '3': 2, '4': 1, '5': 8, '10': 'muted'},
],
diff --git a/public/lib/settings/lib/setting_store_factory.dart b/public/lib/settings/lib/setting_store_factory.dart
index 4926359..aab7f79 100644
--- a/public/lib/settings/lib/setting_store_factory.dart
+++ b/public/lib/settings/lib/setting_store_factory.dart
@@ -26,7 +26,7 @@
/// Returns the setting store for [Audio].
SettingStore<Audio> createAudioStore() {
- return new SettingStore<Audio>(
- _deviceSettingsManagerService, 'Audio', new Audio());
+ return SettingStore<Audio>(
+ _deviceSettingsManagerService, 'Audio', Audio());
}
}
diff --git a/public/lib/settings/lib/setting_store_factory_legacy.dart b/public/lib/settings/lib/setting_store_factory_legacy.dart
index 8dc59cb..3b482c4 100644
--- a/public/lib/settings/lib/setting_store_factory_legacy.dart
+++ b/public/lib/settings/lib/setting_store_factory_legacy.dart
@@ -29,8 +29,8 @@
/// Returns the setting store for [Audio].
SettingStoreLegacy<Audio> createAudioStore() {
- return new SettingStoreLegacy<Audio>(
- _deviceSettingsManagerService, 'Audio', new Audio());
+ return SettingStoreLegacy<Audio>(
+ _deviceSettingsManagerService, 'Audio', Audio());
}
/// Handles connection error to the settings service.
diff --git a/public/lib/story/dart/lib/src/link_client.dart b/public/lib/story/dart/lib/src/link_client.dart
index 5b00e2e..8c06c63 100644
--- a/public/lib/story/dart/lib/src/link_client.dart
+++ b/public/lib/story/dart/lib/src/link_client.dart
@@ -38,7 +38,7 @@
class LinkClient {
/// The underlying [Proxy] used to send client requests to the [fidl.Link]
/// service.
- final fidl.LinkProxy proxy = new fidl.LinkProxy();
+ final fidl.LinkProxy proxy = fidl.LinkProxy();
/// The name of the link.
final String name;
@@ -59,7 +59,7 @@
..onUnbind = _handleUnbind;
}
- final Completer<Null> _bind = new Completer<Null>();
+ final Completer<Null> _bind = Completer<Null>();
/// A future that completes when the [proxy] is bound.
Future<Null> get bound => _bind.future;
@@ -75,7 +75,7 @@
}) async {
log.fine('#get($path)');
- Completer<Object> completer = new Completer<Object>();
+ Completer<Object> completer = Completer<Object>();
try {
await bound;
@@ -107,7 +107,7 @@
}) async {
log.fine('#set($path, $json)');
- Completer<Null> completer = new Completer<Null>();
+ Completer<Null> completer = Completer<Null>();
try {
await bound;
@@ -119,7 +119,7 @@
String jsonString = json.encode(jsonData);
var jsonList = Uint8List.fromList(utf8.encode(jsonString));
var data = fuchsia_mem.Buffer(
- vmo: new SizedVmo.fromUint8List(jsonList),
+ vmo: SizedVmo.fromUint8List(jsonList),
size: jsonList.length,
);
@@ -160,13 +160,13 @@
// TODO(SO-1127): connect the stream's control plane to the underlying link watcher
// so that it properly responds to clients requesting listen, pause, resume,
// cancel.
- StreamController<String> controller = new StreamController<String>();
+ StreamController<String> controller = StreamController<String>();
_streams.add(controller);
bound.then((_) {
log.fine('link proxy bound, adding watcher');
- LinkWatcherHost watcher = new LinkWatcherHost(onNotify: (String data) {
+ LinkWatcherHost watcher = LinkWatcherHost(onNotify: (String data) {
// TODO: remove when MI4-940 is done
bool isInitialNullData =
(data == null || data == 'null') && !_receivedInitialValue;
@@ -196,7 +196,7 @@
assert(ref != null);
assert(ref.isNotEmpty);
- Completer<Null> completer = new Completer<Null>();
+ Completer<Null> completer = Completer<Null>();
try {
await bound;
@@ -233,7 +233,7 @@
/// See [fidl.Link#getEntity].
Future<String> getEntity() async {
- Completer<String> completer = new Completer<String>();
+ Completer<String> completer = Completer<String>();
try {
await bound;
diff --git a/public/lib/story/dart/lib/src/link_watcher_host.dart b/public/lib/story/dart/lib/src/link_watcher_host.dart
index a4eea53..454ac05 100644
--- a/public/lib/story/dart/lib/src/link_watcher_host.dart
+++ b/public/lib/story/dart/lib/src/link_watcher_host.dart
@@ -16,7 +16,7 @@
/// Hosts a [LinkWatcherImpl] and manages the underlying [binding].
class LinkWatcherHost {
/// The [Binding] that connects the [impl] to client requests.
- final fidl.LinkWatcherBinding binding = new fidl.LinkWatcherBinding();
+ final fidl.LinkWatcherBinding binding = fidl.LinkWatcherBinding();
/// Callback for when the Link content value updates.
final LinkWatcherNotifyCallback onNotify;
@@ -29,7 +29,7 @@
LinkWatcherHost({
@required this.onNotify,
}) : assert(onNotify != null) {
- impl = new LinkWatcherImpl(
+ impl = LinkWatcherImpl(
onNotify: onNotify,
);
@@ -45,12 +45,12 @@
/// Async version of binding.wrap()
Future<InterfaceHandle<fidl.LinkWatcher>> wrap() {
if (_wrap != null) {
- Exception err = new Exception(
+ Exception err = Exception(
'failing due to rebind attempt on an active connection');
_wrap.completeError(err);
return _wrap.future;
} else {
- _wrap = new Completer<InterfaceHandle<fidl.LinkWatcher>>();
+ _wrap = Completer<InterfaceHandle<fidl.LinkWatcher>>();
}
InterfaceHandle<fidl.LinkWatcher> handle;
@@ -64,7 +64,7 @@
// TODO: binding.wrap should use exceptions instead of a null value for
// failure modes.
if (handle == null) {
- Exception err = new Exception('failed to wrap LinkWatcherImpl');
+ Exception err = Exception('failed to wrap LinkWatcherImpl');
_wrap.completeError(err);
}
@@ -79,7 +79,7 @@
}
void _handleConnectionError() {
- Exception err = new Exception('binding connection failed');
+ Exception err = Exception('binding connection failed');
if (_wrap != null && !_wrap.isCompleted) {
_wrap.completeError(err);
diff --git a/public/lib/story/dart/lib/src/link_watcher_impl.dart b/public/lib/story/dart/lib/src/link_watcher_impl.dart
index 3c1c70b..1c439e6 100644
--- a/public/lib/story/dart/lib/src/link_watcher_impl.dart
+++ b/public/lib/story/dart/lib/src/link_watcher_impl.dart
@@ -24,7 +24,7 @@
@override
void notify(fuchsia_mem.Buffer buffer) {
- var dataVmo = new SizedVmo(buffer.vmo.handle, buffer.size);
+ var dataVmo = SizedVmo(buffer.vmo.handle, buffer.size);
var data = dataVmo.read(buffer.size);
dataVmo.close();
onNotify(utf8.decode(data.bytesAsUint8List()));
diff --git a/public/lib/testing/flutter/lib/src/fake_image_http_client.dart b/public/lib/testing/flutter/lib/src/fake_image_http_client.dart
index 350516a..aed23be 100644
--- a/public/lib/testing/flutter/lib/src/fake_image_http_client.dart
+++ b/public/lib/testing/flutter/lib/src/fake_image_http_client.dart
@@ -35,7 +35,7 @@
class FakeHttpClientRequest implements HttpClientRequest {
@override
HttpHeaders get headers {
- return new FakeHttpHeaders();
+ return FakeHttpHeaders();
}
@override
@@ -65,7 +65,7 @@
@override
StreamSubscription<List<int>> listen(void onData(List<int> event),
{Function onError, void onDone(), bool cancelOnError}) {
- return new Stream<List<int>>.fromIterable(
+ return Stream<List<int>>.fromIterable(
<List<int>>[_kTransparentImageBytes])
.listen(onData,
onDone: onDone, onError: onError, cancelOnError: cancelOnError);
diff --git a/public/lib/ui/flutter/child_view.dart b/public/lib/ui/flutter/child_view.dart
index a903fde..7b5fe9b 100644
--- a/public/lib/ui/flutter/child_view.dart
+++ b/public/lib/ui/flutter/child_view.dart
@@ -37,7 +37,7 @@
{ChildViewConnectionCallback onAvailable,
ChildViewConnectionCallback onUnavailable})
: this.fromViewHolderToken(
- new EventPair(viewOwner?.passChannel()?.passHandle()),
+ EventPair(viewOwner?.passChannel()?.passHandle()),
onAvailable: onAvailable,
onUnavailable: onUnavailable);
@@ -55,12 +55,12 @@
InterfaceRequest<ServiceProvider> childServices,
ChildViewConnectionCallback onAvailable,
ChildViewConnectionCallback onUnavailable}) {
- final Services services = new Services();
+ final Services services = Services();
final LaunchInfo launchInfo =
- new LaunchInfo(url: url, directoryRequest: services.request());
+ LaunchInfo(url: url, directoryRequest: services.request());
try {
launcher.createComponent(launchInfo, controller);
- return new ChildViewConnection.connect(services,
+ return ChildViewConnection.connect(services,
childServices: childServices,
onAvailable: onAvailable,
onUnavailable: onUnavailable);
@@ -73,14 +73,14 @@
{InterfaceRequest<ServiceProvider> childServices,
ChildViewConnectionCallback onAvailable,
ChildViewConnectionCallback onUnavailable}) {
- final app.ViewProviderProxy viewProvider = new app.ViewProviderProxy();
+ final app.ViewProviderProxy viewProvider = app.ViewProviderProxy();
services.connectToService(viewProvider.ctrl);
try {
- EventPairPair viewTokens = new EventPairPair();
+ EventPairPair viewTokens = EventPairPair();
assert(viewTokens.status == ZX.OK);
viewProvider.createView(viewTokens.second, childServices, null);
- return new ChildViewConnection.fromViewHolderToken(viewTokens.first,
+ return ChildViewConnection.fromViewHolderToken(viewTokens.first,
onAvailable: onAvailable, onUnavailable: onUnavailable);
} finally {
viewProvider.ctrl.close();
@@ -123,11 +123,11 @@
assert(!_available);
assert(_sceneHost == null);
- final EventPairPair sceneTokens = new EventPairPair();
+ final EventPairPair sceneTokens = EventPairPair();
assert(sceneTokens.status == ZX.OK);
// Analyzer doesn't know Handle must be dart:zircon's Handle
- _sceneHost = new ui.SceneHost(sceneTokens.first.passHandle());
+ _sceneHost = ui.SceneHost(sceneTokens.first.passHandle());
_viewKey = nextGlobalViewKey();
globalViewContainer.addChild2(
_viewKey, _viewHolderToken, sceneTokens.second);
@@ -147,7 +147,7 @@
assert(_sceneHost != null);
assert(ViewContainerListenerImpl.instance.getConnectionForKey(_viewKey) ==
this);
- final EventPairPair viewTokens = new EventPairPair();
+ final EventPairPair viewTokens = EventPairPair();
assert(viewTokens.status == ZX.OK);
ViewContainerListenerImpl.instance.removeConnectionForKey(_viewKey);
_viewHolderToken = viewTokens.first;
@@ -231,12 +231,12 @@
return null;
}
- SizeF size = new SizeF(width: width, height: height);
- InsetF inset = new InsetF(
+ SizeF size = SizeF(width: width, height: height);
+ InsetF inset = InsetF(
top: insetTop, right: insetRight, bottom: insetBottom, left: insetLeft);
- ViewLayout viewLayout = new ViewLayout(size: size, inset: inset);
- final customFocusBehavior = new CustomFocusBehavior(allowFocus: focusable);
- return _currentViewProperties = new ViewProperties(
+ ViewLayout viewLayout = ViewLayout(size: size, inset: inset);
+ final customFocusBehavior = CustomFocusBehavior(allowFocus: focusable);
+ return _currentViewProperties = ViewProperties(
viewLayout: viewLayout,
customFocusBehavior: customFocusBehavior,
);
@@ -383,8 +383,8 @@
_width, _height, 0.0, 0.0, 0.0, 0.0, _focusable);
assert(() {
if (globalViewContainer == null) {
- _debugErrorMessage ??= new TextPainter(
- text: const TextSpan(
+ _debugErrorMessage ??= TextPainter(
+ text: TextSpan(
text:
'Child views are supported only when running in Scenic.'));
_debugErrorMessage.layout(minWidth: size.width, maxWidth: size.width);
@@ -400,7 +400,7 @@
void paint(PaintingContext context, Offset offset) {
assert(needsCompositing);
if (_connection?._available == true) {
- context.addLayer(new ChildSceneLayer(
+ context.addLayer(ChildSceneLayer(
offset: offset,
width: _width,
height: _height,
@@ -411,7 +411,7 @@
assert(() {
if (globalViewContainer == null) {
context.canvas.drawRect(
- offset & size, new Paint()..color = const Color(0xFF0000FF));
+ offset & size, Paint()..color = Color(0xFF0000FF));
_debugErrorMessage.paint(context.canvas, offset);
}
return true;
@@ -422,7 +422,7 @@
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description.add(
- new DiagnosticsProperty<ChildViewConnection>(
+ DiagnosticsProperty<ChildViewConnection>(
'connection',
connection,
),
@@ -477,11 +477,11 @@
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description
- ..add(new DiagnosticsProperty<Offset>('offset', offset))
- ..add(new DoubleProperty('width', width))
- ..add(new DoubleProperty('height', height))
- ..add(new DiagnosticsProperty<ui.SceneHost>('sceneHost', sceneHost))
- ..add(new DiagnosticsProperty<bool>('hitTestable', hitTestable));
+ ..add(DiagnosticsProperty<Offset>('offset', offset))
+ ..add(DoubleProperty('width', width))
+ ..add(DoubleProperty('height', height))
+ ..add(DiagnosticsProperty<ui.SceneHost>('sceneHost', sceneHost))
+ ..add(DiagnosticsProperty<bool>('hitTestable', hitTestable));
}
@override
@@ -496,7 +496,7 @@
class ChildView extends LeafRenderObjectWidget {
/// Creates a widget that is replaced by content from another process.
ChildView({this.connection, this.hitTestable = true, this.focusable = true})
- : super(key: new GlobalObjectKey(connection));
+ : super(key: GlobalObjectKey(connection));
/// A connection to the child whose content will replace this widget.
final ChildViewConnection connection;
@@ -513,7 +513,7 @@
@override
_RenderChildView createRenderObject(BuildContext context) {
- return new _RenderChildView(
+ return _RenderChildView(
connection: connection,
hitTestable: hitTestable,
focusable: focusable,
diff --git a/public/lib/ui/flutter/child_view_async.dart b/public/lib/ui/flutter/child_view_async.dart
index 4c52103..62a66ef 100644
--- a/public/lib/ui/flutter/child_view_async.dart
+++ b/public/lib/ui/flutter/child_view_async.dart
@@ -37,7 +37,7 @@
{ChildViewConnectionCallback onAvailable,
ChildViewConnectionCallback onUnavailable})
: this.fromViewHolderToken(
- new EventPair(viewOwner?.passChannel()?.passHandle()),
+ EventPair(viewOwner?.passChannel()?.passHandle()),
onAvailable: onAvailable,
onUnavailable: onUnavailable);
@@ -55,12 +55,12 @@
InterfaceRequest<ServiceProvider> childServices,
ChildViewConnectionCallback onAvailable,
ChildViewConnectionCallback onUnavailable}) {
- final Services services = new Services();
+ final Services services = Services();
final LaunchInfo launchInfo =
- new LaunchInfo(url: url, directoryRequest: services.request());
+ LaunchInfo(url: url, directoryRequest: services.request());
try {
launcher.createComponent(launchInfo, controller);
- return new ChildViewConnection.connect(services,
+ return ChildViewConnection.connect(services,
childServices: childServices,
onAvailable: onAvailable,
onUnavailable: onUnavailable);
@@ -73,14 +73,14 @@
{InterfaceRequest<ServiceProvider> childServices,
ChildViewConnectionCallback onAvailable,
ChildViewConnectionCallback onUnavailable}) {
- final app.ViewProviderProxy viewProvider = new app.ViewProviderProxy();
+ final app.ViewProviderProxy viewProvider = app.ViewProviderProxy();
services.connectToService(viewProvider.ctrl);
try {
- EventPairPair viewTokens = new EventPairPair();
+ EventPairPair viewTokens = EventPairPair();
assert(viewTokens.status == ZX.OK);
viewProvider.createView(viewTokens.second, childServices, null);
- return new ChildViewConnection.fromViewHolderToken(viewTokens.first,
+ return ChildViewConnection.fromViewHolderToken(viewTokens.first,
onAvailable: onAvailable, onUnavailable: onUnavailable);
} finally {
viewProvider.ctrl.close();
@@ -123,11 +123,11 @@
assert(!_available);
assert(_sceneHost == null);
- final EventPairPair sceneTokens = new EventPairPair();
+ final EventPairPair sceneTokens = EventPairPair();
assert(sceneTokens.status == ZX.OK);
// Analyzer doesn't know Handle must be dart:zircon's Handle
- _sceneHost = new ui.SceneHost(sceneTokens.first.passHandle());
+ _sceneHost = ui.SceneHost(sceneTokens.first.passHandle());
_viewKey = nextGlobalViewKey();
globalViewContainer.addChild2(
_viewKey, _viewHolderToken, sceneTokens.second);
@@ -147,7 +147,7 @@
assert(_sceneHost != null);
assert(ViewContainerListenerImpl.instance.getConnectionForKey(_viewKey) ==
this);
- final EventPairPair viewTokens = new EventPairPair();
+ final EventPairPair viewTokens = EventPairPair();
assert(viewTokens.status == ZX.OK);
ViewContainerListenerImpl.instance.removeConnectionForKey(_viewKey);
_viewHolderToken = viewTokens.first;
@@ -231,12 +231,12 @@
return null;
}
- SizeF size = new SizeF(width: width, height: height);
- InsetF inset = new InsetF(
+ SizeF size = SizeF(width: width, height: height);
+ InsetF inset = InsetF(
top: insetTop, right: insetRight, bottom: insetBottom, left: insetLeft);
- ViewLayout viewLayout = new ViewLayout(size: size, inset: inset);
- final customFocusBehavior = new CustomFocusBehavior(allowFocus: focusable);
- return _currentViewProperties = new ViewProperties(
+ ViewLayout viewLayout = ViewLayout(size: size, inset: inset);
+ final customFocusBehavior = CustomFocusBehavior(allowFocus: focusable);
+ return _currentViewProperties = ViewProperties(
viewLayout: viewLayout,
customFocusBehavior: customFocusBehavior,
);
@@ -383,8 +383,8 @@
_width, _height, 0.0, 0.0, 0.0, 0.0, _focusable);
assert(() {
if (globalViewContainer == null) {
- _debugErrorMessage ??= new TextPainter(
- text: const TextSpan(
+ _debugErrorMessage ??= TextPainter(
+ text: TextSpan(
text:
'Child views are supported only when running in Scenic.'));
_debugErrorMessage.layout(minWidth: size.width, maxWidth: size.width);
@@ -400,7 +400,7 @@
void paint(PaintingContext context, Offset offset) {
assert(needsCompositing);
if (_connection?._available == true) {
- context.addLayer(new ChildSceneLayer(
+ context.addLayer(ChildSceneLayer(
offset: offset,
width: _width,
height: _height,
@@ -411,7 +411,7 @@
assert(() {
if (globalViewContainer == null) {
context.canvas.drawRect(
- offset & size, new Paint()..color = const Color(0xFF0000FF));
+ offset & size, Paint()..color = Color(0xFF0000FF));
_debugErrorMessage.paint(context.canvas, offset);
}
return true;
@@ -422,7 +422,7 @@
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description.add(
- new DiagnosticsProperty<ChildViewConnection>(
+ DiagnosticsProperty<ChildViewConnection>(
'connection',
connection,
),
@@ -477,11 +477,11 @@
void debugFillProperties(DiagnosticPropertiesBuilder description) {
super.debugFillProperties(description);
description
- ..add(new DiagnosticsProperty<Offset>('offset', offset))
- ..add(new DoubleProperty('width', width))
- ..add(new DoubleProperty('height', height))
- ..add(new DiagnosticsProperty<ui.SceneHost>('sceneHost', sceneHost))
- ..add(new DiagnosticsProperty<bool>('hitTestable', hitTestable));
+ ..add(DiagnosticsProperty<Offset>('offset', offset))
+ ..add(DoubleProperty('width', width))
+ ..add(DoubleProperty('height', height))
+ ..add(DiagnosticsProperty<ui.SceneHost>('sceneHost', sceneHost))
+ ..add(DiagnosticsProperty<bool>('hitTestable', hitTestable));
}
@override
@@ -496,7 +496,7 @@
class ChildView extends LeafRenderObjectWidget {
/// Creates a widget that is replaced by content from another process.
ChildView({this.connection, this.hitTestable = true, this.focusable = true})
- : super(key: new GlobalObjectKey(connection));
+ : super(key: GlobalObjectKey(connection));
/// A connection to the child whose content will replace this widget.
final ChildViewConnection connection;
@@ -513,7 +513,7 @@
@override
_RenderChildView createRenderObject(BuildContext context) {
- return new _RenderChildView(
+ return _RenderChildView(
connection: connection,
hitTestable: hitTestable,
focusable: focusable,
diff --git a/public/lib/ui/flutter/fakes/mozart_fakes.dart b/public/lib/ui/flutter/fakes/mozart_fakes.dart
index 47a3f3d..a6a1c50 100644
--- a/public/lib/ui/flutter/fakes/mozart_fakes.dart
+++ b/public/lib/ui/flutter/fakes/mozart_fakes.dart
@@ -16,7 +16,7 @@
class Scenic {
static void offerServiceProvider(Handle handle, List<String> services) {
- throw new UnimplementedError(
+ throw UnimplementedError(
'offerServiceProvider is not implemented on this platform.');
}
}
diff --git a/public/lib/ui/scenic/dart/src/resources.dart b/public/lib/ui/scenic/dart/src/resources.dart
index 00ad577..1806ea4 100644
--- a/public/lib/ui/scenic/dart/src/resources.dart
+++ b/public/lib/ui/scenic/dart/src/resources.dart
@@ -15,18 +15,18 @@
Resource._create(this.session, ui_gfx.ResourceArgs resource)
: id = session.nextResourceId() {
- session.enqueue(new ui_gfx.Command.withCreateResource(
- new ui_gfx.CreateResourceCmd(id: id, resource: resource)));
+ session.enqueue(ui_gfx.Command.withCreateResource(
+ ui_gfx.CreateResourceCmd(id: id, resource: resource)));
}
Resource._import(this.session, EventPair token, ui_gfx.ImportSpec spec)
: id = session.nextResourceId() {
- session.enqueue(new ui_gfx.Command.withImportResource(
- new ui_gfx.ImportResourceCmd(id: id, token: token, spec: spec)));
+ session.enqueue(ui_gfx.Command.withImportResource(
+ ui_gfx.ImportResourceCmd(id: id, token: token, spec: spec)));
}
}
-ui_gfx.Value vector1(double val) => new ui_gfx.Value.withVector1(val);
+ui_gfx.Value vector1(double val) => ui_gfx.Value.withVector1(val);
class Node extends Resource {
Node._create(Session session, ui_gfx.ResourceArgs resource)
@@ -37,24 +37,24 @@
void setRotation(double x, double y, double z, double w) {
final ui_gfx.Quaternion quaternion =
- new ui_gfx.Quaternion(x: x, y: y, z: z, w: w);
+ ui_gfx.Quaternion(x: x, y: y, z: z, w: w);
setRotationValue(
- new ui_gfx.QuaternionValue(value: quaternion, variableId: 0));
+ ui_gfx.QuaternionValue(value: quaternion, variableId: 0));
}
void setRotationValue(ui_gfx.QuaternionValue rotation) {
- session.enqueue(new ui_gfx.Command.withSetRotation(
- new ui_gfx.SetRotationCmd(id: id, value: rotation)));
+ session.enqueue(ui_gfx.Command.withSetRotation(
+ ui_gfx.SetRotationCmd(id: id, value: rotation)));
}
void setTranslation(double x, double y, double z) {
- final ui_gfx.Vec3 vec3 = new ui_gfx.Vec3(x: x, y: y, z: z);
- setTranslationValue(new ui_gfx.Vector3Value(value: vec3, variableId: 0));
+ final ui_gfx.Vec3 vec3 = ui_gfx.Vec3(x: x, y: y, z: z);
+ setTranslationValue(ui_gfx.Vector3Value(value: vec3, variableId: 0));
}
void setTranslationValue(ui_gfx.Vector3Value vec3) {
- session.enqueue(new ui_gfx.Command.withSetTranslation(
- new ui_gfx.SetTranslationCmd(id: id, value: vec3)));
+ session.enqueue(ui_gfx.Command.withSetTranslation(
+ ui_gfx.SetTranslationCmd(id: id, value: vec3)));
}
}
@@ -67,13 +67,13 @@
: super._import(session, token, spec);
void addChild(Node child) {
- session.enqueue(new ui_gfx.Command.withAddChild(
- new ui_gfx.AddChildCmd(nodeId: id, childId: child.id)));
+ session.enqueue(ui_gfx.Command.withAddChild(
+ ui_gfx.AddChildCmd(nodeId: id, childId: child.id)));
}
void addPart(Node part) {
- session.enqueue(new ui_gfx.Command.withAddPart(
- new ui_gfx.AddPartCmd(nodeId: id, partId: part.id)));
+ session.enqueue(ui_gfx.Command.withAddPart(
+ ui_gfx.AddPartCmd(nodeId: id, partId: part.id)));
}
}
@@ -98,13 +98,13 @@
const ui_gfx.ShapeNodeArgs()));
void setMaterial(Material material) {
- session.enqueue(new ui_gfx.Command.withSetMaterial(
- new ui_gfx.SetMaterialCmd(nodeId: id, materialId: material.id)));
+ session.enqueue(ui_gfx.Command.withSetMaterial(
+ ui_gfx.SetMaterialCmd(nodeId: id, materialId: material.id)));
}
void setShape(Shape shape) {
- session.enqueue(new ui_gfx.Command.withSetShape(
- new ui_gfx.SetShapeCmd(nodeId: id, shapeId: shape.id)));
+ session.enqueue(ui_gfx.Command.withSetShape(
+ ui_gfx.SetShapeCmd(nodeId: id, shapeId: shape.id)));
}
}
@@ -116,17 +116,17 @@
const ui_gfx.MaterialArgs()));
void setColor(double red, double green, double blue, double alpha) {
- final ui_gfx.ColorRgba color = new ui_gfx.ColorRgba(
+ final ui_gfx.ColorRgba color = ui_gfx.ColorRgba(
red: (red * 255).round(),
green: (green * 255).round(),
blue: (blue * 255).round(),
alpha: (alpha * 255).round());
- setColorValue(new ui_gfx.ColorRgbaValue(value: color, variableId: 0));
+ setColorValue(ui_gfx.ColorRgbaValue(value: color, variableId: 0));
}
void setColorValue(ui_gfx.ColorRgbaValue color) {
- session.enqueue(new ui_gfx.Command.withSetColor(
- new ui_gfx.SetColorCmd(materialId: id, color: color)));
+ session.enqueue(ui_gfx.Command.withSetColor(
+ ui_gfx.SetColorCmd(materialId: id, color: color)));
}
}
@@ -144,7 +144,7 @@
double topRightRadius,
double bottomLeftRadius,
double bottomRightRadius) =>
- new RoundedRectangle.fromValues(
+ RoundedRectangle.fromValues(
session,
vector1(width),
vector1(height),
@@ -161,7 +161,7 @@
ui_gfx.Value topRightRadius,
ui_gfx.Value bottomLeftRadius,
ui_gfx.Value bottomRightRadius) {
- final ui_gfx.RoundedRectangleArgs rect = new ui_gfx.RoundedRectangleArgs(
+ final ui_gfx.RoundedRectangleArgs rect = ui_gfx.RoundedRectangleArgs(
width: width,
height: height,
topLeftRadius: topLeftRadius,
@@ -169,8 +169,8 @@
bottomLeftRadius: bottomLeftRadius,
bottomRightRadius: bottomRightRadius);
- return new RoundedRectangle._create(
- session, new ui_gfx.ResourceArgs.withRoundedRectangle(rect));
+ return RoundedRectangle._create(
+ session, ui_gfx.ResourceArgs.withRoundedRectangle(rect));
}
RoundedRectangle._create(Session session, ui_gfx.ResourceArgs resource)
diff --git a/public/lib/ui/scenic/dart/src/session.dart b/public/lib/ui/scenic/dart/src/session.dart
index be6b51b..3b43d99 100644
--- a/public/lib/ui/scenic/dart/src/session.dart
+++ b/public/lib/ui/scenic/dart/src/session.dart
@@ -23,7 +23,7 @@
class Session {
int _nextResourceId = 1;
- final ui_scenic.SessionProxy _session = new ui_scenic.SessionProxy();
+ final ui_scenic.SessionProxy _session = ui_scenic.SessionProxy();
List<ui_scenic.Command> _commands = <ui_scenic.Command>[];
Session.fromScenic(ui_scenic.ScenicProxy scenic) {
@@ -35,15 +35,15 @@
}
factory Session.fromServiceProvider(ServiceProvider serviceProvider) {
- final ui_scenic.ScenicProxy scenic = new ui_scenic.ScenicProxy();
+ final ui_scenic.ScenicProxy scenic = ui_scenic.ScenicProxy();
connectToService(serviceProvider, scenic.ctrl);
- return new Session.fromScenic(scenic);
+ return Session.fromScenic(scenic);
}
bool get hasEnqueuedCommands => _commands.isNotEmpty;
void enqueue(gfx.Command command) {
- _commands.add(new ui_scenic.Command.withGfx(command));
+ _commands.add(ui_scenic.Command.withGfx(command));
}
Future<PresentationInfo> present(int presentationTime) async {
diff --git a/public/lib/user/dart/lib/src/session_shell_impl.dart b/public/lib/user/dart/lib/src/session_shell_impl.dart
index 288729f..f84412a 100644
--- a/public/lib/user/dart/lib/src/session_shell_impl.dart
+++ b/public/lib/user/dart/lib/src/session_shell_impl.dart
@@ -31,19 +31,19 @@
class SessionShellImpl implements Lifecycle {
/// Binding for the actual SessionShell interface object.
final SessionShellContextProxy _sessionShellContextProxy =
- new SessionShellContextProxy();
- final FocusProviderProxy _focusProviderProxy = new FocusProviderProxy();
- final FocusControllerProxy _focusControllerProxy = new FocusControllerProxy();
+ SessionShellContextProxy();
+ final FocusProviderProxy _focusProviderProxy = FocusProviderProxy();
+ final FocusControllerProxy _focusControllerProxy = FocusControllerProxy();
final VisibleStoriesControllerProxy _visibleStoriesControllerProxy =
- new VisibleStoriesControllerProxy();
- final StoryProviderProxy _storyProviderProxy = new StoryProviderProxy();
+ VisibleStoriesControllerProxy();
+ final StoryProviderProxy _storyProviderProxy = StoryProviderProxy();
final SuggestionProviderProxy _suggestionProviderProxy =
- new SuggestionProviderProxy();
- final ContextReaderProxy _contextReaderProxy = new ContextReaderProxy();
- final ContextWriterProxy _contextWriterProxy = new ContextWriterProxy();
+ SuggestionProviderProxy();
+ final ContextReaderProxy _contextReaderProxy = ContextReaderProxy();
+ final ContextWriterProxy _contextWriterProxy = ContextWriterProxy();
final IntelligenceServicesProxy _intelligenceServicesProxy =
- new IntelligenceServicesProxy();
- final LinkProxy _linkProxy = new LinkProxy();
+ IntelligenceServicesProxy();
+ final LinkProxy _linkProxy = LinkProxy();
/// Called when [initialize] occurs.
final OnSessionShellReady onReady;
@@ -121,8 +121,8 @@
}
if (onNotify != null) {
- _linkWatcherImpl = new LinkWatcherImpl(onNotify: onNotify);
- _linkWatcherBinding = new LinkWatcherBinding();
+ _linkWatcherImpl = LinkWatcherImpl(onNotify: onNotify);
+ _linkWatcherBinding = LinkWatcherBinding();
if (watchAll) {
_linkProxy.watchAll(_linkWatcherBinding.wrap(_linkWatcherImpl));
diff --git a/public/lib/widgets/dart/lib/src/model/model.dart b/public/lib/widgets/dart/lib/src/model/model.dart
index 49bc90a..f2a2bc6 100644
--- a/public/lib/widgets/dart/lib/src/model/model.dart
+++ b/public/lib/widgets/dart/lib/src/model/model.dart
@@ -57,7 +57,7 @@
/// whenever there's a change to the returned model.
T of(BuildContext context, {bool rebuildOnChange = false}) {
// ignore: prefer_const_constructors
- final Type type = new _InheritedModel<T>.forRuntimeType().runtimeType;
+ final Type type = _InheritedModel<T>.forRuntimeType().runtimeType;
Widget widget = rebuildOnChange
? context.inheritFromWidgetOfExactType(type)
: context.ancestorWidgetOfExactType(type);
@@ -78,9 +78,9 @@
const ScopedModel({this.model, this.child});
@override
- Widget build(BuildContext context) => new _ModelListener(
+ Widget build(BuildContext context) => _ModelListener(
model: model,
- builder: (BuildContext context) => new _InheritedModel<T>(
+ builder: (BuildContext context) => _InheritedModel<T>(
model: model,
child: child,
),
@@ -95,7 +95,7 @@
const _ModelListener({this.model, this.builder});
@override
- _ModelListenerState createState() => new _ModelListenerState();
+ _ModelListenerState createState() => _ModelListenerState();
}
class _ModelListenerState extends State<_ModelListener> {
@@ -171,6 +171,6 @@
Widget build(BuildContext context) => builder(
context,
child,
- new ModelFinder<T>().of(context, rebuildOnChange: true),
+ ModelFinder<T>().of(context, rebuildOnChange: true),
);
}
diff --git a/runtime/dart/build_test_bootstrap.dart b/runtime/dart/build_test_bootstrap.dart
index 3357d61..dc8ecf2 100644
--- a/runtime/dart/build_test_bootstrap.dart
+++ b/runtime/dart/build_test_bootstrap.dart
@@ -13,7 +13,7 @@
/// Builds the Flutter test wrapper that gets executed by the test harness.
Future<Null> main(List<String> args) async {
- ArgParser parser = new ArgParser();
+ ArgParser parser = ArgParser();
parser.addOption(
_testNameKey,
valueHelp: 'filename',
@@ -36,6 +36,6 @@
host: InternetAddress.loopbackIPv4,
);
- File outputFile = new File(results[_outputKey]);
+ File outputFile = File(results[_outputKey]);
await outputFile.writeAsString(content);
}
diff --git a/runtime/dart/compiler.dart b/runtime/dart/compiler.dart
index 3eb7ddb..0f15f9e 100644
--- a/runtime/dart/compiler.dart
+++ b/runtime/dart/compiler.dart
@@ -30,7 +30,7 @@
try {
options = _argParser.parse(args);
if (!options.rest.isNotEmpty) {
- throw new Exception('Must specify input.dart');
+ throw Exception('Must specify input.dart');
}
} on Exception catch (error) {
print('ERROR: $error\n');
@@ -58,16 +58,16 @@
Future createManifest(
String packageManifestFilename, String dataDir, String output) async {
- List<String> packages = await new File('$output-packages').readAsLines();
+ List<String> packages = await File('$output-packages').readAsLines();
// Make sure the 'main' package is the last (convention with package loader).
packages.remove('main');
packages.add('main');
- final IOSink packageManifest = new File(packageManifestFilename).openWrite();
+ final IOSink packageManifest = File(packageManifestFilename).openWrite();
final String kernelListFilename = '$packageManifestFilename.dilplist';
- final IOSink kernelList = new File(kernelListFilename).openWrite();
+ final IOSink kernelList = File(kernelListFilename).openWrite();
for (String package in packages) {
final String filenameInPackage = '$package.dilp';
final String filenameInBuild = '$output-$package.dilp';
@@ -78,12 +78,12 @@
await kernelList.close();
final String frameworkVersionFilename = '$packageManifestFilename.frameworkversion';
- final IOSink frameworkVersion = new File(frameworkVersionFilename).openWrite();
+ final IOSink frameworkVersion = File(frameworkVersionFilename).openWrite();
for (String package in ['collection', 'flutter', 'meta', 'typed_data', 'vector_math']) {
Digest digest;
if (packages.contains(package)) {
final filenameInBuild = '$output-$package.dilp';
- final bytes = await new File(filenameInBuild).readAsBytes();
+ final bytes = await File(filenameInBuild).readAsBytes();
digest = sha256.convert(bytes);
}
frameworkVersion.write('$package=$digest\n');
diff --git a/runtime/dart_runner/embedder/builtin.dart b/runtime/dart_runner/embedder/builtin.dart
index 270decd..5c44650 100644
--- a/runtime/dart_runner/embedder/builtin.dart
+++ b/runtime/dart_runner/embedder/builtin.dart
@@ -25,7 +25,7 @@
_rawScript.startsWith('file:')) {
return Uri.parse(_rawScript);
} else {
- return Uri.base.resolveUri(new Uri.file(_rawScript));
+ return Uri.base.resolveUri(Uri.file(_rawScript));
}
}
diff --git a/runtime/dart_runner/examples/goodbye_dart/goodbye_dart.dart b/runtime/dart_runner/examples/goodbye_dart/goodbye_dart.dart
index 52f0ba9..ffd838a 100644
--- a/runtime/dart_runner/examples/goodbye_dart/goodbye_dart.dart
+++ b/runtime/dart_runner/examples/goodbye_dart/goodbye_dart.dart
@@ -17,7 +17,7 @@
fuchsia.exit(23);
}
- _timer = new Timer(const Duration(seconds: 1), () {
+ _timer = Timer(const Duration(seconds: 1), () {
print('Goodbye, Dart!');
fuchsia.exit(42);
});
diff --git a/runtime/dart_runner/examples/hello_app_dart/main.dart b/runtime/dart_runner/examples/hello_app_dart/main.dart
index 5fba81a..f0089a1 100644
--- a/runtime/dart_runner/examples/hello_app_dart/main.dart
+++ b/runtime/dart_runner/examples/hello_app_dart/main.dart
@@ -8,7 +8,7 @@
import 'package:fidl_fuchsia_examples_hello/fidl.dart';
class _HelloImpl extends Hello {
- final HelloBinding _binding = new HelloBinding();
+ final HelloBinding _binding = HelloBinding();
void bind(InterfaceRequest<Hello> request) {
_binding.bind(this, request);
@@ -21,8 +21,8 @@
}
void main(List<String> args) {
- StartupContext context = new StartupContext.fromStartupInfo();
+ StartupContext context = StartupContext.fromStartupInfo();
context.outgoingServices
- .addServiceForName(new _HelloImpl().bind, Hello.$serviceName);
+ .addServiceForName(_HelloImpl().bind, Hello.$serviceName);
}
diff --git a/runtime/dart_runner/integration/main.dart b/runtime/dart_runner/integration/main.dart
index f474429..d5c7234 100644
--- a/runtime/dart_runner/integration/main.dart
+++ b/runtime/dart_runner/integration/main.dart
@@ -11,28 +11,28 @@
import 'package:test/test.dart';
void main(List<String> args) {
- final StartupContext context = new StartupContext.fromStartupInfo();
+ final StartupContext context = StartupContext.fromStartupInfo();
tearDownAll(context.close);
// TODO(rosswang): nested environments and determinism
test('schedule delayed futures',
- () => new Future<Null>.delayed(const Duration(seconds: 1)));
+ () => Future<Null>.delayed(const Duration(seconds: 1)));
test('start hello_dart', () {
- const LaunchInfo info = const LaunchInfo(
+ const LaunchInfo info = LaunchInfo(
url:
'fuchsia-pkg://fuchsia.com/hello_dart_jit#meta/hello_dart_jit.cmx');
context.launcher.createComponent(info, null);
});
test('communicate with a fidl service (hello_app_dart)', () async {
- final Services services = new Services();
- final HelloProxy service = new HelloProxy();
+ final Services services = Services();
+ final HelloProxy service = HelloProxy();
- final ComponentControllerProxy actl = new ComponentControllerProxy();
+ final ComponentControllerProxy actl = ComponentControllerProxy();
- final LaunchInfo info = new LaunchInfo(
+ final LaunchInfo info = LaunchInfo(
url:
'fuchsia-pkg://fuchsia.com/hello_app_dart_jit#meta/hello_app_dart_jit.cmx',
directoryRequest: services.request());
@@ -42,7 +42,7 @@
..close();
// TODO(rosswang): let's see if we can generate a future-based fidl dart
- final Completer<String> hello = new Completer<String>();
+ final Completer<String> hello = Completer<String>();
service.say('hello', hello.complete);
expect(await hello.future, equals('hola from Dart!'));
diff --git a/runtime/flutter_runner/collect_traces.dart b/runtime/flutter_runner/collect_traces.dart
index df7a57a..4bf1d54 100644
--- a/runtime/flutter_runner/collect_traces.dart
+++ b/runtime/flutter_runner/collect_traces.dart
@@ -19,10 +19,10 @@
return;
}
- var functionCounts = new Map<String, int>();
+ var functionCounts = Map<String, int>();
ProcessSignal.sigint.watch().listen((_) {
- var functions = new List<String>();
+ var functions = List<String>();
// TODO(flutter): Investigate consensus functions to avoid bloat.
var minimumCount = 1;
functionCounts.forEach((String function, int count) {
@@ -33,15 +33,15 @@
functions.sort();
- var sb = new StringBuffer();
+ var sb = StringBuffer();
for (var function in functions) {
sb.writeln(function);
}
- new File(args[0]).writeAsString(sb.toString(), flush: true).then((_) { exit(0); });
+ File(args[0]).writeAsString(sb.toString(), flush: true).then((_) { exit(0); });
});
- final stdinAsLines = new LineSplitter().bind(new Utf8Decoder().bind(stdin));
+ final stdinAsLines = LineSplitter().bind(Utf8Decoder().bind(stdin));
await for (final line in stdinAsLines) {
final marker = "compilation-trace: ";
final markerPosition = line.indexOf(marker);
diff --git a/shell/keyboard/lib/keyboard.dart b/shell/keyboard/lib/keyboard.dart
index 75228ca..5a4354f 100644
--- a/shell/keyboard/lib/keyboard.dart
+++ b/shell/keyboard/lib/keyboard.dart
@@ -10,10 +10,10 @@
import 'constants.dart' as constants;
import 'keys.dart';
-const Color _borderColor = const Color(0xFFE8EAED);
-const Color _backgroundColor = const Color(0xFFFFFFFF);
-const Color _contentColor = const Color(0xFF202124);
-const TextStyle _defaultTextStyle = const TextStyle(
+const Color _borderColor = Color(0xFFE8EAED);
+const Color _backgroundColor = Color(0xFFFFFFFF);
+const Color _contentColor = Color(0xFF202124);
+const TextStyle _defaultTextStyle = TextStyle(
color: _contentColor,
fontFamily: 'GoogleSans',
fontSize: 16.0,
@@ -97,7 +97,7 @@
final VoidCallback onHide;
/// Constructor.
- const Keyboard(
+ Keyboard(
{Key key,
this.onText,
this.onSuggestion,
@@ -127,7 +127,7 @@
@override
Widget build(BuildContext context) => Container(
- padding: const EdgeInsets.fromLTRB(
+ padding: EdgeInsets.fromLTRB(
constants.borderWidth,
constants.borderWidth,
constants.borderWidth,
@@ -144,7 +144,7 @@
top: Radius.circular(constants.cornerRadius / _cornerFactor)),
color: _backgroundColor,
child: Container(
- padding: const EdgeInsets.symmetric(horizontal: _sidePadding),
+ padding: EdgeInsets.symmetric(horizontal: _sidePadding),
child: _keyboards.containsKey(_currentKeyboard)
? _keyboards[_currentKeyboard]
: Offstage(),
diff --git a/shell/keyboard/lib/word_suggestion_service.dart b/shell/keyboard/lib/word_suggestion_service.dart
index dcdbec7..e835235 100644
--- a/shell/keyboard/lib/word_suggestion_service.dart
+++ b/shell/keyboard/lib/word_suggestion_service.dart
@@ -4,7 +4,7 @@
import 'dart:math';
-const List<String> _kWords = const <String>[
+const List<String> _kWords = <String>[
'the',
'be',
'to',
@@ -214,7 +214,7 @@
class WordSuggestionService {
/// Returns a list of words that are similar to [input].
List<String> suggestWords(String input) {
- final List<String> suggestedWords = new List<String>.from(_kWords)
+ final List<String> suggestedWords = List<String>.from(_kWords)
..removeWhere((String a) => levenshteinDistance(input, a) > 3)
..sort((String a, String b) =>
levenshteinDistance(input, a) - levenshteinDistance(input, b));
@@ -235,8 +235,8 @@
}
// Create two work vectors of integer distances.
- final List<int> v0 = new List<int>.filled(t.length + 1, 0);
- final List<int> v1 = new List<int>.filled(t.length + 1, 0);
+ final List<int> v0 = List<int>.filled(t.length + 1, 0);
+ final List<int> v1 = List<int>.filled(t.length + 1, 0);
// Initialize v0 (the previous row of distances).
// This row is A[0][i]: edit distance for an empty s.
diff --git a/shell/keyboard/test/keyboard_test.dart b/shell/keyboard/test/keyboard_test.dart
index f15d507..4b2dd0a 100644
--- a/shell/keyboard/test/keyboard_test.dart
+++ b/shell/keyboard/test/keyboard_test.dart
@@ -8,15 +8,15 @@
import 'package:keyboard/keyboard.dart';
final services.AssetBundle _defaultBundle =
- new services.NetworkAssetBundle(Uri.base);
+ services.NetworkAssetBundle(Uri.base);
void main() {
testWidgets('tapping "uppercase" symbol swaps to upper case letters',
(WidgetTester tester) async {
String onTextText;
- GlobalKey keyboardKey = new GlobalKey();
- Keyboard keyboard = new Keyboard(
+ GlobalKey keyboardKey = GlobalKey();
+ Keyboard keyboard = Keyboard(
key: keyboardKey,
onText: (String text) {
onTextText = text;
@@ -25,8 +25,8 @@
onDelete: () {},
onGo: () {});
- await tester.pumpWidget(new DefaultAssetBundle(
- bundle: _defaultBundle, child: new Center(child: keyboard)));
+ await tester.pumpWidget(DefaultAssetBundle(
+ bundle: _defaultBundle, child: Center(child: keyboard)));
expect(onTextText, isNull);
// tap the center of the keyboard to get a lower case letter
@@ -49,7 +49,7 @@
final Finder element = find.byKey(keyboardKey);
Offset topLeft = tester.getTopLeft(element);
Offset bottomLeft = tester.getBottomLeft(element);
- return new Offset(
+ return Offset(
topLeft.dx, topLeft.dy + ((bottomLeft.dy - topLeft.dy) * 0.6));
}
diff --git a/shell/keyboard/test/keys_test.dart b/shell/keyboard/test/keys_test.dart
index 603bd65..7945162 100644
--- a/shell/keyboard/test/keys_test.dart
+++ b/shell/keyboard/test/keys_test.dart
@@ -7,7 +7,7 @@
import 'package:flutter/widgets.dart';
import 'package:keyboard/keys.dart';
-final AssetBundle _defaultBundle = new NetworkAssetBundle(Uri.base);
+final AssetBundle _defaultBundle = NetworkAssetBundle(Uri.base);
void main() {
testWidgets(
@@ -15,11 +15,11 @@
(WidgetTester tester) async {
String onTextText;
- GlobalKey textKeyKey = new GlobalKey();
- TextKey textKey = new TextKey('A',
+ GlobalKey textKeyKey = GlobalKey();
+ TextKey textKey = TextKey('A',
key: textKeyKey, onText: (String text) => onTextText = text);
- await tester.pumpWidget(new Row(children: <Widget>[textKey]));
+ await tester.pumpWidget(Row(children: <Widget>[textKey]));
expect(onTextText, isNull);
await _tap(tester, _getMiddleOfLeftSide(tester, textKeyKey));
@@ -31,8 +31,8 @@
(WidgetTester tester) async {
bool pressed = false;
- GlobalKey imageKeyKey = new GlobalKey();
- ImageKey imageKey = new ImageKey(
+ GlobalKey imageKeyKey = GlobalKey();
+ ImageKey imageKey = ImageKey(
"doesn't matter",
() => pressed = true,
const Color(0xFFFFFFFF),
@@ -40,8 +40,8 @@
key: imageKeyKey,
);
- await tester.pumpWidget(new DefaultAssetBundle(
- bundle: _defaultBundle, child: new Row(children: <Widget>[imageKey])));
+ await tester.pumpWidget(DefaultAssetBundle(
+ bundle: _defaultBundle, child: Row(children: <Widget>[imageKey])));
expect(pressed, isFalse);
await _tap(tester, _getMiddleOfLeftSide(tester, imageKeyKey));
@@ -53,7 +53,7 @@
Finder element = find.byKey(key);
Offset topLeft = tester.getTopLeft(element);
Offset center = tester.getCenter(element);
- return new Offset(topLeft.dx, center.dy);
+ return Offset(topLeft.dx, center.dy);
}
Future<Null> _tap(WidgetTester tester, Offset point) async {
diff --git a/shell/mondrian_story_shell/lib/anim/flux.dart b/shell/mondrian_story_shell/lib/anim/flux.dart
index db10f64..98ee46c 100644
--- a/shell/mondrian_story_shell/lib/anim/flux.dart
+++ b/shell/mondrian_story_shell/lib/anim/flux.dart
@@ -19,7 +19,7 @@
factory FluxAnimation.fromAnimation(Animation<T> animation, T velocity) =>
animation is FluxAnimation
? animation
- : new _FluxAnimationWrapper<T>(animation, velocity);
+ : _FluxAnimationWrapper<T>(animation, velocity);
/// The instantaneous change in the value in natural units per second.
T get velocity;
@@ -278,7 +278,7 @@
@required T velocity,
}) : _vsync = vsync,
assert(target != null),
- target = new FluxAnimation<T>.fromAnimation(target, velocity),
+ target = FluxAnimation<T>.fromAnimation(target, velocity),
assert(vsync != null),
assert(simulate != null) {
_value = value;
@@ -317,7 +317,7 @@
// where velocityOrigin is the 'zero' velocity. However, this introduces
// a zeroVelocity parameter complexity to the API and may be confusing.
? target
- : new ChainedAnimation<T>(this, then: target);
+ : ChainedAnimation<T>(this, then: target);
void _scheduleUpdate() {
if (_lastUpdateCallbackId != null) {
@@ -334,7 +334,7 @@
void _update() {
Sim<T> sim = simulate(value, target.value, velocity);
_disposeAnimation();
- _animation = new SimAnimationController<T>(vsync: _vsync, sim: sim)
+ _animation = SimAnimationController<T>(vsync: _vsync, sim: sim)
..addListener(notifyListeners)
..addStatusListener(notifyStatusListeners);
if (!_animation.isCompleted) {
@@ -436,7 +436,7 @@
AnimationLazyListenerMixin {
/// Construct a chained animation starting with animation followed by then.
ChainedAnimation(this._animation, {FluxAnimation<T> then})
- : _next = (then == null) ? null : new ChainedAnimation<T>(then) {
+ : _next = (then == null) ? null : ChainedAnimation<T>(then) {
_active = (_next != null && _animation.isCompleted) ? _next : _animation;
}
@@ -447,7 +447,7 @@
/// Returns a new FluxAnimation that runs the current animation,
/// followed by the one specified in the argument when it is complete.
ChainedAnimation<T> then(FluxAnimation<T> next) =>
- new ChainedAnimation<T>(_animation, then: next);
+ ChainedAnimation<T>(_animation, then: next);
@override
AnimationStatus get status => _active.status;
diff --git a/shell/mondrian_story_shell/lib/anim/sim.dart b/shell/mondrian_story_shell/lib/anim/sim.dart
index 47dd983..d5e6776 100644
--- a/shell/mondrian_story_shell/lib/anim/sim.dart
+++ b/shell/mondrian_story_shell/lib/anim/sim.dart
@@ -97,8 +97,8 @@
/// Convenience constructor when the value is fixed.
Independent2DSim.static({@required Offset value})
- : xSim = new StaticSimulation(value: value.dx),
- ySim = new StaticSimulation(value: value.dy);
+ : xSim = StaticSimulation(value: value.dx),
+ ySim = StaticSimulation(value: value.dy);
/// The Simulation used for the x axis.
final Simulation xSim;
@@ -107,10 +107,10 @@
final Simulation ySim;
@override
- Offset value(double time) => new Offset(xSim.x(time), ySim.x(time));
+ Offset value(double time) => Offset(xSim.x(time), ySim.x(time));
@override
- Offset velocity(double time) => new Offset(xSim.dx(time), ySim.dx(time));
+ Offset velocity(double time) => Offset(xSim.dx(time), ySim.dx(time));
@override
bool isDone(double time) => xSim.isDone(time) && ySim.isDone(time);
diff --git a/shell/mondrian_story_shell/lib/layout/container_layout.dart b/shell/mondrian_story_shell/lib/layout/container_layout.dart
index fb4c00e..a8ee3d5 100644
--- a/shell/mondrian_story_shell/lib/layout/container_layout.dart
+++ b/shell/mondrian_story_shell/lib/layout/container_layout.dart
@@ -38,7 +38,7 @@
ContainerLayout layoutSpec = layouts.first;
for (LayoutEntry entry in layoutSpec.surfaces) {
- Rect rect = new Rect.fromLTWH(
+ Rect rect = Rect.fromLTWH(
entry.rectangle[0],
entry.rectangle[1],
entry.rectangle[2],
@@ -46,7 +46,7 @@
);
String label = entry.nodeName;
layout.add(
- new PositionedSurface(
+ PositionedSurface(
surface: nodeMap[label],
position: rect,
),
@@ -56,9 +56,9 @@
log.warning('''Container $containerId with surfaces $containerSurfaces
could not be laid out. Falling back on focused surface.''');
layout.add(
- new PositionedSurface(
+ PositionedSurface(
surface: focusedSurface,
- position: new Rect.fromLTWH(0.0, 0.0, 1.0, 1.0),
+ position: Rect.fromLTWH(0.0, 0.0, 1.0, 1.0),
),
);
}
diff --git a/shell/mondrian_story_shell/lib/layout/copresent_layout.dart b/shell/mondrian_story_shell/lib/layout/copresent_layout.dart
index 008ba48..4d322d6 100644
--- a/shell/mondrian_story_shell/lib/layout/copresent_layout.dart
+++ b/shell/mondrian_story_shell/lib/layout/copresent_layout.dart
@@ -54,7 +54,7 @@
surfaces.firstWhere((PositionedSurface positioned) {
return positioned.surface == focused.parent;
});
- PositionedSurface ontopSurface = new PositionedSurface(
+ PositionedSurface ontopSurface = PositionedSurface(
surface: focused,
position: parentSurface.position,
);
@@ -145,9 +145,9 @@
double fractionalWidth = surface.absoluteEmphasis(top) / totalEmphasis;
double fractionalHeight = 1.0;
layout.add(
- new PositionedSurface(
+ PositionedSurface(
surface: surface,
- position: new Rect.fromLTWH(
+ position: Rect.fromLTWH(
fractionalWidthOffset,
0.0,
fractionalWidth,
diff --git a/shell/mondrian_story_shell/lib/layout/pattern_layout.dart b/shell/mondrian_story_shell/lib/layout/pattern_layout.dart
index 411f22e..dd516b7 100644
--- a/shell/mondrian_story_shell/lib/layout/pattern_layout.dart
+++ b/shell/mondrian_story_shell/lib/layout/pattern_layout.dart
@@ -36,9 +36,9 @@
log.warning('unrecognized pattern $pattern');
layout.add(
- new PositionedSurface(
+ PositionedSurface(
surface: focused,
- position: new Rect.fromLTWH(0.0, 0.0, 1.0, 1.0),
+ position: Rect.fromLTWH(0.0, 0.0, 1.0, 1.0),
),
);
return layout;
@@ -96,18 +96,18 @@
List<PositionedSurface> _layoutTicker(Surface tickerSource, Surface ticker,
double availableHeight, double availableWidth) {
return <PositionedSurface>[
- new PositionedSurface(
+ PositionedSurface(
surface: tickerSource,
- position: new Rect.fromLTWH(
+ position: Rect.fromLTWH(
0.0,
0.0,
availableWidth,
availableHeight * (1.0 - _tickerHeightRatio),
),
),
- new PositionedSurface(
+ PositionedSurface(
surface: ticker,
- position: new Rect.fromLTWH(
+ position: Rect.fromLTWH(
0.0,
availableHeight * (1.0 - _tickerHeightRatio),
availableWidth,
@@ -122,18 +122,18 @@
Surface comments,
) {
return <PositionedSurface>[
- new PositionedSurface(
+ PositionedSurface(
surface: commentsSource,
- position: new Rect.fromLTWH(
+ position: Rect.fromLTWH(
0.0,
0.0,
1.0 - _commentsWidthRatio,
1.0,
),
),
- new PositionedSurface(
+ PositionedSurface(
surface: comments,
- position: new Rect.fromLTWH(
+ position: Rect.fromLTWH(
1.0 - _commentsWidthRatio,
0.0,
_commentsWidthRatio,
diff --git a/shell/mondrian_story_shell/lib/main.dart b/shell/mondrian_story_shell/lib/main.dart
index fcccfc0..47cdaf1 100644
--- a/shell/mondrian_story_shell/lib/main.dart
+++ b/shell/mondrian_story_shell/lib/main.dart
@@ -53,8 +53,8 @@
void onWindowMetricsChanged() {
Timeline.instantSync(
'Mondrian: onWindowMetricsChanged '
- '${new MediaQueryData.fromWindow(window).size.width},'
- '${new MediaQueryData.fromWindow(window).size.height}',
+ '${MediaQueryData.fromWindow(window).size.width},'
+ '${MediaQueryData.fromWindow(window).size.height}',
);
}
diff --git a/shell/mondrian_story_shell/lib/models/inset_manager.dart b/shell/mondrian_story_shell/lib/models/inset_manager.dart
index 0151237..9a0ad4d 100644
--- a/shell/mondrian_story_shell/lib/models/inset_manager.dart
+++ b/shell/mondrian_story_shell/lib/models/inset_manager.dart
@@ -9,7 +9,7 @@
show ScopedModel, Model, ScopedModelDescendant;
const RK4SpringDescription _kSimulationDesc =
- const RK4SpringDescription(tension: 450.0, friction: 50.0);
+ RK4SpringDescription(tension: 450.0, friction: 50.0);
/// Frame for child views
class InsetManager extends SpringModel {
diff --git a/shell/mondrian_story_shell/lib/models/surface/surface.dart b/shell/mondrian_story_shell/lib/models/surface/surface.dart
index daea172..cc739a7 100644
--- a/shell/mondrian_story_shell/lib/models/surface/surface.dart
+++ b/shell/mondrian_story_shell/lib/models/surface/surface.dart
@@ -24,7 +24,7 @@
/// Public constructor
Surface(this._graph, this.node, this.properties, this.relation,
this.compositionPattern, this.placeholderColor) {
- transitionModel = new SurfaceTransitionModel()
+ transitionModel = SurfaceTransitionModel()
// notify listeners of Surface model to changes that happen in
// surface_transition, so we can use the same model in builders
@@ -33,9 +33,9 @@
}
Surface.fromJson(Map<String, dynamic> json, this._graph)
- : node = new Tree<String>(value: json['id']),
+ : node = Tree<String>(value: json['id']),
compositionPattern = json['compositionPattern'],
- properties = new SurfaceProperties.fromJson(
+ properties = SurfaceProperties.fromJson(
json['surfaceProperties'].cast<String, dynamic>()),
relation = SurfaceRelationUtil.decode(
json['surfaceRelation'].cast<String, String>()),
@@ -126,7 +126,7 @@
/// Returns a Tree for this surface
Tree<Surface> get tree {
- Tree<Surface> t = new Tree<Surface>(value: this);
+ Tree<Surface> t = Tree<Surface>(value: this);
for (Surface child in children) {
t.add(child.tree);
}
diff --git a/shell/mondrian_story_shell/lib/models/surface/surface_graph.dart b/shell/mondrian_story_shell/lib/models/surface/surface_graph.dart
index 7f80d31..9bc54d5 100644
--- a/shell/mondrian_story_shell/lib/models/surface/surface_graph.dart
+++ b/shell/mondrian_story_shell/lib/models/surface/surface_graph.dart
@@ -33,7 +33,7 @@
final Map<String, Surface> _surfaces = <String, Surface>{};
/// Surface relationship tree
- final Tree<String> _tree = new Tree<String>(value: null);
+ final Tree<String> _tree = Tree<String>(value: null);
/// The stack of previous focusedSurfaces, most focused at end
final List<String> _focusedSurfaces = <String>[];
@@ -76,13 +76,13 @@
String pattern,
String placeholderColor,
) {
- Tree<String> node = _tree.find(id) ?? new Tree<String>(value: id);
+ Tree<String> node = _tree.find(id) ?? Tree<String>(value: id);
Tree<String> parent =
(parentId == kNoParent) ? _tree : _tree.find(parentId);
assert(parent != null);
assert(relation != null);
Surface oldSurface = _surfaces[id];
- Surface updatedSurface = new Surface(
+ Surface updatedSurface = Surface(
this, node, properties, relation, pattern, placeholderColor);
// if this is an external surface, create an association between this and
// the most focused surface.
@@ -161,7 +161,7 @@
// TODO (djurphy): collisions/pathing - partial fix if we
// make the changes so container IDs are paths.
log.info('addContainer: $id');
- Tree<String> node = _tree.find(id) ?? new Tree<String>(value: id);
+ Tree<String> node = _tree.find(id) ?? Tree<String>(value: id);
log.info('found or made node: $node');
Tree<String> parent =
(parentId == kNoParent) ? _tree : _tree.find(parentId);
@@ -169,7 +169,7 @@
assert(relation != null);
parent.add(node);
Surface oldSurface = _surfaces[id];
- _surfaces[id] = new SurfaceContainer(
+ _surfaces[id] = SurfaceContainer(
this, node, properties, relation, '' /*pattern*/, layouts);
oldSurface?.notifyListeners();
log.info('_surfaces[id]: ${_surfaces[id]}');
@@ -265,7 +265,7 @@
List<dynamic> decodedSurfaceList = json['surfaceList'];
for (dynamic s in decodedSurfaceList) {
Map<String, dynamic> item = s.cast<String, dynamic>();
- Surface surface = new Surface.fromJson(item, this);
+ Surface surface = Surface.fromJson(item, this);
_surfaces.putIfAbsent(surface.node.value, () {
return surface;
diff --git a/shell/mondrian_story_shell/lib/models/surface/surface_properties.dart b/shell/mondrian_story_shell/lib/models/surface/surface_properties.dart
index d968d79..3e209d8 100644
--- a/shell/mondrian_story_shell/lib/models/surface/surface_properties.dart
+++ b/shell/mondrian_story_shell/lib/models/surface/surface_properties.dart
@@ -44,7 +44,7 @@
} else if (str == 'null') {
return null;
} else {
- throw new ArgumentError.value(str);
+ throw ArgumentError.value(str);
}
}
}
diff --git a/shell/mondrian_story_shell/lib/models/surface/surface_relation_util.dart b/shell/mondrian_story_shell/lib/models/surface/surface_relation_util.dart
index f663a92..f389af8 100644
--- a/shell/mondrian_story_shell/lib/models/surface/surface_relation_util.dart
+++ b/shell/mondrian_story_shell/lib/models/surface/surface_relation_util.dart
@@ -18,7 +18,7 @@
}
static SurfaceRelation decode(Map<String, String> encoded) {
- return new SurfaceRelation(
+ return SurfaceRelation(
emphasis: double.parse(encoded['emphasis']),
arrangement: arrangementFromString(encoded['arrangement']),
dependency: dependencyFromString(encoded['dependency']),
diff --git a/shell/mondrian_story_shell/lib/models/surface/surface_transition.dart b/shell/mondrian_story_shell/lib/models/surface/surface_transition.dart
index cbcb469..b065cad 100644
--- a/shell/mondrian_story_shell/lib/models/surface/surface_transition.dart
+++ b/shell/mondrian_story_shell/lib/models/surface/surface_transition.dart
@@ -7,7 +7,7 @@
import 'package:lib.widgets/model.dart';
-const Duration _kPlaceholderDuration = const Duration(milliseconds: 2700);
+const Duration _kPlaceholderDuration = Duration(milliseconds: 2700);
/// A model for handling the transition of placeholders to Surfaces.
/// This implementation does not do a crossfade as labelling nodes non-shadow
diff --git a/shell/mondrian_story_shell/lib/models/tree/spanning_tree.dart b/shell/mondrian_story_shell/lib/models/tree/spanning_tree.dart
index 8e91712..4ab986c 100644
--- a/shell/mondrian_story_shell/lib/models/tree/spanning_tree.dart
+++ b/shell/mondrian_story_shell/lib/models/tree/spanning_tree.dart
@@ -13,7 +13,7 @@
Tree<Surface> _spanningTree(
Surface previous, Surface current, bool condition(Surface s)) {
assert(current != null);
- Tree<Surface> tree = new Tree<Surface>(value: current);
+ Tree<Surface> tree = Tree<Surface>(value: current);
if (current.parent != previous &&
current.parent != null &&
condition(current)) {
@@ -31,7 +31,7 @@
/// Gets the dependent spanning tree the current widget is part of
Tree<Surface> getDependentSpanningTree(Surface surface) {
- Tree<Surface> root = new Tree<Surface>(value: surface);
+ Tree<Surface> root = Tree<Surface>(value: surface);
while (root.ancestors.isNotEmpty &&
root.value.relation.dependency == SurfaceDependency.dependent) {
root = root.ancestors.first;
@@ -43,7 +43,7 @@
/// Returns the List (forest) of DependentSpanningTrees in the current graph
List<Tree<Surface>> getDependentSpanningTrees(Surface surface) {
List<Tree<Surface>> queue = <Tree<Surface>>[];
- Forest<Surface> forest = new Forest<Surface>();
+ Forest<Surface> forest = Forest<Surface>();
Tree<Surface> tree = _spanningTree(null, surface, (Surface s) => true);
@@ -85,7 +85,7 @@
/// Gets the pattern spanning tree the current widget is part of
Tree<Surface> patternSpanningTree(
SurfaceGraph graph, Tree<String> node, String pattern) {
- Tree<Surface> root = new Tree<Surface>(value: graph.getNode(node.value));
+ Tree<Surface> root = Tree<Surface>(value: graph.getNode(node.value));
while (
root.ancestors.isNotEmpty && root.value.compositionPattern == pattern) {
root = root.ancestors.first;
@@ -101,7 +101,7 @@
Tree<String> containerNode = surface.node.root.find(containerId);
// log.info('found: $node');
Tree<Surface> root =
- new Tree<Surface>(value: graph.getNode(containerNode.value));
+ Tree<Surface>(value: graph.getNode(containerNode.value));
if (root.value is SurfaceContainer) {
return _spanningTree(
null,
diff --git a/shell/mondrian_story_shell/lib/models/tree/tree.dart b/shell/mondrian_story_shell/lib/models/tree/tree.dart
index db710f8..c04afc8 100644
--- a/shell/mondrian_story_shell/lib/models/tree/tree.dart
+++ b/shell/mondrian_story_shell/lib/models/tree/tree.dart
@@ -31,7 +31,7 @@
/// Direct descendents of parent, except this
Iterable<Tree<T>> get siblings => (_parent == null)
- ? new Iterable<Tree<T>>.empty() // ignore: prefer_const_constructors
+ ? Iterable<Tree<T>>.empty() // ignore: prefer_const_constructors
: _parent.children.where((Tree<T> node) => node != this);
/// Direct ancestors of this, starting at parent to root
@@ -101,7 +101,7 @@
firstWhere((Tree<T> node) => node.value == value, orElse: () => null);
/// Generate a new tree with the same structure with transformed values
- Tree<V> mapTree<V>(V f(T value)) => new Tree<V>(
+ Tree<V> mapTree<V>(V f(T value)) => Tree<V>(
value: f(value),
children: _children.map((Tree<T> n) => n.mapTree(f)),
);
@@ -184,7 +184,7 @@
firstWhere((Tree<T> node) => node.value == value, orElse: () => null);
/// Generate a new forest with the same structure with transformed values
- Forest<V> mapForest<V>(V f(T value)) => new Forest<V>(
+ Forest<V> mapForest<V>(V f(T value)) => Forest<V>(
roots: _roots.map((Tree<T> n) => n.mapTree(f)),
);
diff --git a/shell/mondrian_story_shell/lib/widgets/breathing_placeholder.dart b/shell/mondrian_story_shell/lib/widgets/breathing_placeholder.dart
index cccf924..20725da 100644
--- a/shell/mondrian_story_shell/lib/widgets/breathing_placeholder.dart
+++ b/shell/mondrian_story_shell/lib/widgets/breathing_placeholder.dart
@@ -20,7 +20,7 @@
class BreathingPlaceholder extends StatefulWidget {
@override
- BreathingState createState() => new BreathingState();
+ BreathingState createState() => BreathingState();
}
class BreathingState extends State<BreathingPlaceholder>
@@ -34,13 +34,13 @@
void initState() {
super.initState();
pause();
- _opacityController = new AnimationController(
+ _opacityController = AnimationController(
vsync: this,
- duration: const Duration(milliseconds: _kBreathPeriod),
+ duration: Duration(milliseconds: _kBreathPeriod),
lowerBound: _kLowerBound,
upperBound: _kUpperBound,
);
- _opacity = new CurvedAnimation(
+ _opacity = CurvedAnimation(
parent: _opacityController,
curve: Curves.easeIn,
)..addStatusListener(
@@ -53,7 +53,7 @@
}
void pause() {
- _timer = new Timer(Duration(milliseconds: _kPausePeriod), animate);
+ _timer = Timer(Duration(milliseconds: _kPausePeriod), animate);
}
void animate() {
@@ -82,13 +82,13 @@
@override
Widget build(BuildContext context) {
- return new Stack(
+ return Stack(
children: <Widget>[
- new Container(
+ Container(
color: _kBaseColor,
),
- new FadeTransition(
- child: new Container(
+ FadeTransition(
+ child: Container(
color: _kTopColor,
),
opacity: _opacity,
diff --git a/shell/mondrian_story_shell/lib/widgets/gestures.dart b/shell/mondrian_story_shell/lib/widgets/gestures.dart
index 728963a..b704bcd 100644
--- a/shell/mondrian_story_shell/lib/widgets/gestures.dart
+++ b/shell/mondrian_story_shell/lib/widgets/gestures.dart
@@ -46,7 +46,7 @@
}
@override
- Offset _getDeltaForDetails(Offset delta) => new Offset(delta.dx, delta.dy);
+ Offset _getDeltaForDetails(Offset delta) => Offset(delta.dx, delta.dy);
@override
double _getPrimaryValueFromOffset(Offset value) => value.dx;
@@ -115,7 +115,7 @@
@override
void addPointer(PointerEvent event) {
startTrackingPointer(event.pointer);
- _velocityTrackers[event.pointer] = new gestures.VelocityTracker();
+ _velocityTrackers[event.pointer] = gestures.VelocityTracker();
if (_state == _DragState.ready) {
_state = _DragState.possible;
_initialPosition = event.position;
@@ -143,7 +143,7 @@
invokeCallback<void>(
'onUpdate',
() => onUpdate(
- new DragUpdateDetails(
+ DragUpdateDetails(
sourceTimeStamp: event.timeStamp,
delta: _getDeltaForDetails(delta),
primaryDelta: null,
@@ -174,7 +174,7 @@
invokeCallback<void>(
'onStart',
() => onStart(
- new DragStartDetails(
+ DragStartDetails(
sourceTimeStamp: timestamp,
globalPosition: _initialPosition,
),
@@ -205,12 +205,12 @@
final gestures.VelocityEstimate estimate = tracker.getVelocityEstimate();
if (estimate != null && _isFlingGesture(estimate)) {
final Velocity velocity =
- new Velocity(pixelsPerSecond: estimate.pixelsPerSecond)
+ Velocity(pixelsPerSecond: estimate.pixelsPerSecond)
.clampMagnitude(minFlingVelocity ?? gestures.kMinFlingVelocity,
maxFlingVelocity ?? gestures.kMaxFlingVelocity);
invokeCallback<void>(
'onEnd',
- () => onEnd(new DragEndDetails(
+ () => onEnd(DragEndDetails(
velocity: velocity,
primaryVelocity:
_getPrimaryValueFromOffset(velocity.pixelsPerSecond),
@@ -220,7 +220,7 @@
} else {
invokeCallback<void>(
'onEnd',
- () => onEnd(new DragEndDetails(
+ () => onEnd(DragEndDetails(
velocity: Velocity.zero,
primaryVelocity: 0.0,
)), debugReport: () {
@@ -295,9 +295,9 @@
onHorizontalDragUpdate != null ||
onHorizontalDragEnd != null) {
gestures[UnidirectionalHorizontalDragGestureRecognizer] =
- new GestureRecognizerFactoryWithHandlers<
+ GestureRecognizerFactoryWithHandlers<
UnidirectionalHorizontalDragGestureRecognizer>(
- () => new UnidirectionalHorizontalDragGestureRecognizer(
+ () => UnidirectionalHorizontalDragGestureRecognizer(
direction: direction,
debugOwner: this,
),
@@ -311,7 +311,7 @@
);
}
- return new RawGestureDetector(
+ return RawGestureDetector(
gestures: gestures,
behavior: behavior,
excludeFromSemantics: excludeFromSemantics,
diff --git a/shell/mondrian_story_shell/lib/widgets/isometric_widget.dart b/shell/mondrian_story_shell/lib/widgets/isometric_widget.dart
index 23e66bb..7ce75cd 100644
--- a/shell/mondrian_story_shell/lib/widgets/isometric_widget.dart
+++ b/shell/mondrian_story_shell/lib/widgets/isometric_widget.dart
@@ -8,7 +8,7 @@
import 'package:meta/meta.dart';
/// 60-30 isometric projection matrix
-final Matrix4 _iso = new Matrix4.identity()
+final Matrix4 _iso = Matrix4.identity()
..rotateX(60 * pi / 180.0)
..rotateZ(30 * pi / 180.0);
@@ -25,14 +25,14 @@
const IsoMetric({@required this.child, this.scaleFactor = 4.0});
@override
- Widget build(BuildContext context) => new LayoutBuilder(
+ Widget build(BuildContext context) => LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
BoxConstraints _scaledConstraints = constraints * scaleFactor;
- return new FittedBox(
+ return FittedBox(
fit: BoxFit.scaleDown,
- child: new Container(
+ child: Container(
constraints: _scaledConstraints,
- child: new Transform(
+ child: Transform(
child: child,
transform: _getTransformation(constraints: _scaledConstraints),
origin: _scaledConstraints.biggest.center(Offset.zero),
@@ -52,6 +52,6 @@
);
double isoScale = min(constraintsRect.height / transRect.height,
constraintsRect.width / transRect.width);
- return new Matrix4.copy(_iso)..scale(isoScale);
+ return Matrix4.copy(_iso)..scale(isoScale);
}
}
diff --git a/shell/mondrian_story_shell/lib/widgets/mondrian.dart b/shell/mondrian_story_shell/lib/widgets/mondrian.dart
index 4ccda65..749d95e 100644
--- a/shell/mondrian_story_shell/lib/widgets/mondrian.dart
+++ b/shell/mondrian_story_shell/lib/widgets/mondrian.dart
@@ -22,7 +22,7 @@
const Mondrian({Key key}) : super(key: key);
@override
- MondrianState createState() => new MondrianState();
+ MondrianState createState() => MondrianState();
}
/// State
@@ -30,7 +30,7 @@
@override
Widget build(BuildContext context) {
_traceFrame();
- return new SurfaceDirector();
+ return SurfaceDirector();
}
}
diff --git a/shell/mondrian_story_shell/lib/widgets/mondrian_child_view.dart b/shell/mondrian_story_shell/lib/widgets/mondrian_child_view.dart
index 64812a7..c031c1a 100644
--- a/shell/mondrian_story_shell/lib/widgets/mondrian_child_view.dart
+++ b/shell/mondrian_story_shell/lib/widgets/mondrian_child_view.dart
@@ -21,20 +21,20 @@
final Surface surface;
@override
- Widget build(BuildContext context) => new AnimatedBuilder(
+ Widget build(BuildContext context) => AnimatedBuilder(
animation: surface,
builder: (BuildContext context, Widget child) =>
surface.transitionModel.opacity != 1.0
- ? new Stack(
+ ? Stack(
children: <Widget>[
- new ChildView(
+ ChildView(
connection: surface.connection,
hitTestable: interactable,
),
- new BreathingPlaceholder()
+ BreathingPlaceholder()
],
)
- : new ChildView(
+ : ChildView(
connection: surface.connection,
hitTestable: interactable,
),
@@ -52,7 +52,7 @@
try {
String parseString = hexColorString.replaceAll('#', '');
int colorInt = int.parse(parseString, radix: 16);
- placeholderColor = new Color(colorInt).withOpacity(1.0);
+ placeholderColor = Color(colorInt).withOpacity(1.0);
} on FormatException {
log.fine('hexColorString conversion error for string $hexColorString');
}
diff --git a/shell/mondrian_story_shell/lib/widgets/mondrian_logo.dart b/shell/mondrian_story_shell/lib/widgets/mondrian_logo.dart
index 2319797..02a76cd 100644
--- a/shell/mondrian_story_shell/lib/widgets/mondrian_logo.dart
+++ b/shell/mondrian_story_shell/lib/widgets/mondrian_logo.dart
@@ -6,16 +6,16 @@
import 'package:flutter/widgets.dart';
/// Logo Yellow
-const Color yellow = const Color(0xFFFFFD3B);
+const Color yellow = Color(0xFFFFFD3B);
/// Logo Red
-const Color red = const Color(0xFFFC5D60);
+const Color red = Color(0xFFFC5D60);
/// Logo Blue
-const Color blue = const Color(0xFF4D8AE9);
+const Color blue = Color(0xFF4D8AE9);
/// Logo Border
-const Color borderColor = const Color(0xFF353535);
+const Color borderColor = Color(0xFF353535);
/// Programmatic implementation of Static Mondrian Logo
class MondrianLogo extends StatelessWidget {
@@ -24,56 +24,56 @@
@override
Widget build(BuildContext context) {
- return new LayoutBuilder(
+ return LayoutBuilder(
builder: (BuildContext layoutContext, BoxConstraints constraints) {
double fontPoint = constraints.maxHeight / 2.3;
double borderWidth = constraints.maxWidth / 37.5;
double borderRadius = constraints.maxWidth * 0.0625;
- return new Material(
- child: new Container(
- child: new Row(
+ return Material(
+ child: Container(
+ child: Row(
children: <Widget>[
- new Flexible(
+ Flexible(
flex: 1,
- child: new Container(
- decoration: new BoxDecoration(
+ child: Container(
+ decoration: BoxDecoration(
color: blue,
- border: new Border(
- right: new BorderSide(
+ border: Border(
+ right: BorderSide(
color: borderColor, width: borderWidth),
),
),
),
),
- new Flexible(
+ Flexible(
flex: 1,
- child: new Column(
+ child: Column(
children: <Widget>[
- new Flexible(
+ Flexible(
flex: 1,
- child: new Container(
- decoration: new BoxDecoration(
+ child: Container(
+ decoration: BoxDecoration(
color: red,
- border: new Border(
- bottom: new BorderSide(
+ border: Border(
+ bottom: BorderSide(
color: borderColor, width: borderWidth),
),
),
),
),
- new Flexible(
+ Flexible(
flex: 1,
- child: new Container(
- child: new Center(
- child: new Text(
+ child: Container(
+ child: Center(
+ child: Text(
'M',
- style: new TextStyle(
+ style: TextStyle(
fontFamily: 'Kanit', // ToDo - djmurphy
fontStyle: FontStyle.normal,
fontSize: fontPoint),
),
),
- decoration: const BoxDecoration(color: yellow),
+ decoration: BoxDecoration(color: yellow),
),
)
],
@@ -81,15 +81,15 @@
),
],
),
- foregroundDecoration: new BoxDecoration(
- borderRadius: new BorderRadius.all(
- new Radius.circular(borderRadius),
+ foregroundDecoration: BoxDecoration(
+ borderRadius: BorderRadius.all(
+ Radius.circular(borderRadius),
),
- border: new Border.all(width: borderWidth, color: borderColor),
+ border: Border.all(width: borderWidth, color: borderColor),
),
),
- borderRadius: new BorderRadius.all(
- new Radius.circular(borderRadius),
+ borderRadius: BorderRadius.all(
+ Radius.circular(borderRadius),
),
);
},
diff --git a/shell/mondrian_story_shell/lib/widgets/overview.dart b/shell/mondrian_story_shell/lib/widgets/overview.dart
index a931e8b..391353e 100644
--- a/shell/mondrian_story_shell/lib/widgets/overview.dart
+++ b/shell/mondrian_story_shell/lib/widgets/overview.dart
@@ -17,14 +17,14 @@
/// Printable names for relation arrangement
const Map<SurfaceArrangement, String> relName =
- const <SurfaceArrangement, String>{
+ <SurfaceArrangement, String>{
SurfaceArrangement.none: 'no opinion',
SurfaceArrangement.copresent: 'co-present',
};
/// Printable names for relation dependency
const Map<SurfaceDependency, String> depName =
- const <SurfaceDependency, String>{
+ <SurfaceDependency, String>{
SurfaceDependency.dependent: 'dependent',
SurfaceDependency.none: 'independent',
};
@@ -37,7 +37,7 @@
/// Build the ListView of Surface views in SurfaceGraph
Widget buildGraphList(BoxConstraints constraints, SurfaceGraph graph) {
- return new ListView.builder(
+ return ListView.builder(
itemCount: graph.focusStack.toList().length,
scrollDirection: Axis.vertical,
itemExtent: constraints.maxHeight / 3.5,
@@ -45,24 +45,24 @@
Surface s = graph.focusStack.toList().reversed.elementAt(index);
String arrangement = relName[s.relation.arrangement] ?? 'unknown';
String dependency = depName[s.relation.dependency] ?? 'unknown';
- return new Row(
+ return Row(
children: <Widget>[
- new Flexible(
+ Flexible(
flex: 1,
- child: new Center(
+ child: Center(
child: index < graph.focusStack.length - 1
- ? new Text('Presentation: $arrangement'
+ ? Text('Presentation: $arrangement'
'\nDependency: $dependency'
'\nEmphasis: ${s.relation.emphasis}')
: null,
),
),
- new Flexible(
+ Flexible(
flex: 2,
- child: new Container(
- child: new Center(
- child: new IsoMetric(
- child: new ChildView(
+ child: Container(
+ child: Center(
+ child: IsoMetric(
+ child: ChildView(
connection: s.connection, hitTestable: false),
),
),
@@ -75,20 +75,20 @@
}
@override
- Widget build(BuildContext context) => new LayoutBuilder(
+ Widget build(BuildContext context) => LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
- return new Container(
+ return Container(
alignment: FractionalOffset.center,
width: math.min(constraints.maxWidth, constraints.maxHeight),
height: constraints.maxHeight,
- padding: const EdgeInsets.symmetric(horizontal: 44.0),
- child: new Scrollbar(
- child: new ScopedModelDescendant<SurfaceGraph>(
+ padding: EdgeInsets.symmetric(horizontal: 44.0),
+ child: Scrollbar(
+ child: ScopedModelDescendant<SurfaceGraph>(
builder:
(BuildContext context, Widget child, SurfaceGraph graph) {
if (graph.focusStack.isEmpty) {
log.warning('focusedSurfaceHistory is empty');
- return new Container();
+ return Container();
}
return buildGraphList(constraints, graph);
},
diff --git a/shell/mondrian_story_shell/lib/widgets/surface_director.dart b/shell/mondrian_story_shell/lib/widgets/surface_director.dart
index cba2347..b6465dd 100644
--- a/shell/mondrian_story_shell/lib/widgets/surface_director.dart
+++ b/shell/mondrian_story_shell/lib/widgets/surface_director.dart
@@ -28,7 +28,7 @@
/// Directs the layout of the SurfaceSpace
class SurfaceDirector extends StatefulWidget {
@override
- _SurfaceDirectorState createState() => new _SurfaceDirectorState();
+ _SurfaceDirectorState createState() => _SurfaceDirectorState();
}
class _SurfaceDirectorState extends State<SurfaceDirector> {
@@ -40,14 +40,14 @@
double depth,
FractionalOffset offscreen,
) {
- return new SurfaceForm.single(
- key: new GlobalObjectKey(ps.surface.node),
+ return SurfaceForm.single(
+ key: GlobalObjectKey(ps.surface.node),
child: MondrianChildView(
surface: ps.surface,
interactable: depth <= 0.0,
),
position: ps.position,
- initPosition: ps.position.shift(new Offset(offscreen.dx, offscreen.dy)),
+ initPosition: ps.position.shift(Offset(offscreen.dx, offscreen.dy)),
depth: depth,
friction: depth > 0.0
? kDragFrictionInfinite
@@ -71,13 +71,13 @@
SurfaceForm _orphanedForm(
Surface surface, SurfaceForm form, FractionalOffset offscreen) {
- return new SurfaceForm.single(
+ return SurfaceForm.single(
key: form.key,
child: MondrianChildView(
surface: surface,
interactable: false,
),
- position: form.position.shift(new Offset(offscreen.dx, offscreen.dy)),
+ position: form.position.shift(Offset(offscreen.dx, offscreen.dy)),
initPosition: form.initPosition,
depth: form.depth,
friction: kDragFrictionInfinite,
@@ -197,7 +197,7 @@
focusStack.removeLast();
}
}
- Forest<Surface> dependentSpanningTrees = new Forest<Surface>();
+ Forest<Surface> dependentSpanningTrees = Forest<Surface>();
if (placedSurfaces.isNotEmpty) {
// Get the dependent spanning trees for each tree off of the root
for (Tree<String> childTree in graph.root.children) {
@@ -229,7 +229,7 @@
dependentSpanningTrees.mapForest((Surface s) => placedSurfaces[s]);
for (SurfaceForm orphan in _orphanedForms) {
- formForest.add(new Tree<SurfaceForm>(value: orphan));
+ formForest.add(Tree<SurfaceForm>(value: orphan));
}
/// Determine the max and min depths of all visible surfaces.
@@ -253,9 +253,9 @@
}
}
- return new ScopedModel<DepthModel>(
- model: new DepthModel(minDepth: minDepth, maxDepth: maxDepth),
- child: new SurfaceStage(forms: formForest),
+ return ScopedModel<DepthModel>(
+ model: DepthModel(minDepth: minDepth, maxDepth: maxDepth),
+ child: SurfaceStage(forms: formForest),
);
}
}
diff --git a/shell/mondrian_story_shell/lib/widgets/surface_frame.dart b/shell/mondrian_story_shell/lib/widgets/surface_frame.dart
index 7df077c..101a6cb 100644
--- a/shell/mondrian_story_shell/lib/widgets/surface_frame.dart
+++ b/shell/mondrian_story_shell/lib/widgets/surface_frame.dart
@@ -31,10 +31,10 @@
@override
Widget build(BuildContext context) {
- return new Container(
+ return Container(
alignment: FractionalOffset.center,
- child: new IgnorePointer(
- child: new ScopedModelDescendant<DepthModel>(
+ child: IgnorePointer(
+ child: ScopedModelDescendant<DepthModel>(
builder: (
BuildContext context,
Widget child,
@@ -51,9 +51,9 @@
_surfaceDepth,
(depthModel.maxDepth - depth) / 2.0,
).clamp(0.0, _surfaceDepth);
- return new PhysicalModel(
+ return PhysicalModel(
elevation: elevation,
- color: const Color(0x00000000),
+ color: Color(0x00000000),
child: child,
);
},
diff --git a/shell/mondrian_story_shell/lib/widgets/surface_relationships.dart b/shell/mondrian_story_shell/lib/widgets/surface_relationships.dart
index b919c01..e7c6da7 100644
--- a/shell/mondrian_story_shell/lib/widgets/surface_relationships.dart
+++ b/shell/mondrian_story_shell/lib/widgets/surface_relationships.dart
@@ -33,11 +33,11 @@
const FontWeight _relationshipTreeFontWeight = FontWeight.w200;
const double _iconSize = 12.0;
-const Color _storytellerPrimaryColor = const Color(0xFF6315F6);
+const Color _storytellerPrimaryColor = Color(0xFF6315F6);
/// Printable names for relation arrangement
const Map<SurfaceArrangement, String> relName =
- const <SurfaceArrangement, String>{
+ <SurfaceArrangement, String>{
SurfaceArrangement.none: 'None',
SurfaceArrangement.copresent: 'Co-present',
SurfaceArrangement.sequential: 'Sequential',
@@ -46,7 +46,7 @@
/// Printable names for relation dependency
const Map<SurfaceDependency, String> depName =
- const <SurfaceDependency, String>{
+ <SurfaceDependency, String>{
SurfaceDependency.dependent: 'Dependent',
SurfaceDependency.none: 'Independent',
};
@@ -61,18 +61,18 @@
const SurfaceRelationships({Key key}) : super(key: key);
@override
- Widget build(BuildContext context) => new LayoutBuilder(
+ Widget build(BuildContext context) => LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
- return new Container(
+ return Container(
width: constraints.maxWidth,
height: constraints.maxHeight,
color: Colors.grey[100],
- child: new ScopedModelDescendant<SurfaceGraph>(
+ child: ScopedModelDescendant<SurfaceGraph>(
builder:
(BuildContext context, Widget child, SurfaceGraph graph) {
if (graph.focusStack.isEmpty) {
log.warning('focusedSurfaceHistory is empty');
- return new Container();
+ return Container();
}
return _buildRelationshipsPage(context, constraints, graph);
},
@@ -84,7 +84,7 @@
Widget _buildRelationshipsPage(
BuildContext context, BoxConstraints constraints, SurfaceGraph graph) {
Map<String, GlobalKey> surfaceKeys = <String, GlobalKey>{};
- GlobalKey stackKey = new GlobalKey();
+ GlobalKey stackKey = GlobalKey();
Set<Surface> firstDepthSurfaces = <Surface>{};
for (Surface s in graph.focusStack.toList()) {
@@ -110,9 +110,9 @@
totalLabelWidth = MediaQuery.of(context).size.width;
}
- return new SingleChildScrollView(
+ return SingleChildScrollView(
scrollDirection: Axis.horizontal,
- child: new Column(
+ child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_buildLabel(totalLabelWidth, maxHeight),
@@ -123,11 +123,11 @@
}
Widget _buildLabel(double labelWidth, int maxHeight) {
- return new Material(
+ return Material(
elevation: 4.0,
- child: new Container(
+ child: Container(
width: labelWidth,
- child: new Row(
+ child: Row(
children: _buildLabelWidgetList(maxHeight),
),
),
@@ -136,10 +136,10 @@
Widget _buildContent(SurfaceGraph graph, GlobalKey stackKey,
Map<String, GlobalKey> surfaceKeys, Set<Surface> firstSurfaces) {
- return new Expanded(
- child: new SingleChildScrollView(
+ return Expanded(
+ child: SingleChildScrollView(
scrollDirection: Axis.vertical,
- child: new Stack(
+ child: Stack(
key: stackKey,
children: <Widget>[
_buildEdges(stackKey, surfaceKeys, firstSurfaces),
@@ -152,8 +152,8 @@
Widget _buildEdges(GlobalKey stackKey, Map<String, GlobalKey> surfaceKeys,
Set<Surface> firstSurfaces) {
- return new CustomPaint(
- painter: new _RelationshipTreeEdges(
+ return CustomPaint(
+ painter: _RelationshipTreeEdges(
firstSurfaces: firstSurfaces,
surfaceKeys: surfaceKeys,
backgroundKey: stackKey,
@@ -163,13 +163,13 @@
Widget _buildNodes(SurfaceGraph graph, Map<String, GlobalKey> surfaceKeys,
Set<Surface> firstSurfaces) {
- return new Container(
- padding: new EdgeInsets.only(
+ return Container(
+ padding: EdgeInsets.only(
left: _pageHorizontalPadding,
right: _pageHorizontalPadding,
top: _pageTopPadding,
),
- child: new Column(
+ child: Column(
children: firstSurfaces
.map((surface) => _buildTree(surfaceKeys, graph, surface,
(graph.focusStack.last == surface)))
@@ -182,16 +182,16 @@
List<Widget> _buildLabelWidgetList(int maxHeight) {
List<Widget> labelWidgets = <Widget>[];
double totalLength = _pageHorizontalPadding + _surfaceWidgetWidth;
- labelWidgets.add(new Container(
+ labelWidgets.add(Container(
/// Depth 1
- padding: new EdgeInsets.only(right: _labelHorizontalPadding),
+ padding: EdgeInsets.only(right: _labelHorizontalPadding),
width: totalLength,
height: _labelWidgetHeight,
decoration: _labelBoxDecoration(true, true),
alignment: Alignment.centerRight,
- child: new Text(
+ child: Text(
'Depth 1',
- style: new TextStyle(
+ style: TextStyle(
color: Colors.black,
fontSize: 10.0,
),
@@ -204,15 +204,15 @@
for (int i = 0; i < maxHeight; i++) {
totalLength += labelWidgetWidth;
- labelWidgets.add(new Container(
- padding: new EdgeInsets.only(right: _labelHorizontalPadding),
+ labelWidgets.add(Container(
+ padding: EdgeInsets.only(right: _labelHorizontalPadding),
width: labelWidgetWidth,
height: _labelWidgetHeight,
decoration: _labelBoxDecoration(true, true),
alignment: Alignment.centerRight,
- child: new Text(
+ child: Text(
'Depth ${i + 2}',
- style: new TextStyle(
+ style: TextStyle(
color: Colors.black,
fontSize: 10.0,
),
@@ -220,8 +220,8 @@
));
}
- labelWidgets.add(new Expanded(
- child: new Container(
+ labelWidgets.add(Expanded(
+ child: Container(
height: _labelWidgetHeight,
decoration: _labelBoxDecoration(false, true),
),
@@ -231,14 +231,14 @@
}
BoxDecoration _labelBoxDecoration(bool rightBorder, bool bottomBorder) {
- return new BoxDecoration(
+ return BoxDecoration(
color: Colors.white,
- border: new Border(
- right: new BorderSide(
+ border: Border(
+ right: BorderSide(
color: rightBorder ? Colors.grey[400] : Colors.transparent,
width: 0.5,
),
- bottom: new BorderSide(
+ bottom: BorderSide(
color: bottomBorder ? Colors.grey[400] : Colors.transparent,
width: 0.5,
),
@@ -273,11 +273,11 @@
}
String id = surface.node.value;
- globalKeys[id] = new GlobalKey();
+ globalKeys[id] = GlobalKey();
Widget thisWidget = _buildChildNode(globalKeys[id], surface, isFocused);
- List<Surface> children = new List<Surface>.from(surface.children.toList())
+ List<Surface> children = List<Surface>.from(surface.children.toList())
..removeWhere((child) => child == null);
if (_storytellerDebug) {
@@ -295,14 +295,14 @@
if (_storytellerDebug) {
log.info('*** The first child: ${children[0]}');
}
- return new Row(
+ return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
thisWidget,
(children.length == 1)
? _buildTree(globalKeys, graph, children[0],
(graph.focusStack.toList().last == children[0]))
- : new Column(
+ : Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: children.map((child) {
return _buildTree(globalKeys, graph, child,
@@ -318,13 +318,13 @@
Widget _buildChildNode(GlobalKey key, Surface surface, bool isFocused) {
bool isFirstDepthNode = (surface.parentId == null);
- return new Container(
- padding: new EdgeInsets.only(bottom: _branchPadding),
- child: new Row(
+ return Container(
+ padding: EdgeInsets.only(bottom: _branchPadding),
+ child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
(isFirstDepthNode)
- ? new Container()
+ ? Container()
: _buildRelationshipWidget(surface),
_buildSurfaceWidget(key, surface, isFocused),
],
@@ -341,16 +341,16 @@
String dependency = depName[surface.relation.dependency] ?? 'Unknown';
String emphasis = surface.relation.emphasis.toStringAsPrecision(2);
- return new Container(
+ return Container(
width: _branchWidth,
height: _surfaceWidgetHeight,
- child: new Center(
- child: new Container(
- padding: new EdgeInsets.symmetric(horizontal: 12.0, vertical: 6.0),
+ child: Center(
+ child: Container(
+ padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 6.0),
width: _relationshipWidgetWidth,
height: _relationshipWidgetHeight,
decoration: _relationshipBoxDeco(dependency),
- child: new Column(
+ child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@@ -365,12 +365,12 @@
}
Widget _buildRelationshipRow(IconData icon, String text, String dependency) {
- return new Row(
+ return Row(
children: <Widget>[
_relationshipIcon(icon, dependency),
- new Container(
- padding: new EdgeInsets.only(left: 10.0),
- child: new Text(
+ Container(
+ padding: EdgeInsets.only(left: 10.0),
+ child: Text(
text,
style: _relationshipTextStyle(dependency),
),
@@ -380,12 +380,12 @@
}
BoxDecoration _relationshipBoxDeco(String dependency) {
- return new BoxDecoration(
+ return BoxDecoration(
color: (dependency == 'Independent')
? Colors.white
: _storytellerPrimaryColor,
borderRadius: BorderRadius.circular(10.0),
- border: new Border.all(
+ border: Border.all(
color: _storytellerPrimaryColor,
width: 2.0,
),
@@ -393,7 +393,7 @@
}
TextStyle _relationshipTextStyle(String dependency) {
- return new TextStyle(
+ return TextStyle(
color: (dependency == 'Independent')
? _storytellerPrimaryColor
: Colors.white,
@@ -403,7 +403,7 @@
}
Icon _relationshipIcon(IconData icon, String dependency) {
- return new Icon(
+ return Icon(
icon,
color: (dependency == 'Independent')
? _storytellerPrimaryColor
@@ -414,9 +414,9 @@
/// Builds a node of the tree that shows a surface, the surface's id and state.
Widget _buildSurfaceWidget(GlobalKey key, Surface surface, bool isFocused) {
- return new Container(
+ return Container(
height: _surfaceWidgetHeight + _surfaceWidgetTextHeight + 8.0,
- child: new Column(
+ child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
@@ -428,17 +428,17 @@
}
Widget _buildSurfaceImage(GlobalKey key, Surface surface) {
- return new Material(
+ return Material(
key: key,
color: Colors.white,
elevation: 2.0,
- borderRadius: new BorderRadius.circular(8.0),
- child: new Container(
+ borderRadius: BorderRadius.circular(8.0),
+ child: Container(
width: _surfaceWidgetWidth,
height: _surfaceWidgetHeight,
- child: new Center(
- child: new SurfaceResize(
- child: new ChildView(
+ child: Center(
+ child: SurfaceResize(
+ child: ChildView(
connection: surface.connection,
hitTestable: false,
),
@@ -449,15 +449,15 @@
}
Widget _buildSurfaceInfoText(Surface surface, bool isFocused) {
- return new Container(
+ return Container(
width: _surfaceWidgetWidth,
height: _surfaceWidgetTextHeight,
- child: new Row(
+ child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_buildStateIndicator(surface.dismissed, isFocused),
- new Expanded(
- child: new Text(
+ Expanded(
+ child: Text(
'${surface.node.value}',
style: TextStyle(
color: (surface.dismissed) ? Colors.grey[400] : Colors.black,
@@ -493,15 +493,15 @@
stateBorderColor = _storytellerPrimaryColor;
}
- return new Padding(
- padding: const EdgeInsets.only(top: 4.0, left: 8.0, right: 8.0),
- child: new Container(
+ return Padding(
+ padding: EdgeInsets.only(top: 4.0, left: 8.0, right: 8.0),
+ child: Container(
width: 6.0,
height: 6.0,
- decoration: new BoxDecoration(
+ decoration: BoxDecoration(
color: stateFillColor,
borderRadius: BorderRadius.circular(3.0),
- border: new Border.all(
+ border: Border.all(
width: 1.0,
color: stateBorderColor,
),
@@ -526,7 +526,7 @@
@override
void paint(Canvas canvas, Size size) {
- Paint paint = new Paint()
+ Paint paint = Paint()
..color = _storytellerPrimaryColor
..strokeWidth = 1.5
..strokeCap = StrokeCap.round
@@ -535,7 +535,7 @@
final bgContext = backgroundKey.currentContext;
final RenderBox bgBox = bgContext.findRenderObject();
- Set<Surface> currentSurfaces = new Set<Surface>.from(firstSurfaces);
+ Set<Surface> currentSurfaces = Set<Surface>.from(firstSurfaces);
while (currentSurfaces.isNotEmpty) {
for (Surface surface in currentSurfaces) {
diff --git a/shell/mondrian_story_shell/lib/widgets/surface_resize.dart b/shell/mondrian_story_shell/lib/widgets/surface_resize.dart
index 2721ad3..4fa83c3 100644
--- a/shell/mondrian_story_shell/lib/widgets/surface_resize.dart
+++ b/shell/mondrian_story_shell/lib/widgets/surface_resize.dart
@@ -8,7 +8,7 @@
import 'package:meta/meta.dart';
/// 60-30 isometric projection matrix
-final Matrix4 _iso = new Matrix4.identity();
+final Matrix4 _iso = Matrix4.identity();
/// Widget that performs an isometric transformation on a Widget,
/// scaling it so that it fits within the bounds of its original rectangle
@@ -23,15 +23,15 @@
const SurfaceResize({@required this.child, this.scaleFactor = 4.0});
@override
- Widget build(BuildContext context) => new LayoutBuilder(
+ Widget build(BuildContext context) => LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
BoxConstraints _scaledConstraints = constraints * scaleFactor;
- return new FittedBox(
+ return FittedBox(
fit: BoxFit.scaleDown,
- child: new Container(
+ child: Container(
constraints: _scaledConstraints,
- child: new Transform(
+ child: Transform(
child: child,
transform: _getTransformation(constraints: _scaledConstraints),
origin: _scaledConstraints.biggest.center(Offset.zero),
@@ -51,6 +51,6 @@
);
double isoScale = min(constraintsRect.height / transRect.height,
constraintsRect.width / transRect.width);
- return new Matrix4.copy(_iso)..scale(isoScale);
+ return Matrix4.copy(_iso)..scale(isoScale);
}
}
diff --git a/shell/mondrian_story_shell/lib/widgets/surface_stage.dart b/shell/mondrian_story_shell/lib/widgets/surface_stage.dart
index 3321c24..1e97f94 100644
--- a/shell/mondrian_story_shell/lib/widgets/surface_stage.dart
+++ b/shell/mondrian_story_shell/lib/widgets/surface_stage.dart
@@ -20,7 +20,7 @@
import '../widgets/gestures.dart';
import 'surface_frame.dart';
-const SpringDescription _kSimSpringDescription = const SpringDescription(
+const SpringDescription _kSimSpringDescription = SpringDescription(
mass: 1.0,
stiffness: 220.0,
damping: 29.0,
@@ -50,7 +50,7 @@
forms
.reduceForest(
(SurfaceForm f, Iterable<_SurfaceInstance> children) =>
- new _SurfaceInstance(
+ _SurfaceInstance(
form: f,
dependents: children.toList(),
useGestures: useGestures,
@@ -71,14 +71,14 @@
// toward the edges of the screen from moving or dismissing the
// associated surfaces.
children.addAll(<Widget>[
- new Positioned(
+ Positioned(
left: -_kGestureWidth,
top: _kGestureWidth,
bottom: _kGestureWidth,
width: 2.0 * _kGestureWidth,
child: _createIgnoringGestureDetector(Direction.left),
),
- new Positioned(
+ Positioned(
right: -_kGestureWidth,
top: _kGestureWidth,
bottom: _kGestureWidth,
@@ -87,7 +87,7 @@
),
]);
}
- return new Stack(
+ return Stack(
fit: StackFit.expand,
children: children,
);
@@ -96,7 +96,7 @@
/// This gesture detector fights in the arena and ignores the horizontal drags
/// in the given [direction] if it wins.
Widget _createIgnoringGestureDetector(Direction direction) {
- return new UnidirectionalHorizontalGestureDetector(
+ return UnidirectionalHorizontalGestureDetector(
direction: direction,
behavior: HitTestBehavior.translucent,
onHorizontalDragStart: (DragStartDetails details) {},
@@ -127,7 +127,7 @@
final bool useGestures;
@override
- _SurfaceInstanceState createState() => new _SurfaceInstanceState();
+ _SurfaceInstanceState createState() => _SurfaceInstanceState();
}
class DummyTickerProvider implements TickerProvider {
@@ -162,7 +162,7 @@
return ManualAnimation<Rect>(
value: widget.form.initPosition,
velocity: Rect.zero,
- builder: (Rect value, Rect velocity) => new MovingTargetAnimation<Rect>(
+ builder: (Rect value, Rect velocity) => MovingTargetAnimation<Rect>(
vsync: tickerProvider,
simulate: _kFormSimulate,
target: _target,
@@ -185,8 +185,8 @@
final _SurfaceInstanceState parentSurfaceState = context
?.ancestorStateOfType(const TypeMatcher<_SurfaceInstanceState>());
return parentSurfaceState == null
- ? new ManualAnimation<Rect>(value: f.position, velocity: Rect.zero)
- : new TransformedAnimation<Rect>(
+ ? ManualAnimation<Rect>(value: f.position, velocity: Rect.zero)
+ : TransformedAnimation<Rect>(
animation: parentSurfaceState.animation,
valueTransform: (Rect r) => f.position.shift(
r.center - parentSurfaceState.widget.form.position.center),
@@ -196,7 +196,7 @@
@override
Widget build(BuildContext context) {
- return new AnimatedBuilder(
+ return AnimatedBuilder(
animation: _animation,
builder: (BuildContext context, Widget child) {
Size parentSize = MediaQuery.of(context).size;
@@ -219,12 +219,12 @@
);
final stackChildren = <Widget>[
- new Positioned(
+ Positioned(
left: left,
top: top,
bottom: bottom,
right: right,
- child: new SurfaceFrame(
+ child: SurfaceFrame(
child: form.parts.keys.first,
depth: surfaceDepth,
// HACK(alangardner): May need explicit interactable parameter
@@ -235,7 +235,7 @@
if (widget.useGestures) {
stackChildren.addAll([
- new Positioned(
+ Positioned(
left: left - _kGestureWidth,
top: top + _kGestureWidth,
bottom: bottom + _kGestureWidth,
@@ -246,7 +246,7 @@
Direction.right,
),
),
- new Positioned(
+ Positioned(
right: right - _kGestureWidth,
top: top + _kGestureWidth,
bottom: bottom + _kGestureWidth,
@@ -259,7 +259,7 @@
),
]);
}
- return new Stack(
+ return Stack(
fit: StackFit.expand,
children: stackChildren..addAll(widget.dependents),
);
@@ -272,7 +272,7 @@
SurfaceForm form,
Direction direction,
) {
- return new UnidirectionalHorizontalGestureDetector(
+ return UnidirectionalHorizontalGestureDetector(
direction: direction,
behavior: HitTestBehavior.translucent,
onHorizontalDragStart: (DragStartDetails details) {
@@ -332,14 +332,14 @@
}
Offset _toFractional(Offset absoluteOffset, Size size) {
- return new Offset(
+ return Offset(
absoluteOffset.dx / size.width,
absoluteOffset.dy / size.height,
);
}
Offset _toAbsolute(Offset fractionalOffset, Size size) {
- return new Offset(
+ return Offset(
fractionalOffset.dx * size.width,
fractionalOffset.dy * size.height,
);
@@ -347,23 +347,23 @@
}
const double _kEpsilon = 1e-3;
-const Tolerance _kTolerance = const Tolerance(
+const Tolerance _kTolerance = Tolerance(
distance: _kEpsilon,
time: _kEpsilon,
velocity: _kEpsilon,
);
Sim<Rect> _kFormSimulate(Rect value, Rect target, Rect velocity) =>
- new IndependentRectSim(
- positionSim: new Independent2DSim(
- xSim: new SpringSimulation(
+ IndependentRectSim(
+ positionSim: Independent2DSim(
+ xSim: SpringSimulation(
_kSimSpringDescription,
value.center.dx,
target.center.dx,
velocity.center.dx,
tolerance: _kTolerance,
),
- ySim: new SpringSimulation(
+ ySim: SpringSimulation(
_kSimSpringDescription,
value.center.dy,
target.center.dy,
@@ -371,15 +371,15 @@
tolerance: _kTolerance,
),
),
- sizeSim: new Independent2DSim(
- xSim: new SpringSimulation(
+ sizeSim: Independent2DSim(
+ xSim: SpringSimulation(
_kSimSpringDescription,
value.size.width,
target.size.width,
velocity.size.width,
tolerance: _kTolerance,
),
- ySim: new SpringSimulation(
+ ySim: SpringSimulation(
_kSimSpringDescription,
value.size.height,
target.size.height,
diff --git a/shell/mondrian_story_shell/test/layout/pattern_layout_test.dart b/shell/mondrian_story_shell/test/layout/pattern_layout_test.dart
index fc066d0..22de9de 100644
--- a/shell/mondrian_story_shell/test/layout/pattern_layout_test.dart
+++ b/shell/mondrian_story_shell/test/layout/pattern_layout_test.dart
@@ -17,10 +17,10 @@
void main() {
// pattern layout logs warnings
setupLogger(name: 'mondrain_story_shell_tests');
- Surface firstSurface = new MockSurface();
- LayoutModel layoutModel = new LayoutModel();
+ Surface firstSurface = MockSurface();
+ LayoutModel layoutModel = LayoutModel();
test('Ticker pattern with 2 surfaces', () {
- Surface patternSurface = new MockSurface();
+ Surface patternSurface = MockSurface();
when(patternSurface.compositionPattern).thenReturn('ticker');
List<Surface> surfaces = [
firstSurface,
@@ -31,15 +31,15 @@
expect(positionedSurfaces.length, 2);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 0.85, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 0.85, width: 1.0, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 0.15, width: 1.0, topLeft: const Offset(0.0, 0.85));
+ height: 0.15, width: 1.0, topLeft: Offset(0.0, 0.85));
});
test('Ticker pattern with 2 surfaces and empty composition pattern', () {
when(firstSurface.compositionPattern).thenReturn('');
- Surface patternSurface = new MockSurface();
+ Surface patternSurface = MockSurface();
when(patternSurface.compositionPattern).thenReturn('ticker');
List<Surface> surfaces = [
firstSurface,
@@ -50,18 +50,18 @@
expect(positionedSurfaces.length, 2);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 0.85, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 0.85, width: 1.0, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 0.15, width: 1.0, topLeft: const Offset(0.0, 0.85));
+ height: 0.15, width: 1.0, topLeft: Offset(0.0, 0.85));
});
test('Multiple tickers', () {
- Surface tickerSurface = new MockSurface();
+ Surface tickerSurface = MockSurface();
when(tickerSurface.compositionPattern).thenReturn('ticker');
- Surface tickerSurface2 = new MockSurface();
+ Surface tickerSurface2 = MockSurface();
when(tickerSurface2.compositionPattern).thenReturn('ticker');
- Surface tickerSurface3 = new MockSurface();
+ Surface tickerSurface3 = MockSurface();
when(tickerSurface3.compositionPattern).thenReturn('ticker');
List<Surface> surfaces = [
firstSurface,
@@ -74,15 +74,15 @@
expect(positionedSurfaces.length, 2);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 0.85, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 0.85, width: 1.0, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 0.15, width: 1.0, topLeft: const Offset(0.0, 0.85));
+ height: 0.15, width: 1.0, topLeft: Offset(0.0, 0.85));
expect(positionedSurfaces[1].surface, tickerSurface3);
});
test('Comments-right pattern with 2 surfaces', () {
- Surface patternSurface = new MockSurface();
+ Surface patternSurface = MockSurface();
when(patternSurface.compositionPattern).thenReturn('comments-right');
List<Surface> surfaces = [
firstSurface,
@@ -93,18 +93,18 @@
expect(positionedSurfaces.length, 2);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 0.7, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 0.7, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.3, topLeft: const Offset(0.7, 0.0));
+ height: 1.0, width: 0.3, topLeft: Offset(0.7, 0.0));
});
test('Multiple comments-right', () {
- Surface commentsSurface = new MockSurface();
+ Surface commentsSurface = MockSurface();
when(commentsSurface.compositionPattern).thenReturn('comments-right');
- Surface commentsSurface2 = new MockSurface();
+ Surface commentsSurface2 = MockSurface();
when(commentsSurface2.compositionPattern).thenReturn('comments-right');
- Surface commentsSurface3 = new MockSurface();
+ Surface commentsSurface3 = MockSurface();
when(commentsSurface3.compositionPattern).thenReturn('comments-right');
List<Surface> surfaces = [
firstSurface,
@@ -117,15 +117,15 @@
expect(positionedSurfaces.length, 2);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 0.7, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 0.7, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.3, topLeft: const Offset(0.7, 0.0));
+ height: 1.0, width: 0.3, topLeft: Offset(0.7, 0.0));
expect(positionedSurfaces[1].surface, commentsSurface3);
});
test('Undefined pattern', () {
- Surface patternSurface = new MockSurface();
+ Surface patternSurface = MockSurface();
when(patternSurface.compositionPattern).thenReturn('undefined');
List<Surface> surfaces = [
firstSurface,
@@ -136,13 +136,13 @@
expect(positionedSurfaces.length, 1);
test_util.assertSurfaceProperties(positionedSurfaces.first,
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
});
test('Comments and ticker', () {
- Surface commentsSurface = new MockSurface();
+ Surface commentsSurface = MockSurface();
when(commentsSurface.compositionPattern).thenReturn('comments-right');
- Surface tickerSurface = new MockSurface();
+ Surface tickerSurface = MockSurface();
when(tickerSurface.compositionPattern).thenReturn('ticker');
List<Surface> surfaces = [
firstSurface,
@@ -154,19 +154,19 @@
expect(positionedSurfaces.length, 3);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 0.85, width: 0.7, topLeft: const Offset(0.0, 0.0));
+ height: 0.85, width: 0.7, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.3, topLeft: const Offset(0.7, 0.0));
+ height: 1.0, width: 0.3, topLeft: Offset(0.7, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[2],
- height: 0.15, width: 0.7, topLeft: const Offset(0.0, 0.85));
+ height: 0.15, width: 0.7, topLeft: Offset(0.0, 0.85));
});
test('Ticker and comments', () {
- Surface commentsSurface = new MockSurface();
+ Surface commentsSurface = MockSurface();
when(commentsSurface.compositionPattern).thenReturn('comments-right');
- Surface tickerSurface = new MockSurface();
+ Surface tickerSurface = MockSurface();
when(tickerSurface.compositionPattern).thenReturn('ticker');
List<Surface> surfaces = [
firstSurface,
@@ -178,23 +178,23 @@
expect(positionedSurfaces.length, 3);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 0.85, width: 0.7, topLeft: const Offset(0.0, 0.0));
+ height: 0.85, width: 0.7, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.3, topLeft: const Offset(0.7, 0.0));
+ height: 1.0, width: 0.3, topLeft: Offset(0.7, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[2],
- height: 0.15, width: 0.7, topLeft: const Offset(0.0, 0.85));
+ height: 0.15, width: 0.7, topLeft: Offset(0.0, 0.85));
});
test('Multiple ticker and comments', () {
- Surface commentsSurface = new MockSurface();
+ Surface commentsSurface = MockSurface();
when(commentsSurface.compositionPattern).thenReturn('comments-right');
- Surface commentsSurface2 = new MockSurface();
+ Surface commentsSurface2 = MockSurface();
when(commentsSurface2.compositionPattern).thenReturn('comments-right');
- Surface tickerSurface = new MockSurface();
+ Surface tickerSurface = MockSurface();
when(tickerSurface.compositionPattern).thenReturn('ticker');
- Surface tickerSurface2 = new MockSurface();
+ Surface tickerSurface2 = MockSurface();
when(tickerSurface2.compositionPattern).thenReturn('ticker');
List<Surface> surfaces = [
firstSurface,
@@ -208,14 +208,14 @@
expect(positionedSurfaces.length, 3);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 0.85, width: 0.7, topLeft: const Offset(0.0, 0.0));
+ height: 0.85, width: 0.7, topLeft: Offset(0.0, 0.0));
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.3, topLeft: const Offset(0.7, 0.0));
+ height: 1.0, width: 0.3, topLeft: Offset(0.7, 0.0));
expect(positionedSurfaces[1].surface, commentsSurface2);
test_util.assertSurfaceProperties(positionedSurfaces[2],
- height: 0.15, width: 0.7, topLeft: const Offset(0.0, 0.85));
+ height: 0.15, width: 0.7, topLeft: Offset(0.0, 0.85));
expect(positionedSurfaces[2].surface, tickerSurface2);
});
}
diff --git a/shell/mondrian_story_shell/test/layout/surface_relationship_test.dart b/shell/mondrian_story_shell/test/layout/surface_relationship_test.dart
index 79d4f0b..a29530f 100644
--- a/shell/mondrian_story_shell/test/layout/surface_relationship_test.dart
+++ b/shell/mondrian_story_shell/test/layout/surface_relationship_test.dart
@@ -17,13 +17,13 @@
import '../layout_test_utils.dart' as test_util;
void main() {
- LayoutModel layoutModel = new LayoutModel();
+ LayoutModel layoutModel = LayoutModel();
test('Single surface', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation surfaceRelation = const SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.none,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -42,15 +42,15 @@
expect(positionedSurfaces[0].surface, root);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
});
test('Copresent 2 surfaces', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
// properties for root surface
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation surfaceRelation = const SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.none,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -61,8 +61,8 @@
'root_of_test', ViewHolderToken(value: EventPair(null)));
// properties for the copresent surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -82,19 +82,19 @@
expect(positionedSurfaces[0].surface, root);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 0.5, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.0, 0.0));
expect(positionedSurfaces[1].surface, copresentSurface);
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.5, topLeft: const Offset(0.5, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.5, 0.0));
});
test('Sequential surfaces', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
// properties for root surface
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation surfaceRelation = const SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.none,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -105,8 +105,8 @@
'root_of_test', ViewHolderToken(value: EventPair(null)));
// properties for the sequential surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.sequential,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -126,15 +126,15 @@
expect(positionedSurfaces[0].surface, sequentialSurface);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
});
test('one surface ontop of another surface', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
// properties for root surface
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation surfaceRelation = const SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.none,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -145,8 +145,8 @@
'root_of_test', ViewHolderToken(value: EventPair(null)));
// properties for the ontop surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.ontop,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -166,20 +166,20 @@
expect(positionedSurfaces[0].surface, root);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
expect(positionedSurfaces[1].surface, ontopSurface);
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
});
test('two surfaces in copresent and one brought ontop of the root surface',
() {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
// properties for root surface
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation surfaceRelation = const SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.none,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -190,8 +190,8 @@
'root_of_test', ViewHolderToken(value: EventPair(null)));
// properties for root surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -202,8 +202,8 @@
'copresent', ViewHolderToken(value: EventPair(null)));
// properties for the ontop surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.ontop,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -224,25 +224,25 @@
expect(positionedSurfaces[0].surface, root);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 0.5, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.0, 0.0));
expect(positionedSurfaces[1].surface, copresentSurface);
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.5, topLeft: const Offset(0.5, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.5, 0.0));
expect(positionedSurfaces[2].surface, ontopSurface);
test_util.assertSurfaceProperties(positionedSurfaces[2],
- height: 1.0, width: 0.5, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.0, 0.0));
});
test(
'two surfaces in copresent and one brought ontop of the copresent surface',
() {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
// properties for root surface
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation surfaceRelation = const SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.none,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -253,8 +253,8 @@
'root_of_test', ViewHolderToken(value: EventPair(null)));
// properties for root surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -265,8 +265,8 @@
'copresent', ViewHolderToken(value: EventPair(null)));
// properties for the ontop surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.ontop,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -287,23 +287,23 @@
expect(positionedSurfaces[0].surface, root);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 0.5, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.0, 0.0));
expect(positionedSurfaces[1].surface, copresentSurface);
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 0.5, topLeft: const Offset(0.5, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.5, 0.0));
expect(positionedSurfaces[2].surface, ontopSurface);
test_util.assertSurfaceProperties(positionedSurfaces[2],
- height: 1.0, width: 0.5, topLeft: const Offset(0.5, 0.0));
+ height: 1.0, width: 0.5, topLeft: Offset(0.5, 0.0));
});
test('three surfaces on top of each other', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
// properties for root surface
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation surfaceRelation = const SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.none,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -314,8 +314,8 @@
'root_of_test', ViewHolderToken(value: EventPair(null)));
// properties for root surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.ontop,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -326,8 +326,8 @@
'ontop1', ViewHolderToken(value: EventPair(null)));
// properties for the ontop surface
- properties = new SurfaceProperties();
- surfaceRelation = const SurfaceRelation(
+ properties = SurfaceProperties();
+ surfaceRelation = SurfaceRelation(
arrangement: SurfaceArrangement.ontop,
dependency: SurfaceDependency.none,
emphasis: 1.0,
@@ -348,14 +348,14 @@
expect(positionedSurfaces[0].surface, root);
test_util.assertSurfaceProperties(positionedSurfaces[0],
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
expect(positionedSurfaces[1].surface, firstOnTop);
test_util.assertSurfaceProperties(positionedSurfaces[1],
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
expect(positionedSurfaces[2].surface, secondOntop);
test_util.assertSurfaceProperties(positionedSurfaces[2],
- height: 1.0, width: 1.0, topLeft: const Offset(0.0, 0.0));
+ height: 1.0, width: 1.0, topLeft: Offset(0.0, 0.0));
});
}
diff --git a/shell/mondrian_story_shell/test/model/surface/surface_graph_test.dart b/shell/mondrian_story_shell/test/model/surface/surface_graph_test.dart
index b095195..ced699f 100644
--- a/shell/mondrian_story_shell/test/model/surface/surface_graph_test.dart
+++ b/shell/mondrian_story_shell/test/model/surface/surface_graph_test.dart
@@ -14,10 +14,10 @@
void main() {
test('toJson and back again with a single surface', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
SurfaceProperties properties =
- new SurfaceProperties(containerLabel: 'containerLabel');
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceProperties(containerLabel: 'containerLabel');
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -31,7 +31,7 @@
String encoded = json.encode(graph);
Map<String, dynamic> decoded = json.decode(encoded);
- SurfaceGraph decodedGraph = new SurfaceGraph.fromJson(decoded);
+ SurfaceGraph decodedGraph = SurfaceGraph.fromJson(decoded);
expect(decodedGraph.focusStack.length, 1);
Surface surface = decodedGraph.focusStack.first;
@@ -44,10 +44,10 @@
});
test('toJson and back again with two surfaces', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
SurfaceProperties properties =
- new SurfaceProperties(containerLabel: 'containerLabel');
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceProperties(containerLabel: 'containerLabel');
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -59,8 +59,8 @@
..focusSurface('parent');
expect(graph.focusStack.length, 1);
- properties = new SurfaceProperties(containerLabel: 'containerLabel');
- relation = new SurfaceRelation(
+ properties = SurfaceProperties(containerLabel: 'containerLabel');
+ relation = SurfaceRelation(
emphasis: 0.5,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -75,7 +75,7 @@
String encoded = json.encode(graph);
Map<String, dynamic> decoded = json.decode(encoded);
- SurfaceGraph decodedGraph = new SurfaceGraph.fromJson(decoded);
+ SurfaceGraph decodedGraph = SurfaceGraph.fromJson(decoded);
expect(decodedGraph.focusStack.length, 2);
Surface surface = decodedGraph.focusStack.first;
@@ -100,10 +100,10 @@
});
test('toJson and back again with one surface with two children', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
SurfaceProperties properties =
- new SurfaceProperties(containerLabel: 'containerLabel');
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceProperties(containerLabel: 'containerLabel');
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -115,8 +115,8 @@
..focusSurface('parent');
expect(graph.focusStack.length, 1);
- properties = new SurfaceProperties(containerLabel: 'containerLabel');
- relation = new SurfaceRelation(
+ properties = SurfaceProperties(containerLabel: 'containerLabel');
+ relation = SurfaceRelation(
emphasis: 0.5,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -128,8 +128,8 @@
..focusSurface('child1');
expect(graph.focusStack.length, 2);
- properties = new SurfaceProperties(containerLabel: 'containerLabel');
- relation = new SurfaceRelation(
+ properties = SurfaceProperties(containerLabel: 'containerLabel');
+ relation = SurfaceRelation(
emphasis: 0.0,
arrangement: SurfaceArrangement.ontop,
dependency: SurfaceDependency.dependent,
@@ -144,7 +144,7 @@
String encoded = json.encode(graph);
Map<String, dynamic> decoded = json.decode(encoded);
- SurfaceGraph decodedGraph = new SurfaceGraph.fromJson(decoded);
+ SurfaceGraph decodedGraph = SurfaceGraph.fromJson(decoded);
expect(decodedGraph.focusStack.length, 3);
Surface surface = decodedGraph.focusStack.first;
@@ -180,18 +180,18 @@
});
test('external surfaces are found by resummon dismissed checks', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
SurfaceProperties externalProp =
- new SurfaceProperties(source: ModuleSource.external$);
+ SurfaceProperties(source: ModuleSource.external$);
graph
- ..addSurface('parent', new SurfaceProperties(), '', new SurfaceRelation(),
+ ..addSurface('parent', SurfaceProperties(), '', SurfaceRelation(),
null, '')
..connectViewFromViewHolderToken(
'parent', ViewHolderToken(value: EventPair(null)))
..focusSurface('parent')
// Now add external surface
..addSurface(
- 'external', externalProp, 'parent', new SurfaceRelation(), null, '')
+ 'external', externalProp, 'parent', SurfaceRelation(), null, '')
..connectViewFromViewHolderToken(
'external', ViewHolderToken(value: EventPair(null)))
..focusSurface('external')
@@ -202,10 +202,10 @@
});
test('duplicate surface add', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
SurfaceProperties properties =
- new SurfaceProperties(containerLabel: 'containerLabel');
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceProperties(containerLabel: 'containerLabel');
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -226,10 +226,10 @@
});
test('duplicate child surface add', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
SurfaceProperties properties =
- new SurfaceProperties(containerLabel: 'containerLabel');
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceProperties(containerLabel: 'containerLabel');
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -257,10 +257,10 @@
});
test('duplicate child surface add', () {
- SurfaceGraph graph = new SurfaceGraph();
+ SurfaceGraph graph = SurfaceGraph();
SurfaceProperties properties =
- new SurfaceProperties(containerLabel: 'containerLabel');
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceProperties(containerLabel: 'containerLabel');
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
diff --git a/shell/mondrian_story_shell/test/model/surface/surface_test.dart b/shell/mondrian_story_shell/test/model/surface/surface_test.dart
index afc3dd6..cc18b32 100644
--- a/shell/mondrian_story_shell/test/model/surface/surface_test.dart
+++ b/shell/mondrian_story_shell/test/model/surface/surface_test.dart
@@ -14,23 +14,23 @@
void main() {
test('toJson and fromJson', () {
- SurfaceGraph graph = new SurfaceGraph();
- Tree parent = new Tree<String>(value: null);
- Tree node = new Tree<String>(value: 'value');
- Tree child = new Tree<String>(value: 'childValue');
+ SurfaceGraph graph = SurfaceGraph();
+ Tree parent = Tree<String>(value: null);
+ Tree node = Tree<String>(value: 'value');
+ Tree child = Tree<String>(value: 'childValue');
parent.add(node);
node.add(child);
- SurfaceProperties properties = new SurfaceProperties(
+ SurfaceProperties properties = SurfaceProperties(
containerLabel: 'containerLabel', source: ModuleSource.external$);
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
);
- Surface surface = new Surface(graph, node, properties, relation, null, '');
+ Surface surface = Surface(graph, node, properties, relation, null, '');
String encoded = json.encode(surface);
Map decodedJson = json.decode(encoded);
- Surface decodedSurface = new Surface.fromJson(decodedJson, graph);
+ Surface decodedSurface = Surface.fromJson(decodedJson, graph);
expect(decodedSurface.node.value, 'value');
expect(decodedSurface.isParentRoot, true);
expect(decodedSurface.relation.emphasis, 0.12);
@@ -42,7 +42,7 @@
});
test('encode and decode surfaceRelation', () {
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.5,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
@@ -55,22 +55,22 @@
});
test('toJson and fromJson with empty surface properties', () {
- SurfaceGraph graph = new SurfaceGraph();
- Tree parent = new Tree<String>(value: null);
- Tree node = new Tree<String>(value: 'value');
- Tree child = new Tree<String>(value: 'childValue');
+ SurfaceGraph graph = SurfaceGraph();
+ Tree parent = Tree<String>(value: null);
+ Tree node = Tree<String>(value: 'value');
+ Tree child = Tree<String>(value: 'childValue');
parent.add(node);
node.add(child);
- SurfaceProperties properties = new SurfaceProperties();
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceProperties properties = SurfaceProperties();
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.12,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
);
- Surface surface = new Surface(graph, node, properties, relation, null, '');
+ Surface surface = Surface(graph, node, properties, relation, null, '');
String encoded = json.encode(surface);
Map decodedJson = json.decode(encoded);
- Surface decodedSurface = new Surface.fromJson(decodedJson, graph);
+ Surface decodedSurface = Surface.fromJson(decodedJson, graph);
expect(decodedSurface.node.value, 'value');
expect(decodedSurface.isParentRoot, true);
expect(decodedSurface.relation.emphasis, 0.12);
@@ -82,7 +82,7 @@
});
test('encode and decode surfaceRelation', () {
- SurfaceRelation relation = new SurfaceRelation(
+ SurfaceRelation relation = SurfaceRelation(
emphasis: 0.5,
arrangement: SurfaceArrangement.copresent,
dependency: SurfaceDependency.dependent,
diff --git a/shell/mondrian_story_shell/test/model/tree/spanning_tree_test.dart b/shell/mondrian_story_shell/test/model/tree/spanning_tree_test.dart
index 9f278d1..35e8211 100644
--- a/shell/mondrian_story_shell/test/model/tree/spanning_tree_test.dart
+++ b/shell/mondrian_story_shell/test/model/tree/spanning_tree_test.dart
@@ -26,7 +26,7 @@
SurfaceRelation(arrangement: SurfaceArrangement.sequential);
setUp(() {
- graph = new SurfaceGraph();
+ graph = SurfaceGraph();
});
test('getCopresentSpanningTree with one surface in the graph', () {
diff --git a/shell/mondrian_story_shell/test/model/tree/tree_test.dart b/shell/mondrian_story_shell/test/model/tree/tree_test.dart
index be142f4..11d23b3 100644
--- a/shell/mondrian_story_shell/test/model/tree/tree_test.dart
+++ b/shell/mondrian_story_shell/test/model/tree/tree_test.dart
@@ -34,15 +34,15 @@
List<Tree<String>> expectedForest;
setUp(() {
- grandparent = new Tree<String>(value: 'grandparent');
- parent = new Tree<String>(value: 'parent');
- uncle = new Tree<String>(value: 'uncle');
- aunt = new Tree<String>(value: 'aunt');
- cousin = new Tree<String>(value: 'cousin');
- sibling = new Tree<String>(value: 'sibling');
- sibling2 = new Tree<String>(value: 'sibling2');
- niece = new Tree<String>(value: 'niece');
- child = new Tree<String>(value: 'child');
+ grandparent = Tree<String>(value: 'grandparent');
+ parent = Tree<String>(value: 'parent');
+ uncle = Tree<String>(value: 'uncle');
+ aunt = Tree<String>(value: 'aunt');
+ cousin = Tree<String>(value: 'cousin');
+ sibling = Tree<String>(value: 'sibling');
+ sibling2 = Tree<String>(value: 'sibling2');
+ niece = Tree<String>(value: 'niece');
+ child = Tree<String>(value: 'child');
grandparent = t(
// the root
@@ -68,15 +68,15 @@
);
trimmedTree = t(
- new Tree<String>(value: grandparent.value),
+ Tree<String>(value: grandparent.value),
children: <Tree<String>>[uncle, aunt],
);
- forest = new Forest<String>()..add(grandparent);
+ forest = Forest<String>()..add(grandparent);
- secondRoot = new Tree<String>(value: 'parent of friend');
- friend = new Tree<String>(value: 'friend');
- childFriend = new Tree<String>(value: 'child of friend');
+ secondRoot = Tree<String>(value: 'parent of friend');
+ friend = Tree<String>(value: 'friend');
+ childFriend = Tree<String>(value: 'child of friend');
secondRoot = t(
secondRoot, // the root
diff --git a/shell/third_party/QR-Code-generator/dart/qrcodegen/lib/qrcodegen.dart b/shell/third_party/QR-Code-generator/dart/qrcodegen/lib/qrcodegen.dart
index af83456..591f148 100644
--- a/shell/third_party/QR-Code-generator/dart/qrcodegen/lib/qrcodegen.dart
+++ b/shell/third_party/QR-Code-generator/dart/qrcodegen/lib/qrcodegen.dart
@@ -97,7 +97,7 @@
QrCode.withList(List<int> initData, this.mask, this.version, this.errCorLvl) {
_checkMask();
if (version < 1 || version > 40) {
- throw new ArgumentError('Version value out of range');
+ throw ArgumentError('Version value out of range');
}
_createGrid();
@@ -135,7 +135,7 @@
/// code points (not UTF-16 code units). The smallest possible QR Code version is automatically chosen for the output.
/// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
factory QrCode.encodeText(String text, EccEnum ecl) =>
- new QrCode._encodeSegments(
+ QrCode._encodeSegments(
segs: _QrSegment.makeSegments(text),
initialEcl: _kEcc[ecl],
);
@@ -145,7 +145,7 @@
/// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
/// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
factory QrCode.encodeBinary(List<int> data, EccEnum ecl) =>
- new QrCode._encodeSegments(
+ QrCode._encodeSegments(
segs: <_QrSegment>[new _QrSegment.makeBytes(data)],
initialEcl: _kEcc[ecl],
);
@@ -165,7 +165,7 @@
if (!(1 <= minVersion && minVersion <= maxVersion && maxVersion <= 40) ||
mask < -1 ||
mask > 7) {
- throw new ArgumentError('Invalid value');
+ throw ArgumentError('Invalid value');
}
_Ecc ecl = initialEcl;
@@ -182,7 +182,7 @@
}
if (version >= maxVersion) {
// All versions in the range could not fit the given data
- throw new ArgumentError('Data too long');
+ throw ArgumentError('Data too long');
}
}
@@ -200,7 +200,7 @@
// Create the data bit string by concatenating all segments
int dataCapacityBits = _getNumDataCodewords(version, ecl) * 8;
- _BitBuffer bb = new _BitBuffer();
+ _BitBuffer bb = _BitBuffer();
for (_QrSegment seg in segs) {
bb
..appendBits(seg.mode.modeBits, 4)
@@ -222,13 +222,13 @@
assert(bb.bitLength % 8 == 0);
// Create the QR Code symbol
- return new QrCode.withList(bb.bytes, mask, version, ecl);
+ return QrCode.withList(bb.bytes, mask, version, ecl);
}
void _checkMask() {
// Check arguments and handle simple scalar fields
if (mask < -1 || mask > 7) {
- throw new ArgumentError('Mask value out of range');
+ throw ArgumentError('Mask value out of range');
}
}
@@ -236,13 +236,13 @@
size = version * 4 + 17;
// Initialize both grids to be size*size arrays of Boolean false
- _modules = new List<List<bool>>.generate(
+ _modules = List<List<bool>>.generate(
size,
- (_) => new List<bool>.filled(size, false),
+ (_) => List<bool>.filled(size, false),
);
- _isFunction = new List<List<bool>>.generate(
+ _isFunction = List<List<bool>>.generate(
size,
- (_) => new List<bool>.filled(size, false),
+ (_) => List<bool>.filled(size, false),
);
}
@@ -426,7 +426,7 @@
// Split data into blocks and append ECC to each block
List<List<int>> blocks = <List<int>>[];
- _ReedSolomonGenerator rs = new _ReedSolomonGenerator(blockEccLen);
+ _ReedSolomonGenerator rs = _ReedSolomonGenerator(blockEccLen);
for (int i = 0, k = 0; i < numBlocks; i++) {
List<int> dat = data.sublist(
k, k + shortBlockLen - blockEccLen + (i < numShortBlocks ? 0 : 1));
@@ -456,7 +456,7 @@
// data area of this QR Code symbol. Function modules need to be marked off before this is called.
void _drawCodewords(List<int> data) {
if (data.length != (_getNumRawDataModules(version) / 8).floor()) {
- throw new ArgumentError('Invalid argument');
+ throw ArgumentError('Invalid argument');
}
int i = 0; // Bit index into the data
// Do the funny zigzag scan
@@ -489,7 +489,7 @@
// well-formed QR Code symbol needs exactly one mask applied (not zero, not two, etc.).
void _applyMask(int mask) {
if (mask < 0 || mask > 7) {
- throw new ArgumentError('Mask value out of range');
+ throw ArgumentError('Mask value out of range');
}
for (int y = 0; y < size; y++) {
for (int x = 0; x < size; x++) {
@@ -627,7 +627,7 @@
// This stateless pure function could be implemented as table of 40 variable-length lists of integers.
static List<int> _getAlignmentPatternPositions(int ver) {
if (ver != null && (ver < 1 || ver > 40))
- throw new ArgumentError('Version number out of range');
+ throw ArgumentError('Version number out of range');
else if (ver == 1)
return <int>[];
else {
@@ -652,7 +652,7 @@
// The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
static int _getNumRawDataModules(int ver) {
if (ver < 1 || ver > 40)
- throw new ArgumentError('Version number out of range');
+ throw ArgumentError('Version number out of range');
int result = (16 * ver + 128) * ver + 64;
if (ver >= 2) {
int numAlign = (ver / 7).floor() + 2;
@@ -669,7 +669,7 @@
// This stateless pure function could be implemented as a (40*4)-cell lookup table.
static int _getNumDataCodewords(int ver, _Ecc ecl) {
if (ver < 1 || ver > 40)
- throw new ArgumentError('Version number out of range');
+ throw ArgumentError('Version number out of range');
return (_getNumRawDataModules(ver) / 8).floor() -
_kEccCodewordsPerBlock[ecl.ordinal][ver] *
QrCode._kNumErrorCorrectionBlocks[ecl.ordinal][ver];
@@ -1044,10 +1044,10 @@
*/
static final Map<EccEnum, _Ecc> _kEcc = <EccEnum, _Ecc>{
// Constants declared in ascending order of error protection
- EccEnum.low: new _Ecc(0, 1),
- EccEnum.medium: new _Ecc(1, 0),
- EccEnum.quartile: new _Ecc(2, 3),
- EccEnum.high: new _Ecc(3, 2),
+ EccEnum.low: _Ecc(0, 1),
+ EccEnum.medium: _Ecc(1, 0),
+ EccEnum.quartile: _Ecc(2, 3),
+ EccEnum.high: _Ecc(3, 2),
};
}
@@ -1092,7 +1092,7 @@
_QrSegment(this.mode, this.numChars, this.bitData) {
if (numChars < 0) {
- throw new ArgumentError('Invalid argument');
+ throw ArgumentError('Invalid argument');
}
}
@@ -1100,34 +1100,34 @@
/// Returns a segment representing the given binary data encoded in byte mode.
factory _QrSegment.makeBytes(List<int> data) {
- _BitBuffer bb = new _BitBuffer();
+ _BitBuffer bb = _BitBuffer();
for (int b in data) {
bb.appendBits(b, 8);
}
- return new _QrSegment(kMode[_ModeEnum.byte], data.length, bb.bits);
+ return _QrSegment(kMode[_ModeEnum.byte], data.length, bb.bits);
}
/// Returns a segment representing the given string of decimal digits encoded in numeric mode.
factory _QrSegment.makeNumeric(String digits) {
if (!digits.contains(kNumericRegEx))
- throw new ArgumentError('String contains non-numeric characters');
- _BitBuffer bb = new _BitBuffer();
+ throw ArgumentError('String contains non-numeric characters');
+ _BitBuffer bb = _BitBuffer();
int i;
for (i = 0; i + 3 <= digits.length; i += 3) // Process groups of 3
bb.appendBits(int.parse(digits.substring(i, 3), radix: 10), 10);
int rem = digits.length - i;
if (rem > 0) // 1 or 2 digits remaining
bb.appendBits(int.parse(digits.substring(i), radix: 10), rem * 3 + 1);
- return new _QrSegment(kMode[_ModeEnum.numeric], digits.length, bb.bits);
+ return _QrSegment(kMode[_ModeEnum.numeric], digits.length, bb.bits);
}
/// Returns a segment representing the given text string encoded in alphanumeric mode. The characters allowed are:
/// 0 to 9, A to Z (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
factory _QrSegment.makeAlphanumeric(String text) {
if (!text.contains(kAlphanumericRegex))
- throw new ArgumentError(
+ throw ArgumentError(
'String contains unencodable characters in alphanumeric mode');
- _BitBuffer bb = new _BitBuffer();
+ _BitBuffer bb = _BitBuffer();
int i;
for (i = 0; i + 2 <= text.length; i += 2) {
// Process groups of 2
@@ -1137,12 +1137,12 @@
}
if (i < text.length) // 1 character remaining
bb.appendBits(kAlphanumericCharset.indexOf(text[i]), 6);
- return new _QrSegment(kMode[_ModeEnum.alphanumeric], text.length, bb.bits);
+ return _QrSegment(kMode[_ModeEnum.alphanumeric], text.length, bb.bits);
}
/// Returns a segment representing an Extended Channel Interpretation (ECI) designator with the given assignment value.
factory _QrSegment.makeEci(int assignVal) {
- _BitBuffer bb = new _BitBuffer();
+ _BitBuffer bb = _BitBuffer();
if (0 <= assignVal && assignVal < (1 << 7))
bb.appendBits(assignVal, 8);
else if ((1 << 7) <= assignVal && assignVal < (1 << 14)) {
@@ -1150,15 +1150,15 @@
} else if ((1 << 14) <= assignVal && assignVal < 999999) {
bb..appendBits(6, 3)..appendBits(assignVal, 21);
} else
- throw new ArgumentError('ECI assignment value out of range');
- return new _QrSegment(kMode[_ModeEnum.eci], 0, bb.bits);
+ throw ArgumentError('ECI assignment value out of range');
+ return _QrSegment(kMode[_ModeEnum.eci], 0, bb.bits);
}
// Returns a copy of all bits, which is an array of 0s and 1s.
- List<int> get bits => new List<int>.from(bitData);
+ List<int> get bits => List<int>.from(bitData);
/*
- * Returns a new mutable list of zero or more segments to represent the given Unicode text string.
+ * Returns a mutable list of zero or more segments to represent the given Unicode text string.
* The result may use various segment modes and switch modes to optimize the length of the bit stream.
*/
static List<_QrSegment> makeSegments(String text) {
@@ -1176,7 +1176,7 @@
// Package-private helper function.
static int getTotalBits(List<_QrSegment> segs, int version) {
if (version < 1 || version > 40)
- throw new ArgumentError('Version number out of range');
+ throw ArgumentError('Version number out of range');
int result = 0;
for (int i = 0; i < segs.length; i++) {
_QrSegment seg = segs[i];
@@ -1193,11 +1193,11 @@
/*---- Constants for QrSegment ----*/
// (Public) Can test whether a string is encodable in numeric mode (such as by using QrSegment.makeNumeric()).
- static final RegExp kNumericRegEx = new RegExp(r'/^[0-9]*\$/');
+ static final RegExp kNumericRegEx = RegExp(r'/^[0-9]*\$/');
// (Public) Can test whether a string is encodable in alphanumeric mode (such as by using QrSegment.makeAlphanumeric()).
static final RegExp kAlphanumericRegex =
- new RegExp('r/^[A-Z0-9 \$%*+.\/:-]*\$/');
+ RegExp('r/^[A-Z0-9 \$%*+.\/:-]*\$/');
// (Private) The set of all legal characters in alphanumeric mode, where each character value maps to the index in the string.
static const String kAlphanumericCharset =
@@ -1210,11 +1210,11 @@
*/
static final Map<_ModeEnum, _Mode> kMode = <_ModeEnum, _Mode>{
// Constants
- _ModeEnum.numeric: new _Mode(0x1, <int>[10, 12, 14]),
- _ModeEnum.alphanumeric: new _Mode(0x2, <int>[9, 11, 13]),
- _ModeEnum.byte: new _Mode(0x4, <int>[8, 16, 16]),
- _ModeEnum.kanji: new _Mode(0x8, <int>[8, 10, 12]),
- _ModeEnum.eci: new _Mode(0x7, <int>[0, 0, 0]),
+ _ModeEnum.numeric: _Mode(0x1, <int>[10, 12, 14]),
+ _ModeEnum.alphanumeric: _Mode(0x2, <int>[9, 11, 13]),
+ _ModeEnum.byte: _Mode(0x4, <int>[8, 16, 16]),
+ _ModeEnum.kanji: _Mode(0x8, <int>[8, 10, 12]),
+ _ModeEnum.eci: _Mode(0x7, <int>[0, 0, 0]),
};
}
@@ -1243,7 +1243,7 @@
else if (27 <= ver && ver <= 40)
return ccbits[2];
else
- throw new ArgumentError('Version number out of range');
+ throw ArgumentError('Version number out of range');
};
}
}
@@ -1286,7 +1286,7 @@
_ReedSolomonGenerator(this.degree) {
if (degree < 1 || degree > 255)
- throw new ArgumentError('Degree out of range');
+ throw ArgumentError('Degree out of range');
// Start with the monomial x^0
for (int i = 0; i < degree - 1; i++) {
@@ -1329,7 +1329,7 @@
// result are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
static int multiply(int x, int y) {
if (x >> 8 != 0 || y >> 8 != 0)
- throw new ArgumentError('Byte out of range');
+ throw ArgumentError('Byte out of range');
// Russian peasant multiplication
int z = 0;
for (int i = 7; i >= 0; i--) {
@@ -1351,7 +1351,7 @@
int get bitLength => bitData.length;
// Returns a copy of all bits.
- List<int> get bits => new List<int>.from(bitData);
+ List<int> get bits => List<int>.from(bitData);
// Returns a copy of all bytes, padding up to the nearest byte.
List<int> get bytes {
@@ -1372,7 +1372,7 @@
// If 0 <= len <= 31, then this requires 0 <= val < 2^len.
void appendBits(int val, int len) {
if (len < 0 || len > 32 || len < 32 && (val >> len) != 0)
- throw new ArgumentError('Value out of range');
+ throw ArgumentError('Value out of range');
for (int i = len - 1; i >= 0; i--) // Append bit by bit
bitData.add((val >> i) & 1);
}
diff --git a/tests/dart_app_service_tests/test/dart_server_test.dart b/tests/dart_app_service_tests/test/dart_server_test.dart
index 4244d0c..56a316a 100644
--- a/tests/dart_app_service_tests/test/dart_server_test.dart
+++ b/tests/dart_app_service_tests/test/dart_server_test.dart
@@ -12,15 +12,15 @@
const String server =
'fuchsia-pkg://fuchsia.com/echo_server_async_dart#meta/echo_server_async_dart.cmx';
- var context = new StartupContext.fromStartupInfo();
+ var context = StartupContext.fromStartupInfo();
- final Services services = new Services();
+ final Services services = Services();
final LaunchInfo launchInfo =
- new LaunchInfo(url: server, directoryRequest: services.request());
+ LaunchInfo(url: server, directoryRequest: services.request());
await context.launcher.createComponent(launchInfo, null);
- var echo = new EchoProxy();
+ var echo = EchoProxy();
echo.ctrl
.bind(await services.connectToServiceByName<Echo>(Echo.$serviceName));
diff --git a/tools/analysis_options.yaml b/tools/analysis_options.yaml
index f577604..f3736ca 100644
--- a/tools/analysis_options.yaml
+++ b/tools/analysis_options.yaml
@@ -129,8 +129,10 @@
- type_init_formals
- unawaited_futures
- unnecessary_brace_in_string_interps
+ - unnecessary_const
- unnecessary_getters_setters
- unnecessary_lambdas
+ - unnecessary_new
- unnecessary_null_aware_assignments
- unnecessary_null_in_if_null_operators
- unnecessary_overrides
diff --git a/tools/doc_checker/bin/main.dart b/tools/doc_checker/bin/main.dart
index 5c74dde..2b2b11d 100644
--- a/tools/doc_checker/bin/main.dart
+++ b/tools/doc_checker/bin/main.dart
@@ -35,7 +35,7 @@
case ErrorType.invalidUri:
return 'Invalid URI';
default:
- throw new UnsupportedError('Unknown error type $type');
+ throw UnsupportedError('Unknown error type $type');
}
}
@@ -66,7 +66,7 @@
}
Future<Null> main(List<String> args) async {
- final ArgParser parser = new ArgParser()
+ final ArgParser parser = ArgParser()
..addFlag(
_optionHelp,
help: 'Displays this help message.',
@@ -91,7 +91,7 @@
final String docsDir = path.canonicalize(options[_optionRootDir]);
- final List<String> docs = new Directory(docsDir)
+ final List<String> docs = Directory(docsDir)
.listSync(recursive: true)
.where((FileSystemEntity entity) =>
path.extension(entity.path) == '.md' &&
@@ -102,7 +102,7 @@
.toList();
final String readme = path.join(docsDir, 'README.md');
- final Graph graph = new Graph();
+ final Graph graph = Graph();
final List<Error> errors = <Error>[];
final List<Link<String>> linksToVerify = [];
@@ -113,12 +113,12 @@
if (doc == readme) {
graph.root = node;
}
- for (String link in new LinkScraper().scrape(doc)) {
+ for (String link in LinkScraper().scrape(doc)) {
Uri uri;
try {
uri = Uri.parse(link);
} on FormatException {
- errors.add(new Error(ErrorType.invalidUri, label, link));
+ errors.add(Error(ErrorType.invalidUri, label, link));
continue;
}
if (uri.hasScheme) {
@@ -130,16 +130,16 @@
final uriRelPath = uri.pathSegments.sublist(1).join('/');
if (path.isWithin(options[_optionRootDir], uriRelPath)) {
shouldTestLink = false;
- errors.add(new Error(
+ errors.add(Error(
ErrorType.convertHttpToPath, label, uri.toString()));
} else if (!validProjects.contains(uri.pathSegments[0])) {
shouldTestLink = false;
errors.add(
- new Error(ErrorType.obsoleteProject, label, uri.toString()));
+ Error(ErrorType.obsoleteProject, label, uri.toString()));
}
}
if (shouldTestLink) {
- linksToVerify.add(new Link(uri, label));
+ linksToVerify.add(Link(uri, label));
}
}
continue;
@@ -159,10 +159,10 @@
graph.addEdge(from: node, to: graph.getNode(relativeLocation));
} else {
errors.add(
- new Error(ErrorType.unknownLocalFile, label, relativeLocation));
+ Error(ErrorType.unknownLocalFile, label, relativeLocation));
}
} else {
- errors.add(new Error(ErrorType.convertPathToHttp, label, location));
+ errors.add(Error(ErrorType.convertPathToHttp, label, location));
}
}
}
@@ -171,7 +171,7 @@
await verifyLinks(linksToVerify, (Link<String> link, bool isValid) {
if (!isValid) {
errors.add(
- new Error(ErrorType.brokenLink, link.payload, link.uri.toString()));
+ Error(ErrorType.brokenLink, link.payload, link.uri.toString()));
}
});
@@ -180,7 +180,7 @@
..addAll(
graph.orphans..removeWhere((Node node) => node.label == 'navbar.md'));
for (Node node in unreachable) {
- errors.add(new Error.forProject(ErrorType.unreachablePage, node.label));
+ errors.add(Error.forProject(ErrorType.unreachablePage, node.label));
}
errors
@@ -188,7 +188,7 @@
..forEach(reportError);
if (options[_optionDotFile].isNotEmpty) {
- graph.export('fuchsia_docs', new File(options[_optionDotFile]).openWrite());
+ graph.export('fuchsia_docs', File(options[_optionDotFile]).openWrite());
}
if (errors.isNotEmpty) {
diff --git a/tools/doc_checker/lib/graph.dart b/tools/doc_checker/lib/graph.dart
index 5a802de..9936c11 100644
--- a/tools/doc_checker/lib/graph.dart
+++ b/tools/doc_checker/lib/graph.dart
@@ -15,12 +15,12 @@
/// Returns or creates a node with the given [label].
Node getNode(String label) =>
- _nodes.putIfAbsent(label, () => new Node._internal(label, _nextId++));
+ _nodes.putIfAbsent(label, () => Node._internal(label, _nextId++));
/// Sets the graph's root node.
set root(Node node) {
if (!_nodes.containsValue(node)) {
- throw new Exception('Unknown node: $node');
+ throw Exception('Unknown node: $node');
}
_root = node;
}
@@ -75,7 +75,7 @@
/// Creates a string representation of this graph in the DOT format.
void export(String name, StringSink out) {
- const List<String> colors = const <String>[
+ const List<String> colors = <String>[
'#4285f4',
'#f4b400',
'#0f9d58',
diff --git a/tools/doc_checker/lib/link_scraper.dart b/tools/doc_checker/lib/link_scraper.dart
index 814934e..c5150dd 100644
--- a/tools/doc_checker/lib/link_scraper.dart
+++ b/tools/doc_checker/lib/link_scraper.dart
@@ -11,8 +11,8 @@
/// Extracts links from the given [file].
Iterable<String> scrape(String file) {
final List<Node> nodes =
- new Document().parseLines(new File(file).readAsLinesSync());
- final _Visitor visitor = new _Visitor();
+ Document().parseLines(File(file).readAsLinesSync());
+ final _Visitor visitor = _Visitor();
for (Node node in nodes) {
node.accept(visitor);
}
diff --git a/tools/doc_checker/lib/link_verifier.dart b/tools/doc_checker/lib/link_verifier.dart
index c631e7e..91a84f0 100644
--- a/tools/doc_checker/lib/link_verifier.dart
+++ b/tools/doc_checker/lib/link_verifier.dart
@@ -28,7 +28,7 @@
urisByDomain.putIfAbsent(link.uri.authority, () => []).add(link);
}
await Future.wait(urisByDomain.keys.map((String domain) =>
- new _LinkVerifier(urisByDomain[domain]).verify(callback)));
+ _LinkVerifier(urisByDomain[domain]).verify(callback)));
return null;
}
@@ -55,7 +55,7 @@
if (code == HttpStatus.tooManyRequests) {
final int delay =
int.tryParse(response.headers['retry-after'] ?? '') ?? 50;
- sleep(new Duration(milliseconds: delay));
+ sleep(Duration(milliseconds: delay));
continue;
}
@@ -63,7 +63,7 @@
if (code == HttpStatus.permanentRedirect) {
if (response.headers.containsKey('location')) {
Uri redirectUri = Uri.parse(link.uri.origin + response.headers['location']);
- return _verifyLink(new Link<P>(redirectUri, link.payload));
+ return _verifyLink(Link<P>(redirectUri, link.payload));
}
return false;
}
diff --git a/tools/doc_checker/lib/projects.dart b/tools/doc_checker/lib/projects.dart
index 09fb9d4..3abfc66 100644
--- a/tools/doc_checker/lib/projects.dart
+++ b/tools/doc_checker/lib/projects.dart
@@ -3,7 +3,7 @@
// found in the LICENSE file
/// List of active repos under fuchsia.googlesource.com which can be linked to.
-const List<String> validProjects = const <String>[
+const List<String> validProjects = <String>[
'atom-language-fidl',
'cobalt',
'fargo',
diff --git a/tools/protobuf/protoc_gen_dart/lib/main.dart b/tools/protobuf/protoc_gen_dart/lib/main.dart
index 3cc81f1..34b1638 100644
--- a/tools/protobuf/protoc_gen_dart/lib/main.dart
+++ b/tools/protobuf/protoc_gen_dart/lib/main.dart
@@ -83,11 +83,11 @@
void main() {
var packageMapping = <String, String>{};
- new CodeGenerator(stdin, stdout).generate(
+ CodeGenerator(stdin, stdout).generate(
optionParsers: {
DartImportMappingOptionParser.kImportOptionKey:
DartImportMappingOptionParser(packageMapping),
},
- config: new DartImportMappingOutputConfiguration(packageMapping),
+ config: DartImportMappingOutputConfiguration(packageMapping),
);
}
diff --git a/tools/scripts/report_coverage.dart b/tools/scripts/report_coverage.dart
index 7896036..d0b57d6 100644
--- a/tools/scripts/report_coverage.dart
+++ b/tools/scripts/report_coverage.dart
@@ -19,7 +19,7 @@
}
// Existence check.
- File reportFile = new File(args[0]);
+ File reportFile = File(args[0]);
if (!await reportFile.exists()) {
stderr.writeln('The file ${args[0]} does not exist.');
exit(1);
@@ -27,9 +27,9 @@
// Process line by line.
String currentFile;
- Set<String> files = new SplayTreeSet<String>();
- Map<String, int> totalLines = new HashMap<String, int>();
- Map<String, int> coveredLines = new HashMap<String, int>();
+ Set<String> files = SplayTreeSet<String>();
+ Map<String, int> totalLines = HashMap<String, int>();
+ Map<String, int> coveredLines = HashMap<String, int>();
await reportFile
.openRead()
@@ -58,7 +58,7 @@
}).asFuture();
// Report to console.
- TableWriter writer = new TableWriter(stdout)
+ TableWriter writer = TableWriter(stdout)
..setHeaders(<Object>['Filepath', 'Covered', 'Total', 'Percentage'])
..setRightAlignment(<bool>[false, true, true, true]);
for (String file in files) {