【发布时间】:2020-05-23 13:39:03
【问题描述】:
在我的 Flutter 应用程序中,我有一个返回 Future 的函数,但我想得到 Stream 的结果。这是函数:
Future<bool> isGpsOn() async {
if (await Geolocator().isLocationServiceEnabled()) {
return true;
} else {
return false;
}
}
怎么做?
【问题讨论】:
-
你在哪里打电话
isGpsOn()..? -
它在我的存储库层中。我想在 Bloc 模式中使用它。