Comments (10)
The implementation of the third solution in flutter-tizen/flutter-tizen#177 (comment) can be found at: swift-kim/flutter-tizen@6fd8233
The commit should land after the next Flutter stable release.
cc @HakkyuKim
from plugins.
My conclusion is that plugins are generally not expected to work properly inside isolates. This applies to other platforms as well, regardless of the underlying implementation mechanism (platform channel or Dart plugin registrant). (There's even a third-party package called flutter_isolate that allows invoking plugins from isolates.)
The only workaround is to call the register
function of a plugin (Dart plugin) before invoking its API from an isolate.
Example (path_provider_tizen):
import 'package:flutter/foundation.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path_provider_tizen/path_provider_tizen.dart';
compute((Object? message) async {
PathProviderPlugin.register();
await getApplicationDocumentsDirectory();
}, null);
from plugins.
to solve this limitation, do we need re-implement plugins based on native?
from plugins.
No, we need to check how other platforms tackle this problem but I had not enough time to investigate.
from plugins.
- I tested
path_provider_windows
on Windows and it worked without problem on secondary isolates. I'm still not exactly sure how the Dart plugin registry for Windows is different from flutter-tizen's. generated_main.dart
was not generated by flutter_tools even with flutter/flutter#79669 applied on Windows. I don't know why.- Still flutter/flutter#79669 will land to the stable branch soon and it would be better to re-implement flutter-tizen's Dart plugin registry based on the official one. In fact its approach is not quite different from ours, but the main difference is that
generateMainDartWithPluginRegistrant
(equivalent of_createEntrypoint
for Tizen) is part of the build graph. - Consider adding
implements:
attributes to Tizen plugins' pubspecs. It's not quite necessary tho because the attribute doesn't do very much thing.
from plugins.
I'll test swift-kim/flutter-tizen@1ed4ee7 when the next stable Flutter version is released.
Related engine PR: flutter/engine#25496
from plugins.
@swift-kim That was really fast! Thank you!
I'll have a closer look tomorrow.
from plugins.
It seems Dart plugin registrants are not yet fully implemented for secondary isolates in the upstream engine: flutter/flutter#81421
Thus the change in #123 (comment) has no effect.
from plugins.
I tried invoking InvokeDartPluginRegistrantIfAvailable
(Dart_RootLibrary
~Dart_Invoke
) after initializing secondary isolates but encountered only some segmentation faults. I'm not sure where I can safely put the code (I tried in DartIsolateInitializeCallback
and SpawnIsolateTask:Run
).
from plugins.
Will be fixed by flutter-tizen/flutter-tizen#516.
from plugins.
Related Issues (20)
- [webview_flutter_tizen] crash when run on real TV device HOT 34
- Not supporting low latency mode (HLS) HOT 2
- Inconsistent statements in documentation HOT 2
- [video_player_avplay] pausing video will throw an error and can not resume play in some situtaion HOT 3
- [video_player_avplay] The type of plusplayer's volume is different
- [video_player_avplay] Failed to build video_player_avplay plugin HOT 2
- Unresolved reference: samsung kotlin(UNRESOLVED_REFERENCE)
- [wearable_rotary] First RotaryController of NavigationStack never dismissed HOT 2
- [video_player_avplay] Unable to build for 8.0 Tizen Version HOT 9
- CI build error HOT 1
- [google_maps_flutter] Cannot resolve package dependencies HOT 1
- [google_maps_flutter] GoogleMaps isn't work when using 3.57 version or higher. HOT 1
- [webview_flutter_tizen] Crash occurs when creating webview again HOT 2
- video_player_avplay crash HOT 2
- Update tizen_interop to 0.3.0 HOT 3
- [google_maps_flutter] InfoWindow is displayed incorrectly
- video_player_avplay issues after the last seek performed HOT 3
- [tizen_app_control]Open system settings app
- [webview_flutter] Softkeyboard doesn't appear on when input text is clicked or focused in TV HOT 4
- [google_maps_flutter] Map can't load
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plugins.