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