diff --git a/lib/models/billing_plan.dart b/lib/models/billing_plan.dart index d033747e2..bfeeb0c98 100644 --- a/lib/models/billing_plan.dart +++ b/lib/models/billing_plan.dart @@ -4,7 +4,7 @@ class BillingPlan { final String id; final String androidID; final String iosID; - final int storageInMBs; + final int storage; final String price; final String period; @@ -12,7 +12,7 @@ class BillingPlan { this.id, this.androidID, this.iosID, - this.storageInMBs, + this.storage, this.price, this.period, }); @@ -29,7 +29,7 @@ class BillingPlan { id: id ?? this.id, androidID: androidID ?? this.androidID, iosID: iosID ?? this.iosID, - storageInMBs: storageInMBs ?? this.storageInMBs, + storage: storageInMBs ?? this.storage, price: price ?? this.price, period: period ?? this.period, ); @@ -40,7 +40,7 @@ class BillingPlan { 'id': id, 'androidID': androidID, 'iosID': iosID, - 'storageInMBs': storageInMBs, + 'storage': storage, 'price': price, 'period': period, }; @@ -53,7 +53,7 @@ class BillingPlan { id: map['id'], androidID: map['androidID'], iosID: map['iosID'], - storageInMBs: map['storageInMBs'], + storage: map['storage'], price: map['price'], period: map['period'], ); @@ -66,7 +66,7 @@ class BillingPlan { @override String toString() { - return 'BillingPlan(id: $id, androidID: $androidID, iosID: $iosID, storageInMBs: $storageInMBs, price: $price, period: $period)'; + return 'BillingPlan(id: $id, androidID: $androidID, iosID: $iosID, storage: $storage, price: $price, period: $period)'; } @override @@ -77,7 +77,7 @@ class BillingPlan { o.id == id && o.androidID == androidID && o.iosID == iosID && - o.storageInMBs == storageInMBs && + o.storage == storage && o.price == price && o.period == period; } @@ -87,7 +87,7 @@ class BillingPlan { return id.hashCode ^ androidID.hashCode ^ iosID.hashCode ^ - storageInMBs.hashCode ^ + storage.hashCode ^ price.hashCode ^ period.hashCode; } diff --git a/lib/ui/email_entry_page.dart b/lib/ui/email_entry_page.dart index 9c5c4d29e..1b0cf2573 100644 --- a/lib/ui/email_entry_page.dart +++ b/lib/ui/email_entry_page.dart @@ -306,7 +306,7 @@ class BillingPlanWidget extends StatelessWidget { child: Column( children: [ Text( - (plan.storageInMBs / 1024).round().toString() + " GB", + (plan.storage / (1024 * 1024 * 1024)).round().toString() + " GB", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16, diff --git a/lib/ui/subscription_page.dart b/lib/ui/subscription_page.dart index 2432ef1a5..4671bfd44 100644 --- a/lib/ui/subscription_page.dart +++ b/lib/ui/subscription_page.dart @@ -13,7 +13,6 @@ import 'package:photos/models/billing_plan.dart'; import 'package:photos/models/subscription.dart'; import 'package:photos/services/billing_service.dart'; import 'package:photos/ui/loading_widget.dart'; -import 'package:photos/utils/date_time_util.dart'; import 'package:photos/utils/dialog_util.dart'; import 'package:photos/utils/toast_util.dart'; import 'package:progress_dialog/progress_dialog.dart'; @@ -385,7 +384,10 @@ class SubscriptionPlanWidget extends StatelessWidget { child: Column( children: [ Text( - (plan.storageInMBs / 1024).round().toString() + " GB", + (plan.storage / (1024 * 1024 * 1024)) + .round() + .toString() + + " GB", style: TextStyle( fontWeight: FontWeight.bold, fontSize: 16,