improve UI for leave family

This commit is contained in:
Neeraj Gupta 2022-04-25 09:51:43 +05:30
parent 896ac3cf29
commit cb342cbb2d
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
2 changed files with 97 additions and 23 deletions

BIN
assets/family_sharing.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View file

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
import 'package:photos/models/user_details.dart';
import 'package:photos/services/user_service.dart';
import 'package:photos/ui/common/dialogs.dart';
import 'package:photos/ui/common_elements.dart';
import 'package:photos/utils/dialog_util.dart';
class ChildSubscriptionWidget extends StatelessWidget {
@ -18,33 +18,107 @@ class ChildSubscriptionWidget extends StatelessWidget {
final String familyAdmin = userDetails.familyData.members
.firstWhere((element) => element.isAdmin)
.email;
return Column(
return Padding(
padding: const EdgeInsets.symmetric(vertical: 32),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 40, horizontal: 20),
child: Row(
children: [
Expanded(
Center(
child: Text(
"only your family plan admin ($familyAdmin) can change the plan.",
"you are on a family plan!",
style: TextStyle(fontSize: 14, color: Colors.white),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
children: [
TextSpan(
text: "please contact ",
),
TextSpan(
text: familyAdmin,
style: TextStyle(color: Color.fromRGBO(29, 185, 84, 1)),
),
TextSpan(
text: " to manage your family subscription",
),
],
style: TextStyle(
fontSize: 16,
height: 1.3,
color: Colors.white,
fontFamily: 'Ubuntu',
fontSize: 14,
),
),
),
],
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
),
Image.asset(
"assets/family_sharing.jpg",
height: 256,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 0),
),
InkWell(
child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.symmetric(vertical: 18, horizontal: 100),
side: BorderSide(
width: 2,
color: Color.fromRGBO(255, 52, 52, 1),
),
),
button(
child: Text(
"leave family",
onPressed: () async {
await _leaveFamilyPlan(context);
},
style: TextStyle(
fontFamily: 'Ubuntu-Regular',
fontWeight: FontWeight.bold,
fontSize: 18,
color: Color.fromRGBO(255, 52, 52, 1),
),
textAlign: TextAlign.center,
),
onPressed: () async => {await _leaveFamilyPlan(context)},
),
),
Expanded(
child: Align(
alignment: Alignment.bottomCenter,
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
children: const [
TextSpan(
text: "please contact ",
),
TextSpan(
text: "support@ente.io",
style: TextStyle(color: Color.fromRGBO(29, 185, 84, 1)),
),
TextSpan(
text: " for help",
),
],
style: TextStyle(
fontFamily: 'Ubuntu-Regular',
fontSize: 12,
),
),
),
),
),
],
),
);
}