@@ -16,7 +16,7 @@ import 'models/purchase_exception.dart';
1616import 'qa_provider.dart' ;
1717
1818class Qonversion {
19- static const String _sdkVersion = "3.0.0 " ;
19+ static const String _sdkVersion = "3.0.1 " ;
2020
2121 static const MethodChannel _channel = MethodChannel ('qonversion_flutter_sdk' );
2222 static const _purchasesEventChannel =
@@ -207,27 +207,20 @@ class Qonversion {
207207 /// See [Offerings] (https://qonversion.io/docs/offerings) for more details.
208208 /// See [Product Center] (https://qonversion.io/docs/product-center) for more details.
209209 static Future <QOfferings > offerings () async {
210- final offeringsString =
211- await (_channel.invokeMethod <String >(Constants .mOfferings) as FutureOr <String >);
210+ final offeringsString = await _channel.invokeMethod <String >(Constants .mOfferings);
212211
213- final Map <String , dynamic > decodedOfferings = jsonDecode (offeringsString);
214-
215- return QOfferings .fromJson (decodedOfferings);
212+ return QMapper .offeringsFromJson (offeringsString);
216213 }
217214
218215 /// You can check if a user is eligible for an introductory offer, including a free trial.
219216 /// You can show only a regular price for users who are not eligible for an introductory offer.
220217 /// [ids] products identifiers that must be checked
221218 static Future <Map <String , QEligibility >> checkTrialIntroEligibility (
222219 List <String > ids) async {
223- final eligibilitiesString = await (_channel.invokeMethod <String >(
224- Constants .mCheckTrialIntroEligibility, {"ids" : ids}) as FutureOr <String >);
225-
226- final Map <String , dynamic > decodedEligibilities =
227- jsonDecode (eligibilitiesString);
220+ final eligibilitiesString = await _channel.invokeMethod <String >(
221+ Constants .mCheckTrialIntroEligibility, {"ids" : ids});
228222
229- return decodedEligibilities
230- .map ((key, value) => MapEntry (key, QEligibility .fromJson (value)));
223+ return QMapper .eligibilityFromJson (eligibilitiesString);
231224 }
232225
233226 // Private methods
0 commit comments