conflict resolved

This commit is contained in:
Dakshesh42
2024-08-14 17:32:38 +05:30
17 changed files with 1112 additions and 636 deletions

View File

@@ -169,5 +169,8 @@ class ApiUrls {
static const getcommunitygroups = "${baseUrl}fetch-community-all-groups"; static const getcommunitygroups = "${baseUrl}fetch-community-all-groups";
static const getcommunitymembers = "${baseUrl}fetch-community-all-members";
} }

View File

@@ -6,6 +6,8 @@ import 'package:flutter/foundation.dart';
import 'package:get/get.dart' hide Response; import 'package:get/get.dart' hide Response;
import 'package:regroup/Global.dart'; import 'package:regroup/Global.dart';
import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
@@ -16,8 +18,8 @@ class NetworkApiServices {
Dio dio = Dio(); Dio dio = Dio();
final controllerEntryPoint = Get.put(EntryPointController()); final controllerEntryPoint = Get.put(EntryPointController());
String basicAuth = 'Basic ${base64.encode( String basicAuth =
utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&'))}'; 'Basic ${base64.encode(utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&'))}';
Future<ResponseData> getApi(String url, {bool optionalpar = false}) async { Future<ResponseData> getApi(String url, {bool optionalpar = false}) async {
if (kDebugMode) { if (kDebugMode) {
@@ -45,12 +47,48 @@ class NetworkApiServices {
: Options( : Options(
headers: { headers: {
'authorization': basicAuth, 'authorization': basicAuth,
'access-token': token 'access-token':
token
}, },
), ),
); );
} on Exception catch (e) { }
log(e.toString()); on Exception catch (e) {
// log(e.toString());
if (e is DioException) {
log(e.response.toString());
if (e.response == null) {
return ResponseData<dynamic>(
'Oops something Went Wrong, Please try again!',
ResponseStatus.FAILED,
);
}
if (e.response!.statusCode == 401) {
if (e.response!.data['message'] == 'Invalid token') {
// prefs.remove('access-token');
// await prefs.clear();
// Get.offNamed(RouteName.loginScreen);
utils.showToast('Please login again');
} else {
return ResponseData<dynamic>(
'Oops something Went Wrong, Please try again!',
ResponseStatus.FAILED,
);
}
}
if (e.response!.statusCode == 403) {
if (e.response!.data['message'] is List) {
return ResponseData<dynamic>(
e.response!.data['message'][0]!, ResponseStatus.FAILED,
data: e.response!.data);
} else {
return ResponseData<dynamic>(
e.response!.data['message'], ResponseStatus.FAILED,
data: e.response!.data);
}
}
}
return ResponseData<dynamic>( return ResponseData<dynamic>(
'Oops something Went Wrong', ResponseStatus.FAILED); 'Oops something Went Wrong', ResponseStatus.FAILED);
} }
@@ -174,7 +212,9 @@ class NetworkApiServices {
}, },
) )
: Options( : Options(
headers: {'authorization': basicAuth, 'access-token': token}, headers: {'authorization': basicAuth, 'access-token':
token
},
), ),
); );
log(response.toString()); log(response.toString());
@@ -188,13 +228,22 @@ class NetworkApiServices {
); );
} }
if (e.response!.statusCode == 401) { if (e.response!.statusCode == 401) {
prefs.remove('token'); if (e.response!.data['message'] == 'Invalid token') {
prefs.remove('refreshToken'); prefs.remove('access-token');
await prefs.clear();
Get.offNamed(RouteName.loginScreen);
utils.showToast('Please login again');
} else {
return ResponseData<dynamic>(
'Oops something Went Wrong, Please try again!',
ResponseStatus.FAILED,
);
}
// Get.toNamed(RouteName.login); // Get.toNamed(RouteName.login);
return ResponseData<dynamic>( // return ResponseData<dynamic>(
'Oops something Went Wrong, Please try again!', // 'Oops something Went Wrong, Please try again!',
ResponseStatus.FAILED, // ResponseStatus.FAILED,
); // );
} }
if (e.response!.statusCode == 403) { if (e.response!.statusCode == 403) {
if (e.response!.data['message'] is List) { if (e.response!.data['message'] is List) {

View File

@@ -2,13 +2,13 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Login/ViewModel/LoginApi.dart'; import 'package:regroup/Login/ViewModel/LoginApi.dart';
import 'package:regroup/Utils/Common/AppleOAuthService.dart'; import 'package:regroup/Utils/Common/AppleOAuthService.dart';
import 'package:regroup/Utils/Common/CustomNextButton.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/googleOAuthService.dart'; import 'package:regroup/Utils/Common/googleOAuthService.dart';
import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/Common/sized_box.dart';
@@ -17,8 +17,6 @@ import 'package:regroup/Utils/texts.dart';
import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart'; import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart';
import 'package:regroup/resources/routes/route_name.dart'; import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
class LoginScreen extends StatefulWidget { class LoginScreen extends StatefulWidget {
const LoginScreen({super.key}); const LoginScreen({super.key});
@@ -32,6 +30,7 @@ class _LoginScreenState extends State<LoginScreen> {
RxBool isObscured = true.obs; RxBool isObscured = true.obs;
final TextEditingController _passwordController = TextEditingController(); final TextEditingController _passwordController = TextEditingController();
GoogleAuthService googleSigninController = Get.put(GoogleAuthService()); GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
bool isLoading = false;
@override @override
void initState() { void initState() {
@@ -120,7 +119,6 @@ class _LoginScreenState extends State<LoginScreen> {
final LoginResult result = await FacebookAuth.instance.login(); final LoginResult result = await FacebookAuth.instance.login();
if (result.status == LoginStatus.success) { if (result.status == LoginStatus.success) {
final userData = await FacebookAuth.instance.getUserData(); final userData = await FacebookAuth.instance.getUserData();
logger.i(userData['email']); logger.i(userData['email']);
logger.i(userData['id']); logger.i(userData['id']);
@@ -216,7 +214,7 @@ class _LoginScreenState extends State<LoginScreen> {
context: context, context: context,
builder: (context) { builder: (context) {
return AlertDialog( return AlertDialog(
backgroundColor: Color(0xff222935), backgroundColor: const Color(0xff222935),
title: Text( title: Text(
'Exit App', 'Exit App',
style: TextStyle( style: TextStyle(
@@ -300,7 +298,7 @@ class _LoginScreenState extends State<LoginScreen> {
padding: EdgeInsets.symmetric(horizontal: 16.w), padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: Container( child: SizedBox(
width: 107.w, width: 107.w,
height: 86.h, height: 86.h,
child: SvgPicture.asset( child: SvgPicture.asset(
@@ -350,7 +348,6 @@ class _LoginScreenState extends State<LoginScreen> {
} }
return null; return null;
}, },
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(30), LengthLimitingTextInputFormatter(30),
@@ -396,22 +393,72 @@ class _LoginScreenState extends State<LoginScreen> {
), ),
sizedBoxHeight(10.h), sizedBoxHeight(10.h),
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Padding( child: Padding(
padding: EdgeInsets.only(right: 6.w), padding: EdgeInsets.only(right: 6.w),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Get.toNamed(RouteName.forgotpass); Get.toNamed(RouteName.forgotpass);
}, },
child: child: text14400white('Forgot password ?'),
text14400white('Forgot password ?')), ),
)), ),
),
sizedBoxHeight(40.h), sizedBoxHeight(40.h),
CustomButton( Center(
text: "Login", child: SizedBox(
onPressed: () { width: isLoading ? 50 : double.infinity,
_logincheck(); height: 50,
}), child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFD90B2E),
padding: EdgeInsets.zero),
onPressed: () {
setState(
() {
isLoading = true;
},
);
Future.delayed(
const Duration(seconds: 1),
() {
setState(() {
isLoading = false;
});
_logincheck();
},
);
},
child: isLoading
? const Row(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
SizedBox(
width: 30,
height: 30,
child: CircularProgressIndicator(
color: Colors.white,
strokeWidth: 2,
),
),
],
)
: Text(
'Login',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "Helvetica",
fontWeight: FontWeight.w400,
fontSize: 16.sp,
color: const Color(0xFFFCFCFC),
),
),
),
),
),
sizedBoxHeight(20.h), sizedBoxHeight(20.h),
GestureDetector( GestureDetector(
onTap: () { onTap: () {

View File

@@ -6,21 +6,20 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart' hide MultipartFile, FormData; import 'package:get/get.dart' hide MultipartFile, FormData;
import 'package:path/path.dart' as path;
import 'package:regroup/Common/CommonButton.dart'; import 'package:regroup/Common/CommonButton.dart';
import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart'; import 'package:regroup/Main_Screens/ProfileTab/EditProfile/View/picturecontroller/indiprofileimagecontroller.dart';
import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart'; import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart'; import 'package:regroup/Main_Screens/ProfileTab/EditProfile/ViewModel/InterestApiList.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/CommonDropdown.dart'; import 'package:regroup/Utils/Common/CommonDropdown.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/ImageUpload.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart';
import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/Utils/texts.dart'; import 'package:regroup/Utils/texts.dart';
import 'package:path/path.dart' as path;
import 'package:regroup/resources/routes/route_name.dart'; import 'package:regroup/resources/routes/route_name.dart';
class EditProfile extends StatefulWidget { class EditProfile extends StatefulWidget {
@@ -101,16 +100,15 @@ class _EditProfileState extends State<EditProfile> {
locationController.text = getEditProfileIndi!.data!.about ?? ''; locationController.text = getEditProfileIndi!.data!.about ?? '';
aboutController.text = getEditProfileIndi!.data!.about ?? ''; aboutController.text = getEditProfileIndi!.data!.about ?? '';
positionController.text = positionController.text = getEditProfileIndi!.data!.position ?? '';
getEditProfileIndi!.data!.position ?? 'Lorem lpsum';
trainingScoresController.text = trainingScoresController.text =
getEditProfileIndi!.data!.trainingScores ?? '50'; getEditProfileIndi!.data!.trainingScores ?? '';
heightController.text = getEditProfileIndi!.data!.height ?? '6 feet'; heightController.text = getEditProfileIndi!.data!.height ?? '';
weightController.text = getEditProfileIndi!.data!.weight ?? '70kg'; weightController.text = getEditProfileIndi!.data!.weight ?? '';
battingAvgController.text = battingAvgController.text =
getEditProfileIndi!.data!.battingAverage ?? '372'; getEditProfileIndi!.data!.battingAverage ?? '';
isOnce = false; isOnce = false;
setState(() {}); setState(() {});
@@ -119,16 +117,12 @@ class _EditProfileState extends State<EditProfile> {
void saveEditProfileInd() async { void saveEditProfileInd() async {
utils.loader(); utils.loader();
FormData? updata; FormData? updata;
MultipartFile imageFile = MultipartFile.fromBytes([]);
var imageFile;
selectedinterestid.isEmpty selectedinterestid.isEmpty
? getCatIdFromName(listofUserInterests) ? getCatIdFromName(listofUserInterests)
: selectedinterestid; : selectedinterestid;
String abilitiesIds = selectedinterestid.toString(); String abilitiesIds = selectedinterestid.toString();
if (editProfileImage.usserprofilePicPath.value.isNotEmpty) { if (editProfileImage.usserprofilePicPath.value.isNotEmpty) {
imageFile = await MultipartFile.fromFile( imageFile = await MultipartFile.fromFile(
editProfileImage.usserprofilePicPath.value, editProfileImage.usserprofilePicPath.value,
@@ -138,8 +132,9 @@ class _EditProfileState extends State<EditProfile> {
updata = FormData.fromMap({ updata = FormData.fromMap({
"full_name": fullNameController.text, "full_name": fullNameController.text,
"profile_image": "profile_image": editProfileImage.usserprofilePicPath.value.isNotEmpty
editProfileImage.usserprofilePicPath.isNotEmpty ? imageFile : null, ? imageFile
: null,
"user_name": userNameController.text, "user_name": userNameController.text,
"date_of_birth": dateController.text, "date_of_birth": dateController.text,
"gender": _selectedgenderType, "gender": _selectedgenderType,
@@ -182,404 +177,400 @@ class _EditProfileState extends State<EditProfile> {
return GestureDetector( return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(), onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold( child: Scaffold(
backgroundColor: const Color(0xFF222935), backgroundColor: const Color(0xFF222935),
extendBody: true, extendBody: true,
appBar: const CommonAppbar( appBar: const CommonAppbar(
titleTxt: "", titleTxt: "",
), ),
body: FutureBuilder( body: FutureBuilder(
future: myfuture, future: myfuture,
builder: (ctx, snapshot) { builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
return const Center( return const Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: Colors.blue, color: Colors.blue,
), ),
); );
} }
if (snapshot.hasError) { if (snapshot.hasError) {
return Center( return Center(
child: Text( child: Text(
'${snapshot.error} occurred', '${snapshot.error} occurred',
style: TextStyle(fontSize: 18.spMin), style: TextStyle(fontSize: 18.spMin),
), ),
); );
} }
if (snapshot.connectionState == ConnectionState.done && if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) { snapshot.hasData) {
return Stack(children: [ return Stack(children: [
Container( Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage(
"assets/images/png/Ellipse 1496.png"), "assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)), fit: BoxFit.fill)),
), ),
SingleChildScrollView( SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16), padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(children: [ child: Column(children: [
sizedBoxHeight(25.h), sizedBoxHeight(25.h),
Stack( Stack(
children: [ children: [
Obx( Obx(
() => editProfileImage () => editProfileImage
.usserprofilePicPath.value != .usserprofilePicPath.value !=
'' ''
? ClipOval( ? ClipOval(
child: SizedBox.fromSize( child: SizedBox.fromSize(
size: Size.fromRadius(50.r), size: Size.fromRadius(50.r),
child: editProfileImage child: editProfileImage
.usserprofilePicPath .usserprofilePicPath
.value != .value !=
'' ''
? Image( ? Image(
image: FileImage( image: FileImage(
File( File(
editProfileImage editProfileImage
.usserprofilePicPath .usserprofilePicPath
.value, .value,
),
), ),
fit: BoxFit.cover, ),
width: double.infinity, fit: BoxFit.cover,
errorBuilder: width: double.infinity,
(BuildContext errorBuilder:
context, (BuildContext context,
Object Object exception,
exception, StackTrace?
StackTrace? stackTrace) {
stackTrace) { return CircleAvatar(
return CircleAvatar( backgroundImage:
backgroundImage: const AssetImage(
const AssetImage( "assets/images/png/cimg3.png"),
"assets/images/png/cimg3.png"), radius: 50.r,
radius: 50.r, );
); },
}, )
) : Image.asset(
: Image.asset( 'assets/images/png/cimg3.png')),
'assets/images/png/cimg3.png')), )
) : ClipOval(
: ClipOval( child: SizedBox.fromSize(
child: SizedBox.fromSize( size: Size.fromRadius(60.r),
size: Size.fromRadius(60.r), child: getEditProfileIndi!
child: getEditProfileIndi!.data! .data!.profilePhoto !=
.profilePhoto != null
null ? ClipOval(
? ClipOval( child: SizedBox.fromSize(
child: size: Size.fromRadius(
SizedBox.fromSize( 25.r),
size: Size.fromRadius( child: CircleAvatar(
25.r), backgroundImage: NetworkImage(
child: CircleAvatar( getEditProfileIndi!
backgroundImage: .data!
NetworkImage( .profilePhoto!),
getEditProfileIndi! radius: 25.r,
.data!
.profilePhoto!),
radius: 25.r,
),
), ),
) ),
: Image.asset( )
"assets/images/blank-profile-picture-973460_1280.png")), : Image.asset(
), "assets/images/blank-profile-picture-973460_1280.png")),
), ),
Positioned( ),
bottom: 0, Positioned(
right: 0, bottom: 0,
child: InkWell( right: 0,
onTap: () { child: InkWell(
ImageUploadBottomSheet().showModal( onTap: () {
context, ImageUploadBottomSheet().showModal(
true, context,
(result) { true,
editProfileImage (result) {
.usserprofilePicPath editProfileImage.usserprofilePicPath
.value = result; .value = result;
var filenameresult = var filenameresult =
extractFileName1(result); extractFileName1(result);
profilePicture = result; profilePicture = result;
isImageAdded = true; isImageAdded = true;
setState(() {}); setState(() {});
}, },
);
},
child: Container(
height: 35.h,
width: 35.w,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFD90B2E)),
child: Center(
child: Image.asset(
"assets/images/png/cameraicon2.png",
height: 19.h,
width: 19.w,
),
),
),
))
],
),
sizedBoxHeight(15.h),
text16400white("Edit profile picture"),
sizedBoxHeight(20.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16400white("Full name"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: fullNameController,
leadingIcon: SizedBox(
width: 18.w,
height: 17.h,
child: Center(
child: Image.asset(
"assets/images/png/Frame 24.png",
width: 18.w,
height: 17.h,
),
),
),
hintText: "Enter your full name",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]')),
],
),
sizedBoxHeight(20.h),
text16400white("User name"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: userNameController,
leadingIcon: SizedBox(
width: 18.w,
height: 17.h,
child: Center(
child: Image.asset(
"assets/images/png/Frame 24.png",
width: 18.w,
height: 17.h,
),
),
),
hintText: "Enter your user name",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]')),
],
),
sizedBoxHeight(20.h),
text16400white("Date of birth"),
sizedBoxHeight(16.h),
GestureDetector(
onTap: () =>
datePicker(context, dateController),
child: AbsorbPointer(
child: CustomTextFormField(
leadingIcon: SizedBox(
width: 18.0,
height: 17.0,
child: Center(
child: Image.asset(
"assets/images/png/calender.png",
width: 18.0,
height: 17.0,
),
),
),
hintText: "12-04-2024",
textEditingController: dateController,
),
),
),
sizedBoxHeight(20.h),
text16400white("Gender"),
sizedBoxHeight(16.h),
CustomDropDownRadio(
initialSelectedValue: _selectedgenderType,
header: _selectedgenderType ?? "Male",
title: "",
showOtherOption: true,
listData: const [
"Male",
"Female",
"Prefer not to say"
],
onItemSelected: _onItemSelected,
leadingImage: Image.asset(
"assets/images/png/Vector ws.png",
width: 18.w,
height: 17.h,
),
),
sizedBoxHeight(25.h),
Row(
children: [
text16400white("Location"),
sizedBoxWidth(6.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: locationController,
leadingIcon: SizedBox(
width: 18.w,
height: 17.h,
child: Center(
child: Image.asset(
"assets/images/png/Group 58645.png",
width: 18.w,
height: 17.h,
),
),
),
hintText: "Enter your location",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]')),
],
),
sizedBoxHeight(20.h),
Row(
children: [
text16400white("Interests"),
sizedBoxWidth(6.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(16.h),
CustomDropDownChexkBox(
header: 'Select interest',
title: "",
listData: listofInterests,
onItemSelected: getCatIdFromName,
leadingImage: Image.asset(
"assets/images/png/Vector (4).png",
width: 18.w,
height: 17.h,
),
initiallySelected: listofUserInterests,
),
sizedBoxHeight(20.h),
text16400white("About"),
sizedBoxHeight(16.h),
CustomTextFormField2(
textEditingController: aboutController,
hintText:
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
maxlines: 3,
),
text16400white("Position"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: positionController,
hintText: "Enter your position",
inputFormatters: [
LengthLimitingTextInputFormatter(50),
],
),
sizedBoxHeight(20.h),
text16400white("Training Scores"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController:
trainingScoresController,
texttype: TextInputType.number,
hintText: "Enter your training scores",
inputFormatters: [
LengthLimitingTextInputFormatter(10),
FilteringTextInputFormatter.allow(
RegExp('[0-9]')),
],
),
sizedBoxHeight(20.h),
text16400white("Height"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: heightController,
hintText: "Enter your height",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(r'[a-zA-Z0-9\s]')),
],
),
sizedBoxHeight(20.h),
text16400white("Weight"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: weightController,
hintText: "Enter your weight",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(r'[a-zA-Z0-9\s]')),
],
),
sizedBoxHeight(20.h),
text16400white("Batting Average"),
sizedBoxHeight(16.h),
CustomTextFormField(
texttype: TextInputType.number,
textEditingController: battingAvgController,
hintText: "Enter your batting average",
inputFormatters: [
LengthLimitingTextInputFormatter(10),
FilteringTextInputFormatter.allow(
RegExp('[0-9]')),
],
),
sizedBoxHeight(20.h),
sizedBoxHeight(60.h),
CommonBtn(
text: "Save",
onTap: () {
if (fullNameController.text.isBlank! ||
userNameController.text.isBlank! ||
dateController.text.isBlank! ||
locationController.text.isBlank! ||
aboutController.text.isBlank! ||
positionController.text.isBlank! ||
trainingScoresController
.text.isBlank! ||
heightController.text.isBlank! ||
weightController.text.isBlank! ||
battingAvgController.text.isBlank!) {
Get.snackbar(
'Error',
'Please fill missing details',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
); );
} else { },
saveEditProfileInd(); child: Container(
} height: 35.h,
}, width: 35.w,
decoration: const BoxDecoration(
shape: BoxShape.circle,
color: Color(0xFFD90B2E)),
child: Center(
child: Image.asset(
"assets/images/png/cameraicon2.png",
height: 19.h,
width: 19.w,
),
),
),
))
],
),
sizedBoxHeight(15.h),
text16400white("Edit profile picture"),
sizedBoxHeight(20.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16400white("Full name"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: fullNameController,
leadingIcon: SizedBox(
width: 18.w,
height: 17.h,
child: Center(
child: Image.asset(
"assets/images/png/Frame 24.png",
width: 18.w,
height: 17.h,
),
),
), ),
sizedBoxHeight(60.h), hintText: "Enter your full name",
], inputFormatters: [
) FilteringTextInputFormatter.allow(
]))) RegExp('[a-zA-Z ]')),
]); ],
} ),
return Container(); sizedBoxHeight(20.h),
})), text16400white("User name"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: userNameController,
leadingIcon: SizedBox(
width: 18.w,
height: 17.h,
child: Center(
child: Image.asset(
"assets/images/png/Frame 24.png",
width: 18.w,
height: 17.h,
),
),
),
hintText: "Enter your user name",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]')),
],
),
sizedBoxHeight(20.h),
text16400white("Date of birth"),
sizedBoxHeight(16.h),
GestureDetector(
onTap: () =>
datePicker(context, dateController),
child: AbsorbPointer(
child: CustomTextFormField(
leadingIcon: SizedBox(
width: 18.0,
height: 17.0,
child: Center(
child: Image.asset(
"assets/images/png/calender.png",
width: 18.0,
height: 17.0,
),
),
),
hintText: "12-04-2024",
textEditingController: dateController,
),
),
),
sizedBoxHeight(20.h),
text16400white("Gender"),
sizedBoxHeight(16.h),
CustomDropDownRadio(
initialSelectedValue: _selectedgenderType,
header: _selectedgenderType ?? "Male",
title: "",
showOtherOption: true,
listData: const [
"Male",
"Female",
"Prefer not to say"
],
onItemSelected: _onItemSelected,
leadingImage: Image.asset(
"assets/images/png/Vector ws.png",
width: 18.w,
height: 17.h,
),
),
sizedBoxHeight(25.h),
Row(
children: [
text16400white("Location"),
sizedBoxWidth(6.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: locationController,
leadingIcon: SizedBox(
width: 18.w,
height: 17.h,
child: Center(
child: Image.asset(
"assets/images/png/Group 58645.png",
width: 18.w,
height: 17.h,
),
),
),
hintText: "Enter your location",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp('[a-zA-Z ]')),
],
),
sizedBoxHeight(20.h),
Row(
children: [
text16400white("Interests"),
sizedBoxWidth(6.w),
Image.asset(
"assets/images/png/octicon_question-24.png",
height: 16.h,
width: 16.w,
)
],
),
sizedBoxHeight(16.h),
CustomDropDownChexkBox(
header: 'Select interest',
title: "",
listData: listofInterests,
onItemSelected: getCatIdFromName,
leadingImage: Image.asset(
"assets/images/png/Vector (4).png",
width: 18.w,
height: 17.h,
),
initiallySelected: listofUserInterests,
),
sizedBoxHeight(20.h),
text16400white("About"),
sizedBoxHeight(16.h),
CustomTextFormField2(
textEditingController: aboutController,
hintText:
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
maxlines: 3,
),
text16400white("Position"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: positionController,
hintText: "Enter your position",
inputFormatters: [
LengthLimitingTextInputFormatter(50),
],
),
sizedBoxHeight(20.h),
text16400white("Training Scores"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController:
trainingScoresController,
texttype: TextInputType.number,
hintText: "Enter your training scores",
inputFormatters: [
LengthLimitingTextInputFormatter(10),
FilteringTextInputFormatter.allow(
RegExp('[0-9]')),
],
),
sizedBoxHeight(20.h),
text16400white("Height"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: heightController,
hintText: "Enter your height",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(r'[a-zA-Z0-9\s]')),
],
),
sizedBoxHeight(20.h),
text16400white("Weight"),
sizedBoxHeight(16.h),
CustomTextFormField(
textEditingController: weightController,
hintText: "Enter your weight",
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(r'[a-zA-Z0-9\s]')),
],
),
sizedBoxHeight(20.h),
text16400white("Batting Average"),
sizedBoxHeight(16.h),
CustomTextFormField(
texttype: TextInputType.number,
textEditingController: battingAvgController,
hintText: "Enter your batting average",
inputFormatters: [
LengthLimitingTextInputFormatter(10),
FilteringTextInputFormatter.allow(
RegExp('[0-9]')),
],
),
sizedBoxHeight(20.h),
sizedBoxHeight(60.h),
CommonBtn(
text: "Save",
onTap: () {
if (fullNameController.text.isBlank! ||
userNameController.text.isBlank! ||
dateController.text.isBlank! ||
locationController.text.isBlank! ||
aboutController.text.isBlank! ||
positionController.text.isBlank! ||
trainingScoresController
.text.isBlank! ||
heightController.text.isBlank! ||
weightController.text.isBlank! ||
battingAvgController.text.isBlank!) {
Get.snackbar(
'Error',
'Please fill missing details',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else {
saveEditProfileInd();
}
},
),
sizedBoxHeight(60.h),
],
)
])))
]);
}
return Container();
}),
),
); );
} }
} }

View File

@@ -70,10 +70,10 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
return Colors.transparent; return Colors.transparent;
} else if (_firstSelectedIndex == index && _isFirstSelectionActive) { } else if (_firstSelectedIndex == index && _isFirstSelectionActive) {
// Apply Color(0XFFD90B2E) to the first selected item // Apply Color(0XFFD90B2E) to the first selected item
return Color(0XFFD90B2E); return const Color(0XFFD90B2E);
} else if (_selectedIndices.contains(index)) { } else if (_selectedIndices.contains(index)) {
// Apply Color(0xFF009DAB) to all other selected items // Apply Color(0xFF009DAB) to all other selected items
return Color(0xFF009DAB); return const Color(0xFF009DAB);
} }
return Colors.transparent; return Colors.transparent;
} }
@@ -318,35 +318,40 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
shrinkWrap: true, shrinkWrap: true,
gridDelegate: gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount( SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: crossAxisCount: 3,
3, // Number of items in each row crossAxisSpacing: 12.w,
crossAxisSpacing: 12 mainAxisSpacing: 12.h,
.w, // Horizontal spacing between items
mainAxisSpacing: 12
.h, // Vertical spacing between items
), ),
itemCount: itemCount:
indiactivityobj!.data!.length, indiactivityobj!.data!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final activity =
indiactivityobj!.data![index];
return ActivityContainer( return ActivityContainer(
index: indiactivityobj! key: ValueKey(
.data![index].id!, activity.id), // Added ValueKey
titleString: indiactivityobj! index: activity.id!,
.data![index].name!, titleString: activity.name!,
image: indiactivityobj! image: activity.image,
.data![index].image,
// 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices isSelected: _selectedIndices
.contains(indiactivityobj! .contains(activity.id!),
.data![index].id!), gradientColor:
gradientColor: _getGradientColor( _getGradientColor(activity.id!),
indiactivityobj! onTap: (selectedIndex) {
.data![index].id!), setState(() {
onTap: _onContainerTap, if (_selectedIndices
.contains(selectedIndex)) {
_selectedIndices
.remove(selectedIndex);
} else {
_selectedIndices
.add(selectedIndex);
}
});
},
); );
}, },
), ),
sizedBoxHeight(30.h), sizedBoxHeight(30.h),
// text20400FCFCFC("Add other activity"), // text20400FCFCFC("Add other activity"),
// sizedBoxHeight(25.h), // sizedBoxHeight(25.h),
@@ -412,10 +417,10 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
width: 212.w, width: 212.w,
height: 35.h, height: 35.h,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF363636), color: const Color(0xFF363636),
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
border: border: Border.all(
Border.all(color: Color(0xFFD90B2E), width: 1.w)), color: const Color(0xFFD90B2E), width: 1.w)),
child: Center( child: Center(
child: text16400white("Cant find your interest"))), child: text16400white("Cant find your interest"))),
) )
@@ -450,7 +455,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
children: [ children: [
Row( Row(
children: [ children: [
Spacer(), const Spacer(),
InkWell( InkWell(
onTap: () { onTap: () {
Get.back(); Get.back();
@@ -524,7 +529,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
children: [ children: [
Row( Row(
children: [ children: [
Spacer(), const Spacer(),
Image.asset( Image.asset(
"assets/images/png/x-circle.png", "assets/images/png/x-circle.png",
height: 28.h, height: 28.h,
@@ -560,7 +565,8 @@ class ActivityContainer extends StatelessWidget {
final Color gradientColor; final Color gradientColor;
final Function(int) onTap; final Function(int) onTap;
ActivityContainer({ const ActivityContainer({
super.key,
required this.index, required this.index,
required this.titleString, required this.titleString,
required this.image, required this.image,
@@ -584,8 +590,8 @@ class ActivityContainer extends StatelessWidget {
? _firstSelectedIndex == index && ? _firstSelectedIndex == index &&
_isFirstSelectionActive == true _isFirstSelectionActive == true
? [ ? [
Color(0xFF009DAB).withOpacity(0.80), const Color(0xFF009DAB).withOpacity(0.80),
Color(0xFF009DAB).withOpacity(0.77), const Color(0xFF009DAB).withOpacity(0.77),
gradientColor.withOpacity(0.70), gradientColor.withOpacity(0.70),
gradientColor.withOpacity(0.50), gradientColor.withOpacity(0.50),
] ]
@@ -604,7 +610,7 @@ class ActivityContainer extends StatelessWidget {
_isFirstSelectionActive == true _isFirstSelectionActive == true
? BorderSide(width: 0.4.w, color: Colors.transparent) ? BorderSide(width: 0.4.w, color: Colors.transparent)
: BorderSide(width: 3.w, color: gradientColor) : BorderSide(width: 3.w, color: gradientColor)
: BorderSide(width: 2.w, color: Color(0xFF434A53)), : BorderSide(width: 2.w, color: const Color(0xFF434A53)),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
), ),

View File

@@ -1,4 +1,3 @@
import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@@ -6,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart' hide MultipartFile, FormData; import 'package:get/get.dart' hide MultipartFile, FormData;
import 'package:glassmorphism/glassmorphism.dart'; import 'package:path/path.dart' as path;
import 'package:regroup/Common/CommonWidget.dart'; import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/profileimagecontroller.dart'; import 'package:regroup/Common/controller/profileimagecontroller.dart';
@@ -15,14 +14,12 @@ import 'package:regroup/Utils/Common/CommonDropdown.dart';
import 'package:regroup/Utils/Common/CustomNextButton.dart'; import 'package:regroup/Utils/Common/CustomNextButton.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.dart'; import 'package:regroup/Utils/Common/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/ImageUpload.dart'; import 'package:regroup/Utils/Common/ImageUpload.dart';
import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/dialogs.dart'; import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/Utils/texts.dart'; import 'package:regroup/Utils/texts.dart';
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart'; import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
import 'package:regroup/resources/routes/route_name.dart'; import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
import 'package:path/path.dart' as path;
class TellusaboutIndividual extends StatefulWidget { class TellusaboutIndividual extends StatefulWidget {
const TellusaboutIndividual({super.key}); const TellusaboutIndividual({super.key});
@@ -36,6 +33,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
TextEditingController userNameController = TextEditingController(); TextEditingController userNameController = TextEditingController();
TextEditingController datecontroller = TextEditingController(); TextEditingController datecontroller = TextEditingController();
TextEditingController locationcontroller = TextEditingController(); TextEditingController locationcontroller = TextEditingController();
TextEditingController imageFile = TextEditingController();
DateTime? _selectedDate; DateTime? _selectedDate;
final photographController = TextEditingController(); final photographController = TextEditingController();
@@ -132,7 +130,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
void TellusUploadData() async { void TellusUploadData() async {
utils.loader(); utils.loader();
var imageFile; MultipartFile? imageFile;
if (editProfileImage.profilePicPath.value.isNotEmpty) { if (editProfileImage.profilePicPath.value.isNotEmpty) {
imageFile = await MultipartFile.fromFile( imageFile = await MultipartFile.fromFile(
editProfileImage.profilePicPath.value, editProfileImage.profilePicPath.value,
@@ -431,8 +429,10 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
datecontroller.text.isBlank! || datecontroller.text.isBlank! ||
_selectedgendertype.isEmpty || _selectedgendertype.isEmpty ||
locationcontroller.text.isBlank! || locationcontroller.text.isBlank! ||
// imageFile.text.isBlank! ||
editProfileImage.profilePicPath.value == '') { editProfileImage.profilePicPath.value == '') {
utils.showToast('Please fill all fields'); utils
.showToast('Please Upload Profile Picture');
} else { } else {
TellusUploadData(); TellusUploadData();
} }

View File

@@ -520,7 +520,7 @@ class _SignupScreenState extends State<SignupScreen> {
decoration: ShapeDecoration( decoration: ShapeDecoration(
gradient: LinearGradient( gradient: LinearGradient(
begin: const Alignment( begin: const Alignment(
0.71, -0.70), 0.71, -0.70),
end: end:
const Alignment(-0.71, 0.7), const Alignment(-0.71, 0.7),
colors: [ colors: [

View File

@@ -145,6 +145,9 @@ class RouteName {
static const String viewalluserspinned = '/viewallusersspinned'; static const String viewalluserspinned = '/viewallusersspinned';
static const String communitymembers = '/communitymembers';

View File

@@ -73,6 +73,7 @@ import 'package:regroup/sidemenu/Community/Admin/PopupItem/Community%20settings/
import 'package:regroup/sidemenu/Community/Announcements/AnnouncementRequest.dart'; import 'package:regroup/sidemenu/Community/Announcements/AnnouncementRequest.dart';
import 'package:regroup/sidemenu/Community/Announcements/ManageMembers.dart'; import 'package:regroup/sidemenu/Community/Announcements/ManageMembers.dart';
import 'package:regroup/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart'; import 'package:regroup/sidemenu/Community/Announcements/NewAnnouncement/NewAnnounceent.dart';
import 'package:regroup/sidemenu/Community/Members/CommunityMembers.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/AddGroups.dart'; import 'package:regroup/sidemenu/Community/MyCommunity/AddGroups.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/NewCommunity.dart'; import 'package:regroup/sidemenu/Community/MyCommunity/NewCommunity.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/View/RequestsScreen.dart'; import 'package:regroup/sidemenu/Community/MyCommunity/View/RequestsScreen.dart';
@@ -537,10 +538,18 @@ class AppRoutes {
name: RouteName.viewalluserspinned, name: RouteName.viewalluserspinned,
page: () => const Viewtusertags(), page: () => const Viewtusertags(),
), ),
GetPage(
name: RouteName.communitymembers,
page: () => const CommunityMembers(),
),
GetPage( GetPage(
name: RouteName.requestscreen, name: RouteName.requestscreen,
page: () => const RequestsScreen(), page: () => const RequestsScreen(),
), ),
]; ];
} }

View File

@@ -19,36 +19,11 @@ class Group extends StatefulWidget {
} }
class _GroupState extends State<Group> { class _GroupState extends State<Group> {
List GroupData = [
{
"imagepath": "assets/images/png/img45.png",
"title": "Cardio crusaders circle",
"subtitle": "Iron titans fitness crew",
"members": "7 members"
},
{
"imagepath": "assets/images/png/Rectangle 25.png",
"title": "Strength squad syndicate",
"subtitle": "Iron titans fitness crew",
"members": "7 members"
},
{
"imagepath": "assets/images/png/img2.png",
"title": "Flexibility faction force",
"subtitle": "Iron titans fitness crew",
"members": "7 members"
},
];
late Future myfuture;
int id = Get.arguments["id"]; int id = Get.arguments["id"];
bool iscommunity = Get.arguments["iscommunity"]; bool iscommunity = Get.arguments["iscommunity"];
@override @override
void initState() { void initState() {
// TODO: implement initState
// myfuture = Sidegetmethod().getJoinedusergroups(id);
super.initState(); super.initState();
} }
@@ -64,7 +39,7 @@ class _GroupState extends State<Group> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: iscommunity == true body: iscommunity == true
? FutureBuilder( ? FutureBuilder(
future: Getcommunity().getCommunitygroups(1), future: Getcommunity().getCommunitygroups(id),
builder: (ctx, snapshot) { builder: (ctx, snapshot) {
if (snapshot.data == null) { if (snapshot.data == null) {
return const Column( return const Column(

View File

@@ -0,0 +1,267 @@
import 'dart:async';
import 'package:cached_network_image/cached_network_image.dart';
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/CommonWidget.dart';
import 'package:regroup/Common/controller/CommonTextFormField.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/view_model/getmethod.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class CommunityMembers extends StatefulWidget {
const CommunityMembers({super.key});
@override
State<CommunityMembers> createState() => _CommunityMembersState();
}
class _CommunityMembersState extends State<CommunityMembers> {
StreamController<CommunityMembersModel> searchcontroller = StreamController();
int communityid = Get.arguments["communityid"];
@override
void initState() {
print(communityid);
var updata = communityid;
var updata2 = "";
Getcommunity().getCommunityMemberssearch(updata, updata2,
streamController: searchcontroller);
super.initState();
}
@override
void dispose() {
searchcontroller.close();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFF222935),
extendBody: true,
appBar: const CommonAppbar(
titleTxt: "Members",
),
resizeToAvoidBottomInset: false,
body: 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) {
Getcommunity().getCommunityMemberssearch(communityid, value,
streamController: searchcontroller);
},
hintText: "Search people",
),
),
sizedBoxHeight(25.h),
StreamBuilder<CommunityMembersModel>(
stream: searchcontroller.stream,
builder: (ctx, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Display shimmer effect while waiting for data
return const Center(child: CircularProgressIndicator());
} else if (snapshot.hasError) {
// Handle error state
return Center(
child: Text(
'${snapshot.error} occurred',
style: const TextStyle(fontSize: 18),
),
);
} else {
// Data has been loaded, show actual UI
return communitymembersobj!.data.isEmpty
? _buildNoDataBody(context)
: ListView.separated(
physics: const ScrollPhysics(),
shrinkWrap: true,
itemCount: communitymembersobj!.data.length,
separatorBuilder:
(BuildContext context, int index) {
return commonDivider();
},
itemBuilder: (context, index) {
var mainFollowersData =
communitymembersobj!.data[index];
return GestureDetector(
onTap: () {
mainFollowersData
.iamPrincipal!.principalTypeXid ==
1
? Get.toNamed(
RouteName.profiletabindguest,
arguments: {
"FolloweridIndex":
mainFollowersData
.iamPrincipalXid!,
})
: Get.toNamed(
RouteName.profiletabbusguest,
arguments: {
"FolloweridIndex":
mainFollowersData
.iamPrincipalXid!,
});
},
child: Column(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 16.h, horizontal: 16.w),
child: Row(
children: [
mainFollowersData.iamPrincipal!
.profilePhoto ==
null ||
mainFollowersData
.iamPrincipal!
.profilePhoto!
.isEmpty
? CircleAvatar(
backgroundImage: const AssetImage(
'assets/images/png/Ellipse 43.png'),
radius: 25.r,
)
: CircleAvatar(
backgroundImage:
CachedNetworkImageProvider(
mainFollowersData
.iamPrincipal!
.profilePhoto!,
),
// NetworkImage(
// mainFollowersData
// .iamPrincipal!
// .profilePhoto!),
radius: 25.r,
child: CachedNetworkImage(
cacheKey: mainFollowersData
.iamPrincipalXid
.toString(),
maxHeightDiskCache: 100,
maxWidthDiskCache: 100,
imageUrl: mainFollowersData
.iamPrincipal!
.profilePhoto!,
placeholder:
(context, url) =>
Container(),
errorWidget:
(context, url, error) =>
Icon(Icons.error),
imageBuilder: (context,
imageProvider) =>
CircleAvatar(
backgroundImage:
imageProvider,
radius: 25.r,
),
),
),
sizedBoxWidth(10.w),
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
mainFollowersData.iamPrincipal!
.userName ==
null ||
mainFollowersData
.iamPrincipal!
.userName!
.isEmpty ==
true
? text16w400_FCFCFC("Regroup")
: text16w400_FCFCFC(
mainFollowersData
.iamPrincipal!
.userName!),
sizedBoxHeight(4.h),
mainFollowersData.iamPrincipal!
.userName ==
null ||
mainFollowersData
.iamPrincipal!
.userName!
.isEmpty ==
true
? text12w400_FCFCFC_blur(
"regroup")
: text12w400_FCFCFC_blur(
mainFollowersData
.iamPrincipal!
.userName!)
],
),
],
),
)
],
),
);
},
);
}
},
),
])
]),
)
]),
);
}
Widget _buildNoDataBody(context) {
return Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"No Members Found",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: FontWeight.w600),
)
],
),
);
}
}

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:developer'; import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
@@ -333,9 +334,26 @@ class _AddGroupState extends State<AddGroup> {
backgroundImage: AssetImage('assets/images/png/img2.png'), backgroundImage: AssetImage('assets/images/png/img2.png'),
radius: 20.r, radius: 20.r,
) )
: CircleAvatar( :
backgroundImage: NetworkImage(imagePath), // CircleAvatar(
// backgroundImage: NetworkImage(imagePath),
// radius: 20.r,
// ),
CircleAvatar(
backgroundImage: CachedNetworkImageProvider(imagePath),
radius: 20.r, radius: 20.r,
child: CachedNetworkImage(
cacheKey: index.toString(),
maxHeightDiskCache: 100,
maxWidthDiskCache: 100,
imageUrl: imagePath,
placeholder: (context, url) => Container(),
errorWidget: (context, url, error) => Icon(Icons.error),
imageBuilder: (context, imageProvider) => CircleAvatar(
backgroundImage: imageProvider,
radius: 25.r,
),
),
), ),
sizedBoxWidth(10.w), sizedBoxWidth(10.w),
Expanded( Expanded(

View File

@@ -0,0 +1,74 @@
class CommunityMembersModel {
CommunityMembersModel({
required this.status,
required this.statusCode,
required this.message,
required this.data,
});
final String? status;
final int? statusCode;
final String? message;
final List<Datum> data;
factory CommunityMembersModel.fromJson(Map<String, dynamic> json){
return CommunityMembersModel(
status: json["status"],
statusCode: json["status_code"],
message: json["message"],
data: json["data"] == null ? [] : List<Datum>.from(json["data"]!.map((x) => Datum.fromJson(x))),
);
}
}
class Datum {
Datum({
required this.id,
required this.iamPrincipalXid,
required this.manageCommunityXid,
required this.iamPrincipal,
});
final int? id;
final int? iamPrincipalXid;
final int? manageCommunityXid;
final IamPrincipal? iamPrincipal;
factory Datum.fromJson(Map<String, dynamic> json){
return Datum(
id: json["id"],
iamPrincipalXid: json["iam_principal_xid"],
manageCommunityXid: json["manage_community_xid"],
iamPrincipal: json["iam_principal"] == null ? null : IamPrincipal.fromJson(json["iam_principal"]),
);
}
}
class IamPrincipal {
IamPrincipal({
required this.id,
required this.principalTypeXid,
required this.userName,
required this.profilePhoto,
required this.isUserPinned,
});
final int? id;
final int? principalTypeXid;
final String? userName;
final String? profilePhoto;
final bool? isUserPinned;
factory IamPrincipal.fromJson(Map<String, dynamic> json){
return IamPrincipal(
id: json["id"],
principalTypeXid: json["principal_type_xid"],
userName: json["user_name"],
profilePhoto: json["profile_photo"],
isUserPinned: json["is_user_pinned"],
);
}
}

View File

@@ -1,4 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_reaction_button/flutter_reaction_button.dart'; import 'package:flutter_reaction_button/flutter_reaction_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -265,9 +267,8 @@ class _CommunityDetailsState extends State<CommunityDetails> {
]), ]),
sizedBoxHeight(40.h), sizedBoxHeight(40.h),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w), padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column( child: Column(children: [
children: [
Row( Row(
children: [ children: [
text20w700_FCFCFC( text20w700_FCFCFC(
@@ -292,152 +293,166 @@ class _CommunityDetailsState extends State<CommunityDetails> {
], ],
), ),
sizedBoxHeight(30.h), sizedBoxHeight(30.h),
Row( InkWell(
mainAxisAlignment: MainAxisAlignment.center, onTap: () {
children: [ additionalContent = !additionalContent!;
text13w400_FCFCFC("Show Details"), setState(() {});
sizedBoxWidth(4.w), },
InkWell( child: Row(
onTap: () { mainAxisAlignment: MainAxisAlignment.center,
additionalContent = !additionalContent!; children: [
setState(() {}); text13w400_FCFCFC("Show Details"),
}, sizedBoxWidth(4.w),
child: Image.asset( Image.asset(
"assets/images/png/Vector 8.png", "assets/images/png/Vector 8.png",
height: 8.h, height: 8.h,
width: 20.w, width: 20.w,
), )
) ],
], ),
), ),
if (additionalContent == true) if (additionalContent == true)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
sizedBoxHeight(30.h), sizedBoxHeight(30.h),
text16w400_FCFCFC("About community"), text16w400_FCFCFC("About community"),
sizedBoxHeight(16.h), sizedBoxHeight(16.h),
text14w400_FCFCFCblur( text14w400_FCFCFCblur(
""), "Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."),
sizedBoxHeight(20.h), sizedBoxHeight(20.h),
Row( Row(
children: [ children: [
commonGlassUI( commonGlassUI(
width: 35.w, width: 35.w,
height: 35.h, height: 35.h,
opacity1: 0.24, opacity1: 0.24,
opacity2: 0.24, opacity2: 0.24,
borderRadius: BorderRadius.circular(100), borderRadius:
customWidget: Center( BorderRadius.circular(100),
child: Image.asset( customWidget: Center(
"assets/images/png/Group 58645.png", child: Image.asset(
height: 17.h, "assets/images/png/Group 58645.png",
width: 13.w, height: 17.h,
width: 13.w,
),
), ),
), borderwidth: 0.5),
borderwidth: 0.5), sizedBoxWidth(12.w),
sizedBoxWidth(12.w), text16400white(
text16400white( "Elm street london, United Kingdom")
"Elm street london, United Kingdom") ],
], ),
), sizedBoxHeight(16.h),
sizedBoxHeight(16.h), Row(
Row( children: [
children: [ commonGlassUI(
commonGlassUI( width: 35.w,
width: 35.w, height: 35.h,
height: 35.h, opacity1: 0.24,
opacity1: 0.24, opacity2: 0.24,
opacity2: 0.24, borderRadius:
borderRadius: BorderRadius.circular(100), BorderRadius.circular(100),
customWidget: Center( customWidget: Center(
child: Image.asset( child: Image.asset(
"assets/images/png/puzzle-pieces 1 (traced).png", "assets/images/png/puzzle-pieces 1 (traced).png",
height: 20.h, height: 20.h,
width: 16.w, width: 16.w,
),
), ),
), borderwidth: 0.5),
borderwidth: 0.5), sizedBoxWidth(12.w),
sizedBoxWidth(12.w), text16400white("Sports")
text16400white("Sports") ],
], ),
), sizedBoxHeight(20.h),
sizedBoxHeight(20.h), commonGlassUI(
commonGlassUI(
width: double.infinity, width: double.infinity,
height: 51.h, height: 51.h,
borderRadius: BorderRadius.circular(10.r), borderRadius: BorderRadius.circular(10.r),
customWidget: Column( customWidget: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Row( GestureDetector(
children: [ onTap: () {
sizedBoxWidth(16.w), Get.toNamed(
stackContainers( RouteName.communitymembers,
number: "+2", arguments: {
containerImages: [ 'communityid': CommunityId,
"assets/images/png/cimg3.png", });
"assets/images/png/cimg2.png", },
"assets/images/png/cimg3.png", child: Row(
"assets/images/png/cimg2.png", children: [
], sizedBoxWidth(16.w),
), stackContainers(
sizedBoxWidth(90.w), number: "+2",
text16w400_white('7 members'), containerImages: [
Spacer(), "assets/images/png/cimg3.png",
Icon( "assets/images/png/cimg2.png",
Icons.arrow_forward, "assets/images/png/cimg3.png",
size: 20.sp, "assets/images/png/cimg2.png",
color: Colors.white, ],
),
sizedBoxWidth(16.w),
],
),
],
),
borderwidth: 1.w),
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.addgroup);
},
child: commonGlassUI(
width: double.infinity,
height: 51.h,
borderRadius: BorderRadius.circular(10.r),
customWidget: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Row(children: [
Image.asset(
"assets/images/png/Black.png",
height: 23.h,
width: 31.w,
), ),
sizedBoxWidth(15.w), sizedBoxWidth(90.w),
text16w400white('10 groups'), text16w400_white('7 members'),
Spacer(), Spacer(),
Icon( Icon(
Icons.arrow_forward, Icons.arrow_forward,
size: 20.sp, size: 20.sp,
color: Colors.white, color: Colors.white,
), ),
]), sizedBoxWidth(16.w),
], ],
),
), ),
), ],
borderwidth: 1), ),
), ),
], sizedBoxHeight(20.h),
), GestureDetector(
sizedBoxHeight(40.h), onTap: () {
Get.toNamed(RouteName.addgroup);
},
child: commonGlassUI(
width: double.infinity,
height: 51.h,
borderRadius: BorderRadius.circular(10.r),
customWidget: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Row(children: [
Image.asset(
"assets/images/png/Black.png",
height: 23.h,
width: 31.w,
),
sizedBoxWidth(15.w),
text16w400white('10 groups'),
Spacer(),
Icon(
Icons.arrow_forward,
size: 20.sp,
color: Colors.white,
),
]),
],
),
),
borderwidth: 1),
),
]),
sizedBoxHeight(25.h),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
Get.toNamed(RouteName.announcement); // Get.toNamed(RouteName.addgroup);
Get.toNamed(RouteName.group, arguments: {
'id': CommunityId,
'iscommunity': true,
});
}, },
child: commonGlassUI( child: commonGlassUI(
width: double.infinity, width: double.infinity,
@@ -473,7 +488,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
), ),
borderwidth: 1), borderwidth: 1),
), ),
sizedBoxHeight(35.h), sizedBoxHeight(40.h),
Container( Container(
height: 40.h, height: 40.h,
width: 200.w, width: 200.w,
@@ -484,9 +499,7 @@ class _CommunityDetailsState extends State<CommunityDetails> {
child: text14w400white("Leave the community")), child: text14w400white("Leave the community")),
), ),
sizedBoxHeight(50.h), sizedBoxHeight(50.h),
], ])),
),
),
DefaultTabController( DefaultTabController(
length: 2, length: 2,
// initialIndex: selectedIndex.value, // initialIndex: selectedIndex.value,

View File

@@ -4,11 +4,14 @@ import 'dart:developer';
import 'package:regroup/Common/api_urls.dart'; import 'package:regroup/Common/api_urls.dart';
import 'package:regroup/Common/base_manager.dart'; import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/data/network/network_api.dart'; import 'package:regroup/Common/controller/data/network/network_api.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityMebersModel.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart'; import 'package:regroup/sidemenu/Community/MyCommunity/Model/communityaddgroupsModel.dart';
import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart'; import 'package:regroup/sidemenu/Community/MyCommunity/Model/communitygroupsModel.dart';
CommunityAddgroupsModel? communityaddgroupobj; CommunityAddgroupsModel? communityaddgroupobj;
CommunitygroupsModel? communitygroupspobj; CommunitygroupsModel? communitygroupspobj;
CommunityMembersModel? communitymembersobj;
@@ -41,4 +44,19 @@ class Getcommunity {
return response; return response;
} }
Future<ResponseData<dynamic>> getCommunityMemberssearch(updata,updata2,
{required StreamController<CommunityMembersModel> streamController}) async {
final response =
await NetworkApiServices().getApi(
"${ApiUrls.getcommunitymembers}?manage_community_xid=$updata&search=$updata2",
);
if (response.status == ResponseStatus.SUCCESS) {
communitymembersobj = CommunityMembersModel.fromJson(response.data);
if (!streamController.isClosed) streamController.sink.add(communitymembersobj!);
}
return response;
}
} }

View File

@@ -1214,7 +1214,7 @@ packages:
source: hosted source: hosted
version: "7.0.0" version: "7.0.0"
sqflite: sqflite:
dependency: transitive dependency: "direct main"
description: description:
name: sqflite name: sqflite
sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d

View File

@@ -77,6 +77,9 @@ dependencies:
flutter_html: ^3.0.0-beta.2 flutter_html: ^3.0.0-beta.2
comment_tree: ^0.3.0 comment_tree: ^0.3.0
flutter_keyboard_visibility: ^6.0.0 flutter_keyboard_visibility: ^6.0.0
sqflite: ^2.3.3+1
cached_network_image: any cached_network_image: any