Merge pull request #240 from ente-io/fixes

Minor bug fixes
This commit is contained in:
Vishnu Mohandas 2022-05-12 10:02:27 +05:30 committed by GitHub
commit 462041eb73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 28 deletions

View file

@ -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']),
);

View file

@ -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();

View file

@ -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();

View file

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