[mob] Switch from FlutterIsolate to DartUiIsolate
This commit is contained in:
@@ -6,9 +6,9 @@ import "dart:typed_data" show Uint8List, Float32List, ByteData;
|
||||
import "dart:ui" show Image;
|
||||
|
||||
import "package:computer/computer.dart";
|
||||
import "package:dart_ui_isolate/dart_ui_isolate.dart";
|
||||
import "package:flutter/foundation.dart" show debugPrint, kDebugMode;
|
||||
import "package:flutter_image_compress/flutter_image_compress.dart";
|
||||
import "package:flutter_isolate/flutter_isolate.dart";
|
||||
import "package:logging/logging.dart";
|
||||
import "package:onnxruntime/onnxruntime.dart";
|
||||
import "package:photos/core/configuration.dart";
|
||||
@@ -62,7 +62,7 @@ class FaceMlService {
|
||||
final Duration _inactivityDuration = const Duration(seconds: 120);
|
||||
int _activeTasks = 0;
|
||||
final _initLockIsolate = Lock();
|
||||
late FlutterIsolate _isolate;
|
||||
late DartUiIsolate _isolate;
|
||||
late ReceivePort _receivePort = ReceivePort();
|
||||
late SendPort _mainSendPort;
|
||||
|
||||
@@ -169,7 +169,7 @@ class FaceMlService {
|
||||
_receivePort = ReceivePort();
|
||||
|
||||
try {
|
||||
_isolate = await FlutterIsolate.spawn(
|
||||
_isolate = await DartUiIsolate.spawn(
|
||||
_isolateMain,
|
||||
_receivePort.sendPort,
|
||||
);
|
||||
|
||||
@@ -4,8 +4,7 @@ import 'dart:isolate';
|
||||
import 'dart:typed_data' show Float32List, Uint8List;
|
||||
import 'dart:ui';
|
||||
|
||||
import "package:flutter/rendering.dart";
|
||||
import 'package:flutter_isolate/flutter_isolate.dart';
|
||||
import "package:dart_ui_isolate/dart_ui_isolate.dart";
|
||||
import "package:logging/logging.dart";
|
||||
import "package:photos/face/model/box.dart";
|
||||
import "package:photos/face/model/dimension.dart";
|
||||
@@ -45,7 +44,7 @@ class ImageMlIsolate {
|
||||
final _initLock = Lock();
|
||||
final _functionLock = Lock();
|
||||
|
||||
late FlutterIsolate _isolate;
|
||||
late DartUiIsolate _isolate;
|
||||
late ReceivePort _receivePort = ReceivePort();
|
||||
late SendPort _mainSendPort;
|
||||
|
||||
@@ -69,7 +68,7 @@ class ImageMlIsolate {
|
||||
_receivePort = ReceivePort();
|
||||
|
||||
try {
|
||||
_isolate = await FlutterIsolate.spawn(
|
||||
_isolate = await DartUiIsolate.spawn(
|
||||
_isolateMain,
|
||||
_receivePort.sendPort,
|
||||
);
|
||||
|
||||
@@ -394,6 +394,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.2"
|
||||
dart_ui_isolate:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dart_ui_isolate
|
||||
sha256: bd531558002a00de0ac7dd73c84887dd01e652bd254d3098d7763881535196d7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
dartx:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -725,14 +733,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.8.0"
|
||||
flutter_isolate:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_isolate
|
||||
sha256: "994ddec596da4ca12ca52154fd59404077584643eb7e3f1008a55fda9fe0b76b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.4"
|
||||
flutter_launcher_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -2648,5 +2648,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=3.2.3 <4.0.0"
|
||||
dart: ">=3.2.5 <4.0.0"
|
||||
flutter: ">=3.16.6"
|
||||
|
||||
@@ -45,6 +45,7 @@ dependencies:
|
||||
cross_file: ^0.3.3
|
||||
crypto: ^3.0.2
|
||||
cupertino_icons: ^1.0.0
|
||||
dart_ui_isolate: ^1.1.1
|
||||
defer_pointer: ^0.0.2
|
||||
device_info_plus: ^9.0.3
|
||||
dio: ^4.0.6
|
||||
@@ -77,7 +78,6 @@ dependencies:
|
||||
flutter_email_sender: ^5.2.0
|
||||
flutter_image_compress: ^1.1.0
|
||||
flutter_inappwebview: ^5.8.0
|
||||
flutter_isolate: ^2.0.4
|
||||
flutter_launcher_icons: ^0.13.1
|
||||
flutter_local_notifications: ^12.0.4
|
||||
flutter_localizations:
|
||||
@@ -176,7 +176,7 @@ dependencies:
|
||||
|
||||
dependency_overrides:
|
||||
connectivity_plus: ^4.0.0
|
||||
|
||||
|
||||
#Remove this after upgrading to flutter v3.19x
|
||||
#Build fails when resolving to latest version of ffi on flutter v3.16.x
|
||||
ffi: 2.1.0
|
||||
|
||||
Reference in New Issue
Block a user