如何使任务在Flutter中在后台运行

问题描述 投票:4回答:1

我有一个音乐应用,可以在线播放音频。唯一的问题是,每次我退出应用程序时,它都会被杀死,这对用户不利。他们需要它即使在退出后也能在后台继续运行。我该如何实现?

flutter flutter-test
1个回答
1
投票

Can I run Dart code in the background of an Flutter app?

是的,您可以在iOS和Android上的后台进程中运行Dart代码。有关更多信息,请参见Medium article Executing Dart in the Background with Flutter Plugins and Geofencing

© www.soinside.com 2019 - 2024. All rights reserved.