Commit df78ec2b authored by Hixie's avatar Hixie

fix framework to match new mojo sdk

The dart bindings changed semantics in a non-compatible way.
parent b55dfd60
......@@ -142,7 +142,7 @@ class MeasurementFragmentState extends State<MeasurementFragment> {
new Input(
key: weightKey,
placeholder: 'Enter weight',
keyboardType: KeyboardType.NUMBER,
keyboardType: KeyboardType.number,
onChanged: _handleWeightChanged
),
],
......
......@@ -63,7 +63,7 @@ class SettingsFragmentState extends State<SettingsFragment> {
content: new Input(
key: weightGoalKey,
placeholder: 'Goal weight in lbs',
keyboardType: KeyboardType.NUMBER,
keyboardType: KeyboardType.number,
onChanged: _handleGoalWeightChanged
),
actions: <Widget>[
......
......@@ -113,7 +113,7 @@ class MineDiggerState extends State<MineDigger> {
probe(ix, iy);
},
onLongPress: () {
userFeedback.performHapticFeedback(HapticFeedbackType.LONG_PRESS);
userFeedback.performHapticFeedback(HapticFeedbackType.longPress);
flag(ix, iy);
},
child: new Listener(
......
......@@ -57,10 +57,10 @@ void handlePointerPacket(ByteData serializedPacket) {
PointerPacket packet = PointerPacket.deserialize(message);
for (Pointer pointer in packet.pointers) {
if (pointer.type == PointerType.DOWN) {
if (pointer.type == PointerType.down) {
color = new ui.Color.fromARGB(255, 0, 0, 255);
ui.window.scheduleFrame();
} else if (pointer.type == PointerType.UP) {
} else if (pointer.type == PointerType.up) {
color = new ui.Color.fromARGB(255, 0, 255, 0);
ui.window.scheduleFrame();
}
......
......@@ -88,7 +88,7 @@ void handlePointerPacket(ByteData serializedPacket) {
PointerPacket packet = PointerPacket.deserialize(message);
for (Pointer pointer in packet.pointers) {
if (pointer.type == PointerType.UP) {
if (pointer.type == PointerType.up) {
imageCache.load(url2).first.then(handleImageLoad);
}
}
......
......@@ -60,7 +60,7 @@ class DemoBinding extends BindingBase with Scheduler, Renderer {
);
PointerPacket packet = PointerPacket.deserialize(message);
for (Pointer pointer in packet.pointers) {
if (pointer.type == PointerType.MOVE)
if (pointer.type == PointerType.move)
image.growth = math.max(0.0, image.growth + pointer.x - touches[pointer.pointer].x);
touches[pointer.pointer] = new Touch(pointer.x, pointer.y);
}
......
......@@ -42,7 +42,7 @@ class PointerEventConverter {
assert(_pointerKindMap.containsKey(datum.kind));
PointerDeviceKind kind = _pointerKindMap[datum.kind];
switch (datum.type) {
case PointerType.DOWN:
case PointerType.down:
assert(!_pointers.containsKey(datum.pointer));
_PointerState state = _pointers.putIfAbsent(
datum.pointer,
......@@ -84,7 +84,7 @@ class PointerEventConverter {
tilt: datum.tilt
);
break;
case PointerType.MOVE:
case PointerType.move:
// If the service starts supporting hover pointers, then it must also
// start sending us ADDED and REMOVED data points.
// See also: https://github.com/flutter/flutter/issues/720
......@@ -114,14 +114,14 @@ class PointerEventConverter {
tilt: datum.tilt
);
break;
case PointerType.UP:
case PointerType.CANCEL:
case PointerType.up:
case PointerType.cancel:
assert(_pointers.containsKey(datum.pointer));
_PointerState state = _pointers[datum.pointer];
assert(state.down);
assert(position == state.lastPosition);
state.setUp();
if (datum.type == PointerType.UP) {
if (datum.type == PointerType.up) {
yield new PointerUpEvent(
timeStamp: timeStamp,
pointer: state.pointer,
......@@ -175,9 +175,9 @@ class PointerEventConverter {
}
static const Map<PointerKind, PointerDeviceKind> _pointerKindMap = const <PointerKind, PointerDeviceKind>{
PointerKind.TOUCH: PointerDeviceKind.touch,
PointerKind.MOUSE: PointerDeviceKind.mouse,
PointerKind.STYLUS: PointerDeviceKind.stylus,
PointerKind.INVERTED_STYLUS: PointerDeviceKind.invertedStylus,
PointerKind.touch: PointerDeviceKind.touch,
PointerKind.mouse: PointerDeviceKind.mouse,
PointerKind.stylus: PointerDeviceKind.stylus,
PointerKind.invertedStylus: PointerDeviceKind.invertedStylus,
};
}
......@@ -40,14 +40,14 @@ class _DatePickerState extends State<DatePicker> {
_DatePickerMode _mode = _DatePickerMode.day;
void _handleModeChanged(_DatePickerMode mode) {
userFeedback.performHapticFeedback(HapticFeedbackType.VIRTUAL_KEY);
userFeedback.performHapticFeedback(HapticFeedbackType.virtualKey);
setState(() {
_mode = mode;
});
}
void _handleYearChanged(DateTime dateTime) {
userFeedback.performHapticFeedback(HapticFeedbackType.VIRTUAL_KEY);
userFeedback.performHapticFeedback(HapticFeedbackType.virtualKey);
setState(() {
_mode = _DatePickerMode.day;
});
......@@ -56,7 +56,7 @@ class _DatePickerState extends State<DatePicker> {
}
void _handleDayChanged(DateTime dateTime) {
userFeedback.performHapticFeedback(HapticFeedbackType.VIRTUAL_KEY);
userFeedback.performHapticFeedback(HapticFeedbackType.virtualKey);
if (config.onChanged != null)
config.onChanged(dateTime);
}
......
......@@ -21,7 +21,7 @@ class Input extends Scrollable {
this.hideText: false,
this.isDense: false,
this.onChanged,
this.keyboardType: KeyboardType.TEXT,
this.keyboardType: KeyboardType.text,
this.onSubmitted
}) : super(
key: key,
......
......@@ -110,7 +110,7 @@ class _TimePickerState extends State<TimePicker> {
_TimePickerMode _mode = _TimePickerMode.hour;
void _handleModeChanged(_TimePickerMode mode) {
userFeedback.performHapticFeedback(HapticFeedbackType.VIRTUAL_KEY);
userFeedback.performHapticFeedback(HapticFeedbackType.virtualKey);
setState(() {
_mode = mode;
});
......
......@@ -62,13 +62,13 @@ class _Shell {
ServiceProviderProxy services = new ServiceProviderProxy.unbound();
_shell.connectToApplication(url, services, null);
var pipe = new core.MojoMessagePipe();
core.MojoMessagePipe pipe = new core.MojoMessagePipe();
proxy.impl.bind(pipe.endpoints[0]);
services.ptr.connectToService(proxy.name, pipe.endpoints[1]);
services.ptr.connectToService(proxy.serviceName, pipe.endpoints[1]);
services.close();
}
void connectToService(String url, Object proxy) {
void connectToService(String url, bindings.ProxyBase proxy) {
if (overrideConnectToService != null && overrideConnectToService(url, proxy))
return;
_connectToService(url, proxy);
......
......@@ -126,7 +126,7 @@ class LongPressDraggable<T> extends DraggableBase<T> {
gestureArena: Gesturer.instance.gestureArena,
longTapDelay: kLongPressTimeout,
onLongTapDown: (Point position, int pointer) {
userFeedback.performHapticFeedback(HapticFeedbackType.VIRTUAL_KEY);
userFeedback.performHapticFeedback(HapticFeedbackType.virtualKey);
starter(position, pointer);
}
);
......
......@@ -8,8 +8,8 @@ dependencies:
collection: '>=1.1.3 <2.0.0'
intl: '>=0.12.4+2 <0.13.0'
material_design_icons: '>=0.0.3 <0.1.0'
sky_engine: 0.0.83
sky_services: 0.0.83
sky_engine: 0.0.84
sky_services: 0.0.84
vector_math: '>=1.4.5 <2.0.0'
quiver: '>=0.21.4 <0.22.0'
......
import 'package:flutter/src/services/shell.dart' as shell;
import 'package:mojo/bindings.dart' as bindings;
// Tests can use ServiceMocker to register replacement implementations
// of Mojo services.
......@@ -10,12 +11,12 @@ class _ServiceMocker {
// Map of interface names to mock implementations.
Map<String, Object> _interfaceMock = new Map<String, Object>();
bool _connectToService(String url, dynamic proxy) {
Object mock = _interfaceMock[proxy.impl.name];
bool _connectToService(String url, bindings.ProxyBase proxy) {
Object mock = _interfaceMock[proxy.serviceName];
if (mock != null) {
// Replace the proxy's implementation of the service interface with the
// mock.
proxy.ptr = mock;
// mock. The mojom bindings put the "ptr" field on all proxies.
(proxy as dynamic).ptr = mock;
return true;
} else {
return false;
......
......@@ -29,7 +29,7 @@ class MockKeyboard implements KeyboardService {
void main() {
MockKeyboard mockKeyboard = new MockKeyboard();
serviceMocker.registerMockService(KeyboardServiceName, mockKeyboard);
serviceMocker.registerMockService(KeyboardService.serviceName, mockKeyboard);
test('Editable text has consistent width', () {
testWidgets((WidgetTester tester) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment