From 4a72a9c718d8a0d76d1581bc44a5675a7bb317d9 Mon Sep 17 00:00:00 2001 From: cj201199 Date: Fri, 19 Jul 2024 20:32:48 +0530 Subject: [PATCH] guest user individual api intrgration done. --- lib/Common/api_urls.dart | 9 + .../EditProfile/View/ProfileTab.dart | 7 +- .../ProfileTab/Followers/Followers.dart | 735 +++++++--- .../ProfileTab/Following/Following.dart | 637 ++++++--- .../Business/ProfileTabBusGuest.dart | 813 ----------- .../Individual/ProfileTabIndGuest.dart | 1138 ---------------- .../Guest User/Model/GetGuestFollowers.dart | 82 ++ .../Guest User/Model/GetGuestFollowing.dart | 82 ++ .../Model/GuestGetProfileDataBus.dart | 179 +++ .../Model/GuestGetProfileDataIndi.dart | 296 ++++ .../View/Business/ProfileTabBusGuest.dart | 857 ++++++++++++ .../View/Individual/ProfileTabIndGuest.dart | 1204 +++++++++++++++++ .../Guest User/ViewModel/GuestProfileApi.dart | 73 + .../ProfileTab/My Network/MyNetwork.dart | 965 ++++++++----- lib/resources/routes/routes.dart | 4 +- 15 files changed, 4400 insertions(+), 2681 deletions(-) delete mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/Business/ProfileTabBusGuest.dart delete mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/Individual/ProfileTabIndGuest.dart create mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart create mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart create mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart create mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart create mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart create mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart create mode 100644 lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart diff --git a/lib/Common/api_urls.dart b/lib/Common/api_urls.dart index 057a17c..da20f1e 100644 --- a/lib/Common/api_urls.dart +++ b/lib/Common/api_urls.dart @@ -76,6 +76,15 @@ class ApiUrls { static const posteditprofilebusiness = "${baseUrl}update-business-profile"; static const geteditprofilebusiness = "${baseUrl}fetch-business-profile"; +//Guest + + static const getGuestProfileInd = "${baseUrl}get-guest-view-of-individual-user-profile"; + static const getGuestProfileBus = "${baseUrl}get-guest-view-of-business-user-profile"; + + + static const getGuestfollowers = "${baseUrl}get-guest-user-followers"; + static const getGuestfollowing = "${baseUrl}get-guest-user-following"; + } diff --git a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart index f313a88..4e6686a 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart @@ -1,6 +1,4 @@ -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'; @@ -9,7 +7,6 @@ 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'; @@ -111,9 +108,7 @@ class _ProfileTabState extends State { accountTypeValue = prefs.getString('accountTypeValue'); accounTypeLogin = prefs.getString('accountTypefromLogin'); - if (getEditProfileIndi != null && - getEditProfileIndi!.data != null && - getEditProfileIndi!.data!.interest != null) { + if (getEditProfileIndi!.data!.interest != null) { // Join all interest names with a comma separator interestText = getEditProfileIndi!.data!.interest!.map((e) => e.name).join(', '); diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart b/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart index 19fcb62..f6aa298 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Followers/Followers.dart @@ -5,6 +5,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; @@ -13,6 +15,7 @@ import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class Followers extends StatefulWidget { @@ -24,6 +27,9 @@ class Followers extends StatefulWidget { class _FollowersState extends State { StreamController searchcontroller = StreamController(); + StreamController guestsearchcontroller = + StreamController(); + var guestUserid = Get.arguments['UpdataGuestIdfollowers'] ?? ''; @override void initState() { @@ -31,6 +37,11 @@ class _FollowersState extends State { var updata = ""; Profilegetmethod().getFollowers(updata, streamController: searchcontroller); + var guestupdata = ""; + + GuestProfileApi().getGuestfollowers(guestUserid, guestupdata, + streamController: guestsearchcontroller); + super.initState(); } @@ -116,15 +127,15 @@ class _FollowersState extends State { RemoveEmojiInputFormatter(), ], onInput: (value) { - Profilegetmethod().getFollowers(value, - streamController: searchcontroller); + GuestProfileApi().getGuestfollowers(guestUserid, value, + streamController: guestsearchcontroller); }, hintText: "Search people", ), ), sizedBoxHeight(25.h), - StreamBuilder( - stream: searchcontroller.stream, + StreamBuilder( + stream: guestsearchcontroller.stream, builder: (ctx, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { // Display shimmer effect while waiting for data @@ -139,231 +150,226 @@ class _FollowersState extends State { ); } else { // Data has been loaded, show actual UI - return followersobj!.data!.isEmpty + return getguestfollowersobj!.data!.isEmpty ? _buildNoDataBody(context) - : - // ListView.builder( - // shrinkWrap: true, - // itemCount: followersobj!.data!.length, - // itemBuilder: (context, index) { - // return Column( - // children: [ - // followerWidget( - // imagePath: followersobj?.data?[index] - // .follower?.profilePhoto ?? - // "", - // // followersData[index]["imagePath"], - // title: followersobj?.data?[index].follower - // ?.fullName ?? - // "", - // // followersData[index]["title"], - // subtitle: followersobj?.data?[index] - // .follower?.userName ?? - // "", - // blockonTap: () { - // BlockUploadata(followersobj! - // .data![index].follower!.id); - // } - // // followersData[index]["subtitle"] - // ), - // if (index != followersobj!.data!.length - 1) - // commonDivider(), - // ], - // ); - // }, - // ); - - ListView.separated( + : ListView.separated( physics: ScrollPhysics(), shrinkWrap: true, - itemCount: followersobj!.data!.length, + itemCount: getguestfollowersobj!.data!.length, separatorBuilder: (BuildContext context, int index) { return commonDivider(); }, itemBuilder: (context, index) { - return Column( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - followersobj!.data![index].follower! - .profilePhoto == - null || - followersobj! - .data![index] - .follower! - .profilePhoto! - .isEmpty - ? CircleAvatar( - backgroundImage: AssetImage( - 'assets/images/png/Ellipse 43.png'), - radius: 25.r, - ) - : CircleAvatar( - backgroundImage: NetworkImage( - followersobj! - .data![index] - .follower! - .profilePhoto!), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - followersobj!.data![index].follower! - .fullName == - null || - followersobj! - .data![index] - .follower! - .fullName! - .isEmpty == - true - ? text16w400_FCFCFC("Regroup") - : text16w400_FCFCFC( - followersobj!.data![index] - .follower!.fullName!), - sizedBoxHeight(4.h), - followersobj!.data![index].follower! - .userName == - null || - followersobj! - .data![index] - .follower! - .userName! - .isEmpty == - true - ? text12w400_FCFCFC_blur( - "regroup") - : text12w400_FCFCFC_blur( - followersobj!.data![index] - .follower!.userName!) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: - BoxConstraints.tightFor( - width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext - context) => - [ - PopupMenuItem( - // onTap: () {}, - onTap: () async { - setState(() { - removeid = followersobj! - .data![index] - .follower! - .id ?? - 0; - followersobj!.data! - .removeWhere((item) => - item.follower! - .id == - removeid); - RemoveUploadata(); - }); - }, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Remove user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-regular.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () async { - setState(() { - blockid = followersobj! - .data![index] - .follower! - .id ?? - 0; - followersobj!.data! - .removeWhere((item) => - item.follower! - .id == - blockid); - BlockUploadata(); - }); - }, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Block user"), - Spacer(), - Image.asset( - "assets/images/png/blockchat.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, + return GestureDetector( + onTap: () { + Get.toNamed(RouteName.profiletabindguest, + arguments: { + "FolloweridIndex": getguestfollowersobj! + .data![index].iamPrincipalXid, + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + getguestfollowersobj! + .data![index] + .follower! + .profilePhoto == + null || + getguestfollowersobj! + .data![index] + .follower! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + getguestfollowersobj! + .data![index] + .follower! + .profilePhoto!), + radius: 25.r, ), - ), - )), - ], - ), - ) - ], + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + getguestfollowersobj! + .data![index] + .follower! + .fullName == + null || + getguestfollowersobj! + .data![index] + .follower! + .fullName! + .isEmpty == + true + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC( + getguestfollowersobj! + .data![index] + .follower! + .fullName!), + sizedBoxHeight(4.h), + getguestfollowersobj! + .data![index] + .follower! + .userName == + null || + getguestfollowersobj! + .data![index] + .follower! + .userName! + .isEmpty == + true + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + getguestfollowersobj! + .data![index] + .follower! + .userName!) + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: + Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 176.w), + offset: Offset(0, 20), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: + (BuildContext context) => + [ + PopupMenuItem( + // onTap: () {}, + onTap: () async { + setState(() { + removeid = getguestfollowersobj! + .data![ + index] + .follower! + .id ?? + 0; + getguestfollowersobj! + .data! + .removeWhere((item) => + item.follower! + .id == + removeid); + RemoveUploadata(); + }); + }, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + text14400white( + "Remove user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_delete-28-regular.png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-regular.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + setState(() { + blockid = getguestfollowersobj! + .data![ + index] + .follower! + .id ?? + 0; + getguestfollowersobj! + .data! + .removeWhere((item) => + item.follower! + .id == + blockid); + BlockUploadata(); + }); + }, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + text14400white( + "Block user"), + Spacer(), + Image.asset( + "assets/images/png/blockchat.png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ) + ], + ), ); }, ); @@ -373,13 +379,298 @@ class _FollowersState extends State { ]) ])) ])); + + // Stack(children: [ + // Container( + // decoration: const BoxDecoration( + // image: DecorationImage( + // image: AssetImage("assets/images/png/Ellipse 1496.png"), + // fit: BoxFit.fill)), + // ), + // SingleChildScrollView( + // child: Column(children: [ + // Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + // Padding( + // padding: EdgeInsets.symmetric(horizontal: 16.w), + // child: CustomTextFormField( + // leadingIcon: SizedBox( + // height: 23, + // width: 23, + // child: Center( + // child: Image.asset( + // "assets/images/png/ion_search-outline.png", + // height: 23, + // width: 23, + // ), + // ), + // ), + // texttype: TextInputType.text, + // inputFormatters: [ + // RemoveEmojiInputFormatter(), + // ], + // onInput: (value) { + // Profilegetmethod().getFollowers(value, + // streamController: searchcontroller); + // }, + // hintText: "Search people", + // ), + // ), + // sizedBoxHeight(25.h), + // StreamBuilder( + // stream: searchcontroller.stream, + // builder: (ctx, snapshot) { + // if (snapshot.connectionState == ConnectionState.waiting) { + // // Display shimmer effect while waiting for data + // return Center(child: CircularProgressIndicator()); + // } else if (snapshot.hasError) { + // // Handle error state + // return Center( + // child: Text( + // '${snapshot.error} occurred', + // style: TextStyle(fontSize: 18), + // ), + // ); + // } else { + // // Data has been loaded, show actual UI + // return followersobj!.data!.isEmpty + // ? _buildNoDataBody(context) + // : + // // ListView.builder( + // // shrinkWrap: true, + // // itemCount: followersobj!.data!.length, + // // itemBuilder: (context, index) { + // // return Column( + // // children: [ + // // followerWidget( + // // imagePath: followersobj?.data?[index] + // // .follower?.profilePhoto ?? + // // "", + // // // followersData[index]["imagePath"], + // // title: followersobj?.data?[index].follower + // // ?.fullName ?? + // // "", + // // // followersData[index]["title"], + // // subtitle: followersobj?.data?[index] + // // .follower?.userName ?? + // // "", + // // blockonTap: () { + // // BlockUploadata(followersobj! + // // .data![index].follower!.id); + // // } + // // // followersData[index]["subtitle"] + // // ), + // // if (index != followersobj!.data!.length - 1) + // // commonDivider(), + // // ], + // // ); + // // }, + // // ); + + // ListView.separated( + // physics: ScrollPhysics(), + // shrinkWrap: true, + // itemCount: followersobj!.data!.length, + // separatorBuilder: + // (BuildContext context, int index) { + // return commonDivider(); + // }, + // itemBuilder: (context, index) { + // return Column( + // children: [ + // Padding( + // padding: EdgeInsets.symmetric( + // vertical: 16.h, horizontal: 16.w), + // child: Row( + // children: [ + // followersobj!.data![index].follower! + // .profilePhoto == + // null || + // followersobj! + // .data![index] + // .follower! + // .profilePhoto! + // .isEmpty + // ? CircleAvatar( + // backgroundImage: AssetImage( + // 'assets/images/png/Ellipse 43.png'), + // radius: 25.r, + // ) + // : CircleAvatar( + // backgroundImage: NetworkImage( + // followersobj! + // .data![index] + // .follower! + // .profilePhoto!), + // radius: 25.r, + // ), + // sizedBoxWidth(10.w), + // Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // followersobj!.data![index].follower! + // .fullName == + // null || + // followersobj! + // .data![index] + // .follower! + // .fullName! + // .isEmpty == + // true + // ? text16w400_FCFCFC("Regroup") + // : text16w400_FCFCFC( + // followersobj!.data![index] + // .follower!.fullName!), + // sizedBoxHeight(4.h), + // followersobj!.data![index].follower! + // .userName == + // null || + // followersobj! + // .data![index] + // .follower! + // .userName! + // .isEmpty == + // true + // ? text12w400_FCFCFC_blur( + // "regroup") + // : text12w400_FCFCFC_blur( + // followersobj!.data![index] + // .follower!.userName!) + // ], + // ), + // Spacer(), + // PopupMenuButton( + // surfaceTintColor: Color(0xFF222935), + // constraints: + // BoxConstraints.tightFor( + // width: 176.w), + // offset: Offset(0, 20), + // color: Color(0xFF222935), + // tooltip: "", + // itemBuilder: (BuildContext + // context) => + // [ + // PopupMenuItem( + // // onTap: () {}, + // onTap: () async { + // setState(() { + // removeid = followersobj! + // .data![index] + // .follower! + // .id ?? + // 0; + // followersobj!.data! + // .removeWhere((item) => + // item.follower! + // .id == + // removeid); + // RemoveUploadata(); + // }); + // }, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // text14400white( + // "Remove user"), + // Spacer(), + // Image.asset( + // "assets/images/png/fluent_delete-28-regular.png", + // height: 15.h, + // width: 15.w, + // ) + // ], + // ), + // ), + // ), + // PopupMenuDivider(), + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // text14400white( + // "Message user"), + // Spacer(), + // Image.asset( + // "assets/images/png/fluent_chat-20-regular.png", + // height: 20.h, + // width: 20.w, + // ) + // ], + // ), + // ), + // ), + // PopupMenuDivider(), + // PopupMenuItem( + // onTap: () async { + // setState(() { + // blockid = followersobj! + // .data![index] + // .follower! + // .id ?? + // 0; + // followersobj!.data! + // .removeWhere((item) => + // item.follower! + // .id == + // blockid); + // BlockUploadata(); + // }); + // }, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // text14400white( + // "Block user"), + // Spacer(), + // Image.asset( + // "assets/images/png/blockchat.png", + // height: 25.h, + // width: 25.w, + // ) + // ], + // ), + // ), + // ), + // ], + // child: Container( + // height: 20, + // width: 20, + // child: Center( + // child: Image.asset( + // "assets/images/png/Group 1000004071.png", + // height: 22.h, + // width: 4.w, + // ), + // ), + // )), + // ], + // ), + // ) + // ], + // ); + // }, + // ); + // } + // }, + // ), + // ]) + // ])) + // ])); } Widget _buildNoDataBody(context) { return Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( "No Data Found", diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart b/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart index ea23321..65e921f 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/Following/Following.dart @@ -5,6 +5,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; @@ -13,6 +16,7 @@ import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class Following extends StatefulWidget { @@ -24,13 +28,21 @@ class Following extends StatefulWidget { class _FollowingState extends State { StreamController searchcontroller = StreamController(); + StreamController guestsearchcontroller = + StreamController(); + var guestUserid = Get.arguments['UpdataGuestIdfollowing'] ?? ''; @override void initState() { // TODO: implement initState var updata = ""; Profilegetmethod().getFollowing(updata, streamController: searchcontroller); + var guestupdata = ""; + + GuestProfileApi().getGuestfollowing(guestUserid, guestupdata, + streamController: guestsearchcontroller); + super.initState(); } @@ -66,14 +78,15 @@ class _FollowingState extends State { @override Widget build(BuildContext context) { return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - resizeToAvoidBottomInset: false, - appBar: CommonAppbar( - titleTxt: "Following", - ), - body: Stack(children: [ + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + resizeToAvoidBottomInset: false, + appBar: CommonAppbar( + titleTxt: "Following", + ), + body: Stack( + children: [ Container( decoration: const BoxDecoration( image: DecorationImage( @@ -104,17 +117,14 @@ class _FollowingState extends State { RemoveEmojiInputFormatter(), ], onInput: (value) { - // Onboard().postGroupsearch({"search": value}, - // streamController: searchcontroller); - // searchGroups(value!); - Profilegetmethod().getFollowing(value, - streamController: searchcontroller); + GuestProfileApi().getGuestfollowing(guestUserid, value, + streamController: guestsearchcontroller); }, ), ), sizedBoxHeight(25.h), - StreamBuilder( - stream: searchcontroller.stream, + StreamBuilder( + stream: guestsearchcontroller.stream, builder: (ctx, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { // Display shimmer effect while waiting for data @@ -129,189 +139,187 @@ class _FollowingState extends State { ); } else { // Data has been loaded, show actual UI - return followingobj!.data!.isEmpty + return getguestfollowingobj!.data!.isEmpty ? _buildNoDataBody(context) : ListView.separated( physics: ScrollPhysics(), shrinkWrap: true, - itemCount: followingobj!.data!.length, + itemCount: getguestfollowingobj!.data!.length, separatorBuilder: (BuildContext context, int index) { return commonDivider(); }, itemBuilder: (context, index) { - return - // Column( - // children: [ - // Followinglist( - // imagePath: followingobj?.data?[index] - // .following?.profilePhoto ?? - // '', - // title: followingobj! - // .data?[index].following?.fullName ?? - // '', - // subtitle: followingobj! - // .data?[index].following?.userName ?? - // '', - // unfollowontap: (id) => Uploadata(id), - // unfollowindex: followingobj! - // .data![index].following!.id!, - // ), - // if (index != followingobj!.data!.length - 1) - // commonDivider(), - // ], - // ); - Column( - children: [ - Padding( - padding: EdgeInsets.symmetric( - vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - followingobj!.data![index].following! - .profilePhoto == - null || - followingobj! - .data![index] - .following! - .profilePhoto! - .isEmpty - ? CircleAvatar( - backgroundImage: AssetImage( - 'assets/images/png/Ellipse 43.png'), - radius: 25.r, - ) - : CircleAvatar( - backgroundImage: NetworkImage( - followingobj! - .data![index] - .following! - .profilePhoto!), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - followingobj! - .data![index] - .following! - .fullName == - null || - followingobj! - .data![index] - .following! - .fullName! - .isEmpty - ? text16w400_FCFCFC("Regroup") - : text16w400_FCFCFC( - followingobj!.data![index] - .following!.fullName!), - sizedBoxHeight(4.h), - followingobj! - .data![index] - .following! - .userName == - null || - followingobj! - .data![index] - .following! - .userName! - .isEmpty - ? text12w400_FCFCFC_blur( - "regroup") - : text12w400_FCFCFC_blur( - followingobj!.data![index] - .following!.userName!) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: - BoxConstraints.tightFor( - width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext - context) => - [ - PopupMenuItem( - onTap: () async { - setState(() { - unfollowid = - followingobj! - .data![ - index] - .following! - .id ?? - 0; - // followingobj!.data!.removeAt(index); - followingobj!.data! - .removeWhere((item) => - item.following! - .id == - unfollowid); - Uploadata(); - }); - }, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Unfollow user"), - Spacer(), - Image.asset( - "assets/images/png/Black1323e.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric( - horizontal: 12.w), - child: Row( - children: [ - text14400white( - "Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-22.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, + return GestureDetector( + onTap: () { + Get.toNamed(RouteName.profiletabindguest, + arguments: { + "FollowingidIndex": + getguestfollowingobj!.data![index] + .followingIamPrincipalXid!, + }); + }, + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + getguestfollowingobj! + .data![index] + .following! + .profilePhoto == + null || + getguestfollowingobj! + .data![index] + .following! + .profilePhoto! + .isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + getguestfollowingobj! + .data![index] + .following! + .profilePhoto!), + radius: 25.r, ), - ), - )), - ], + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + getguestfollowingobj! + .data![index] + .following! + .fullName == + null || + getguestfollowingobj! + .data![index] + .following! + .fullName! + .isEmpty + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC( + getguestfollowingobj! + .data![index] + .following! + .fullName!), + sizedBoxHeight(4.h), + getguestfollowingobj! + .data![index] + .following! + .userName == + null || + getguestfollowingobj! + .data![index] + .following! + .userName! + .isEmpty + ? text12w400_FCFCFC_blur( + "regroup") + : text12w400_FCFCFC_blur( + getguestfollowingobj! + .data![index] + .following! + .userName!) + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: + Color(0xFF222935), + constraints: + BoxConstraints.tightFor( + width: 176.w), + offset: Offset(0, 20), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: + (BuildContext context) => + [ + PopupMenuItem( + onTap: () async { + setState(() { + unfollowid = getguestfollowingobj! + .data![ + index] + .following! + .id ?? + 0; + // followingobj!.data!.removeAt(index); + getguestfollowingobj! + .data! + .removeWhere((item) => + item.following! + .id == + unfollowid); + Uploadata(); + }); + }, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + text14400white( + "Unfollow user"), + Spacer(), + Image.asset( + "assets/images/png/Black1323e.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets + .symmetric( + horizontal: + 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-22.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), ), - ), - ], + ], + ), ); }, ); @@ -320,7 +328,260 @@ class _FollowingState extends State { ), ]) ])) - ])); + ], + ), + + // Stack( + // children: [ + // Container( + // decoration: const BoxDecoration( + // image: DecorationImage( + // image: AssetImage("assets/images/png/Ellipse 1496.png"), + // fit: BoxFit.fill)), + // ), + // SingleChildScrollView( + // child: Column(children: [ + // Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + // Padding( + // padding: EdgeInsets.symmetric(horizontal: 16.w), + // child: CustomTextFormField( + // leadingIcon: SizedBox( + // height: 23, + // width: 23, + // child: Center( + // child: Image.asset( + // "assets/images/png/ion_search-outline.png", + // height: 23, + // width: 23, + // ), + // ), + // ), + // hintText: "Search people", + // texttype: TextInputType.text, + // inputFormatters: [ + // // LengthLimitingTextInputFormatter(20), + // RemoveEmojiInputFormatter(), + // ], + // onInput: (value) { + // // Onboard().postGroupsearch({"search": value}, + // // streamController: searchcontroller); + // // searchGroups(value!); + // Profilegetmethod().getFollowing(value, + // streamController: searchcontroller); + // }, + // ), + // ), + // sizedBoxHeight(25.h), + // StreamBuilder( + // stream: searchcontroller.stream, + // builder: (ctx, snapshot) { + // if (snapshot.connectionState == ConnectionState.waiting) { + // // Display shimmer effect while waiting for data + // return Center(child: CircularProgressIndicator()); + // } else if (snapshot.hasError) { + // // Handle error state + // return Center( + // child: Text( + // '${snapshot.error} occurred', + // style: TextStyle(fontSize: 18), + // ), + // ); + // } else { + // // Data has been loaded, show actual UI + // return followingobj!.data!.isEmpty + // ? _buildNoDataBody(context) + // : ListView.separated( + // physics: ScrollPhysics(), + // shrinkWrap: true, + // itemCount: followingobj!.data!.length, + // separatorBuilder: + // (BuildContext context, int index) { + // return commonDivider(); + // }, + // itemBuilder: (context, index) { + // return + // // Column( + // // children: [ + // // Followinglist( + // // imagePath: followingobj?.data?[index] + // // .following?.profilePhoto ?? + // // '', + // // title: followingobj! + // // .data?[index].following?.fullName ?? + // // '', + // // subtitle: followingobj! + // // .data?[index].following?.userName ?? + // // '', + // // unfollowontap: (id) => Uploadata(id), + // // unfollowindex: followingobj! + // // .data![index].following!.id!, + // // ), + // // if (index != followingobj!.data!.length - 1) + // // commonDivider(), + // // ], + // // ); + // Column( + // children: [ + // Padding( + // padding: EdgeInsets.symmetric( + // vertical: 16.h, horizontal: 16.w), + // child: Row( + // children: [ + // followingobj!.data![index].following! + // .profilePhoto == + // null || + // followingobj! + // .data![index] + // .following! + // .profilePhoto! + // .isEmpty + // ? CircleAvatar( + // backgroundImage: AssetImage( + // 'assets/images/png/Ellipse 43.png'), + // radius: 25.r, + // ) + // : CircleAvatar( + // backgroundImage: NetworkImage( + // followingobj! + // .data![index] + // .following! + // .profilePhoto!), + // radius: 25.r, + // ), + // sizedBoxWidth(10.w), + // Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // followingobj! + // .data![index] + // .following! + // .fullName == + // null || + // followingobj! + // .data![index] + // .following! + // .fullName! + // .isEmpty + // ? text16w400_FCFCFC("Regroup") + // : text16w400_FCFCFC( + // followingobj!.data![index] + // .following!.fullName!), + // sizedBoxHeight(4.h), + // followingobj! + // .data![index] + // .following! + // .userName == + // null || + // followingobj! + // .data![index] + // .following! + // .userName! + // .isEmpty + // ? text12w400_FCFCFC_blur( + // "regroup") + // : text12w400_FCFCFC_blur( + // followingobj!.data![index] + // .following!.userName!) + // ], + // ), + // Spacer(), + // PopupMenuButton( + // surfaceTintColor: Color(0xFF222935), + // constraints: + // BoxConstraints.tightFor( + // width: 176.w), + // offset: Offset(0, 20), + // color: Color(0xFF222935), + // tooltip: "", + // itemBuilder: (BuildContext + // context) => + // [ + // PopupMenuItem( + // onTap: () async { + // setState(() { + // unfollowid = + // followingobj! + // .data![ + // index] + // .following! + // .id ?? + // 0; + // // followingobj!.data!.removeAt(index); + // followingobj!.data! + // .removeWhere((item) => + // item.following! + // .id == + // unfollowid); + // Uploadata(); + // }); + // }, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // text14400white( + // "Unfollow user"), + // Spacer(), + // Image.asset( + // "assets/images/png/Black1323e.png", + // height: 20.h, + // width: 20.w, + // ) + // ], + // ), + // ), + // ), + // PopupMenuDivider(), + // PopupMenuItem( + // onTap: () {}, + // child: Padding( + // padding: + // EdgeInsets.symmetric( + // horizontal: 12.w), + // child: Row( + // children: [ + // text14400white( + // "Message user"), + // Spacer(), + // Image.asset( + // "assets/images/png/fluent_chat-20-22.png", + // height: 20.h, + // width: 20.w, + // ) + // ], + // ), + // ), + // ), + // ], + // child: Container( + // height: 20, + // width: 20, + // child: Center( + // child: Image.asset( + // "assets/images/png/Group 1000004071.png", + // height: 22.h, + // width: 4.w, + // ), + // ), + // )), + // ], + // ), + // ), + // ], + // ); + // }, + // ); + // } + // }, + // ), + // ]) + // ])) + // ], + // ), + ); } Widget _buildNoDataBody(context) { diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Business/ProfileTabBusGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Business/ProfileTabBusGuest.dart deleted file mode 100644 index efda704..0000000 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Business/ProfileTabBusGuest.dart +++ /dev/null @@ -1,813 +0,0 @@ -import 'package:flutter/material.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/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class profiletabBusGest extends StatefulWidget { - const profiletabBusGest({super.key}); - - @override - State createState() => _profiletabBusGestState(); -} - -class _profiletabBusGestState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - // key: _scaffoldKey1, - backgroundColor: Color(0xFF222935), - extendBody: true, - // accountTypeValue == '1' || - body: - // 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( - "Victory gear sports emporium"), - sizedBoxHeight(5.h), - text18w400white("@Victorygames_10"), - sizedBoxHeight(15.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.followers); - }, - child: Column( - children: [ - text16400white("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("344"), - 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("Follow")), - ), - ), - 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("Message"), - ), - // 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("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("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( - "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(), - commonContainer( - width: 40.w, - height: 40.h, - borderwidth: 0.5, - boxShape: BoxShape.circle, - opacity1: 0.5, - opacity2: 0.6, - customWidget: PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 200.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - onTap: () { - Get.toNamed(RouteName.shareProfile); - }, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share profile', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 17.h, - width: 17.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Block user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/blocked.png", - height: 18.h, - width: 18.w, - ) - ], - ), - ), - ), - ], - child: Center( - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - height: 20.h, - width: 20.w, - )), - ), - ), - ], - ), - ], - ), - ), - ), - ])); - } -} - -Widget normalcardtile({ - required String profileImg, - required String title, - required String mainImg, - required List 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) => [ - 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( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - 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)), - )); -} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Individual/ProfileTabIndGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Individual/ProfileTabIndGuest.dart deleted file mode 100644 index 77a0c58..0000000 --- a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Individual/ProfileTabIndGuest.dart +++ /dev/null @@ -1,1138 +0,0 @@ -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/CommonGlassmorphism.dart'; -import 'package:regroup/Common/CommonWidget.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; -import 'package:regroup/Utils/Common/sized_box.dart'; -import 'package:regroup/Utils/texts.dart'; -import 'package:regroup/resources/routes/route_name.dart'; - -class ProfileTabIndGuest extends StatefulWidget { - const ProfileTabIndGuest({super.key}); - - @override - State createState() => _ProfileTabIndGuestState(); -} - -class _ProfileTabIndGuestState extends State { - 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 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" - }, - ]; - - 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" - }, - ]; - @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("Edward Hackett"), - sizedBoxHeight(5.h), - text18w400white("@edward_01"), - sizedBoxHeight(15.h), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - onTap: () { - Get.toNamed(RouteName.followers); - }, - child: Column( - children: [ - text16400white("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("254"), - sizedBoxHeight(6.h), - text12400whiteblur("Following") - ], - ), - ), - 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.clubs); - }, - child: Column( - children: [ - text16400white("10"), - sizedBoxHeight(6.h), - text12400whiteblur("Clubs") - ], - ), - ), - ], - ), - 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.editProfile); - }, - child: Container( - height: 40.h, - width: 170.w, - decoration: BoxDecoration( - color: Color(0xFFD90B2E), - borderRadius: BorderRadius.circular(30.r), - ), - child: Center(child: text16w400_FCFCFC("Follow")), - ), - ), - 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("Message"), - ), - // 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/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('Rowing, Football, Swimming'), - // interestText - // text14400whiteblur(getEditProfileIndi! - // .data!.interest! - // .join(', ')), - // text14400whiteblur( - // "Rowing, Football, Swimming"), - ], - ), - sizedBoxHeight(25.h), - // commonGlassUI( - // width: double.infinity, - // height: 135.h, - // borderRadius: BorderRadius.circular(10), - // customWidget: Padding( - // padding: EdgeInsets.symmetric( - // vertical: 12.h, horizontal: 16.w), - // child: Column( - // children: [ - // Row( - // children: [ - // text16w700white("Badges"), - // Spacer(), - // GestureDetector( - // onTap: () { - // Get.toNamed(RouteName.badges); - // }, - // child: text12400white("View more")) - // ], - // ), - // sizedBoxHeight(8.h), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // Image.asset( - // "assets/images/png/Frame 1000004056.png", - // height: 70.h, - // width: 74.w, - // ), - // ], - // ), - // ], - // ), - // ), - // // border: 1 - // ), - ], - ), - ), - 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"]); - }, - )), - 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(20.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(), - commonContainer( - width: 40.w, - height: 40.h, - borderwidth: 0.5, - boxShape: BoxShape.circle, - opacity1: 0.5, - opacity2: 0.6, - customWidget: - PopupMenuButton( - surfaceTintColor: const Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 200.w), - offset: const Offset(0, 50), - color: const Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - onTap: () { - Get.toNamed(RouteName.shareProfile); - }, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Share profile', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/share.png", - height: 17.h, - width: 17.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Report user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/Vector (5).png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - const PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - Text( - 'Block user', - style: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w800, - fontFamily: "Nunito Sans", - ), - ), - const Spacer(), - Image.asset( - "assets/images/png/blocked.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Center( - child: Image.asset( - 'assets/images/png/Group 1000004071.png', - height: 20.h, - width: 20.w, - )), - ), - - ), - ], - ), - ], - ), - ), - ), - ]), - ); - } -} - -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 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) => [ - 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( - onReactionChanged: (reaction) { - updateImage(reaction?.value ?? 'like'); - debugPrint('Selected value: ${reaction?.value}'); - }, - reactions: ?>[ - Reaction( - value: 'like', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - icon: _buildReactionsIcon( - 'assets/images/png/f7_hand-thumbsup.png'), - ), - Reaction( - value: 'heart', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/heart 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/heart 2.png'), - ), - Reaction( - value: 'party', - previewIcon: _buildReactionsPreviewIcon( - 'assets/images/png/party-popper 2.png'), - icon: _buildReactionsIcon( - 'assets/images/png/party-popper 2.png'), - ), - ], - selectedReaction: Reaction( - 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 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 _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)), - ], - ); -} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart new file mode 100644 index 0000000..eaa866c --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowers.dart @@ -0,0 +1,82 @@ +class GetGuestFollowers { + String? status; + int? statusCode; + String? message; + List? data; + + GetGuestFollowers({this.status, this.statusCode, this.message, this.data}); + + GetGuestFollowers.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? followingIamPrincipalXid; + int? iamPrincipalXid; + Follower? follower; + + Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower}); + + Data.fromJson(Map json) { + followingIamPrincipalXid = json['following_iam_principal_xid']; + iamPrincipalXid = json['iam_principal_xid']; + follower = json['follower'] != null + ? new Follower.fromJson(json['follower']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['following_iam_principal_xid'] = this.followingIamPrincipalXid; + data['iam_principal_xid'] = this.iamPrincipalXid; + if (this.follower != null) { + data['follower'] = this.follower!.toJson(); + } + return data; + } +} + +class Follower { + int? id; + String? userName; + String? fullName; + String? profilePhoto; + + Follower({this.id, this.userName, this.fullName, this.profilePhoto}); + + Follower.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + profilePhoto = json['profile_photo']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['profile_photo'] = this.profilePhoto; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart new file mode 100644 index 0000000..ad8a848 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GetGuestFollowing.dart @@ -0,0 +1,82 @@ +class GetGuestFollowing { + String? status; + int? statusCode; + String? message; + List? data; + + GetGuestFollowing({this.status, this.statusCode, this.message, this.data}); + + GetGuestFollowing.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Data { + int? followingIamPrincipalXid; + int? iamPrincipalXid; + Following? following; + + Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.following}); + + Data.fromJson(Map json) { + followingIamPrincipalXid = json['following_iam_principal_xid']; + iamPrincipalXid = json['iam_principal_xid']; + following = json['following'] != null + ? new Following.fromJson(json['following']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['following_iam_principal_xid'] = this.followingIamPrincipalXid; + data['iam_principal_xid'] = this.iamPrincipalXid; + if (this.following != null) { + data['following'] = this.following!.toJson(); + } + return data; + } +} + +class Following { + int? id; + String? userName; + String? fullName; + String? profilePhoto; + + Following({this.id, this.userName, this.fullName, this.profilePhoto}); + + Following.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + profilePhoto = json['profile_photo']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['profile_photo'] = this.profilePhoto; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart new file mode 100644 index 0000000..3d5cdfe --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataBus.dart @@ -0,0 +1,179 @@ +class GuestGetProfileDataBus { + String? status; + int? statusCode; + String? message; + Data? data; + + GuestGetProfileDataBus( + {this.status, this.statusCode, this.message, this.data}); + + GuestGetProfileDataBus.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? id; + int? businessTypeXid; + String? businessOwnerName; + String? businessName; + String? businessLocation; + String? businessContactNumber; + String? businessEmail; + String? businessHandle; + String? websiteLink; + String? googleReviewLink; + String? businessLogo; + String? tags; + String? bannerImage; + Follows? follows; + BusinessType? businessType; + + Data( + {this.id, + this.businessTypeXid, + this.businessOwnerName, + this.businessName, + this.businessLocation, + this.businessContactNumber, + this.businessEmail, + this.businessHandle, + this.websiteLink, + this.googleReviewLink, + this.businessLogo, + this.tags, + this.bannerImage, + this.follows, + this.businessType}); + + Data.fromJson(Map json) { + id = json['id']; + businessTypeXid = json['business_type_xid']; + businessOwnerName = json['business_owner_name']; + businessName = json['business_name']; + businessLocation = json['business_location']; + businessContactNumber = json['business_contact_number']; + businessEmail = json['business_email']; + businessHandle = json['business_handle']; + websiteLink = json['website_link']; + googleReviewLink = json['google_review_link']; + businessLogo = json['business_logo']; + tags = json['tags']; + bannerImage = json['banner_image']; + follows = + json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + businessType = json['business_type'] != null + ? new BusinessType.fromJson(json['business_type']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['business_type_xid'] = this.businessTypeXid; + data['business_owner_name'] = this.businessOwnerName; + data['business_name'] = this.businessName; + data['business_location'] = this.businessLocation; + data['business_contact_number'] = this.businessContactNumber; + data['business_email'] = this.businessEmail; + data['business_handle'] = this.businessHandle; + data['website_link'] = this.websiteLink; + data['google_review_link'] = this.googleReviewLink; + data['business_logo'] = this.businessLogo; + data['tags'] = this.tags; + data['banner_image'] = this.bannerImage; + if (this.follows != null) { + data['follows'] = this.follows!.toJson(); + } + if (this.businessType != null) { + data['business_type'] = this.businessType!.toJson(); + } + return data; + } +} + +class Follows { + int? following; + int? followers; + + Follows({this.following, this.followers}); + + Follows.fromJson(Map json) { + following = json['following']; + followers = json['followers']; + } + + Map toJson() { + final Map data = new Map(); + data['following'] = this.following; + data['followers'] = this.followers; + return data; + } +} + +class BusinessType { + int? id; + String? name; + String? image; + String? description; + int? isActive; + String? createdBy; + String? modifiedBy; + String? deletedAt; + String? createdAt; + String? updatedAt; + + BusinessType( + {this.id, + this.name, + this.image, + this.description, + this.isActive, + this.createdBy, + this.modifiedBy, + this.deletedAt, + this.createdAt, + this.updatedAt}); + + BusinessType.fromJson(Map json) { + id = json['id']; + name = json['name']; + image = json['image']; + description = json['description']; + isActive = json['is_active']; + createdBy = json['created_by']; + modifiedBy = json['modified_by']; + deletedAt = json['deleted_at']; + createdAt = json['created_at']; + updatedAt = json['updated_at']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + data['image'] = this.image; + data['description'] = this.description; + data['is_active'] = this.isActive; + data['created_by'] = this.createdBy; + data['modified_by'] = this.modifiedBy; + data['deleted_at'] = this.deletedAt; + data['created_at'] = this.createdAt; + data['updated_at'] = this.updatedAt; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart new file mode 100644 index 0000000..fa2e75c --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/Model/GuestGetProfileDataIndi.dart @@ -0,0 +1,296 @@ +class GuestGetProfileDataIndi { + String? status; + int? statusCode; + String? message; + Data? data; + + GuestGetProfileDataIndi( + {this.status, this.statusCode, this.message, this.data}); + + GuestGetProfileDataIndi.fromJson(Map json) { + status = json['status']; + statusCode = json['status_code']; + message = json['message']; + data = json['data'] != null ? new Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = new Map(); + data['status'] = this.status; + data['status_code'] = this.statusCode; + data['message'] = this.message; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? id; + String? userName; + String? fullName; + String? gender; + String? dateOfBirth; + List? interest; + String? about; + String? position; + String? trainingScores; + String? height; + String? weight; + String? battingAverage; + Follows? follows; + List? timelines; + int? accountVisibility; + List? myJoinedSubgroups; + + Data( + {this.id, + this.userName, + this.fullName, + this.gender, + this.dateOfBirth, + this.interest, + this.about, + this.position, + this.trainingScores, + this.height, + this.weight, + this.battingAverage, + this.follows, + this.timelines, + this.accountVisibility, + this.myJoinedSubgroups}); + + Data.fromJson(Map json) { + id = json['id']; + userName = json['user_name']; + fullName = json['full_name']; + gender = json['gender']; + dateOfBirth = json['date_of_birth']; + if (json['interest'] != null) { + interest = []; + json['interest'].forEach((v) { + interest!.add(new Interest.fromJson(v)); + }); + } + about = json['about']; + position = json['position']; + trainingScores = json['training_scores']; + height = json['height']; + weight = json['weight']; + battingAverage = json['batting_average']; + follows = + json['follows'] != null ? new Follows.fromJson(json['follows']) : null; + if (json['timelines'] != null) { + timelines = []; + json['timelines'].forEach((v) { + timelines!.add(new Timelines.fromJson(v)); + }); + } + accountVisibility = json['account_visibility']; + if (json['my_joined_subgroups'] != null) { + myJoinedSubgroups = []; + json['my_joined_subgroups'].forEach((v) { + myJoinedSubgroups!.add(new MyJoinedSubgroups.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['user_name'] = this.userName; + data['full_name'] = this.fullName; + data['gender'] = this.gender; + data['date_of_birth'] = this.dateOfBirth; + if (this.interest != null) { + data['interest'] = this.interest!.map((v) => v.toJson()).toList(); + } + data['about'] = this.about; + data['position'] = this.position; + data['training_scores'] = this.trainingScores; + data['height'] = this.height; + data['weight'] = this.weight; + data['batting_average'] = this.battingAverage; + if (this.follows != null) { + data['follows'] = this.follows!.toJson(); + } + if (this.timelines != null) { + data['timelines'] = this.timelines!.map((v) => v.toJson()).toList(); + } + data['account_visibility'] = this.accountVisibility; + if (this.myJoinedSubgroups != null) { + data['my_joined_subgroups'] = + this.myJoinedSubgroups!.map((v) => v.toJson()).toList(); + } + return data; + } +} +class Interest { + int? id; + String? name; + + Interest({this.id, this.name}); + + Interest.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + return data; + } +} + +class Follows { + int? following; + int? followers; + + Follows({this.following, this.followers}); + + Follows.fromJson(Map json) { + following = json['following']; + followers = json['followers']; + } + + Map toJson() { + final Map data = new Map(); + data['following'] = this.following; + data['followers'] = this.followers; + return data; + } +} + +class Timelines { + int? id; + String? clubName; + String? roleName; + String? teamName; + String? startDate; + String? endDate; + String? abilitiesXids; + List? abilities; + + Timelines( + {this.id, + this.clubName, + this.roleName, + this.teamName, + this.startDate, + this.endDate, + this.abilitiesXids, + this.abilities}); + + Timelines.fromJson(Map json) { + id = json['id']; + clubName = json['club_name']; + roleName = json['role_name']; + teamName = json['team_name']; + startDate = json['start_date']; + endDate = json['end_date']; + abilitiesXids = json['abilities_xids']; + if (json['abilities'] != null) { + abilities = []; + json['abilities'].forEach((v) { + abilities!.add(new Abilities.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['club_name'] = this.clubName; + data['role_name'] = this.roleName; + data['team_name'] = this.teamName; + data['start_date'] = this.startDate; + data['end_date'] = this.endDate; + data['abilities_xids'] = this.abilitiesXids; + if (this.abilities != null) { + data['abilities'] = this.abilities!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Abilities { + int? id; + String? name; + + Abilities({this.id, this.name}); + + Abilities.fromJson(Map json) { + id = json['id']; + name = json['name']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['name'] = this.name; + return data; + } +} + +class MyJoinedSubgroups { + int? id; + int? iamPrincipalXid; + int? manageGroupXid; + int? manageSubGroupXid; + SubGroupData? subGroupData; + + MyJoinedSubgroups( + {this.id, + this.iamPrincipalXid, + this.manageGroupXid, + this.manageSubGroupXid, + this.subGroupData}); + + MyJoinedSubgroups.fromJson(Map json) { + id = json['id']; + iamPrincipalXid = json['iam_principal_xid']; + manageGroupXid = json['manage_group_xid']; + manageSubGroupXid = json['manage_sub_group_xid']; + subGroupData = json['sub_group_data'] != null + ? new SubGroupData.fromJson(json['sub_group_data']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['iam_principal_xid'] = this.iamPrincipalXid; + data['manage_group_xid'] = this.manageGroupXid; + data['manage_sub_group_xid'] = this.manageSubGroupXid; + if (this.subGroupData != null) { + data['sub_group_data'] = this.subGroupData!.toJson(); + } + return data; + } +} + +class SubGroupData { + int? id; + String? title; + String? subGroupImage; + + SubGroupData({this.id, this.title, this.subGroupImage}); + + SubGroupData.fromJson(Map json) { + id = json['id']; + title = json['title']; + subGroupImage = json['sub_group_image']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['title'] = this.title; + data['sub_group_image'] = this.subGroupImage; + return data; + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart new file mode 100644 index 0000000..ade1a7f --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Business/ProfileTabBusGuest.dart @@ -0,0 +1,857 @@ +import 'package:flutter/material.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/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; + +class profiletabBusGest extends StatefulWidget { + const profiletabBusGest({super.key}); + + @override + State createState() => _profiletabBusGestState(); +} + +class _profiletabBusGestState extends State { + late Future guestBusfuture; + var updata; + + @override + void initState() { + // TODO: implement initState + updata = "64"; + + guestBusfuture = GuestProfileApi().getGuestProfileBus(updata); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + // accountTypeValue == '1' || + body: FutureBuilder( + future: guestBusfuture, + 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(guestGetProfileBus! + .data!.businessOwnerName ?? + "Victory gear sports emporium"), + sizedBoxHeight(5.h), + text18w400white(guestGetProfileBus! + .data!.businessName ?? + "@Victorygames_10"), + sizedBoxHeight(15.h), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Get.toNamed( + RouteName.followers); + }, + child: Column( + children: [ + text16400white( + guestGetProfileBus! + .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( + guestGetProfileBus! + .data! + .follows! + .following + .toString() ?? + "344"), + 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("Follow")), + ), + ), + 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("Message"), + ), + // 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("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( + "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( + "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(), + commonContainer( + width: 40.w, + height: 40.h, + borderwidth: 0.5, + boxShape: BoxShape.circle, + opacity1: 0.5, + opacity2: 0.6, + customWidget: PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 200.w), + offset: const Offset(0, 50), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () { + Get.toNamed(RouteName.shareProfile); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Share profile', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 17.h, + width: 17.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Report user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Block user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/blocked.png", + height: 18.h, + width: 18.w, + ) + ], + ), + ), + ), + ], + child: Center( + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + height: 20.h, + width: 20.w, + )), + ), + ), + ], + ), + ], + ), + ), + ), + ]); + } + return Container(); + })); + } +} + +Widget normalcardtile({ + required String profileImg, + required String title, + required String mainImg, + required List 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) => [ + 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( + onReactionChanged: (reaction) { + updateImage(reaction?.value ?? 'like'); + debugPrint('Selected value: ${reaction?.value}'); + }, + reactions: ?>[ + Reaction( + value: 'like', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + icon: _buildReactionsIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + ), + Reaction( + value: 'heart', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/heart 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/heart 2.png'), + ), + Reaction( + value: 'party', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/party-popper 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/party-popper 2.png'), + ), + ], + selectedReaction: Reaction( + 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)), + )); +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart new file mode 100644 index 0000000..9630ae5 --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/View/Individual/ProfileTabIndGuest.dart @@ -0,0 +1,1204 @@ +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/CommonGlassmorphism.dart'; +import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/ViewModel/GuestProfileApi.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/texts.dart'; +import 'package:regroup/resources/routes/route_name.dart'; + +class ProfileTabIndGuest extends StatefulWidget { + const ProfileTabIndGuest({super.key}); + + @override + State createState() => _ProfileTabIndGuestState(); +} + +class _ProfileTabIndGuestState extends State { + 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 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" + }, + ]; + + 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" + }, + ]; + + late Future guestIndfuture; + var updata; + + // FollowingidIndex + + @override + void initState() { + // updata = Get.arguments != null + // ? Get.arguments['FolloweridIndex'] + // : Get.arguments != null + // ? Get.arguments['FollowingidIndex'] + // : "56"; + updata = Get.arguments?['FolloweridIndex'] ?? + Get.arguments?['FollowingidIndex'] ?? + "56"; + + guestIndfuture = GuestProfileApi().getGuestProfileInd(updata); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + // key: _scaffoldKey1, + backgroundColor: Color(0xFF222935), + extendBody: true, + // accountTypeValue == '1' || + body: FutureBuilder( + future: guestIndfuture, + 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(guestGetProfileInd! + .data!.fullName ?? + "Edward Hackett"), + sizedBoxHeight(5.h), + text18w400white(guestGetProfileInd! + .data!.userName ?? + "@edward_01"), + sizedBoxHeight(15.h), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + Get.toNamed( + RouteName.followers, + arguments: { + 'UpdataGuestIdfollowers': + updata, + }); + }, + child: Column( + children: [ + text16400white( + guestGetProfileInd! + .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, + arguments: { + 'UpdataGuestIdfollowing': + updata, + }); + }, + child: Column( + children: [ + text16400white( + guestGetProfileInd! + .data! + .follows! + .following + .toString() ?? + "254"), + sizedBoxHeight(6.h), + text12400whiteblur( + "Following") + ], + ), + ), + 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.clubs); + }, + child: Column( + children: [ + text16400white("10"), + sizedBoxHeight(6.h), + text12400whiteblur("Clubs") + ], + ), + ), + ], + ), + 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.editProfile); + }, + child: Container( + height: 40.h, + width: 170.w, + decoration: BoxDecoration( + color: Color(0xFFD90B2E), + borderRadius: + BorderRadius.circular(30.r), + ), + child: Center( + child: text16w400_FCFCFC("Follow")), + ), + ), + 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("Message"), + ), + // 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/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( + 'Rowing, Football, Swimming'), + // interestText + // text14400whiteblur(getEditProfileIndi! + // .data!.interest! + // .join(', ')), + // text14400whiteblur( + // "Rowing, Football, Swimming"), + ], + ), + sizedBoxHeight(25.h), + // commonGlassUI( + // width: double.infinity, + // height: 135.h, + // borderRadius: BorderRadius.circular(10), + // customWidget: Padding( + // padding: EdgeInsets.symmetric( + // vertical: 12.h, horizontal: 16.w), + // child: Column( + // children: [ + // Row( + // children: [ + // text16w700white("Badges"), + // Spacer(), + // GestureDetector( + // onTap: () { + // Get.toNamed(RouteName.badges); + // }, + // child: text12400white("View more")) + // ], + // ), + // sizedBoxHeight(8.h), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // Image.asset( + // "assets/images/png/Frame 1000004056.png", + // height: 70.h, + // width: 74.w, + // ), + // ], + // ), + // ], + // ), + // ), + // // border: 1 + // ), + ], + ), + ), + 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"]); + }, + )), + 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(20.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(), + commonContainer( + width: 40.w, + height: 40.h, + borderwidth: 0.5, + boxShape: BoxShape.circle, + opacity1: 0.5, + opacity2: 0.6, + customWidget: PopupMenuButton( + surfaceTintColor: const Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 200.w), + offset: const Offset(0, 50), + color: const Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () { + Get.toNamed(RouteName.shareProfile); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Share profile', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/share.png", + height: 17.h, + width: 17.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Report user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/Vector (5).png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + const PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + Text( + 'Block user', + style: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w800, + fontFamily: "Nunito Sans", + ), + ), + const Spacer(), + Image.asset( + "assets/images/png/blocked.png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Center( + child: Image.asset( + 'assets/images/png/Group 1000004071.png', + height: 20.h, + width: 20.w, + )), + ), + ), + ], + ), + ], + ), + ), + ), + ]); + } + return Container(); + })); + } + + 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 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) => [ + 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( + onReactionChanged: (reaction) { + updateImage(reaction?.value ?? 'like'); + debugPrint('Selected value: ${reaction?.value}'); + }, + reactions: ?>[ + Reaction( + value: 'like', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + icon: _buildReactionsIcon( + 'assets/images/png/f7_hand-thumbsup.png'), + ), + Reaction( + value: 'heart', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/heart 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/heart 2.png'), + ), + Reaction( + value: 'party', + previewIcon: _buildReactionsPreviewIcon( + 'assets/images/png/party-popper 2.png'), + icon: _buildReactionsIcon( + 'assets/images/png/party-popper 2.png'), + ), + ], + selectedReaction: Reaction( + 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 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 _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)), + ], + ); + } +} diff --git a/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart new file mode 100644 index 0000000..824147b --- /dev/null +++ b/lib/Feed Module/Main_Screens/ProfileTab/Guest User/ViewModel/GuestProfileApi.dart @@ -0,0 +1,73 @@ + import 'dart:async'; +import 'dart:developer'; + +import 'package:regroup/Common/api_urls.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Common/controller/data/network/network_api.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowers.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GetGuestFollowing.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataBus.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Model/GuestGetProfileDataIndi.dart'; + + +GuestGetProfileDataIndi? guestGetProfileInd; +GuestGetProfileDataBus? guestGetProfileBus; + +GetGuestFollowers? getguestfollowersobj; +GetGuestFollowing? getguestfollowingobj; + + +class GuestProfileApi { + GuestProfileApi(); + + +Future> getGuestProfileInd(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestProfileInd}?guest_user_id=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + guestGetProfileInd = GuestGetProfileDataIndi.fromJson(response.data); + log(guestGetProfileInd!.data.toString()); + } + return response; + } + + Future> getGuestProfileBus(updata) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestProfileBus}?guest_user_id=$updata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + guestGetProfileBus = GuestGetProfileDataBus.fromJson(response.data); + log(guestGetProfileBus!.data.toString()); + } + return response; + } + + Future> getGuestfollowers(gestUserid ,guestupdata , {required StreamController streamController}) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestfollowers}?guest_user_id=$gestUserid&search=$guestupdata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + getguestfollowersobj = GetGuestFollowers.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(getguestfollowersobj!); + log(guestGetProfileInd!.data.toString()); + } + return response; + } + + Future> getGuestfollowing(gestUserid ,guestupdata , {required StreamController streamController}) async { + final response = await NetworkApiServices().getApi( + "${ApiUrls.getGuestfollowing}?guest_user_id=$gestUserid&search=$guestupdata", + // optionalpar: false + ); + if (response.status == ResponseStatus.SUCCESS) { + getguestfollowingobj = GetGuestFollowing.fromJson(response.data); + if (!streamController.isClosed) streamController.sink.add(getguestfollowingobj!); + log(guestGetProfileInd!.data.toString()); + } + return response; + } +} \ No newline at end of file diff --git a/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart b/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart index ecbf9f0..0f4d4c7 100644 --- a/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart +++ b/lib/Feed Module/Main_Screens/ProfileTab/My Network/MyNetwork.dart @@ -1,12 +1,22 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:regroup/Common/CommonTabBar.dart'; import 'package:regroup/Common/CommonWidget.dart'; +import 'package:regroup/Common/base_manager.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart'; import 'package:regroup/Utils/Common/CommonAppbar.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/texts.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class MyNetwork extends StatefulWidget { const MyNetwork({super.key}); @@ -61,41 +71,105 @@ class _MyNetworkState extends State { ]) ])); } +} - Widget followersTab() { - List followersData = [ - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Fit fusion squad", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 37.png", - "title": "Power pulse posse", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - ]; +class followersTab extends StatefulWidget { + const followersTab({super.key}); + @override + State createState() => _followersTabState(); +} + +class _followersTabState extends State { + StreamController searchcontroller = StreamController(); + + @override + void initState() { + var updata = ""; + Profilegetmethod().getFollowers(updata, streamController: searchcontroller); + + // TODO: implement initState + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + int? blockid; + int? removeid; + + RemoveUploadata() async { + utils.loader(); + Map updata = { + "iam_principal_xid": removeid, + }; + final data = await Profilepostmethod().postRemoveuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + BlockUploadata() async { + utils.loader(); + Map updata = { + "blocked_iam_principal_xid": blockid, + }; + final data = await Profilepostmethod().postBlockuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("block done"); + return utils.showToast(data.message); + } else { + Get.back(); + print("block not done"); + return utils.showToast(data.message); + } + } + + List followersData = [ + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 43.png", + "title": "Fit fusion squad", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 37.png", + "title": "Power pulse posse", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + ]; + + @override + Widget build(BuildContext context) { return Column( children: [ sizedBoxHeight(25.h), @@ -113,298 +187,565 @@ class _MyNetworkState extends State { ), ), ), + texttype: TextInputType.text, + inputFormatters: [ + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + Profilegetmethod() + .getFollowers(value, streamController: searchcontroller); + }, hintText: "Search people", ), ), - ListView.separated( - physics: ScrollPhysics(), - shrinkWrap: true, - itemCount: followersData.length, - separatorBuilder: (BuildContext context, int index) { - return commonDivider(); - }, - itemBuilder: (context, index) { - return Column( - children: [ - Padding( - padding: - EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - CircleAvatar( - backgroundImage: - AssetImage(followersData[index]["imagePath"]), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(followersData[index]["title"]), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur( - followersData[index]["subtitle"]) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - // onTap: () {}, - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Remove user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, + sizedBoxHeight(20.h), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Expanded( + child: Center(child: CircularProgressIndicator())); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return followersobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: ScrollPhysics(), + shrinkWrap: true, + itemCount: followersobj!.data!.length, + separatorBuilder: (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + return Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + followersobj!.data![index].follower! + .profilePhoto == + null || + followersobj!.data![index].follower! + .profilePhoto!.isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, ) - ], - ), + : CircleAvatar( + backgroundImage: NetworkImage( + followersobj!.data![index] + .follower!.profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + followersobj!.data![index].follower! + .fullName == + null || + followersobj! + .data![index] + .follower! + .fullName! + .isEmpty == + true + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC(followersobj! + .data![index] + .follower! + .fullName!), + sizedBoxHeight(4.h), + followersobj!.data![index].follower! + .userName == + null || + followersobj! + .data![index] + .follower! + .userName! + .isEmpty == + true + ? text12w400_FCFCFC_blur("regroup") + : text12w400_FCFCFC_blur(followersobj! + .data![index].follower!.userName!) + ], ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-regular.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Block user"), - Spacer(), - Image.asset( - "assets/images/png/blockchat.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, + Spacer(), + PopupMenuButton( + surfaceTintColor: Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 176.w), + offset: Offset(0, 20), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + // onTap: () {}, + onTap: () async { + setState(() { + removeid = followersobj! + .data![index] + .follower! + .id ?? + 0; + followersobj!.data! + .removeWhere((item) => + item.follower!.id == + removeid); + RemoveUploadata(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Remove user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_delete-28-regular.png", + height: 15.h, + width: 15.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-regular.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () async { + setState(() { + blockid = followersobj! + .data![index] + .follower! + .id ?? + 0; + followersobj!.data! + .removeWhere((item) => + item.follower!.id == + blockid); + BlockUploadata(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Block user"), + Spacer(), + Image.asset( + "assets/images/png/blockchat.png", + height: 25.h, + width: 25.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], ), - ), - )), - ], - ), - ) - ], - ); + ) + ], + ); + }, + ); + } }, ), ], ); } - Widget followingTab() { - List followingData = [ - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 43.png", - "title": "Fit fusion squad", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 37.png", - "title": "Power pulse posse", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 52.png", - "title": "Iron titans fitness crew", - "subtitle": "Lorem ipsum dummy text", - }, - { - "imagePath": "assets/images/png/Ellipse 48.png", - "title": "Body blitz brigade", - "subtitle": "Lorem ipsum dummy text", - }, - ]; - - return Column( - children: [ - sizedBoxHeight(25.h), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: CustomTextFormField( - leadingIcon: SizedBox( - height: 23, - width: 23, - child: Center( - child: Image.asset( - "assets/images/png/ion_search-outline.png", - height: 23, - width: 23, - ), - ), - ), - hintText: "Search people", - ), + Widget _buildNoDataBody(context) { + return Expanded( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], ), - ListView.separated( - physics: ScrollPhysics(), - shrinkWrap: true, - itemCount: followingData.length, - separatorBuilder: (BuildContext context, int index) { - return commonDivider(); - }, - itemBuilder: (context, index) { - return Column( - children: [ - Padding( - padding: - EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w), - child: Row( - children: [ - CircleAvatar( - backgroundImage: - AssetImage(followingData[index]["imagePath"]), - radius: 25.r, - ), - sizedBoxWidth(10.w), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - text16w400_FCFCFC(followingData[index]["title"]), - sizedBoxHeight(4.h), - text12w400_FCFCFC_blur( - followingData[index]["subtitle"]) - ], - ), - Spacer(), - PopupMenuButton( - surfaceTintColor: Color(0xFF222935), - constraints: BoxConstraints.tightFor(width: 176.w), - offset: Offset(0, 20), - color: Color(0xFF222935), - tooltip: "", - itemBuilder: (BuildContext context) => - [ - PopupMenuItem( - // onTap: () {}, - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Remove user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_delete-28-regular.png", - height: 15.h, - width: 15.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Message user"), - Spacer(), - Image.asset( - "assets/images/png/fluent_chat-20-regular.png", - height: 20.h, - width: 20.w, - ) - ], - ), - ), - ), - PopupMenuDivider(), - PopupMenuItem( - onTap: () async {}, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.w), - child: Row( - children: [ - text14400white("Block user"), - Spacer(), - Image.asset( - "assets/images/png/blockchat.png", - height: 25.h, - width: 25.w, - ) - ], - ), - ), - ), - ], - child: Container( - height: 20, - width: 20, - child: Center( - child: Image.asset( - "assets/images/png/Group 1000004071.png", - height: 22.h, - width: 4.w, - ), - ), - )), - ], - ), - ) - ], - ); - }, - ), - ], + ), + ); + } +} + +class followingTab extends StatefulWidget { + const followingTab({super.key}); + + @override + State createState() => _followingTabState(); +} + +class _followingTabState extends State { + StreamController searchcontroller = StreamController(); + + List followingData = [ + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 43.png", + "title": "Fit fusion squad", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 37.png", + "title": "Power pulse posse", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 52.png", + "title": "Iron titans fitness crew", + "subtitle": "Lorem ipsum dummy text", + }, + { + "imagePath": "assets/images/png/Ellipse 48.png", + "title": "Body blitz brigade", + "subtitle": "Lorem ipsum dummy text", + }, + ]; + + @override + void initState() { + // TODO: implement initState + + var updata = ""; + Profilegetmethod().getFollowing(updata, streamController: searchcontroller); + + super.initState(); + } + + @override + void dispose() { + searchcontroller.close(); + super.dispose(); + } + + Uploadata() async { + utils.loader(); + Map updata = { + "following_iam_principal_xid": unfollowid, + }; + final data = await Profilepostmethod().postunfollowuser(updata); + if (data.status == ResponseStatus.SUCCESS) { + Get.back(); + print("unfollow done"); + // setState(() { + // // Assuming followingobj is a list of items, remove the item with matching user ID + // followingobj!.data!.removeWhere((item) => item.following!.id == userid); + // }); + return utils.showToast(data.message); + } else { + Get.back(); + print("unfollow not done"); + return utils.showToast(data.message); + } + } + + int? unfollowid; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + sizedBoxHeight(25.h), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: CustomTextFormField( + leadingIcon: SizedBox( + height: 23, + width: 23, + child: Center( + child: Image.asset( + "assets/images/png/ion_search-outline.png", + height: 23, + width: 23, + ), + ), + ), + hintText: "Search people", + texttype: TextInputType.text, + inputFormatters: [ + // LengthLimitingTextInputFormatter(20), + RemoveEmojiInputFormatter(), + ], + onInput: (value) { + // Onboard().postGroupsearch({"search": value}, + // streamController: searchcontroller); + // searchGroups(value!); + Profilegetmethod() + .getFollowing(value, streamController: searchcontroller); + }, + ), + ), + sizedBoxHeight(20.h), + StreamBuilder( + stream: searchcontroller.stream, + builder: (ctx, snapshot) { + if (snapshot.connectionState == ConnectionState.waiting) { + // Display shimmer effect while waiting for data + return Expanded( + child: Center(child: CircularProgressIndicator())); + } else if (snapshot.hasError) { + // Handle error state + return Center( + child: Text( + '${snapshot.error} occurred', + style: TextStyle(fontSize: 18), + ), + ); + } else { + // Data has been loaded, show actual UI + return followingobj!.data!.isEmpty + ? _buildNoDataBody(context) + : ListView.separated( + physics: ScrollPhysics(), + shrinkWrap: true, + itemCount: followingobj!.data!.length, + separatorBuilder: (BuildContext context, int index) { + return commonDivider(); + }, + itemBuilder: (context, index) { + return + // Column( + // children: [ + // Followinglist( + // imagePath: followingobj?.data?[index] + // .following?.profilePhoto ?? + // '', + // title: followingobj! + // .data?[index].following?.fullName ?? + // '', + // subtitle: followingobj! + // .data?[index].following?.userName ?? + // '', + // unfollowontap: (id) => Uploadata(id), + // unfollowindex: followingobj! + // .data![index].following!.id!, + // ), + // if (index != followingobj!.data!.length - 1) + // commonDivider(), + // ], + // ); + Column( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 16.h, horizontal: 16.w), + child: Row( + children: [ + followingobj!.data![index].following! + .profilePhoto == + null || + followingobj!.data![index].following! + .profilePhoto!.isEmpty + ? CircleAvatar( + backgroundImage: AssetImage( + 'assets/images/png/Ellipse 43.png'), + radius: 25.r, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + followingobj!.data![index] + .following!.profilePhoto!), + radius: 25.r, + ), + sizedBoxWidth(10.w), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + followingobj!.data![index].following! + .fullName == + null || + followingobj!.data![index] + .following!.fullName!.isEmpty + ? text16w400_FCFCFC("Regroup") + : text16w400_FCFCFC(followingobj! + .data![index] + .following! + .fullName!), + sizedBoxHeight(4.h), + followingobj!.data![index].following! + .userName == + null || + followingobj!.data![index] + .following!.userName!.isEmpty + ? text12w400_FCFCFC_blur("regroup") + : text12w400_FCFCFC_blur(followingobj! + .data![index] + .following! + .userName!) + ], + ), + Spacer(), + PopupMenuButton( + surfaceTintColor: Color(0xFF222935), + constraints: + BoxConstraints.tightFor(width: 176.w), + offset: Offset(0, 20), + color: Color(0xFF222935), + tooltip: "", + itemBuilder: (BuildContext context) => + [ + PopupMenuItem( + onTap: () async { + setState(() { + unfollowid = followingobj! + .data![index] + .following! + .id ?? + 0; + // followingobj!.data!.removeAt(index); + followingobj!.data! + .removeWhere((item) => + item.following!.id == + unfollowid); + Uploadata(); + }); + }, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Unfollow user"), + Spacer(), + Image.asset( + "assets/images/png/Black1323e.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + PopupMenuDivider(), + PopupMenuItem( + onTap: () {}, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.w), + child: Row( + children: [ + text14400white( + "Message user"), + Spacer(), + Image.asset( + "assets/images/png/fluent_chat-20-22.png", + height: 20.h, + width: 20.w, + ) + ], + ), + ), + ), + ], + child: Container( + height: 20, + width: 20, + child: Center( + child: Image.asset( + "assets/images/png/Group 1000004071.png", + height: 22.h, + width: 4.w, + ), + ), + )), + ], + ), + ), + ], + ); + }, + ); + } + }, + ), + ], + ); + } + + Widget _buildNoDataBody(context) { + return Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "No Data Found", + style: TextStyle( + color: Colors.white, + fontSize: 16.sp, + fontWeight: FontWeight.w600), + ) + ], + ), ); } } diff --git a/lib/resources/routes/routes.dart b/lib/resources/routes/routes.dart index 3999c62..b0e2143 100644 --- a/lib/resources/routes/routes.dart +++ b/lib/resources/routes/routes.dart @@ -39,8 +39,8 @@ import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/E import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Followers/Followers.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Following/Following.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Business/ProfileTabBusGuest.dart'; -import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/Individual/ProfileTabIndGuest.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/View/Business/ProfileTabBusGuest.dart'; +import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Guest%20User/View/Individual/ProfileTabIndGuest.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/My%20Network/MyNetwork.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/AccountSessions.dart'; import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/AccountSetting.dart';