-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App ui gets hang while setting wallpaper. #9
Comments
Got the same problem here. Sample of testing code I use: `Future _setWallpaper(Uint8List wallpaperBytes) async {
}` Problem: UI frames drop, it seems that your methods, though marked as Future, clearly take the main thread to to the applying job. Any workaround to avoid this problem? However, this is a very nice library, keep up nice job buddy! :) |
Hey @athul-ain, sorry for the late reply, I'm looking into this. @houdayec I have used platform channels for communicating with the library files at a lower level in Java. (https://flutter.dev/docs/development/platform-integration/platform-channels) I can use Isolates, if that's what you're suggesting. But I haven't implemented the same because of some issues I've seen with them before (check https://stackoverflow.com/questions/57466952/unable-to-understand-flutter-dart-plugin-isolate-workaround-for-window-sendpla). Another solution would be to jump to the background thread (and back) as noted in the platform channels wiki. (https://flutter.dev/docs/development/platform-integration/platform-channels?tab=android-channel-kotlin-tab#step-4-add-an-ios-platform-specific-implementation) Currently, based on the scenario, I think doing a performance analysis & determining the optimum solution will be the best idea. I can do some performance testing & compare:
If you meant something else or had any other suggestions, please let me know? |
Hey @AdityaMulgundkar , You have got right what I meant with this problem. I first thought about using Isolates as you mentioned, it might be more optimised now and would be perfectly Flutter compatible. I don't know much about background threads with platform channels. If it is platform specific, it might ask much more work though it might be faster. Please let me know. If you can perform some analysis, it would be really great and helpful. I don't have much time for this deep work, but I will also investigate as soon as I have free time. |
hey could show me example of how you fixed this. I did kept it as a separate function but it still hang for little while |
Did anyone find any solution to it? |
I created this issue #25 , can someone take a look at it? |
|
The app gets hang as soon as the function for setting wallpaper is called, and works normally after setting the wallpaper, is there any fix for this.
The text was updated successfully, but these errors were encountered: