feat(interface,android): Allow passing an initial locale to the service
This commit is contained in:
@@ -8,10 +8,12 @@ abstract class IsolateHandler {
|
||||
/// [entrypoint] is the entrypoint that is run inside the new isolate.
|
||||
/// [handleUIEvent] is a handler function that is called when the isolate receives data from the UI.
|
||||
/// [handleIsolateEvent] is a handler function that is called when the UI receives data from the service.
|
||||
/// [initialLocale] the locale to pass to the background service when first starting.
|
||||
Future<void> start(
|
||||
Future<void> Function() entrypoint,
|
||||
Future<void> Function(String initialLocale) entrypoint,
|
||||
Future<void> Function(Map<String, dynamic>? data) handleUIEvent,
|
||||
Future<void> Function(Map<String, dynamic>? data) handleIsolateEvent,
|
||||
String initialLocale,
|
||||
);
|
||||
|
||||
/// Make sure that the UI event handler is registered without starting the isolate.
|
||||
|
||||
@@ -22,9 +22,10 @@ class StubIsolateHandler extends IsolateHandler {
|
||||
|
||||
@override
|
||||
Future<void> start(
|
||||
Future<void> Function() entrypoint,
|
||||
Future<void> Function(String initialLocale) entrypoint,
|
||||
Future<void> Function(Map<String, dynamic>? data) handleUIEvent,
|
||||
Future<void> Function(Map<String, dynamic>? data) handleIsolateEvent,
|
||||
String initialLocale,
|
||||
) async {
|
||||
// ignore: avoid_print
|
||||
print('STUB STARTED!!!!!!');
|
||||
|
||||
@@ -17,6 +17,9 @@ class StubPlatformImplementation extends PlatformImplementation {
|
||||
|
||||
@override
|
||||
Future<bool> generateVideoThumbnail(
|
||||
String src, String dest, int width) async =>
|
||||
String src,
|
||||
String dest,
|
||||
int width,
|
||||
) async =>
|
||||
false;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ abstract class BackgroundService {
|
||||
/// [handleEvent] is a function that is called whenever the service receives
|
||||
/// data.
|
||||
void init(
|
||||
Future<void> Function() entrypoint,
|
||||
Future<void> Function(String initialLocale) entrypoint,
|
||||
Future<void> Function(Map<String, dynamic>? data) handleEvent,
|
||||
String initialLocale,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user