diff --git a/lib/services/billing_service.dart b/lib/services/billing_service.dart index 360d5abbc..c3a7f391a 100644 --- a/lib/services/billing_service.dart +++ b/lib/services/billing_service.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'dart:io'; import 'package:dio/dio.dart'; @@ -39,7 +37,7 @@ class BillingService { bool _isOnSubscriptionPage = false; - Future _future; + Future? _future; void init() { // if (Platform.isIOS && kDebugMode) { @@ -75,7 +73,7 @@ class BillingService { _future ??= _fetchBillingPlans().then((response) { return BillingPlans.fromMap(response.data); }); - return _future; + return _future!; } Future> _fetchBillingPlans() { @@ -99,7 +97,7 @@ class BillingService { ); return Subscription.fromMap(response.data["subscription"]); } on DioError catch (e) { - if (e.response != null && e.response.statusCode == 409) { + if (e.response != null && e.response?.statusCode == 409) { throw SubscriptionAlreadyClaimedError(); } else { rethrow;