我怎样才能修复这个问题并使其不被弃用
import 'package:purchases_flutter/purchases_flutter.dart';
class PurchaseApi{
static const _apiKey = '';
static Future init() async{
await Purchases.setDebugLogsEnabled(true);
await Purchases.setup(_apiKey);
}
static Future<List<Offering>> fetchOffers() async {
try{
final offerings = await Purchases.getOfferings();
final current = offerings.current;
return current == null ? [] : [current];
} on PlatformException catch (e) {
return [];
}
}
}
我已经改变了第一次等待购买。setLogLevel(真为LogLevel);但是当我改变设置的时候,我得到了一个错误。错误是方法'PurchasesConfiguration'没有为类型'Purchases'定义。我已经尝试导入'package:purchases_flutter/models/purchases_configuration. dart';
1条答案
按热度按时间tquggr8v1#
enter image description here
当您将鼠标悬停在弃用的安装方法上时,会看到一条提示
替换:来自
到