Skip to content

Commit

Permalink
fix more lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddie Beyl committed Feb 12, 2022
1 parent 4ad4493 commit f82cf44
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/models/introductory_price.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class IntroductoryPrice with _$IntroductoryPrice {

/// Maps introPricePeriodUnit string to PeriodUnit enum type
PeriodUnit get periodUnit {
// ignore: deprecated_member_use_from_same_package
switch (introPricePeriodUnit) {
case 'DAY': { return PeriodUnit.day; }
case 'WEEK': { return PeriodUnit.week; }
Expand Down
7 changes: 5 additions & 2 deletions revenuecat_examples/purchase_tester/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,18 @@ class _UpsellScreenState extends State<UpsellScreen> {
);
}

// ignore: deprecated
// ignore: unused_local_variable
void apiTestIntroductoryPrice(IntroductoryPrice introPrice) {
// ignore: deprecated_member_use
final String introPricePeriodUnit = introPrice.introPricePeriodUnit;
final PeriodUnit introPeriodUnit = introPrice.periodUnit;
final double price = introPrice.price;
final String priceString = introPrice.priceString;
final int cycles = introPrice.cycles;
final int periodNumberOfUnits = introPrice.periodNumberOfUnits;
print('introPricePeriodUnit: ${introPricePeriodUnit}, introPeriodUnit: ' +
'${introPeriodUnit}, price: ${price.toString()}, priceString: ' +
priceString + ', cycles: ${cycles.toString()}, periodNumberOfUnits: ' +
'${periodNumberOfUnits}');
}
}

Expand Down
3 changes: 2 additions & 1 deletion test/purchases_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,10 @@ void main() {

test('IntroductoryPrice has both PeriodUnit enum and periodUnit string', () async {
final mockIntroductoryPrice = IntroductoryPrice.fromJson(
mockIntroductoryPriceJson
mockIntroductoryPriceJson,
);
expect(mockIntroductoryPrice.periodUnit, PeriodUnit.day);
// ignore: deprecated_member_use_from_same_package
expect(mockIntroductoryPrice.introPricePeriodUnit, 'DAY');
});

Expand Down

0 comments on commit f82cf44

Please sign in to comment.