commit
462041eb73
4 changed files with 45 additions and 28 deletions
|
@ -54,8 +54,8 @@ class UserDetails {
|
|||
return UserDetails(
|
||||
map['email'] as String,
|
||||
map['usage'] as int,
|
||||
map['fileCount'] as int,
|
||||
map['sharedCollectionsCount'] as int,
|
||||
map['fileCount'] as int ?? 0,
|
||||
map['sharedCollectionsCount'] as int ?? 0,
|
||||
Subscription.fromMap(map['subscription']),
|
||||
FamilyData.fromMap(map['familyData']),
|
||||
);
|
||||
|
|
|
@ -210,37 +210,37 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
if (!widget.isOnboarding) {
|
||||
widgets.addAll([
|
||||
Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
await _launchFamilyPortal();
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(40, 0, 40, 80),
|
||||
child: Column(
|
||||
children: [
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
text: "manage family",
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
fontFamily: 'Ubuntu',
|
||||
fontSize: 15,
|
||||
),
|
||||
if (!widget.isOnboarding) {
|
||||
widgets.addAll([
|
||||
Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
await _launchFamilyPortal();
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(40, 0, 40, 80),
|
||||
child: Column(
|
||||
children: [
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
text: "manage family",
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
fontFamily: 'Ubuntu',
|
||||
fontSize: 15,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
return SingleChildScrollView(
|
||||
|
@ -270,6 +270,13 @@ class _StripeSubscriptionPageState extends State<StripeSubscriptionPage> {
|
|||
}
|
||||
|
||||
Future<void> _launchFamilyPortal() async {
|
||||
if (_userDetails.subscription.productID == kFreeProductID) {
|
||||
await showErrorDialog(
|
||||
context,
|
||||
"Now you can share your storage plan with your family members!",
|
||||
"Customers on paid plans can add up to 5 family members without paying extra. Each member gets their own private space.");
|
||||
return;
|
||||
}
|
||||
await _dialog.show();
|
||||
try {
|
||||
final String jwtToken = await _userService.getFamiliesToken();
|
||||
|
|
|
@ -237,6 +237,8 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
),
|
||||
),
|
||||
]);
|
||||
}
|
||||
if (!widget.isOnboarding) {
|
||||
widgets.addAll([
|
||||
Align(
|
||||
alignment: Alignment.topCenter,
|
||||
|
@ -434,7 +436,15 @@ class _SubscriptionPageState extends State<SubscriptionPage> {
|
|||
);
|
||||
}
|
||||
|
||||
// todo: refactor manage family in common widget
|
||||
Future<void> _launchFamilyPortal() async {
|
||||
if (_userDetails.subscription.productID == kFreeProductID) {
|
||||
await showErrorDialog(
|
||||
context,
|
||||
"Now you can share your storage plan with your family members!",
|
||||
"Customers on paid plans can add up to 5 family members without paying extra. Each member gets their own private space.");
|
||||
return;
|
||||
}
|
||||
await _dialog.show();
|
||||
try {
|
||||
final String jwtToken = await _userService.getFamiliesToken();
|
||||
|
|
|
@ -11,7 +11,7 @@ description: ente photos application
|
|||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 0.5.20+300
|
||||
version: 0.5.21+301
|
||||
|
||||
environment:
|
||||
sdk: ">=2.10.0 <3.0.0"
|
||||
|
|
Loading…
Add table
Reference in a new issue