mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 12:08:41 +00:00
some small fixes for #229
This commit is contained in:
parent
e759e14f70
commit
e44931a29f
3 changed files with 27 additions and 17 deletions
|
|
@ -102,12 +102,16 @@ class _AdditionalUsersViewState extends State<AdditionalUsersView> {
|
||||||
style: TextStyle(fontSize: 13),
|
style: TextStyle(fontSize: 13),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GridView.count(
|
Padding(
|
||||||
crossAxisCount: 2,
|
padding: const EdgeInsets.all(16.0),
|
||||||
physics: NeverScrollableScrollPhysics(),
|
child: GridView.count(
|
||||||
childAspectRatio: 16 / 5,
|
crossAxisCount: 2,
|
||||||
shrinkWrap: true,
|
physics: NeverScrollableScrollPhysics(),
|
||||||
children: plusInvites.map((x) => AdditionalUserInvite(x)).toList(),
|
childAspectRatio: 16 / 5,
|
||||||
|
shrinkWrap: true,
|
||||||
|
children:
|
||||||
|
plusInvites.map((x) => AdditionalUserInvite(x)).toList(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
if (freeInvites.isNotEmpty)
|
if (freeInvites.isNotEmpty)
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|
@ -116,12 +120,16 @@ class _AdditionalUsersViewState extends State<AdditionalUsersView> {
|
||||||
style: TextStyle(fontSize: 13),
|
style: TextStyle(fontSize: 13),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
GridView.count(
|
Padding(
|
||||||
crossAxisCount: 2,
|
padding: const EdgeInsets.all(16.0),
|
||||||
physics: NeverScrollableScrollPhysics(),
|
child: GridView.count(
|
||||||
childAspectRatio: 16 / 5,
|
crossAxisCount: 2,
|
||||||
shrinkWrap: true,
|
physics: NeverScrollableScrollPhysics(),
|
||||||
children: freeInvites.map((x) => AdditionalUserInvite(x)).toList(),
|
childAspectRatio: 16 / 5,
|
||||||
|
shrinkWrap: true,
|
||||||
|
children:
|
||||||
|
freeInvites.map((x) => AdditionalUserInvite(x)).toList(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -163,7 +171,7 @@ class _AdditionalAccountState extends State<AdditionalAccount> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 4,
|
elevation: 4,
|
||||||
margin: EdgeInsets.symmetric(horizontal: 16),
|
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,12 @@ class _ManageSubscriptionViewState extends State<ManageSubscriptionView> {
|
||||||
if (ballance != null) {
|
if (ballance != null) {
|
||||||
autoRenewal = ballance!.autoRenewal;
|
autoRenewal = ballance!.autoRenewal;
|
||||||
}
|
}
|
||||||
initAsync(false);
|
initAsync(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future initAsync(bool force) async {
|
Future initAsync(bool force) async {
|
||||||
if (force) {
|
if (force) {
|
||||||
ballance = await loadPlanBalance();
|
ballance = await loadPlanBalance(useCache: false);
|
||||||
if (ballance != null) {
|
if (ballance != null) {
|
||||||
autoRenewal = ballance!.autoRenewal;
|
autoRenewal = ballance!.autoRenewal;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,11 +136,12 @@ class _SubscriptionViewState extends State<SubscriptionView> {
|
||||||
String? formattedBalance;
|
String? formattedBalance;
|
||||||
DateTime? nextPayment;
|
DateTime? nextPayment;
|
||||||
String currentPlan = context.read<CustomChangeProvider>().plan;
|
String currentPlan = context.read<CustomChangeProvider>().plan;
|
||||||
|
bool isAdditionalUser = currentPlan == "Free" || currentPlan == "Plus";
|
||||||
|
|
||||||
if (ballance != null) {
|
if (ballance != null) {
|
||||||
DateTime lastPaymentDateTime = DateTime.fromMillisecondsSinceEpoch(
|
DateTime lastPaymentDateTime = DateTime.fromMillisecondsSinceEpoch(
|
||||||
ballance!.lastPaymentDoneUnixTimestamp.toInt() * 1000);
|
ballance!.lastPaymentDoneUnixTimestamp.toInt() * 1000);
|
||||||
if (currentPlan == "Pro" || currentPlan == "Family") {
|
if (!isAdditionalUser) {
|
||||||
nextPayment = lastPaymentDateTime
|
nextPayment = lastPaymentDateTime
|
||||||
.add(Duration(days: ballance!.paymentPeriodDays.toInt()));
|
.add(Duration(days: ballance!.paymentPeriodDays.toInt()));
|
||||||
}
|
}
|
||||||
|
|
@ -318,7 +319,7 @@ class _SubscriptionViewState extends State<SubscriptionView> {
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (currentPlan == "Family" || currentPlan == "Pro")
|
if (!isAdditionalUser)
|
||||||
BetterListTile(
|
BetterListTile(
|
||||||
icon: FontAwesomeIcons.userPlus,
|
icon: FontAwesomeIcons.userPlus,
|
||||||
text: context.lang.manageAdditionalUsers,
|
text: context.lang.manageAdditionalUsers,
|
||||||
|
|
@ -387,6 +388,7 @@ class PlanCard extends StatelessWidget {
|
||||||
case "Plus":
|
case "Plus":
|
||||||
features = [context.lang.plusFeature1];
|
features = [context.lang.plusFeature1];
|
||||||
break;
|
break;
|
||||||
|
case "Tester":
|
||||||
case "Pro":
|
case "Pro":
|
||||||
features = [
|
features = [
|
||||||
context.lang.proFeature1,
|
context.lang.proFeature1,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue