1396 lines
60 KiB
Dart
1396 lines
60 KiB
Dart
import 'package:flutter/cupertino.dart';
|
||
import 'package:flutter/material.dart';
|
||
import 'package:flutter/widgets.dart';
|
||
import 'package:flutter_reaction_button/flutter_reaction_button.dart';
|
||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||
import 'package:get/get.dart';
|
||
import 'package:regroup/Common/CommonBottomNavigationBar.dart';
|
||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||
import 'package:regroup/Common/CommonWidget.dart';
|
||
import 'package:regroup/Common/controller/MainScreen.dart';
|
||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
|
||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||
import 'package:regroup/Utils/texts.dart';
|
||
import 'package:regroup/resources/routes/route_name.dart';
|
||
import 'package:shared_preferences/shared_preferences.dart';
|
||
|
||
class ProfileTab extends StatefulWidget {
|
||
const ProfileTab({super.key});
|
||
|
||
@override
|
||
State<ProfileTab> createState() => _ProfileTabState();
|
||
}
|
||
|
||
class _ProfileTabState extends State<ProfileTab> {
|
||
List cardtile = [
|
||
{
|
||
"imagePath": "assets/images/png/Rectangle 29ss.png",
|
||
"title": "Cardio crusaders circle"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/Rectangle 31ee.png",
|
||
"title": "Strength squad syndicate"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/Rectangle 30aa.png",
|
||
"title": "Flexibility faction force"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/Rectangle 29ss.png",
|
||
"title": "Cardio crusaders circle"
|
||
},
|
||
];
|
||
|
||
List certificationData = [
|
||
{
|
||
"imagePath": "assets/images/png/image 17.png",
|
||
"title": "Professional sports management",
|
||
"subtitle": "Athlete 365 ",
|
||
"date": "Issued Feb 2024"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/image 18.png",
|
||
"title": "Professional sports management",
|
||
"subtitle": "Athlete 365 ",
|
||
"date": "Issued Feb 2024"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/image 19.png",
|
||
"title": "Professional sports management",
|
||
"subtitle": "Athlete 365 ",
|
||
"date": "Issued Feb 2024"
|
||
},
|
||
];
|
||
|
||
List timeline = [
|
||
{
|
||
"imagePath": "assets/images/png/cimg1.png",
|
||
"title": "Cardio crusaders circle"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/cimg1.png",
|
||
"title": "Cardio crusaders circle"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/cimg1.png",
|
||
"title": "Cardio crusaders circle"
|
||
},
|
||
{
|
||
"imagePath": "assets/images/png/cimg1.png",
|
||
"title": "Cardio crusaders circle"
|
||
},
|
||
];
|
||
|
||
bool isOnce = true;
|
||
late Future individualfuture;
|
||
late Future businessfuture;
|
||
|
||
String? accountTypeValue;
|
||
String? accounTypeLogin;
|
||
|
||
String? interestText;
|
||
@override
|
||
void initState() {
|
||
// TODO: implement initState
|
||
setValues();
|
||
|
||
individualfuture = EditProfileApi()
|
||
.getEditProfileIndividual()
|
||
.then((value) => {setValues()});
|
||
|
||
businessfuture = EditProfileApi()
|
||
.getEditProfileBusiness()
|
||
.then((value) => {setValues2()});
|
||
super.initState();
|
||
}
|
||
|
||
setValues() async {
|
||
if (isOnce) {
|
||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||
accountTypeValue = prefs.getString('accountTypeValue');
|
||
accounTypeLogin = prefs.getString('accountTypefromLogin');
|
||
|
||
if (getEditProfileIndi != null &&
|
||
getEditProfileIndi!.data != null &&
|
||
getEditProfileIndi!.data!.interest != null) {
|
||
// Join all interest names with a comma separator
|
||
interestText =
|
||
getEditProfileIndi!.data!.interest!.map((e) => e.name).join(', ');
|
||
}
|
||
isOnce = false;
|
||
setState(() {});
|
||
}
|
||
}
|
||
|
||
setValues2() async {
|
||
if (isOnce) {
|
||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||
accountTypeValue = prefs.getString('accountTypeValue');
|
||
accounTypeLogin = prefs.getString('accountTypefromLogin');
|
||
// foodItemDropdownController.selectedFooddynamic.clear();
|
||
// foodItemDropdownController.foodItemQControllerList.clear();
|
||
// foodItemDropdownController.OtherFoodIngredientList.clear();
|
||
// foodItemDropdownController.TotalFoodIngredientList.clear();
|
||
|
||
// mealController.text = getMealObj!.data!.mealType!;
|
||
|
||
// for (var i = 0; i < getEditProfileIndi.data.; i++) {
|
||
// foodController.text += '${getMealObj!.data!.foodRecords![i].name!}, ';
|
||
// foodItemDropdownController.selectedFooddynamic
|
||
// .add(getMealObj!.data!.foodRecords![i].name!);
|
||
// foodItemDropdownController.foodItemQControllerList
|
||
// .add(getMealObj!.data!.foodRecords![i].quantity!);
|
||
// }
|
||
|
||
isOnce = false;
|
||
setState(() {});
|
||
}
|
||
}
|
||
|
||
@override
|
||
Widget build(BuildContext context) {
|
||
return Scaffold(
|
||
// key: _scaffoldKey1,
|
||
backgroundColor: Color(0xFF222935),
|
||
extendBody: true,
|
||
// accountTypeValue == '1' ||
|
||
body: accounTypeLogin == '1' || accountTypeValue == '1'
|
||
? FutureBuilder(
|
||
future: individualfuture,
|
||
builder: (ctx, snapshot) {
|
||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||
return Center(
|
||
child: CircularProgressIndicator(
|
||
color: Colors.blue,
|
||
),
|
||
);
|
||
}
|
||
|
||
if (snapshot.hasError) {
|
||
return Center(
|
||
child: Text(
|
||
'${snapshot.error} occurred',
|
||
style: TextStyle(fontSize: 18.spMin),
|
||
),
|
||
);
|
||
}
|
||
|
||
if (snapshot.connectionState == ConnectionState.done &&
|
||
snapshot.hasData) {
|
||
print("Data fetched-->");
|
||
return Stack(clipBehavior: Clip.none, children: [
|
||
Container(
|
||
decoration: const BoxDecoration(
|
||
image: DecorationImage(
|
||
image: AssetImage(
|
||
"assets/images/png/Ellipse 1496.png"),
|
||
fit: BoxFit.fill)),
|
||
),
|
||
SafeArea(
|
||
child: SingleChildScrollView(
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Stack(
|
||
children: [
|
||
Container(
|
||
height: 484.h,
|
||
width: double.infinity,
|
||
child: Image.asset(
|
||
"assets/images/png/profileimg.png",
|
||
fit: BoxFit.cover,
|
||
),
|
||
),
|
||
Positioned.fill(
|
||
child: Container(
|
||
decoration: BoxDecoration(
|
||
gradient: LinearGradient(
|
||
begin: Alignment.topCenter,
|
||
end: Alignment.bottomCenter,
|
||
colors: [
|
||
Color.fromRGBO(34, 41, 53, 0.1),
|
||
Color.fromRGBO(34, 41, 53, 0.79),
|
||
],
|
||
stops: [
|
||
0.5788,
|
||
0.8,
|
||
],
|
||
),
|
||
),
|
||
),
|
||
),
|
||
Positioned(
|
||
bottom: 0,
|
||
right: 0,
|
||
left: 0,
|
||
child: Padding(
|
||
padding:
|
||
EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
mainAxisAlignment: MainAxisAlignment.end,
|
||
children: [
|
||
Column(
|
||
children: [
|
||
text20700white(getEditProfileIndi!
|
||
.data!.fullName ??
|
||
"Edward Hackett"),
|
||
sizedBoxHeight(5.h),
|
||
Row(
|
||
mainAxisAlignment:
|
||
MainAxisAlignment.center,
|
||
children: [
|
||
text18w400white(
|
||
'@${getEditProfileIndi!.data!.userName}' ??
|
||
"@edward_01"),
|
||
sizedBoxWidth(5.w),
|
||
Icon(
|
||
Icons.circle,
|
||
size: 5.sp,
|
||
color: Colors.white,
|
||
),
|
||
sizedBoxWidth(5.w),
|
||
text18w400white("2,124 days")
|
||
],
|
||
),
|
||
sizedBoxHeight(15.h),
|
||
GestureDetector(
|
||
onTap: () {
|
||
Get.toNamed(
|
||
RouteName.mynetwork);
|
||
},
|
||
child: Container(
|
||
height: 34.h,
|
||
width: 152.w,
|
||
decoration: BoxDecoration(
|
||
borderRadius:
|
||
BorderRadius.circular(
|
||
41.r),
|
||
border: Border.all(
|
||
color:
|
||
Color(0xFFD90B2E),
|
||
width: 0.84)),
|
||
child: Row(
|
||
mainAxisAlignment:
|
||
MainAxisAlignment.center,
|
||
children: [
|
||
Image.asset(
|
||
'assets/images/png/Vector2a.png',
|
||
height: 17.h,
|
||
width: 17.w,
|
||
),
|
||
sizedBoxWidth(8.w),
|
||
text16400white("My network")
|
||
],
|
||
),
|
||
),
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
],
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
sizedBoxHeight(30.h),
|
||
text18w700white("About"),
|
||
sizedBoxHeight(10.h),
|
||
text14400white(
|
||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."),
|
||
sizedBoxHeight(25.h),
|
||
Row(
|
||
children: [
|
||
commonContainer(
|
||
width: 25.w,
|
||
height: 25.h,
|
||
opacity1: 0.26,
|
||
opacity2: 0.26,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
"assets/images/png/Group 58645.png",
|
||
height: 12.h,
|
||
width: 12.w,
|
||
)),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
text14400whiteblur(
|
||
"Elm street london, United Kingdom"),
|
||
],
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
Row(
|
||
children: [
|
||
commonContainer(
|
||
width: 25.w,
|
||
height: 25.h,
|
||
opacity1: 0.26,
|
||
opacity2: 0.26,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
"assets/images/png/Vector (4).png",
|
||
height: 12.h,
|
||
width: 12.w,
|
||
)),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
text14400whiteblur(interestText ?? ''),
|
||
// interestText
|
||
// text14400whiteblur(getEditProfileIndi!
|
||
// .data!.interest!
|
||
// .join(', ')),
|
||
// text14400whiteblur(
|
||
// "Rowing, Football, Swimming"),
|
||
],
|
||
),
|
||
sizedBoxHeight(30.h),
|
||
],
|
||
),
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Row(
|
||
children: [
|
||
text18w700white("Timeline"),
|
||
Spacer(),
|
||
InkWell(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.addtimeline);
|
||
},
|
||
child: Image.asset(
|
||
"assets/images/png/iconamoon_edit-thin.png",
|
||
height: 20.h,
|
||
width: 20.w,
|
||
),
|
||
)
|
||
],
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
SizedBox(
|
||
height: 300.h,
|
||
child: ListView.builder(
|
||
shrinkWrap: true,
|
||
itemCount: timeline.length,
|
||
itemBuilder: (context, index) {
|
||
return commonTimelineCard(
|
||
imagePath: timeline[index]
|
||
["imagePath"],
|
||
title: timeline[index]
|
||
["title"]);
|
||
},
|
||
)),
|
||
]),
|
||
),
|
||
Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
sizedBoxHeight(30.h),
|
||
Row(
|
||
children: [
|
||
text16w700white(
|
||
"Certifications/Qualifications"),
|
||
Spacer(),
|
||
InkWell(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.certificate);
|
||
},
|
||
child: text12400white("View more")),
|
||
],
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
SizedBox(
|
||
height: 85.h,
|
||
child: ListView.builder(
|
||
shrinkWrap: true,
|
||
scrollDirection: Axis.horizontal,
|
||
itemCount: certificationData.length,
|
||
itemBuilder: (context, index) {
|
||
return Padding(
|
||
padding: EdgeInsets.only(right: 20.w),
|
||
child: certificationCardTile(
|
||
imagePath:
|
||
certificationData[index]
|
||
["imagePath"],
|
||
title: certificationData[index]
|
||
["title"],
|
||
subtitle: certificationData[index]
|
||
["subtitle"],
|
||
date: certificationData[index]
|
||
["date"]),
|
||
);
|
||
},
|
||
),
|
||
),
|
||
sizedBoxHeight(30.h),
|
||
text18w400white("Subgroups"),
|
||
sizedBoxHeight(20.h),
|
||
],
|
||
),
|
||
),
|
||
SizedBox(
|
||
height: 190.h,
|
||
child: ListView.builder(
|
||
shrinkWrap: true,
|
||
scrollDirection: Axis.horizontal,
|
||
padding: EdgeInsets.only(left: 16.w),
|
||
itemCount: cardtile.length,
|
||
itemBuilder: (context, index) {
|
||
return Padding(
|
||
padding: EdgeInsets.only(right: 20.w),
|
||
child: profilecardtile(
|
||
imagePath: cardtile[index]["imagePath"],
|
||
title: cardtile[index]["title"]),
|
||
);
|
||
},
|
||
),
|
||
),
|
||
sizedBoxHeight(30.h),
|
||
Padding(
|
||
padding: EdgeInsets.only(left: 16.w),
|
||
child: text18w700white("Activity"),
|
||
),
|
||
normalcardtile(
|
||
profileImg: 'assets/images/png/Ellipse 48.png',
|
||
title: 'Jocelyn Dokidis',
|
||
mainImg: 'assets/images/png/Rectangle 46.png',
|
||
containerTitle: [
|
||
'Race',
|
||
'Swimming',
|
||
'Events',
|
||
'Marathon',
|
||
'Events'
|
||
]),
|
||
sizedBoxHeight(120.h),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
Positioned.fill(
|
||
top: 40.h,
|
||
child: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
children: [
|
||
sizedBoxHeight(20.h),
|
||
Row(
|
||
children: [
|
||
Spacer(),
|
||
InkWell(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.settings);
|
||
},
|
||
child: commonContainer(
|
||
width: 40.w,
|
||
height: 40.h,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
opacity1: 0.5,
|
||
opacity2: 0.6,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
'assets/images/png/setting2.png',
|
||
height: 20.h,
|
||
width: 20.w,
|
||
)),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
]);
|
||
}
|
||
return Container();
|
||
},
|
||
)
|
||
: FutureBuilder(
|
||
future: businessfuture,
|
||
builder: (ctx, snapshot) {
|
||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||
return Center(
|
||
child: CircularProgressIndicator(
|
||
color: Colors.blue,
|
||
),
|
||
);
|
||
}
|
||
|
||
if (snapshot.hasError) {
|
||
return Center(
|
||
child: Text(
|
||
'${snapshot.error} occurred',
|
||
style: TextStyle(fontSize: 18.spMin),
|
||
),
|
||
);
|
||
}
|
||
|
||
if (snapshot.connectionState == ConnectionState.done &&
|
||
snapshot.hasData) {
|
||
print("Data fetched-->");
|
||
return Stack(clipBehavior: Clip.none, children: [
|
||
Container(
|
||
decoration: const BoxDecoration(
|
||
image: DecorationImage(
|
||
image: AssetImage(
|
||
"assets/images/png/Ellipse 1496.png"),
|
||
fit: BoxFit.fill)),
|
||
),
|
||
SafeArea(
|
||
child: SingleChildScrollView(
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
Stack(
|
||
children: [
|
||
Container(
|
||
height: 484.h,
|
||
width: double.infinity,
|
||
child: Image.asset(
|
||
"assets/images/png/Rectangle 49 (1).png",
|
||
fit: BoxFit.cover,
|
||
),
|
||
),
|
||
Positioned.fill(
|
||
child: Container(
|
||
decoration: BoxDecoration(
|
||
gradient: LinearGradient(
|
||
begin: Alignment.topCenter,
|
||
end: Alignment.bottomCenter,
|
||
colors: [
|
||
Color.fromRGBO(34, 41, 53, 0.1),
|
||
Color.fromRGBO(34, 41, 53, 0.79),
|
||
],
|
||
stops: [
|
||
0.5788,
|
||
0.8,
|
||
],
|
||
),
|
||
),
|
||
),
|
||
),
|
||
Positioned(
|
||
bottom: 0,
|
||
right: 0,
|
||
left: 0,
|
||
child: Padding(
|
||
padding:
|
||
EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
mainAxisAlignment: MainAxisAlignment.end,
|
||
children: [
|
||
Column(
|
||
children: [
|
||
text20700white(getEditProfileBus!
|
||
.data!.businessOwnerName ??
|
||
"Victory gear sports emporium"),
|
||
sizedBoxHeight(5.h),
|
||
text18w400white(
|
||
'@${getEditProfileBus!.data!.businessName}' ??
|
||
"@Victorygames_10"),
|
||
sizedBoxHeight(15.h),
|
||
Row(
|
||
mainAxisAlignment:
|
||
MainAxisAlignment.center,
|
||
children: [
|
||
GestureDetector(
|
||
onTap: () {
|
||
Get.toNamed(
|
||
RouteName.followers);
|
||
},
|
||
child: Column(
|
||
children: [
|
||
text16400white(
|
||
getEditProfileBus!
|
||
.data!
|
||
.follows!
|
||
.followers!
|
||
.toString() ??
|
||
"254"),
|
||
sizedBoxHeight(6.h),
|
||
text12400whiteblur(
|
||
"Followers")
|
||
],
|
||
),
|
||
),
|
||
sizedBoxWidth(20.w),
|
||
Container(
|
||
height: 58.h,
|
||
decoration: BoxDecoration(
|
||
color: Colors.white,
|
||
border: Border.all(
|
||
color: Colors.white,
|
||
width: 1.0,
|
||
),
|
||
boxShadow: [
|
||
BoxShadow(
|
||
color:
|
||
Color(0x66000000),
|
||
offset: Offset(0, 4),
|
||
blurRadius: 4.0,
|
||
),
|
||
],
|
||
),
|
||
),
|
||
sizedBoxWidth(20.w),
|
||
GestureDetector(
|
||
onTap: () {
|
||
Get.toNamed(
|
||
RouteName.following);
|
||
},
|
||
child: Column(
|
||
children: [
|
||
text16400white(
|
||
getEditProfileBus!
|
||
.data!
|
||
.follows!
|
||
.following!
|
||
.toString()),
|
||
sizedBoxHeight(6.h),
|
||
text12400whiteblur(
|
||
"Following")
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
],
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
sizedBoxHeight(30.h),
|
||
Row(
|
||
mainAxisAlignment:
|
||
MainAxisAlignment.spaceBetween,
|
||
children: [
|
||
GestureDetector(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.buseditprofile);
|
||
},
|
||
child: Container(
|
||
height: 40.h,
|
||
width: 170.w,
|
||
decoration: BoxDecoration(
|
||
color: Color(0xFFD90B2E),
|
||
borderRadius:
|
||
BorderRadius.circular(30.r),
|
||
),
|
||
child: Center(
|
||
child: text16w400_FCFCFC(
|
||
"Edit profile")),
|
||
),
|
||
),
|
||
GestureDetector(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.shareProfile);
|
||
},
|
||
child: commonGlassUI(
|
||
width: 170.w,
|
||
height: 40.h,
|
||
|
||
opacity1: 0.05,
|
||
opacity2: 0.07,
|
||
borderRadius:
|
||
BorderRadius.circular(30.r),
|
||
mainOpacity: 1,
|
||
customWidget: Center(
|
||
child: text16w400_FCFCFC(
|
||
"Share profile"),
|
||
),
|
||
// border: 1,
|
||
),
|
||
)
|
||
],
|
||
),
|
||
sizedBoxHeight(30.h),
|
||
text18w700white("About"),
|
||
sizedBoxHeight(10.h),
|
||
text14400white(
|
||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s."),
|
||
sizedBoxHeight(25.h),
|
||
Row(
|
||
children: [
|
||
commonContainer(
|
||
width: 25.w,
|
||
height: 25.h,
|
||
opacity1: 0.26,
|
||
opacity2: 0.26,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
"assets/images/png/Frame 24.png",
|
||
height: 12.h,
|
||
width: 12.w,
|
||
)),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
text14400whiteblur(getEditProfileBus!
|
||
.data!.businessOwnerName ??
|
||
"James Bothman"),
|
||
],
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
Row(
|
||
children: [
|
||
commonContainer(
|
||
width: 25.w,
|
||
height: 25.h,
|
||
opacity1: 0.26,
|
||
opacity2: 0.26,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
"assets/images/png/Vector2a.png",
|
||
height: 12.h,
|
||
width: 12.w,
|
||
)),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
text14400whiteblur(getEditProfileBus!
|
||
.data!.websiteLink ??
|
||
"www.exampledummywebsite.com"),
|
||
],
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
Row(
|
||
children: [
|
||
commonContainer(
|
||
width: 25.w,
|
||
height: 25.h,
|
||
opacity1: 0.26,
|
||
opacity2: 0.26,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
"assets/images/png/Group 58645.png",
|
||
height: 12.h,
|
||
width: 12.w,
|
||
)),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
text14400whiteblur(getEditProfileBus!
|
||
.data!.businessLocation ??
|
||
"Elm street london, United Kingdom"),
|
||
],
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
Row(
|
||
children: [
|
||
commonContainer(
|
||
width: 25.w,
|
||
height: 25.h,
|
||
opacity1: 0.26,
|
||
opacity2: 0.26,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
"assets/images/png/calender.png",
|
||
height: 12.h,
|
||
width: 12.w,
|
||
)),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
// text14400whiteblur(getEditProfileIndi!
|
||
// .data!.interest!
|
||
// .join(', ')),
|
||
text14400whiteblur("Founded at : 2010"),
|
||
],
|
||
),
|
||
sizedBoxHeight(30.h),
|
||
],
|
||
),
|
||
),
|
||
sizedBoxHeight(30.h),
|
||
Padding(
|
||
padding: EdgeInsets.only(left: 16.w),
|
||
child: text18w700white("Posts"),
|
||
),
|
||
normalcardtile(
|
||
profileImg: 'assets/images/png/Ellipse 48.png',
|
||
title: 'Jocelyn Dokidis',
|
||
mainImg: 'assets/images/png/Rectangle 46.png',
|
||
containerTitle: [
|
||
'Race',
|
||
'Swimming',
|
||
'Events',
|
||
'Marathon',
|
||
'Events'
|
||
]),
|
||
sizedBoxHeight(120.h),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
Positioned.fill(
|
||
top: 40.h,
|
||
child: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
children: [
|
||
sizedBoxHeight(20.h),
|
||
Row(
|
||
children: [
|
||
Spacer(),
|
||
InkWell(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.settings);
|
||
},
|
||
child: commonContainer(
|
||
width: 40.w,
|
||
height: 40.h,
|
||
borderwidth: 0.5,
|
||
boxShape: BoxShape.circle,
|
||
opacity1: 0.5,
|
||
opacity2: 0.6,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
'assets/images/png/setting2.png',
|
||
height: 20.h,
|
||
width: 20.w,
|
||
)),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
],
|
||
),
|
||
),
|
||
),
|
||
]);
|
||
}
|
||
return Container();
|
||
},
|
||
),
|
||
|
||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||
);
|
||
}
|
||
|
||
Widget certificationCardTile({
|
||
required String imagePath,
|
||
required String title,
|
||
required String subtitle,
|
||
required String date,
|
||
}) {
|
||
return commonGlassUI(
|
||
width: 270.w,
|
||
height: 70.h,
|
||
borderRadius: BorderRadius.circular(10.r),
|
||
customWidget: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||
child: Row(
|
||
mainAxisAlignment: MainAxisAlignment.start,
|
||
children: [
|
||
Container(
|
||
height: 40.h,
|
||
width: 57.w,
|
||
child: Image.asset(
|
||
imagePath,
|
||
fit: BoxFit.cover,
|
||
),
|
||
),
|
||
sizedBoxWidth(10.w),
|
||
Expanded(
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: [
|
||
text12400white(title),
|
||
sizedBoxHeight(5.h),
|
||
text9400white(subtitle),
|
||
sizedBoxHeight(5.h),
|
||
text9400white(date)
|
||
],
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
// border: 1
|
||
);
|
||
}
|
||
|
||
Widget commonTimelineCard(
|
||
{required String imagePath, required String title}) {
|
||
return Row(
|
||
children: [
|
||
Container(
|
||
width: 10,
|
||
height: 170.h,
|
||
child: Stack(
|
||
clipBehavior: Clip.none,
|
||
children: [
|
||
Positioned(
|
||
top: 50.h,
|
||
child: Container(
|
||
height: 11.h,
|
||
width: 11.w,
|
||
decoration: BoxDecoration(
|
||
color: Colors.white, shape: BoxShape.circle)),
|
||
),
|
||
Positioned(
|
||
right: 3.w,
|
||
child: Container(
|
||
width: 1.w,
|
||
height: 170.h,
|
||
decoration: BoxDecoration(color: Colors.white),
|
||
),
|
||
),
|
||
],
|
||
),
|
||
),
|
||
sizedBoxWidth(20.w),
|
||
Expanded(
|
||
child: Column(
|
||
children: [
|
||
commonGlassUI(
|
||
width: double.infinity,
|
||
height: 145.h,
|
||
borderRadius: BorderRadius.circular(10.r),
|
||
customWidget: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: [
|
||
Row(
|
||
children: [
|
||
CircleAvatar(
|
||
radius: 10.r,
|
||
backgroundImage: AssetImage(imagePath),
|
||
),
|
||
sizedBoxWidth(8.w),
|
||
text14700white(title)
|
||
],
|
||
),
|
||
sizedBoxHeight(10.h),
|
||
text12700white("Team captain"),
|
||
sizedBoxHeight(8.h),
|
||
text12400white("April 2023 - May 2024"),
|
||
sizedBoxHeight(10.h),
|
||
text10400whiteblur(
|
||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
|
||
],
|
||
),
|
||
),
|
||
// border: 1
|
||
),
|
||
],
|
||
),
|
||
),
|
||
],
|
||
);
|
||
}
|
||
|
||
Widget normalcardtile({
|
||
required String profileImg,
|
||
required String title,
|
||
required String mainImg,
|
||
required List<String> containerTitle,
|
||
}) {
|
||
var mainImage = 'assets/images/png/uiw_like-o.png'.obs;
|
||
void updateImage(String reaction) {
|
||
if (reaction == 'like') {
|
||
mainImage.value = 'assets/images/png/f7_hand-thumbsup.png';
|
||
} else if (reaction == 'heart') {
|
||
mainImage.value = 'assets/images/png/heart 2.png';
|
||
} else if (reaction == 'party') {
|
||
mainImage.value = 'assets/images/png/party-popper 2.png';
|
||
}
|
||
}
|
||
|
||
return Column(
|
||
children: [
|
||
sizedBoxHeight(25.h),
|
||
Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Row(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
CircleAvatar(
|
||
foregroundImage: AssetImage(profileImg),
|
||
radius: 25.r,
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
Column(
|
||
crossAxisAlignment: CrossAxisAlignment.start,
|
||
children: [
|
||
text16w400_FCFCFC(title),
|
||
sizedBoxHeight(5.h),
|
||
Row(
|
||
children: [
|
||
Image.asset(
|
||
'assets/images/png/community 1 (traced).png',
|
||
height: 14.w,
|
||
width: 14.w,
|
||
),
|
||
sizedBoxWidth(7.w),
|
||
text12w400_FCFCFC('Active alliance network'),
|
||
sizedBoxWidth(7.w),
|
||
Icon(
|
||
Icons.circle,
|
||
color: Color(0xFFFCFCFC),
|
||
size: 4.sp,
|
||
),
|
||
sizedBoxWidth(6.w),
|
||
text12w400_FCFCFC('1 Hour ago'),
|
||
],
|
||
)
|
||
],
|
||
),
|
||
Spacer(),
|
||
PopupMenuButton(
|
||
surfaceTintColor: Color(0xFF222935),
|
||
constraints: BoxConstraints.tightFor(width: 176.w),
|
||
offset: Offset(0, 50),
|
||
color: Color(0xFF222935),
|
||
tooltip: "",
|
||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||
PopupMenuItem(
|
||
onTap: () {},
|
||
child: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||
child: Row(
|
||
children: [
|
||
Text(
|
||
'Report Post',
|
||
style: TextStyle(
|
||
fontSize: 16.sp,
|
||
color: Colors.white,
|
||
fontWeight: FontWeight.w800,
|
||
fontFamily: "Nunito Sans",
|
||
),
|
||
),
|
||
Spacer(),
|
||
Image.asset(
|
||
"assets/images/png/Vector (5).png",
|
||
height: 15.h,
|
||
width: 15.w,
|
||
)
|
||
],
|
||
),
|
||
),
|
||
),
|
||
PopupMenuDivider(),
|
||
PopupMenuItem(
|
||
onTap: () {},
|
||
child: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||
child: Row(
|
||
children: [
|
||
Text(
|
||
'Share post',
|
||
style: TextStyle(
|
||
fontSize: 16.sp,
|
||
color: Colors.white,
|
||
fontWeight: FontWeight.w800,
|
||
fontFamily: "Nunito Sans",
|
||
),
|
||
),
|
||
Spacer(),
|
||
Image.asset(
|
||
"assets/images/png/share.png",
|
||
height: 20.h,
|
||
width: 20.w,
|
||
)
|
||
],
|
||
),
|
||
),
|
||
),
|
||
PopupMenuDivider(),
|
||
PopupMenuItem(
|
||
onTap: () {},
|
||
child: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||
child: Row(
|
||
children: [
|
||
Text(
|
||
'Pin',
|
||
style: TextStyle(
|
||
fontSize: 16.sp,
|
||
color: Colors.white,
|
||
fontWeight: FontWeight.w800,
|
||
fontFamily: "Nunito Sans",
|
||
),
|
||
),
|
||
Spacer(),
|
||
Image.asset(
|
||
"assets/images/png/f7_pin-fill (2).png",
|
||
height: 25.h,
|
||
width: 25.w,
|
||
)
|
||
],
|
||
),
|
||
),
|
||
),
|
||
],
|
||
child: Image.asset(
|
||
'assets/images/png/Group 1000004071.png',
|
||
width: 16.w,
|
||
height: 18.h,
|
||
),
|
||
),
|
||
sizedBoxWidth(5.w)
|
||
],
|
||
),
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
GestureDetector(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.postdetailsScreen);
|
||
},
|
||
child: Container(
|
||
height: 163.h,
|
||
width: double.infinity,
|
||
child: Image.asset(
|
||
mainImg,
|
||
fit: BoxFit.cover,
|
||
),
|
||
)),
|
||
sizedBoxHeight(20.h),
|
||
Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||
child: Column(children: [
|
||
SizedBox(
|
||
height: 30.h,
|
||
child: ListView.builder(
|
||
scrollDirection: Axis.horizontal,
|
||
shrinkWrap: true,
|
||
itemCount: containerTitle.length,
|
||
itemBuilder: (context, index) {
|
||
return Padding(
|
||
padding: EdgeInsets.only(right: 12.w),
|
||
child: GestureDetector(
|
||
onTap: () {
|
||
// Get.toNamed(RouteName.cyclescreen);
|
||
},
|
||
child: containertile(text: containerTitle[index])),
|
||
);
|
||
},
|
||
),
|
||
),
|
||
sizedBoxHeight(20.h),
|
||
text16w400_FCFCFC(
|
||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."),
|
||
Row(children: [
|
||
stackReaction(number: '20', containerImages: [
|
||
'assets/images/png/f7_hand-thumbsup.png',
|
||
'assets/images/png/heart 2.png',
|
||
'assets/images/png/party-popper 2.png'
|
||
]),
|
||
Spacer(),
|
||
commonContainer(
|
||
width: 30.w,
|
||
height: 30.h,
|
||
opacity1: 0.2,
|
||
opacity2: 0.2,
|
||
borderwidth: 0.43,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
'assets/images/png/Frame 1000004088.png',
|
||
height: 13.h,
|
||
width: 13.w,
|
||
),
|
||
),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
text14w400_FCFCFC('20'),
|
||
sizedBoxWidth(20.w),
|
||
commonContainer(
|
||
width: 30.w,
|
||
height: 30.h,
|
||
opacity1: 0.2,
|
||
opacity2: 0.2,
|
||
borderwidth: 0.43,
|
||
boxShape: BoxShape.circle,
|
||
customWidget: Center(
|
||
child: Image.asset(
|
||
'assets/images/png/Vector (1).png',
|
||
height: 12.h,
|
||
width: 12.w,
|
||
),
|
||
),
|
||
),
|
||
sizedBoxWidth(12.w),
|
||
text14w400_FCFCFC('10'),
|
||
]),
|
||
sizedBoxHeight(30.h),
|
||
Row(
|
||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||
children: [
|
||
Column(
|
||
mainAxisAlignment: MainAxisAlignment.center,
|
||
children: [
|
||
Obx(() {
|
||
return ReactionButton<String>(
|
||
onReactionChanged: (reaction) {
|
||
updateImage(reaction?.value ?? 'like');
|
||
debugPrint('Selected value: ${reaction?.value}');
|
||
},
|
||
reactions: <Reaction<String>?>[
|
||
Reaction<String>(
|
||
value: 'like',
|
||
previewIcon: _buildReactionsPreviewIcon(
|
||
'assets/images/png/f7_hand-thumbsup.png'),
|
||
icon: _buildReactionsIcon(
|
||
'assets/images/png/f7_hand-thumbsup.png'),
|
||
),
|
||
Reaction<String>(
|
||
value: 'heart',
|
||
previewIcon: _buildReactionsPreviewIcon(
|
||
'assets/images/png/heart 2.png'),
|
||
icon: _buildReactionsIcon(
|
||
'assets/images/png/heart 2.png'),
|
||
),
|
||
Reaction<String>(
|
||
value: 'party',
|
||
previewIcon: _buildReactionsPreviewIcon(
|
||
'assets/images/png/party-popper 2.png'),
|
||
icon: _buildReactionsIcon(
|
||
'assets/images/png/party-popper 2.png'),
|
||
),
|
||
],
|
||
selectedReaction: Reaction<String>(
|
||
value: 'like',
|
||
icon: _buildReactionsIcon(
|
||
'assets/images/png/f7_hand-thumbsup.png'),
|
||
),
|
||
boxColor: Colors.white,
|
||
boxElevation: 9,
|
||
boxRadius: 30,
|
||
itemsSpacing: 8,
|
||
itemScale: 0.4,
|
||
itemSize: Size(45, 45),
|
||
boxPadding: EdgeInsets.all(8),
|
||
boxAnimationDuration: Duration(milliseconds: 200),
|
||
itemAnimationDuration: Duration(milliseconds: 500),
|
||
hoverDuration: Duration(milliseconds: 700),
|
||
// toggle: false,
|
||
|
||
child: _buildReactionsIcon(mainImage.value),
|
||
);
|
||
})
|
||
],
|
||
),
|
||
GestureDetector(
|
||
onTap: () {
|
||
Get.toNamed(RouteName.postdetailsScreen);
|
||
},
|
||
child: Column(
|
||
children: [
|
||
Image.asset(
|
||
'assets/images/png/Frame 1000004088.png',
|
||
height: 19.h,
|
||
width: 19.w,
|
||
),
|
||
sizedBoxHeight(8.h),
|
||
text11w400_FCFCFC('Comment')
|
||
],
|
||
),
|
||
),
|
||
Column(
|
||
children: [
|
||
Image.asset(
|
||
'assets/images/png/Frame 1000004089.png',
|
||
height: 19.h,
|
||
width: 19.w,
|
||
),
|
||
sizedBoxHeight(8.h),
|
||
text11w400_FCFCFC('Save')
|
||
],
|
||
)
|
||
],
|
||
)
|
||
]),
|
||
),
|
||
],
|
||
);
|
||
}
|
||
|
||
Widget _buildReactionsPreviewIcon(String assetPath) {
|
||
return Padding(
|
||
padding: const EdgeInsets.all(8.0),
|
||
child: Image.asset(
|
||
assetPath,
|
||
height: 40.h,
|
||
width: 40.w,
|
||
),
|
||
);
|
||
}
|
||
|
||
Widget _buildReactionsIcon(String assetPath) {
|
||
return Column(
|
||
children: [
|
||
Image.asset(
|
||
assetPath,
|
||
height: 19.h,
|
||
width: 19.w,
|
||
),
|
||
sizedBoxHeight(8.h),
|
||
text11w400_FCFCFC('Like')
|
||
],
|
||
);
|
||
}
|
||
|
||
Widget containertile({required String text}) {
|
||
return commonContainer(
|
||
width: 100.w,
|
||
height: 30.h,
|
||
borderRadius: BorderRadius.circular(30.r),
|
||
borderColor: Color(0xFFD90B2E),
|
||
borderwidth: 0.9,
|
||
customWidget: Padding(
|
||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||
child: Center(child: text14w400_FCFCFC(text)),
|
||
));
|
||
}
|
||
|
||
Widget profilecardtile({required String imagePath, required String title}) {
|
||
return Column(
|
||
children: [
|
||
Container(
|
||
height: 109.h,
|
||
width: 100.w,
|
||
decoration: BoxDecoration(
|
||
borderRadius: BorderRadius.circular(10.r),
|
||
),
|
||
child: Image.asset(imagePath),
|
||
),
|
||
sizedBoxHeight(10.h),
|
||
SizedBox(width: 100.w, child: text12w700_FCFCFC(title)),
|
||
],
|
||
);
|
||
}
|
||
}
|