Compare commits
7 Commits
ab9c2367bf
...
Developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bc84a0a98 | ||
|
|
d40658c6d3 | ||
|
|
459021c40f | ||
|
|
c2ba93738d | ||
|
|
2a2c0586f4 | ||
|
|
4d9ae79067 | ||
|
|
985b00b1c7 |
BIN
assets/images/png/Ellipse 37 (1).png
Normal file
BIN
assets/images/png/Ellipse 37 (1).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
BIN
assets/images/png/Rectangle 49 (1).png
Normal file
BIN
assets/images/png/Rectangle 49 (1).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 MiB |
BIN
assets/images/png/edit 1.png
Normal file
BIN
assets/images/png/edit 1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -55,9 +55,27 @@ class ApiUrls {
|
||||
|
||||
static const postremoveuser = "${baseUrl}remove-follower";
|
||||
|
||||
static const postchangepassword = "${baseUrl}update-password-send-otp";
|
||||
|
||||
static const postchangepassverify = "${baseUrl}verify-update-password-otp";
|
||||
|
||||
|
||||
|
||||
static const postnotification = "${baseUrl}update-notification-settings";
|
||||
static const getnotification = "${baseUrl}fetch-notification-settings";
|
||||
|
||||
static const getblockuser = "${baseUrl}fetch-blocked-profile";
|
||||
static const postblockuser = "${baseUrl}block-profile";
|
||||
|
||||
|
||||
// Individual
|
||||
static const posteditprofile = "${baseUrl}update-profile";
|
||||
static const geteditprofile = "${baseUrl}fetch-profile";
|
||||
|
||||
// Business
|
||||
static const posteditprofilebusiness = "${baseUrl}update-business-profile";
|
||||
static const geteditprofilebusiness = "${baseUrl}fetch-business-profile";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:regroup/Feed%20Module/Main_Screens/Chats/View/chatsmainscreen.da
|
||||
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/Community/Community.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupTab.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/ProfileTab.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart';
|
||||
|
||||
class MainController extends GetxController {
|
||||
var selectedIndex = 0.obs;
|
||||
|
||||
@@ -224,11 +224,13 @@ class _NewPostState extends State<NewPost> {
|
||||
CustomDropDownCheckBox(
|
||||
header: "",
|
||||
title: "",
|
||||
|
||||
listData: [
|
||||
'Active alliance network',
|
||||
'Fitfam federation',
|
||||
'The athletic town',
|
||||
'Football fever'
|
||||
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
images: [
|
||||
|
||||
@@ -1,276 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonDropDown.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class EditProfile extends StatefulWidget {
|
||||
const EditProfile({super.key});
|
||||
|
||||
@override
|
||||
State<EditProfile> createState() => _EditProfileState();
|
||||
}
|
||||
|
||||
class _EditProfileState extends State<EditProfile> {
|
||||
TextEditingController dateController = TextEditingController();
|
||||
|
||||
List<File?> filePath = [];
|
||||
bool? isImageAdded = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Stack(
|
||||
children: [
|
||||
filePath.isNotEmpty
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: Image.file(
|
||||
filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
"assets/images/png/cimg3.png",
|
||||
),
|
||||
radius: 50.r,
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
var file = File(result);
|
||||
|
||||
filePath.add(file);
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: 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(
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Edward Hackett",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("User name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "edward_01",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Date of birth"),
|
||||
sizedBoxHeight(16.h),
|
||||
GestureDetector(
|
||||
onTap: () => datePicker(context, dateController),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
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(
|
||||
header: "Male",
|
||||
title: "",
|
||||
showOtherOption: true,
|
||||
listData: ["Male", "Female", "Prefer not to say"],
|
||||
onItemSelected: (p0) {},
|
||||
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(
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Elm street london, United Kingdom",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("Primary sport"),
|
||||
sizedBoxWidth(6.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomDropDownRadio(
|
||||
showOtherOption: true,
|
||||
header: "Rowing, Rugby, Swimming",
|
||||
title: "",
|
||||
listData: [
|
||||
"Rowing",
|
||||
"Cycling",
|
||||
"Running",
|
||||
"Swimming",
|
||||
"Triathlon",
|
||||
"Hiking",
|
||||
"Football",
|
||||
"Rugby"
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
// CommonDropdownradioBtn(
|
||||
// hint: "Rowing, Rugby, Swimming",
|
||||
// items: [
|
||||
// "Rowing",
|
||||
// "Cycling",
|
||||
// "Running",
|
||||
// "Swimming",
|
||||
// "Triathlon",
|
||||
// "Hiking",
|
||||
// "Football",
|
||||
// "Rugby"
|
||||
// ],
|
||||
// leadingIcon: Image.asset(
|
||||
// "assets/images/png/Vector (4).png",
|
||||
// width: 18.w,
|
||||
// height: 17.h,
|
||||
// ),
|
||||
// showOtherOption: true,
|
||||
// ),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Bio"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField2(
|
||||
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,
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
CommonBtn(text: "Save"),
|
||||
sizedBoxHeight(60.h),
|
||||
],
|
||||
)
|
||||
])))
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
class GetEditProfileBus {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
GetEditProfileBus({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetEditProfileBus.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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<String, dynamic> json) {
|
||||
following = json['following'];
|
||||
followers = json['followers'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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<String, dynamic> 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<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
class GetEditProfileIndi {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
Data? data;
|
||||
|
||||
GetEditProfileIndi({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
GetEditProfileIndi.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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>? interest;
|
||||
String? about;
|
||||
String? position;
|
||||
String? trainingScores;
|
||||
String? height;
|
||||
String? weight;
|
||||
String? battingAverage;
|
||||
Follows? follows;
|
||||
|
||||
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});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> 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 = <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;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Interest {
|
||||
int? id;
|
||||
String? name;
|
||||
|
||||
Interest({this.id, this.name});
|
||||
|
||||
Interest.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['name'] = this.name;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Follows {
|
||||
int? following;
|
||||
int? followers;
|
||||
|
||||
Follows({this.following, this.followers});
|
||||
|
||||
Follows.fromJson(Map<String, dynamic> json) {
|
||||
following = json['following'];
|
||||
followers = json['followers'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['following'] = this.following;
|
||||
data['followers'] = this.followers;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,423 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide MultipartFile, FormData;
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/ProfileTab.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||
import 'package:regroup/Utils/Common/ImageUpload.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
|
||||
import '../../../../../Utils/Common/CustomTextformfield.dart';
|
||||
|
||||
class BusEditProfile extends StatefulWidget {
|
||||
const BusEditProfile({super.key});
|
||||
|
||||
@override
|
||||
State<BusEditProfile> createState() => _BusEditProfileState();
|
||||
}
|
||||
|
||||
class _BusEditProfileState extends State<BusEditProfile> {
|
||||
TextEditingController busNameController = TextEditingController();
|
||||
TextEditingController busUserNameController = TextEditingController();
|
||||
TextEditingController ownerNameController = TextEditingController();
|
||||
|
||||
TextEditingController foundedonController = TextEditingController();
|
||||
TextEditingController websiteLinkController = TextEditingController();
|
||||
TextEditingController locationController = TextEditingController();
|
||||
TextEditingController bioController = TextEditingController();
|
||||
|
||||
String profilePicture = "";
|
||||
bool isImageAdded = false;
|
||||
|
||||
bool isOnce = true;
|
||||
late Future myfuture;
|
||||
|
||||
convertFileToMultiPart(String? file) async {
|
||||
return await MultipartFile.fromFile(
|
||||
file!,
|
||||
filename: path.basename(file),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
myfuture = EditProfileApi()
|
||||
.getEditProfileBusiness()
|
||||
.then((value) => {setValues()});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
//Founded on & bio data not there
|
||||
|
||||
setValues() {
|
||||
if (isOnce) {
|
||||
busNameController.text = getEditProfileBus!.data!.businessName ?? '';
|
||||
busUserNameController.text = getEditProfileBus!.data!.businessName ?? '';
|
||||
ownerNameController.text =
|
||||
getEditProfileBus!.data!.businessOwnerName ?? '';
|
||||
foundedonController.text =
|
||||
getEditProfileBus!.data!.businessOwnerName ?? '';
|
||||
websiteLinkController.text = getEditProfileBus!.data!.websiteLink ?? '';
|
||||
locationController.text = getEditProfileBus!.data!.businessLocation ?? '';
|
||||
|
||||
bioController.text = getEditProfileBus!.data!.businessOwnerName ?? '';
|
||||
|
||||
// _selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
|
||||
// _selectedsportType = getEditProfileIndi!.data!.interest!.join(', ') ?? '';
|
||||
|
||||
isOnce = false;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
void saveEditProfileBus() async {
|
||||
FormData? updata;
|
||||
if (busNameController.text.isBlank! ||
|
||||
busUserNameController.text.isBlank! ||
|
||||
ownerNameController.text.isBlank! ||
|
||||
foundedonController.text.isBlank! ||
|
||||
websiteLinkController.text.isBlank! ||
|
||||
locationController.text.isBlank! ||
|
||||
bioController.text.isBlank!) {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'Enter your credentials',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
} else if (profilePicture == "") {
|
||||
utils.showToast('Upload edit profile picture!');
|
||||
} else {
|
||||
updata = FormData.fromMap({
|
||||
"business_name": busNameController.text,
|
||||
"business_username": busUserNameController.text,
|
||||
"business_owner_name": ownerNameController.text,
|
||||
"founded_on": foundedonController.text,
|
||||
"website_link": websiteLinkController.text,
|
||||
"business_location": locationController.text,
|
||||
"bio": bioController.text,
|
||||
"business_profile": await convertFileToMultiPart(profilePicture),
|
||||
});
|
||||
|
||||
final data = await EditProfileApi().postEditProfileBusiness(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
// await global.setname();
|
||||
// Get.snackbar(
|
||||
// "Success!",
|
||||
// 'success!',
|
||||
// duration: Duration(seconds: 2),
|
||||
// colorText: Colors.white,
|
||||
// backgroundColor: Colors.green,
|
||||
// margin: EdgeInsets.all(8),
|
||||
// snackStyle: SnackStyle.FLOATING,
|
||||
// snackPosition: SnackPosition.BOTTOM,
|
||||
// );
|
||||
utils.showToast("Data Saved Successfully");
|
||||
// Get.back();
|
||||
Get.toNamed(RouteName.profiletab);
|
||||
// Get.back(result: true);
|
||||
} else {
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.data['message'],
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
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(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Stack(
|
||||
children: [
|
||||
profilePicture != "" && isImageAdded
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: Image.file(
|
||||
File(profilePicture),
|
||||
// filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: getEditProfileBus!.data!.businessLogo !=
|
||||
null
|
||||
? Container(
|
||||
width: 100.w,
|
||||
height: 100.h,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(
|
||||
image: Image(
|
||||
image: NetworkImage(
|
||||
getEditProfileBus!.data!
|
||||
.businessLogo ??
|
||||
''),
|
||||
).image,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
shape: OvalBorder(),
|
||||
),
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
"assets/images/png/Ellipse 37 (1).png",
|
||||
),
|
||||
radius: 50.r,
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
var filenameresult =
|
||||
extractFileName(result);
|
||||
|
||||
profilePicture = result;
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: 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(30.h),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white("Business name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: busNameController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Victory gear sports emporium",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Business username"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: busUserNameController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "victorygames _10",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Owner name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: ownerNameController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "James Bothman",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Founded on"),
|
||||
sizedBoxHeight(16.h),
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
datePicker(context, foundedonController),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
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:
|
||||
foundedonController,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Website link"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: websiteLinkController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector2a.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "victorygames _10",
|
||||
),
|
||||
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: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Elm street london, United Kingdom",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Bio"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField2(
|
||||
textEditingController: bioController,
|
||||
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,
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
CommonBtn(
|
||||
text: "Save",
|
||||
onTap: () {
|
||||
saveEditProfileBus();
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
],
|
||||
)
|
||||
])))
|
||||
]);
|
||||
}
|
||||
return Container();
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,525 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart' hide MultipartFile, FormData;
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/ViewModel/EditProfileApi.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.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/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
class EditProfile extends StatefulWidget {
|
||||
const EditProfile({super.key});
|
||||
|
||||
@override
|
||||
State<EditProfile> createState() => _EditProfileState();
|
||||
}
|
||||
|
||||
class _EditProfileState extends State<EditProfile> {
|
||||
TextEditingController fullNameController = TextEditingController();
|
||||
TextEditingController userNameController = TextEditingController();
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController locationController = TextEditingController();
|
||||
TextEditingController aboutController = TextEditingController();
|
||||
TextEditingController positionController = TextEditingController();
|
||||
TextEditingController trainingScoresController = TextEditingController();
|
||||
TextEditingController heightController = TextEditingController();
|
||||
TextEditingController weightController = TextEditingController();
|
||||
TextEditingController battingAvgController = TextEditingController();
|
||||
|
||||
String profilePicture = "";
|
||||
bool isImageAdded = false;
|
||||
|
||||
bool isOnce = true;
|
||||
late Future myfuture;
|
||||
|
||||
convertFileToMultiPart1(String? file) async {
|
||||
return await MultipartFile.fromFile(
|
||||
file!,
|
||||
filename: path.basename(file),
|
||||
);
|
||||
}
|
||||
|
||||
String extractFileName1(String filePath) {
|
||||
return path.basename(filePath);
|
||||
}
|
||||
|
||||
String _selectedgenderType = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_selectedgenderType = value;
|
||||
});
|
||||
}
|
||||
|
||||
String _selectedsportType = '';
|
||||
List<String> _selectedSports = [];
|
||||
|
||||
void _onSportSelected(List<String> selectedValues) {
|
||||
setState(() {
|
||||
_selectedSports = selectedValues;
|
||||
_selectedsportType = _selectedSports.join(', ');
|
||||
});
|
||||
}
|
||||
|
||||
List<int> getSelectedSportsIds() {
|
||||
if (getEditProfileIndi == null ||
|
||||
getEditProfileIndi!.data!.interest == null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return _selectedSports
|
||||
.map((sportName) => getEditProfileIndi!.data!.interest!
|
||||
.firstWhere((interest) => interest.name == sportName)
|
||||
.id!)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
myfuture = EditProfileApi()
|
||||
.getEditProfileIndividual()
|
||||
.then((value) => {setValues()});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
setValues() {
|
||||
if (isOnce) {
|
||||
fullNameController.text = getEditProfileIndi!.data!.fullName ?? '';
|
||||
userNameController.text = getEditProfileIndi!.data!.userName ?? '';
|
||||
dateController.text = getEditProfileIndi!.data!.dateOfBirth ?? '';
|
||||
|
||||
_selectedgenderType = getEditProfileIndi!.data!.gender ?? '';
|
||||
_selectedSports =
|
||||
getEditProfileIndi!.data!.interest!.map((e) => e.name!).toList();
|
||||
_selectedsportType = _selectedSports.join(', ');
|
||||
|
||||
isOnce = false;
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
void saveEditProfileInd() async {
|
||||
List<int> selectedSportsIds = getSelectedSportsIds();
|
||||
FormData? updata;
|
||||
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',
|
||||
'Enter your credentials',
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
} else if (profilePicture == "") {
|
||||
utils.showToast('Upload edit profile picture!');
|
||||
} else {
|
||||
updata = FormData.fromMap({
|
||||
"email_address": "priyanka12@yopmail.com",
|
||||
"full_name": fullNameController.text,
|
||||
"profile_image": await convertFileToMultiPart1(profilePicture),
|
||||
// "profile_image": "ghjkk.png",
|
||||
|
||||
"user_name": userNameController.text,
|
||||
"date_of_birth": dateController.text,
|
||||
"gender": _selectedgenderType,
|
||||
// "interest": "selectedSportsIds",
|
||||
"interest": ["1", "2", "3"].toList(),
|
||||
"about": aboutController.text,
|
||||
"position": positionController.text,
|
||||
"training_scores": trainingScoresController.text,
|
||||
"height": heightController.text,
|
||||
"weight": weightController.text,
|
||||
"batting_average": battingAvgController.text,
|
||||
"address_line1": battingAvgController.text,
|
||||
});
|
||||
|
||||
final data = await EditProfileApi().postEditProfileIndividual(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
// await global.setname();
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'success!',
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
Get.back();
|
||||
|
||||
// Get.toNamed(RouteName.individualgroupstep3);
|
||||
Get.back();
|
||||
} else {
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.data['message'],
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
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(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Stack(
|
||||
children: [
|
||||
profilePicture != "" && isImageAdded
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: Image.file(
|
||||
File(profilePicture),
|
||||
// filePath[0]!,
|
||||
fit: BoxFit.cover,
|
||||
width: double.infinity,
|
||||
),
|
||||
),
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
"assets/images/png/cimg3.png",
|
||||
),
|
||||
radius: 50.r,
|
||||
),
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
true,
|
||||
(result) {
|
||||
var filenameresult =
|
||||
extractFileName1(result);
|
||||
|
||||
profilePicture = result;
|
||||
isImageAdded = true;
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 35.h,
|
||||
width: 35.w,
|
||||
decoration: 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: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Edward Hackett",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("User name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: userNameController,
|
||||
leadingIcon: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "edward_01",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Date of birth"),
|
||||
sizedBoxHeight(16.h),
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
datePicker(context, dateController),
|
||||
child: AbsorbPointer(
|
||||
child: CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
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(
|
||||
header: _selectedgenderType ?? "Male",
|
||||
title: "",
|
||||
showOtherOption: true,
|
||||
listData: [
|
||||
"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: Container(
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Elm street london, United Kingdom",
|
||||
),
|
||||
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: _selectedsportType ??
|
||||
"Rowing, Rugby, Swimming",
|
||||
title: "",
|
||||
listData: [
|
||||
"Rowing",
|
||||
"Cycling",
|
||||
"Running",
|
||||
"Swimming",
|
||||
"Triathlon",
|
||||
"Hiking",
|
||||
"Football",
|
||||
"Rugby"
|
||||
],
|
||||
onItemSelected: _onSportSelected,
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
width: 18.w,
|
||||
height: 17.h,
|
||||
),
|
||||
showOtherOption: true,
|
||||
initiallySelected: _selectedSports,
|
||||
),
|
||||
// CustomDropDownRadio(
|
||||
// showOtherOption: true,
|
||||
// header: _selectedsportType ??
|
||||
// "Rowing, Rugby, Swimming",
|
||||
// title: "",
|
||||
// listData: [
|
||||
// "Rowing",
|
||||
// "Cycling",
|
||||
// "Running",
|
||||
// "Swimming",
|
||||
// "Triathlon",
|
||||
// "Hiking",
|
||||
// "Football",
|
||||
// "Rugby"
|
||||
// ],
|
||||
// onItemSelected: _onSportSelected,
|
||||
// leadingImage: Image.asset(
|
||||
// "assets/images/png/Vector (4).png",
|
||||
// width: 18.w,
|
||||
// height: 17.h,
|
||||
// ),
|
||||
// ),
|
||||
|
||||
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,
|
||||
),
|
||||
// sizedBoxHeight(20.h),
|
||||
|
||||
text16400white("Position"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: positionController,
|
||||
hintText: "Lorem Ipsum",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Training Scores"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController:
|
||||
trainingScoresController,
|
||||
hintText: "50",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Height"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: heightController,
|
||||
hintText: "6 feet",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Weight"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: weightController,
|
||||
hintText: "70kg",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Batting Average"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: battingAvgController,
|
||||
hintText: "372",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
sizedBoxHeight(60.h),
|
||||
CommonBtn(
|
||||
text: "Save",
|
||||
onTap: () {
|
||||
saveEditProfileInd();
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(60.h),
|
||||
],
|
||||
)
|
||||
])))
|
||||
]);
|
||||
}
|
||||
return Container();
|
||||
}));
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
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/EditProfile/Model/GetEditProfileBus.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/Model/GetEditProfileIndi.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
GetEditProfileIndi? getEditProfileIndi;
|
||||
GetEditProfileBus? getEditProfileBus;
|
||||
|
||||
class EditProfileApi {
|
||||
EditProfileApi();
|
||||
|
||||
Future<ResponseData<dynamic>> postEditProfileIndividual(var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response =
|
||||
await NetworkApiServices().postApi(data, ApiUrls.posteditprofile);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data['status'] == 'success') {
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getEditProfileIndividual() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.geteditprofile,
|
||||
);
|
||||
getEditProfileIndi = GetEditProfileIndi.fromJson(response.data);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
print("Success---->");
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postEditProfileBusiness(var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices()
|
||||
.postApi(data, ApiUrls.posteditprofilebusiness);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data['status'] == 'success') {
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getEditProfileBusiness() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.geteditprofilebusiness,
|
||||
);
|
||||
getEditProfileBus = GetEditProfileBus.fromJson(response.data);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
print("Success---->");
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,813 @@
|
||||
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<profiletabBusGest> createState() => _profiletabBusGestState();
|
||||
}
|
||||
|
||||
class _profiletabBusGestState extends State<profiletabBusGest> {
|
||||
@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) =>
|
||||
<PopupMenuEntry>[
|
||||
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<String> containerTitle,
|
||||
}) {
|
||||
var mainImage = 'assets/images/png/uiw_like-o.png'.obs;
|
||||
void updateImage(String reaction) {
|
||||
if (reaction == 'like') {
|
||||
mainImage.value = 'assets/images/png/f7_hand-thumbsup.png';
|
||||
} else if (reaction == 'heart') {
|
||||
mainImage.value = 'assets/images/png/heart 2.png';
|
||||
} else if (reaction == 'party') {
|
||||
mainImage.value = 'assets/images/png/party-popper 2.png';
|
||||
}
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
foregroundImage: AssetImage(profileImg),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(5.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/community 1 (traced).png',
|
||||
height: 14.w,
|
||||
width: 14.w,
|
||||
),
|
||||
sizedBoxWidth(7.w),
|
||||
text12w400_FCFCFC('Active alliance network'),
|
||||
sizedBoxWidth(7.w),
|
||||
Icon(
|
||||
Icons.circle,
|
||||
color: Color(0xFFFCFCFC),
|
||||
size: 4.sp,
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
text12w400_FCFCFC('1 Hour ago'),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 176.w),
|
||||
offset: Offset(0, 50),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'Report Post',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Vector (5).png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'Share post',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/share.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'Pin',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 25.h,
|
||||
width: 25.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Image.asset(
|
||||
'assets/images/png/Group 1000004071.png',
|
||||
width: 16.w,
|
||||
height: 18.h,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(5.w)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.postdetailsScreen);
|
||||
},
|
||||
child: Container(
|
||||
height: 163.h,
|
||||
width: double.infinity,
|
||||
child: Image.asset(
|
||||
mainImg,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(children: [
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
itemCount: containerTitle.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(right: 12.w),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.cyclescreen);
|
||||
},
|
||||
child: containertile(text: containerTitle[index])),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."),
|
||||
Row(children: [
|
||||
stackReaction(number: '20', containerImages: [
|
||||
'assets/images/png/f7_hand-thumbsup.png',
|
||||
'assets/images/png/heart 2.png',
|
||||
'assets/images/png/party-popper 2.png'
|
||||
]),
|
||||
Spacer(),
|
||||
commonContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.2,
|
||||
opacity2: 0.2,
|
||||
borderwidth: 0.43,
|
||||
boxShape: BoxShape.circle,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/Frame 1000004088.png',
|
||||
height: 13.h,
|
||||
width: 13.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text14w400_FCFCFC('20'),
|
||||
sizedBoxWidth(20.w),
|
||||
commonContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.2,
|
||||
opacity2: 0.2,
|
||||
borderwidth: 0.43,
|
||||
boxShape: BoxShape.circle,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/Vector (1).png',
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text14w400_FCFCFC('10'),
|
||||
]),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Obx(() {
|
||||
return ReactionButton<String>(
|
||||
onReactionChanged: (reaction) {
|
||||
updateImage(reaction?.value ?? 'like');
|
||||
debugPrint('Selected value: ${reaction?.value}');
|
||||
},
|
||||
reactions: <Reaction<String>?>[
|
||||
Reaction<String>(
|
||||
value: 'like',
|
||||
previewIcon: _buildReactionsPreviewIcon(
|
||||
'assets/images/png/f7_hand-thumbsup.png'),
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/f7_hand-thumbsup.png'),
|
||||
),
|
||||
Reaction<String>(
|
||||
value: 'heart',
|
||||
previewIcon: _buildReactionsPreviewIcon(
|
||||
'assets/images/png/heart 2.png'),
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/heart 2.png'),
|
||||
),
|
||||
Reaction<String>(
|
||||
value: 'party',
|
||||
previewIcon: _buildReactionsPreviewIcon(
|
||||
'assets/images/png/party-popper 2.png'),
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/party-popper 2.png'),
|
||||
),
|
||||
],
|
||||
selectedReaction: Reaction<String>(
|
||||
value: 'like',
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/f7_hand-thumbsup.png'),
|
||||
),
|
||||
boxColor: Colors.white,
|
||||
boxElevation: 9,
|
||||
boxRadius: 30,
|
||||
itemsSpacing: 8,
|
||||
itemScale: 0.4,
|
||||
itemSize: Size(45, 45),
|
||||
boxPadding: EdgeInsets.all(8),
|
||||
boxAnimationDuration: Duration(milliseconds: 200),
|
||||
itemAnimationDuration: Duration(milliseconds: 500),
|
||||
hoverDuration: Duration(milliseconds: 700),
|
||||
// toggle: false,
|
||||
|
||||
child: _buildReactionsIcon(mainImage.value),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.postdetailsScreen);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/Frame 1000004088.png',
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
text11w400_FCFCFC('Comment')
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/Frame 1000004089.png',
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
text11w400_FCFCFC('Save')
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildReactionsPreviewIcon(String assetPath) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
assetPath,
|
||||
height: 40.h,
|
||||
width: 40.w,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildReactionsIcon(String assetPath) {
|
||||
return Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
assetPath,
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
text11w400_FCFCFC('Like')
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget containertile({required String text}) {
|
||||
return commonContainer(
|
||||
width: 100.w,
|
||||
height: 30.h,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
borderColor: Color(0xFFD90B2E),
|
||||
borderwidth: 0.9,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
));
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,410 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonTabBar.dart';
|
||||
import 'package:regroup/Common/CommonWidget.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/texts.dart';
|
||||
|
||||
class MyNetwork extends StatefulWidget {
|
||||
const MyNetwork({super.key});
|
||||
|
||||
@override
|
||||
State<MyNetwork> createState() => _MyNetworkState();
|
||||
}
|
||||
|
||||
class _MyNetworkState extends State<MyNetwork> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "My networks",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
sizedBoxHeight(16.h),
|
||||
Expanded(
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
// initialIndex: selectedIndex.value,
|
||||
child: Column(children: [
|
||||
CommonTabBar(tabs: const [
|
||||
Tab(
|
||||
text: 'Followers',
|
||||
),
|
||||
Tab(
|
||||
text: 'Following',
|
||||
),
|
||||
]),
|
||||
Expanded(
|
||||
child: TabBarView(
|
||||
children: [
|
||||
followersTab(),
|
||||
followingTab(),
|
||||
],
|
||||
),
|
||||
),
|
||||
])),
|
||||
)
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
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",
|
||||
},
|
||||
];
|
||||
|
||||
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",
|
||||
),
|
||||
),
|
||||
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) =>
|
||||
<PopupMenuEntry>[
|
||||
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,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
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",
|
||||
),
|
||||
),
|
||||
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) =>
|
||||
<PopupMenuEntry>[
|
||||
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,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,919 +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/CommonBottomNavigationBar.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/controller/MainScreen.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';
|
||||
|
||||
class ProfileTab extends StatefulWidget {
|
||||
const ProfileTab({super.key});
|
||||
|
||||
@override
|
||||
State<ProfileTab> createState() => _ProfileTabState();
|
||||
}
|
||||
|
||||
class _ProfileTabState extends State<ProfileTab> {
|
||||
List cardtile = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 29ss.png",
|
||||
"title": "Cardio crusaders circle"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 31ee.png",
|
||||
"title": "Strength squad syndicate"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 30aa.png",
|
||||
"title": "Flexibility faction force"
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Rectangle 29ss.png",
|
||||
"title": "Cardio crusaders circle"
|
||||
},
|
||||
];
|
||||
|
||||
List 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"
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
body: 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(
|
||||
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("Edit profile")),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.shareProfile);
|
||||
},
|
||||
child: commonGlassUI(
|
||||
width: 170.w,
|
||||
height: 40.h,
|
||||
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
mainOpacity: 1,
|
||||
customWidget: Center(
|
||||
child: text16w400_FCFCFC("Share profile"),
|
||||
),
|
||||
// border: 1,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
text18w700white("Bio"),
|
||||
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"),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.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(40.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.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),
|
||||
text18w700white("Posts"),
|
||||
]),
|
||||
),
|
||||
normalcardtile(
|
||||
profileImg: 'assets/images/png/Ellipse 48.png',
|
||||
title: 'Jocelyn Dokidis',
|
||||
mainImg: 'assets/images/png/Rectangle 46.png',
|
||||
containerTitle: [
|
||||
'Race',
|
||||
'Swimming',
|
||||
'Events',
|
||||
'Marathon',
|
||||
'Events'
|
||||
]),
|
||||
sizedBoxHeight(120.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned.fill(
|
||||
top: 40.h,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.settings);
|
||||
},
|
||||
child: commonContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderwidth: 0.5,
|
||||
boxShape: BoxShape.circle,
|
||||
opacity1: 0.5,
|
||||
opacity2: 0.6,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/setting2.png',
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
bottomNavigationBar: bottomnavigationbar(mainController),
|
||||
);
|
||||
}
|
||||
|
||||
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,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 10.r,
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
),
|
||||
sizedBoxWidth(8.w),
|
||||
text14700white(title)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text12700white("Team captain"),
|
||||
sizedBoxHeight(8.h),
|
||||
text12400white("April 2023 - May 2024"),
|
||||
sizedBoxHeight(10.h),
|
||||
text10400whiteblur(
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.")
|
||||
],
|
||||
),
|
||||
),
|
||||
// border: 1
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget normalcardtile({
|
||||
required String profileImg,
|
||||
required String title,
|
||||
required String mainImg,
|
||||
required List<String> containerTitle,
|
||||
}) {
|
||||
var mainImage = 'assets/images/png/uiw_like-o.png'.obs;
|
||||
void updateImage(String reaction) {
|
||||
if (reaction == 'like') {
|
||||
mainImage.value = 'assets/images/png/f7_hand-thumbsup.png';
|
||||
} else if (reaction == 'heart') {
|
||||
mainImage.value = 'assets/images/png/heart 2.png';
|
||||
} else if (reaction == 'party') {
|
||||
mainImage.value = 'assets/images/png/party-popper 2.png';
|
||||
}
|
||||
}
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
foregroundImage: AssetImage(profileImg),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(5.h),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/community 1 (traced).png',
|
||||
height: 14.w,
|
||||
width: 14.w,
|
||||
),
|
||||
sizedBoxWidth(7.w),
|
||||
text12w400_FCFCFC('Active alliance network'),
|
||||
sizedBoxWidth(7.w),
|
||||
Icon(
|
||||
Icons.circle,
|
||||
color: Color(0xFFFCFCFC),
|
||||
size: 4.sp,
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
text12w400_FCFCFC('1 Hour ago'),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 176.w),
|
||||
offset: Offset(0, 50),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'Report Post',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Vector (5).png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'Share post',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/share.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'Pin',
|
||||
style: TextStyle(
|
||||
fontSize: 16.sp,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: "Nunito Sans",
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).png",
|
||||
height: 25.h,
|
||||
width: 25.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Image.asset(
|
||||
'assets/images/png/Group 1000004071.png',
|
||||
width: 16.w,
|
||||
height: 18.h,
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(5.w)
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.postdetailsScreen);
|
||||
},
|
||||
child: Container(
|
||||
height: 163.h,
|
||||
width: double.infinity,
|
||||
child: Image.asset(
|
||||
mainImg,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)),
|
||||
sizedBoxHeight(20.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(children: [
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
shrinkWrap: true,
|
||||
itemCount: containerTitle.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(right: 12.w),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.cyclescreen);
|
||||
},
|
||||
child: containertile(text: containerTitle[index])),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC(
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s . . ."),
|
||||
Row(children: [
|
||||
stackReaction(number: '20', containerImages: [
|
||||
'assets/images/png/f7_hand-thumbsup.png',
|
||||
'assets/images/png/heart 2.png',
|
||||
'assets/images/png/party-popper 2.png'
|
||||
]),
|
||||
Spacer(),
|
||||
commonContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.2,
|
||||
opacity2: 0.2,
|
||||
borderwidth: 0.43,
|
||||
boxShape: BoxShape.circle,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/Frame 1000004088.png',
|
||||
height: 13.h,
|
||||
width: 13.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text14w400_FCFCFC('20'),
|
||||
sizedBoxWidth(20.w),
|
||||
commonContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.2,
|
||||
opacity2: 0.2,
|
||||
borderwidth: 0.43,
|
||||
boxShape: BoxShape.circle,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/Vector (1).png',
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text14w400_FCFCFC('10'),
|
||||
]),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Obx(() {
|
||||
return ReactionButton<String>(
|
||||
onReactionChanged: (reaction) {
|
||||
updateImage(reaction?.value ?? 'like');
|
||||
debugPrint('Selected value: ${reaction?.value}');
|
||||
},
|
||||
reactions: <Reaction<String>?>[
|
||||
Reaction<String>(
|
||||
value: 'like',
|
||||
previewIcon: _buildReactionsPreviewIcon(
|
||||
'assets/images/png/f7_hand-thumbsup.png'),
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/f7_hand-thumbsup.png'),
|
||||
),
|
||||
Reaction<String>(
|
||||
value: 'heart',
|
||||
previewIcon: _buildReactionsPreviewIcon(
|
||||
'assets/images/png/heart 2.png'),
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/heart 2.png'),
|
||||
),
|
||||
Reaction<String>(
|
||||
value: 'party',
|
||||
previewIcon: _buildReactionsPreviewIcon(
|
||||
'assets/images/png/party-popper 2.png'),
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/party-popper 2.png'),
|
||||
),
|
||||
],
|
||||
selectedReaction: Reaction<String>(
|
||||
value: 'like',
|
||||
icon: _buildReactionsIcon(
|
||||
'assets/images/png/f7_hand-thumbsup.png'),
|
||||
),
|
||||
boxColor: Colors.white,
|
||||
boxElevation: 9,
|
||||
boxRadius: 30,
|
||||
itemsSpacing: 8,
|
||||
itemScale: 0.4,
|
||||
itemSize: Size(45, 45),
|
||||
boxPadding: EdgeInsets.all(8),
|
||||
boxAnimationDuration: Duration(milliseconds: 200),
|
||||
itemAnimationDuration: Duration(milliseconds: 500),
|
||||
hoverDuration: Duration(milliseconds: 700),
|
||||
// toggle: false,
|
||||
|
||||
child: _buildReactionsIcon(mainImage.value),
|
||||
);
|
||||
})
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.postdetailsScreen);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/Frame 1000004088.png',
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
text11w400_FCFCFC('Comment')
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/Frame 1000004089.png',
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
text11w400_FCFCFC('Save')
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
]),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildReactionsPreviewIcon(String assetPath) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Image.asset(
|
||||
assetPath,
|
||||
height: 40.h,
|
||||
width: 40.w,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildReactionsIcon(String assetPath) {
|
||||
return Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
assetPath,
|
||||
height: 19.h,
|
||||
width: 19.w,
|
||||
),
|
||||
sizedBoxHeight(8.h),
|
||||
text11w400_FCFCFC('Like')
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget containertile({required String text}) {
|
||||
return commonContainer(
|
||||
width: 100.w,
|
||||
height: 30.h,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
borderColor: Color(0xFFD90B2E),
|
||||
borderwidth: 0.9,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: Center(child: text14w400_FCFCFC(text)),
|
||||
));
|
||||
}
|
||||
|
||||
Widget profilecardtile({required String imagePath, required String title}) {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 109.h,
|
||||
width: 100.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
),
|
||||
child: Image.asset(imagePath),
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
SizedBox(width: 100.w, child: text12w700_FCFCFC(title)),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,208 +0,0 @@
|
||||
import 'package:flutter/material.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/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class BlockedUsers extends StatefulWidget {
|
||||
const BlockedUsers({super.key});
|
||||
|
||||
@override
|
||||
State<BlockedUsers> createState() => _BlockedUsersState();
|
||||
}
|
||||
|
||||
class _BlockedUsersState extends State<BlockedUsers> {
|
||||
List blockedUserData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg1.png",
|
||||
"title": "Ryan Dorwart",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg2.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg3.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg4.png",
|
||||
"title": "Kianna Donin",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Maria Herwitz",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Blocked users",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
),
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, 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",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: blockedUserData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
blockedUser(
|
||||
imagePath: blockedUserData[index]["imagePath"],
|
||||
title: blockedUserData[index]["title"],
|
||||
subtitle: blockedUserData[index]["subtitle"]),
|
||||
if (index != blockedUserData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
])
|
||||
]));
|
||||
}
|
||||
|
||||
dialogwidget() {
|
||||
Get.dialog(Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 200.h,
|
||||
borderradius: 14,
|
||||
opacity1: 0.09,
|
||||
opacity2: 0.13,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 30.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w400_FCFCFC(
|
||||
"Are you sure you want to unblock the user?",
|
||||
textAlign: TextAlign.center),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 110.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
customWidget: Center(child: text14400white("No")),
|
||||
border: 1),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
height: 40.h,
|
||||
width: 110.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
),
|
||||
child: Center(child: text14400white("Yes")),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
border: 0.8)));
|
||||
}
|
||||
|
||||
Widget blockedUser({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required String subtitle,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: AssetImage(imagePath),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(4.h),
|
||||
text12w400_FCFCFC_blur(subtitle),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
dialogwidget();
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 105.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
color: Color(0xFFD90B2E)),
|
||||
child: Center(child: text14w400_FCFCFC("Unblock")),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,13 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/base_manager.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/blureffect.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';
|
||||
@@ -19,116 +22,164 @@ class ChangePassword extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ChangePasswordState extends State<ChangePassword> {
|
||||
TextEditingController currentpasscontroller = TextEditingController();
|
||||
TextEditingController newpasscontroller = TextEditingController();
|
||||
TextEditingController repeatpasscontroller = TextEditingController();
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"current_password": currentpasscontroller.text,
|
||||
"new_password": newpasscontroller.text,
|
||||
"confirm_password": repeatpasscontroller.text,
|
||||
};
|
||||
final data = await Profilepostmethod().postChangepassword(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("Change pass up done");
|
||||
|
||||
Get.toNamed(RouteName.verifycode,
|
||||
arguments: {
|
||||
"currentpass" : currentpasscontroller.text,
|
||||
"newpass" : newpasscontroller.text,
|
||||
"confirmpass" : repeatpasscontroller.text
|
||||
}
|
||||
);
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("change pass not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Change password",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Change password",
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Current password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("New password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Repeat password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CommonBtn(
|
||||
text: "Verify",
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.verifycode);
|
||||
},
|
||||
)
|
||||
]),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
)
|
||||
]));
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Current password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
textEditingController: currentpasscontroller,
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("New password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
textEditingController: newpasscontroller,
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Repeat password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
textEditingController: repeatpasscontroller,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
if (val != newpasscontroller.text) {
|
||||
return 'Password does not match';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CommonBtn(
|
||||
text: "Verify",
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.verifycode);
|
||||
if (currentpasscontroller.text.isBlank! &&
|
||||
newpasscontroller.text.isBlank! &&
|
||||
repeatpasscontroller.text.isBlank!) {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else {
|
||||
Uploadata();
|
||||
|
||||
}
|
||||
},
|
||||
)
|
||||
]),
|
||||
),
|
||||
)
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
class FetchBlockedUser {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
FetchBlockedUser({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
FetchBlockedUser.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(new Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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? blockedIamPrincipalXid;
|
||||
int? iamPrincipalXid;
|
||||
BlockedProfile? blockedProfile;
|
||||
|
||||
Data(
|
||||
{this.blockedIamPrincipalXid, this.iamPrincipalXid, this.blockedProfile});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
blockedIamPrincipalXid = json['blocked_iam_principal_xid'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
blockedProfile = json['blocked_profile'] != null
|
||||
? new BlockedProfile.fromJson(json['blocked_profile'])
|
||||
: null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['blocked_iam_principal_xid'] = this.blockedIamPrincipalXid;
|
||||
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||
if (this.blockedProfile != null) {
|
||||
data['blocked_profile'] = this.blockedProfile!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class BlockedProfile {
|
||||
int? id;
|
||||
String? userName;
|
||||
String? fullName;
|
||||
String? profilePhoto;
|
||||
|
||||
BlockedProfile({this.id, this.userName, this.fullName, this.profilePhoto});
|
||||
|
||||
BlockedProfile.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
userName = json['user_name'];
|
||||
fullName = json['full_name'];
|
||||
profilePhoto = json['profile_photo'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['user_name'] = this.userName;
|
||||
data['full_name'] = this.fullName;
|
||||
data['profile_photo'] = this.profilePhoto;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,16 @@ class _SettingsState extends State<Settings> {
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.editProfile);
|
||||
},
|
||||
child: rowTile(
|
||||
imagePath: "assets/images/png/edit 1.png",
|
||||
text: "Edit profile",
|
||||
),
|
||||
),
|
||||
commonDivider(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.helpandsupport);
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Global.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:timer_button/timer_button.dart';
|
||||
|
||||
class VerifyCode extends StatefulWidget {
|
||||
const VerifyCode({super.key});
|
||||
@@ -17,8 +24,59 @@ class VerifyCode extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _VerifyCodeState extends State<VerifyCode> {
|
||||
final TextEditingController pincodeController = TextEditingController();
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
TextEditingController pincodeController = TextEditingController();
|
||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
String currentpassword = Get.arguments['currentpass'];
|
||||
String newpassword = Get.arguments['newpass'];
|
||||
String confirmpassword = Get.arguments['confirmpass'];
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"otp": pincodeController.text,
|
||||
"new_password": newpassword,
|
||||
};
|
||||
// final data = res
|
||||
final res = await Profilepostmethod().postChangepassverifyotp(updata);
|
||||
if (res.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("verification done");
|
||||
|
||||
Get.back();
|
||||
Get.back();
|
||||
|
||||
return utils.showToast(res.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("change pass not done");
|
||||
return utils.showToast(res.message);
|
||||
}
|
||||
}
|
||||
|
||||
Uploadataresendotp() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"current_password": currentpassword,
|
||||
"new_password": newpassword,
|
||||
"confirm_password": confirmpassword,
|
||||
};
|
||||
final data = await Profilepostmethod().postChangepassword(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("otp done");
|
||||
|
||||
setState(() {
|
||||
pincodeController.clear();
|
||||
// turnValidation = false;
|
||||
});
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("otp not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -44,34 +102,97 @@ class _VerifyCodeState extends State<VerifyCode> {
|
||||
text20700white("Check your email"),
|
||||
sizedBoxHeight(10.h),
|
||||
text14400whiteblur(
|
||||
"Enter the verification code that we sent to loremipsum@gmail.com"),
|
||||
"Enter the verification code that we sent to $emailid"),
|
||||
sizedBoxHeight(30.h),
|
||||
text16400white("Enter code"),
|
||||
sizedBoxHeight(20.h),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: CustomPinCodeField(
|
||||
controller: pincodeController,
|
||||
onChanged: (value) {
|
||||
print(value);
|
||||
},
|
||||
onCompleted: (value) {
|
||||
print("Completed");
|
||||
pincodeController.text = value;
|
||||
PinCodeTextField(
|
||||
validator: (value) {
|
||||
if (value != null && value.isEmpty) {
|
||||
return "Please Enter verification code";
|
||||
} else if (value != null && value.length < 4) {
|
||||
return "OTP length should be at least 4";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
length: 4,
|
||||
obscureText: false,
|
||||
animationType: AnimationType.fade,
|
||||
pinTheme: PinTheme(
|
||||
selectedFillColor: Color(0xFF434A53),
|
||||
inactiveFillColor: Color(0xFF434A53),
|
||||
inactiveColor: Color(0xFF434A53),
|
||||
activeColor: Color(0xFF434A53),
|
||||
selectedColor: Color(0xFF434A53),
|
||||
shape: PinCodeFieldShape.underline,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
fieldHeight: 70,
|
||||
fieldWidth: 70,
|
||||
activeFillColor:
|
||||
// Colors.white
|
||||
Color(0xFF303030).withOpacity(0.4),
|
||||
// textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size
|
||||
),
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
enableActiveFill: true,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
controller: pincodeController,
|
||||
onCompleted: (v) {
|
||||
print("Completed");
|
||||
},
|
||||
onChanged: (value) {
|
||||
print(value);
|
||||
setState(() {
|
||||
// currentText = value;
|
||||
});
|
||||
},
|
||||
cursorColor: Colors.white,
|
||||
textStyle: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
beforeTextPaste: (text) {
|
||||
print("Allowing to paste $text");
|
||||
return true;
|
||||
},
|
||||
appContext: context,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Center(
|
||||
child: TimerButton(
|
||||
disabledTextStyle: TextStyle(color: Colors.red),
|
||||
activeTextStyle: TextStyle(color: Colors.white),
|
||||
disabledColor: Color(0XFF222935).withOpacity(0.10),
|
||||
buttonType: ButtonType.textButton,
|
||||
label: "Resend OTP",
|
||||
timeOutInSeconds: 6,
|
||||
//mobile.text.isEmpty ? 1 : 60,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
Uploadataresendotp();
|
||||
});
|
||||
},
|
||||
// disabledColor: Colors.white,
|
||||
color: Color(0XFF222935).withOpacity(0.10),
|
||||
),
|
||||
),
|
||||
// ),
|
||||
sizedBoxHeight(70.h),
|
||||
CustomButton(
|
||||
text: 'Continue',
|
||||
onPressed: () {
|
||||
if (pincodeController.text.isEmpty) {
|
||||
utils.showToast("Pin field is empty");
|
||||
} else if (pincodeController.text.length < 4) {
|
||||
utils.showToast("OTP length should be 4 digits");
|
||||
} else {
|
||||
return;
|
||||
Uploadata();
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -85,122 +206,176 @@ class _VerifyCodeState extends State<VerifyCode> {
|
||||
}
|
||||
}
|
||||
|
||||
class CustomPinCodeField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final ValueChanged<String> onChanged;
|
||||
final ValueChanged<String> onCompleted;
|
||||
// class CustomPinCodeField extends StatefulWidget {
|
||||
// final TextEditingController controller;
|
||||
// final ValueChanged<String> onChanged;
|
||||
// final ValueChanged<String> onCompleted;
|
||||
|
||||
CustomPinCodeField({
|
||||
required this.controller,
|
||||
required this.onChanged,
|
||||
required this.onCompleted,
|
||||
});
|
||||
// CustomPinCodeField({
|
||||
// required this.controller,
|
||||
// required this.onChanged,
|
||||
// required this.onCompleted,
|
||||
// });
|
||||
|
||||
@override
|
||||
_CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
|
||||
}
|
||||
// @override
|
||||
// _CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
|
||||
// }
|
||||
|
||||
class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
late List<TextEditingController> _controllers;
|
||||
late List<FocusNode> _focusNodes;
|
||||
String _currentText = "";
|
||||
// class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
|
||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
// late List<TextEditingController> _controllers;
|
||||
// late List<FocusNode> _focusNodes;
|
||||
// String _currentText = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controllers = List.generate(4, (_) => TextEditingController());
|
||||
_focusNodes = List.generate(4, (_) => FocusNode());
|
||||
}
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// _controllers = List.generate(4, (_) => TextEditingController());
|
||||
// _focusNodes = List.generate(4, (_) => FocusNode());
|
||||
// }
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controllers.forEach((controller) => controller.dispose());
|
||||
_focusNodes.forEach((focusNode) => focusNode.dispose());
|
||||
super.dispose();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _controllers.forEach((controller) => controller.dispose());
|
||||
// _focusNodes.forEach((focusNode) => focusNode.dispose());
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
String? _validate(int index) {
|
||||
// _currentText = _controllers.map((controller) => controller.text).join();
|
||||
if (_currentText[index].isEmpty) {
|
||||
return "Please Enter verification code";
|
||||
} else if (_currentText.length < 4) {
|
||||
return "OTP length should be at least 4";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// String? _validate(int index) {
|
||||
// if (_controllers[index].text.isEmpty) {
|
||||
// return "Please enter verification code";
|
||||
// } else if (_controllers[index].text.length > 1) {
|
||||
// return "Please enter only one digit";
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
void _onChanged(String value, int index) {
|
||||
setState(() {
|
||||
_currentText = _controllers.map((controller) => controller.text).join();
|
||||
});
|
||||
if (value.length == 1 && index != 3) {
|
||||
FocusScope.of(context).nextFocus();
|
||||
} else if (value.isEmpty && index != 0) {
|
||||
FocusScope.of(context).previousFocus();
|
||||
}
|
||||
widget.onChanged(_currentText);
|
||||
// void _onChanged(String value, int index) {
|
||||
// setState(() {
|
||||
// _currentText = _controllers.map((controller) => controller.text).join();
|
||||
// });
|
||||
|
||||
if (_currentText.length == 4) {
|
||||
widget.onCompleted(_currentText);
|
||||
}
|
||||
}
|
||||
// if (value.isNotEmpty) {
|
||||
// if (index < _controllers.length - 1) {
|
||||
// FocusScope.of(context).nextFocus();
|
||||
// } else {
|
||||
// // Last field, trigger onCompleted directly
|
||||
// if (_currentText.length == _controllers.length) {
|
||||
// widget.onCompleted(_currentText);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// // Empty value, focus to previous field if not the first field
|
||||
// if (index > 0) {
|
||||
// FocusScope.of(context).previousFocus();
|
||||
// }
|
||||
// }
|
||||
// widget.onChanged(_currentText);
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Form(
|
||||
key: _formKey,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: List.generate(4, (index) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 40,
|
||||
// color: Colors.amber,
|
||||
child: Center(
|
||||
child: TextFormField(
|
||||
controller: _controllers[index],
|
||||
focusNode: _focusNodes[index],
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(1),
|
||||
],
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
errorStyle: TextStyle(height: 0),
|
||||
),
|
||||
onChanged: (value) => _onChanged(value, index),
|
||||
validator: (value) {
|
||||
if (index == 3) return _validate(index);
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (index != 3)
|
||||
Container(
|
||||
width: 12,
|
||||
height: 2,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.symmetric(horizontal: 10),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Form(
|
||||
// key: _formKey,
|
||||
// child: Column(
|
||||
// children: [
|
||||
// commonGlassContainer(
|
||||
// width: double.infinity,
|
||||
// height: 50.h,
|
||||
// borderradius: 30.r,
|
||||
// border: 1,
|
||||
// customWidget: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: List.generate(4, (index) {
|
||||
// return Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Center(
|
||||
// child: Container(
|
||||
// width: 30,
|
||||
// height: 40,
|
||||
// child: Center(
|
||||
// child: TextFormField(
|
||||
// controller: _controllers[index],
|
||||
// focusNode: _focusNodes[index],
|
||||
// keyboardType: TextInputType.number,
|
||||
// inputFormatters: [
|
||||
// FilteringTextInputFormatter.allow(
|
||||
// RegExp('[0-9]')),
|
||||
// LengthLimitingTextInputFormatter(1),
|
||||
// ],
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 20,
|
||||
// fontFamily: 'Helvetica',
|
||||
// ),
|
||||
// decoration: InputDecoration(
|
||||
// border: InputBorder.none,
|
||||
// errorStyle: TextStyle(height: 0),
|
||||
// ),
|
||||
// onChanged: (value) => _onChanged(value, index),
|
||||
// validator: (value) => _validate(index),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// if (index != 3)
|
||||
// Container(
|
||||
// width: 12,
|
||||
// height: 2,
|
||||
// color: Colors.white,
|
||||
// margin: EdgeInsets.symmetric(horizontal: 10),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// ),
|
||||
// sizedBoxHeight(10.h),
|
||||
// Text(
|
||||
// _validateErrors(),
|
||||
// style: TextStyle(color: Colors.red),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
// String _validateErrors() {
|
||||
// for (int i = 0; i < _controllers.length; i++) {
|
||||
// String? error = _validate(i);
|
||||
// if (error != null) {
|
||||
// return error;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Check if OTP length is less than 4
|
||||
// if (_currentText.length < 4) {
|
||||
// return "OTP length should be 4 digits";
|
||||
// }
|
||||
|
||||
// return "";
|
||||
// }
|
||||
|
||||
// // String _validateErrors() {
|
||||
// // List<String> errors = [];
|
||||
|
||||
// // // Validate each TextFormField
|
||||
// // for (int i = 0; i < _controllers.length; i++) {
|
||||
// // String? error = _validate(i);
|
||||
// // if (error != null && !errors.contains(error)) {
|
||||
// // errors.add(error);
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // // Check OTP length only if there are no other errors
|
||||
// // if (errors.isEmpty && _currentText.length < 4) {
|
||||
// // errors.add("OTP length should be 4 digits");
|
||||
// // }
|
||||
|
||||
// // // Return concatenated error messages
|
||||
// // return errors.isNotEmpty ? errors.join("\n") : "";
|
||||
// // }
|
||||
// }
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
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/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ViewModel/BlockedUserApi.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/texts.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class BlockedUsers extends StatefulWidget {
|
||||
const BlockedUsers({super.key});
|
||||
|
||||
@override
|
||||
State<BlockedUsers> createState() => _BlockedUsersState();
|
||||
}
|
||||
|
||||
class _BlockedUsersState extends State<BlockedUsers> {
|
||||
List blockedUserData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg1.png",
|
||||
"title": "Ryan Dorwart",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg2.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg3.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/cimg4.png",
|
||||
"title": "Kianna Donin",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Maria Herwitz",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
late Future myfuture;
|
||||
double? blockedXid;
|
||||
|
||||
unblockDone(int index) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
await prefs.setInt('blockedprincipalxid',
|
||||
fetchblockuser!.data![index].blockedIamPrincipalXid!);
|
||||
blockedXid = prefs.getInt('blockedprincipalxid')!.toDouble();
|
||||
Map<String, String> updata = {
|
||||
"blocked_iam_principal_xid": blockedXid.toString(),
|
||||
};
|
||||
final resp = await BlockUserAPI().postBlockApi(updata);
|
||||
if (resp.status == ResponseStatus.SUCCESS) {
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'Unblock user successfully',
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// utils.showToast('Unblock user successfully');
|
||||
|
||||
setState(() {
|
||||
fetchblockuser!.data!.removeAt(index);
|
||||
});
|
||||
print('success');
|
||||
} else {
|
||||
// btnController.error();
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
resp.data['message'],
|
||||
duration: Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
myfuture = BlockUserAPI().fetchBlockUser();
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Blocked users",
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: myfuture,
|
||||
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(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
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",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: fetchblockuser!.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
blockedUser(
|
||||
imagePath: fetchblockuser!.data![index]
|
||||
.blockedProfile!.profilePhoto ??
|
||||
'',
|
||||
title: fetchblockuser!.data![index]
|
||||
.blockedProfile!.fullName ??
|
||||
'',
|
||||
subtitle: fetchblockuser!.data![index]
|
||||
.blockedProfile!.userName ??
|
||||
'',
|
||||
index: index),
|
||||
// blockedUser(
|
||||
// imagePath: blockedUserData[index]
|
||||
// ["imagePath"],
|
||||
// title: blockedUserData[index]["title"],
|
||||
// subtitle: blockedUserData[index]
|
||||
// ["subtitle"]),
|
||||
if (index != fetchblockuser!.data!.length - 1)
|
||||
commonDivider(),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h)
|
||||
])
|
||||
]);
|
||||
}
|
||||
return Container();
|
||||
}));
|
||||
}
|
||||
|
||||
dialogwidget({required int index}) {
|
||||
Get.dialog(Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
surfaceTintColor: Colors.transparent,
|
||||
child: commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 200.h,
|
||||
borderradius: 14,
|
||||
opacity1: 0.09,
|
||||
opacity2: 0.13,
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.w, vertical: 30.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text18w400_FCFCFC(
|
||||
"Are you sure you want to unblock the user?",
|
||||
textAlign: TextAlign.center),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 110.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
customWidget: Center(child: text14400white("No")),
|
||||
border: 1),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
// Get.back();
|
||||
unblockDone(index);
|
||||
// await BlockUserAPI().fetchBlockUser();
|
||||
Get.back();
|
||||
// setState(() {});
|
||||
},
|
||||
child: Container(
|
||||
height: 40.h,
|
||||
width: 110.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
),
|
||||
child: Center(child: text14400white("Yes")),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
border: 0.8)));
|
||||
}
|
||||
|
||||
Widget blockedUser({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required String subtitle,
|
||||
required int index,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
CircleAvatar(
|
||||
backgroundImage: NetworkImage(imagePath),
|
||||
|
||||
// AssetImage(imagePath),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16w400_FCFCFC(title),
|
||||
sizedBoxHeight(4.h),
|
||||
text12w400_FCFCFC_blur(subtitle),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
dialogwidget(index: index);
|
||||
},
|
||||
child: Container(
|
||||
height: 30.h,
|
||||
width: 105.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
color: Color(0xFFD90B2E)),
|
||||
child: Center(child: text14w400_FCFCFC("Unblock")),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
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/Settings/Model/FetchBlockUser.dart';
|
||||
|
||||
FetchBlockedUser? fetchblockuser;
|
||||
|
||||
class BlockUserAPI {
|
||||
BlockUserAPI();
|
||||
|
||||
Future<ResponseData<dynamic>> fetchBlockUser() async {
|
||||
final response = await NetworkApiServices().getApi(
|
||||
ApiUrls.getblockuser,
|
||||
);
|
||||
fetchblockuser = FetchBlockedUser.fromJson(response.data);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data["status"] == "success") {
|
||||
print("Success---->");
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postBlockApi(var data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.postblockuser,
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||
if (response.data['status'] == "success") {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
// data: response.data
|
||||
);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class NotificationAPI {
|
||||
);
|
||||
fetchNoti = FetchNotification.fromJson(response.data);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
if (response.data['success'] == true) {
|
||||
if (response.data["status"] == "success") {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
@@ -22,6 +23,19 @@ class _AddTimelineState extends State<AddTimeline> {
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController dateController2 = TextEditingController();
|
||||
|
||||
final List<String> _dropdownProductItems = [
|
||||
'Individual',
|
||||
'Business',
|
||||
];
|
||||
|
||||
String _selectedAccountType = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_selectedAccountType = value;
|
||||
});
|
||||
}
|
||||
|
||||
RxBool isChecked = false.obs;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -150,6 +164,18 @@ class _AddTimelineState extends State<AddTimeline> {
|
||||
)
|
||||
],
|
||||
),
|
||||
text16400white("Ability"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomDropDownWidgetSignup(
|
||||
header: 'Select ability',
|
||||
title: '',
|
||||
listData: _dropdownProductItems,
|
||||
onItemSelected: _onItemSelected,
|
||||
// leadingImage:
|
||||
// Image.asset(
|
||||
// 'assets/images/png/user.png',
|
||||
// ),
|
||||
),
|
||||
sizedBoxHeight(80.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
||||
|
||||
@@ -59,4 +59,26 @@ class Profilepostmethod {
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postChangepassword(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postchangepassword,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> postChangepassverifyotp(updata) async {
|
||||
print("updata is $updata");
|
||||
final response = await NetworkApiServices().postApi(
|
||||
updata,
|
||||
ApiUrls.postchangepassverify,
|
||||
);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ class LoginAPI {
|
||||
.postApi(data, ApiUrls.getlogin, optionalpar: true);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
String? accountype;
|
||||
if (response.data['status'] == 'success') {
|
||||
LoginModel loginObj = LoginModel.fromJson(response.data);
|
||||
await prefs.setString('access-token', loginObj.data!.accessToken!);
|
||||
@@ -32,12 +33,12 @@ class LoginAPI {
|
||||
myusername = loginObj.data?.userData?.userName;
|
||||
fullname = loginObj.data?.userData?.fullName;
|
||||
phonenumber = loginObj.data?.userData?.phoneNumber;
|
||||
|
||||
await prefs.setString('accountTypefromLogin',
|
||||
loginObj.data?.userData?.principalTypeXid.toString() ?? "");
|
||||
print("token is ${loginObj.data!.accessToken!}");
|
||||
|
||||
if (loginObj.data?.userData?.isProfileUpdated == 0) {
|
||||
String? accountype =
|
||||
loginObj.data?.userData?.principalTypeXid.toString();
|
||||
accountype = loginObj.data?.userData?.principalTypeXid.toString();
|
||||
|
||||
if (accountype == "1") {
|
||||
print('tell us individyal');
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
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/Utils/Common/CustomTextformfield.dart';
|
||||
@@ -12,7 +13,7 @@ class CustomDropDownWidgetSignup extends StatefulWidget {
|
||||
required this.title,
|
||||
required this.listData,
|
||||
required this.onItemSelected,
|
||||
required this.leadingImage,
|
||||
this.leadingImage,
|
||||
}) : super(key: key);
|
||||
|
||||
final String header;
|
||||
@@ -73,7 +74,13 @@ class _CustomDropDownWidgetSignupState
|
||||
// 'assets/images/png/user.png',
|
||||
// ),
|
||||
|
||||
widget.leadingImage!,
|
||||
widget.leadingImage == null
|
||||
?
|
||||
SizedBox()
|
||||
:
|
||||
widget.leadingImage!
|
||||
,
|
||||
|
||||
SizedBox(width: 16.w),
|
||||
Text(
|
||||
selectedValue.value.isEmpty
|
||||
@@ -746,6 +753,270 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
}
|
||||
}
|
||||
|
||||
class CustomDropDownChexkBox extends StatefulWidget {
|
||||
const CustomDropDownChexkBox({
|
||||
Key? key,
|
||||
required this.header,
|
||||
required this.title,
|
||||
required this.listData,
|
||||
required this.onItemSelected,
|
||||
required this.leadingImage,
|
||||
this.showOtherOption = false,
|
||||
required this.initiallySelected, // Added this line
|
||||
}) : super(key: key);
|
||||
|
||||
final String header;
|
||||
final String title;
|
||||
final List<String> listData;
|
||||
final Function(List<String>) onItemSelected;
|
||||
final Widget? leadingImage;
|
||||
final bool showOtherOption;
|
||||
final List<String> initiallySelected; // Added this line
|
||||
|
||||
@override
|
||||
State<CustomDropDownChexkBox> createState() => _CustomDropDownChexkBoxState();
|
||||
}
|
||||
|
||||
class _CustomDropDownChexkBoxState extends State<CustomDropDownChexkBox> {
|
||||
RxBool onDropTap = false.obs;
|
||||
RxList<String> selectedValues = <String>[].obs;
|
||||
final TextEditingController _textController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
selectedValues.addAll(widget.initiallySelected); // Added this line
|
||||
}
|
||||
|
||||
List<DropdownMenuItem<String>> _buildDropdownMenuItems() {
|
||||
List<DropdownMenuItem<String>> items =
|
||||
widget.listData.asMap().entries.map((entry) {
|
||||
int index = entry.key;
|
||||
String item = entry.value;
|
||||
return DropdownMenuItem<String>(
|
||||
value: item,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (selectedValues.contains(item)) {
|
||||
selectedValues.remove(item);
|
||||
} else {
|
||||
selectedValues.add(item);
|
||||
}
|
||||
_textController.clear();
|
||||
widget.onItemSelected(selectedValues);
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return Checkbox(
|
||||
value: selectedValues.contains(item),
|
||||
activeColor: Colors.white,
|
||||
checkColor: const Color(0xFFD90B2E),
|
||||
onChanged: (bool? value) {
|
||||
if (value == true) {
|
||||
selectedValues.add(item);
|
||||
} else {
|
||||
selectedValues.remove(item);
|
||||
}
|
||||
_textController.clear();
|
||||
widget.onItemSelected(selectedValues);
|
||||
},
|
||||
);
|
||||
}),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
item,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
if (index != widget.listData.length - 1)
|
||||
const Divider(thickness: 1, color: Color(0xFF434A53)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList();
|
||||
|
||||
if (widget.showOtherOption) {
|
||||
items.add(
|
||||
DropdownMenuItem<String>(
|
||||
value: _textController.text,
|
||||
child: Column(
|
||||
children: [
|
||||
const Divider(thickness: 1, color: Color(0xFF434A53)),
|
||||
Row(
|
||||
children: [
|
||||
Obx(() {
|
||||
return Checkbox(
|
||||
value: selectedValues.contains(_textController.text),
|
||||
activeColor: Colors.white,
|
||||
onChanged: (bool? value) {
|
||||
if (value == true &&
|
||||
_textController.text.trim().isNotEmpty) {
|
||||
selectedValues.add(_textController.text);
|
||||
} else {
|
||||
selectedValues.remove(_textController.text);
|
||||
}
|
||||
widget.onItemSelected(selectedValues);
|
||||
},
|
||||
);
|
||||
}),
|
||||
const SizedBox(width: 8),
|
||||
const Text(
|
||||
"Other: ",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
controller: _textController,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
decoration: const InputDecoration(
|
||||
hintText: '',
|
||||
hintStyle: TextStyle(color: Colors.white70),
|
||||
border: UnderlineInputBorder(),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
if (_textController.text.trim().isNotEmpty) {
|
||||
selectedValues.add(_textController.text);
|
||||
widget.onItemSelected(selectedValues);
|
||||
}
|
||||
},
|
||||
child: const Text(
|
||||
'OK',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(
|
||||
() => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
onDropTap.value = !onDropTap.value;
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
// height: 50,
|
||||
padding:
|
||||
EdgeInsets.only(right: 22, left: 12, top: 14, bottom: 14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
borderRadius: onDropTap.value
|
||||
? const BorderRadius.vertical(
|
||||
top: Radius.circular(30),
|
||||
)
|
||||
: const BorderRadius.all(Radius.circular(30)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.50),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.50),
|
||||
],
|
||||
),
|
||||
border: Border.all(color: const Color(0xFF434A53)),
|
||||
),
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
if (widget.leadingImage != null) widget.leadingImage!,
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
selectedValues.isEmpty
|
||||
? widget.header
|
||||
: selectedValues.join(', '),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
onDropTap.value
|
||||
? Image.asset('assets/images/png/arrowup.png')
|
||||
: Image.asset('assets/images/png/arrowdown.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (onDropTap.value)
|
||||
Scrollbar(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
bottom: Radius.circular(30),
|
||||
),
|
||||
border: Border.all(color: const Color(0xFF434A53)),
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
const Color(0xFFffffff).withOpacity(0.50),
|
||||
const Color(0xFFFFFFFF).withOpacity(0.50),
|
||||
],
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: _buildDropdownMenuItems(),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CustomDropDownCheckBox extends StatefulWidget {
|
||||
const CustomDropDownCheckBox({
|
||||
Key? key,
|
||||
|
||||
@@ -414,6 +414,16 @@ Widget text10400white(String text) {
|
||||
fontWeight: FontWeight.w400),
|
||||
);
|
||||
}
|
||||
Widget text9400white(String text) {
|
||||
return Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 9.sp,
|
||||
color: Colors.white,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
);
|
||||
}
|
||||
|
||||
Widget text6400white(String text) {
|
||||
return Text(
|
||||
|
||||
@@ -182,7 +182,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
fontFamily: 'Cambria',
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
initialRoute: RouteName.splashScreen,
|
||||
initialRoute: RouteName.profiletabbusguest,
|
||||
getPages: AppRoutes.appRoutes(),
|
||||
),
|
||||
designSize: const Size(390, 844),
|
||||
|
||||
@@ -19,6 +19,7 @@ import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class SignupScreen extends StatefulWidget {
|
||||
const SignupScreen({super.key});
|
||||
@@ -138,6 +139,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
utils.loader();
|
||||
int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0;
|
||||
Map<String, dynamic> updata = {
|
||||
@@ -145,6 +147,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
"password": passwordController.text,
|
||||
"account_type": accountTypeValue,
|
||||
};
|
||||
|
||||
final data = await Onboard().Postregisteration(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
@@ -158,7 +161,8 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
"accounttype": selectedCategory,
|
||||
'accountypenumber': accountTypeValue
|
||||
});
|
||||
|
||||
await prefs.setString(
|
||||
'accountTypeValue', accountTypeValue.toString() ?? "");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
|
||||
@@ -32,7 +32,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
int accounttypenumber = Get.arguments["accountypenumber"];
|
||||
|
||||
Uploadata() async {
|
||||
// utils.loader();
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"email_address": email,
|
||||
"password": userpassword,
|
||||
@@ -65,6 +65,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
|
||||
return utils.showToast(res.message);
|
||||
} else {
|
||||
Get.back();
|
||||
// btnController.error();
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
@@ -87,7 +88,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
}
|
||||
|
||||
Uploadataresendotp() async {
|
||||
// utils.loader();
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"email_address": email,
|
||||
"password": userpassword,
|
||||
@@ -95,7 +96,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
};
|
||||
final data = await Onboard().Postregisteration(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
// Get.back();
|
||||
Get.back();
|
||||
// print("resend up done");
|
||||
// return utils.showToast(data.message);
|
||||
Get.snackbar(
|
||||
@@ -120,6 +121,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
// }
|
||||
|
||||
else {
|
||||
Get.back();
|
||||
// btnController.error();
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
|
||||
@@ -57,6 +57,11 @@ class RouteName {
|
||||
|
||||
static const String userchatpage = '/userchatpage';
|
||||
|
||||
static const String profiletab = '/profiletab';
|
||||
static const String mynetwork = '/mynetwork';
|
||||
|
||||
|
||||
|
||||
static const String groupchatpage = '/groupchatpage';
|
||||
static const String managememberscal = '/managememberscal';
|
||||
static const String shareProfile = '/shareProfile';
|
||||
@@ -67,6 +72,7 @@ class RouteName {
|
||||
static const String settings = '/settings';
|
||||
static const String accountsettings = '/accountsettings';
|
||||
static const String editProfile = '/editProfile';
|
||||
static const String buseditprofile = '/buseditprofile';
|
||||
static const String notifications = '/notifications';
|
||||
static const String helpandsupport = '/helpandsupport';
|
||||
static const String privacypolicy = '/privacypolicy';
|
||||
@@ -116,4 +122,13 @@ class RouteName {
|
||||
|
||||
static const String verifygoogleapplepage = '/verifygoogleapplepage';
|
||||
|
||||
|
||||
//profiletabIndGestUser
|
||||
|
||||
static const String profiletabindguest = '/profiletabindguest';
|
||||
|
||||
//profiletabBusGestUser
|
||||
|
||||
static const String profiletabbusguest = '/profiletabbusguest';
|
||||
|
||||
}
|
||||
|
||||
@@ -34,12 +34,17 @@ import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/SubGroup/Subgro
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Badges/Badges.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Certificate/Certificate.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Clubs/Clubs.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/EditProfile.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/BusEditProfile.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/EditProfile/View/EditProfile.dart';
|
||||
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/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';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/BlockedUsers.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/View/BlockedUsers.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ChangePassword.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ContactUs.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart';
|
||||
@@ -497,5 +502,26 @@ class AppRoutes {
|
||||
name: RouteName.verifygoogleapplepage,
|
||||
page: () => Verifygoogleandapple(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.buseditprofile,
|
||||
page: () => BusEditProfile(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.profiletab,
|
||||
page: () => ProfileTab(),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: RouteName.profiletabindguest,
|
||||
page: () => ProfileTabIndGuest(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.profiletabbusguest,
|
||||
page: () => profiletabBusGest(),
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.mynetwork,
|
||||
page: () => MyNetwork(),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user