Update billing plan model

This commit is contained in:
Vishnu Mohandas 2021-02-01 15:50:39 +05:30
parent 500a16c4c9
commit 088c1777fd
3 changed files with 13 additions and 11 deletions

View file

@ -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;
}

View file

@ -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,

View file

@ -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,