Show next renewal date on the susbcription screen

This commit is contained in:
Vishnu Mohandas 2021-02-16 19:31:29 +05:30
parent 5367a387e8
commit 380ce36e7d
2 changed files with 32 additions and 7 deletions

View file

@ -8,6 +8,7 @@ import 'package:flutter/widgets.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:logging/logging.dart';
import 'package:photos/ui/expansion_card.dart';
import 'package:photos/utils/date_time_util.dart';
import 'package:progress_dialog/progress_dialog.dart';
import 'package:url_launcher/url_launcher.dart';
@ -281,14 +282,30 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
},
child: Container(
padding: EdgeInsets.all(80),
child: RichText(
text: TextSpan(
text: "payment details",
style: TextStyle(
color: Colors.blue,
fontFamily: 'Ubuntu',
child: Column(
children: [
Text(
"next renewal on " +
getDateAndMonthAndYear(
DateTime.fromMicrosecondsSinceEpoch(
_currentSubscription.expiryTime)),
style: TextStyle(
color: Colors.white.withOpacity(0.6),
fontSize: 14,
),
),
),
Padding(padding: EdgeInsets.all(8)),
RichText(
text: TextSpan(
text: "payment details",
style: TextStyle(
color: Colors.blue,
fontFamily: 'Ubuntu',
fontSize: 15,
),
),
),
],
),
),
),

View file

@ -50,6 +50,14 @@ String getDayAndMonth(DateTime dateTime) {
_months[dateTime.month];
}
String getDateAndMonthAndYear(DateTime dateTime) {
return dateTime.day.toString() +
" " +
_months[dateTime.month] +
", " +
dateTime.year.toString();
}
String getDay(DateTime dateTime) {
return _days[dateTime.weekday];
}