Compare commits
23 Commits
getuserlog
...
Developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1bc84a0a98 | ||
|
|
d40658c6d3 | ||
|
|
459021c40f | ||
|
|
c2ba93738d | ||
|
|
2a2c0586f4 | ||
|
|
4d9ae79067 | ||
|
|
985b00b1c7 | ||
|
|
e969cbc458 | ||
|
|
b11e16340c | ||
|
|
2fa64b61ca | ||
|
|
04544aa0eb | ||
|
|
c45ee2e088 | ||
|
|
47c735da45 | ||
|
|
1af9882526 | ||
|
|
9365b858f9 | ||
|
|
dd878393c6 | ||
|
|
a31e34e790 | ||
|
|
2bfe5c8ef8 | ||
|
|
7c9b97b41f | ||
|
|
fb304ca5d8 | ||
|
|
ccc2a73929 | ||
|
|
a9ae9ac028 | ||
|
|
54da408ce1 |
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"CodeGPT.apiKey": "CodeGPT Plus Beta",
|
|
||||||
"dart.flutterSdkPath": "D:\\pooja\\fluttersdk\\flutter_3.16.9\\flutter"
|
|
||||||
}
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||||
<application
|
<application
|
||||||
android:label="regroup"
|
android:label="ReGroup"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">ReGroup123</string>
|
<string name="app_name">Regroup</string>
|
||||||
<string name="facebook_app_id">8076081959097016</string>
|
<string name="facebook_app_id">803386025107790</string>
|
||||||
<string name="fb_login_protocol_scheme">fb8076081959097016</string>
|
<string name="fb_login_protocol_scheme">fb803386025107790</string>
|
||||||
<string name="facebook_client_token">ca5a1805872edbec0d3a0a0b02229ba5</string>
|
<string name="facebook_client_token">fa69ee794ff94e50c7ddbfac1e035cb9</string>
|
||||||
</resources>
|
</resources>
|
||||||
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 |
@@ -151,6 +151,8 @@
|
|||||||
dependencies = (
|
dependencies = (
|
||||||
);
|
);
|
||||||
name = Runner;
|
name = Runner;
|
||||||
|
packageProductDependencies = (
|
||||||
|
);
|
||||||
productName = Runner;
|
productName = Runner;
|
||||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
@@ -179,6 +181,8 @@
|
|||||||
Base,
|
Base,
|
||||||
);
|
);
|
||||||
mainGroup = 97C146E51CF9000F007C117D;
|
mainGroup = 97C146E51CF9000F007C117D;
|
||||||
|
packageReferences = (
|
||||||
|
);
|
||||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"originHash" : "ca3cf5f8f83d297b47d2cb0edff3e06f294951e2e06fa55cfc82831103499b2a",
|
||||||
|
"pins" : [
|
||||||
|
{
|
||||||
|
"identity" : "facebook-ios-sdk",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/facebook/facebook-ios-sdk",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "c19607d535864533523d1f437c84035e5fb101cf",
|
||||||
|
"version" : "14.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version" : 3
|
||||||
|
}
|
||||||
@@ -51,5 +51,29 @@
|
|||||||
<string>Regroup get write-only access to the user photo library</string>
|
<string>Regroup get write-only access to the user photo library</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
<string>Allow access to photo library</string>
|
<string>Allow access to photo library</string>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>To capture profile photo please grant camera access</string>
|
||||||
|
<!-- facebook start -->
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>fb803386025107790</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<key>FacebookAppID</key>
|
||||||
|
<string>803386025107790</string>
|
||||||
|
<key>FacebookClientToken</key>
|
||||||
|
<string>fa69ee794ff94e50c7ddbfac1e035cb9</string>
|
||||||
|
<key>FacebookDisplayName</key>
|
||||||
|
<string>Regroup</string>
|
||||||
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>fbapi</string>
|
||||||
|
<string>fb-messenger-share-api</string>
|
||||||
|
</array>
|
||||||
|
<!-- facebook end -->
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class ApiUrls {
|
|||||||
|
|
||||||
static const getlogin = "${baseUrl}login";
|
static const getlogin = "${baseUrl}login";
|
||||||
static const forgotpassword = "${baseUrl}forgot-password";
|
static const forgotpassword = "${baseUrl}forgot-password";
|
||||||
static const verifyotp = "${baseUrl}verify-otp";
|
static const verifyotp = "${baseUrl}forgot-password/verify-otp";
|
||||||
static const tellUsBusinessApi = "${baseUrl}tell-us-about-your-business";
|
static const tellUsBusinessApi = "${baseUrl}tell-us-about-your-business";
|
||||||
static const letUsUnderstandApi = "${baseUrl}update-business-profile-step-1";
|
static const letUsUnderstandApi = "${baseUrl}update-business-profile-step-1";
|
||||||
static const resetpassword = "${baseUrl}reset-password";
|
static const resetpassword = "${baseUrl}reset-password";
|
||||||
@@ -27,9 +27,55 @@ class ApiUrls {
|
|||||||
static const postcommunities = "${baseUrl}select-communities";
|
static const postcommunities = "${baseUrl}select-communities";
|
||||||
|
|
||||||
static const googlelogin = "${baseUrl}sign-in-with-google-login";
|
static const googlelogin = "${baseUrl}sign-in-with-google-login";
|
||||||
|
static const applelogin = "${baseUrl}apple-login-or-registration";
|
||||||
|
static const facebooklogin = "${baseUrl}facebook-login";
|
||||||
|
|
||||||
static const storeDetailsOfOAuth = "${baseUrl}update-user-account-type";
|
static const storeDetailsOfOAuth = "${baseUrl}update-user-account-type";
|
||||||
|
|
||||||
static const getuserdetails = "${baseUrl}get-auth-user-data";
|
static const getuserdetails = "${baseUrl}get-auth-user-data";
|
||||||
|
|
||||||
|
|
||||||
|
static const getfaqs = "${baseUrl}fetch-faqs";
|
||||||
|
|
||||||
|
static const getprivacypolicy = "${baseUrl}fetch-privacy-policy";
|
||||||
|
|
||||||
|
static const gettermsconditios = "${baseUrl}fetch-terms-and-condition";
|
||||||
|
|
||||||
|
static const postcontactus = "${baseUrl}contact-us";
|
||||||
|
|
||||||
|
static const postreportbug = "${baseUrl}bug-report";
|
||||||
|
|
||||||
|
static const getfollowers = "${baseUrl}fetch-followers";
|
||||||
|
|
||||||
|
static const getfollowing = "${baseUrl}fetch-following";
|
||||||
|
|
||||||
|
static const postblock = "${baseUrl}block-profile";
|
||||||
|
|
||||||
|
static const postunfollow = "${baseUrl}follow-user";
|
||||||
|
|
||||||
|
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/Community/Community.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/GroupTab/View/GroupTab.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 {
|
class MainController extends GetxController {
|
||||||
var selectedIndex = 0.obs;
|
var selectedIndex = 0.obs;
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ class NetworkApiServices {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
||||||
data: response.data);
|
data: response.data);
|
||||||
|
} else if (response.statusCode == 201) {
|
||||||
|
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
||||||
|
data: response.data);
|
||||||
} else if (response.statusCode == 404) {
|
} else if (response.statusCode == 404) {
|
||||||
return ResponseData<dynamic>("error", ResponseStatus.ERROR,
|
return ResponseData<dynamic>("error", ResponseStatus.ERROR,
|
||||||
data: response.data);
|
data: response.data);
|
||||||
|
|||||||
@@ -224,11 +224,13 @@ class _NewPostState extends State<NewPost> {
|
|||||||
CustomDropDownCheckBox(
|
CustomDropDownCheckBox(
|
||||||
header: "",
|
header: "",
|
||||||
title: "",
|
title: "",
|
||||||
|
|
||||||
listData: [
|
listData: [
|
||||||
'Active alliance network',
|
'Active alliance network',
|
||||||
'Fitfam federation',
|
'Fitfam federation',
|
||||||
'The athletic town',
|
'The athletic town',
|
||||||
'Football fever'
|
'Football fever'
|
||||||
|
|
||||||
],
|
],
|
||||||
onItemSelected: (p0) {},
|
onItemSelected: (p0) {},
|
||||||
images: [
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,19 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonWidget.dart';
|
import 'package:regroup/Common/CommonWidget.dart';
|
||||||
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomTextformfield.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/Common/sized_box.dart';
|
||||||
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
|
|
||||||
class Followers extends StatefulWidget {
|
class Followers extends StatefulWidget {
|
||||||
const Followers({super.key});
|
const Followers({super.key});
|
||||||
@@ -15,43 +23,59 @@ class Followers extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _FollowersState extends State<Followers> {
|
class _FollowersState extends State<Followers> {
|
||||||
List followersData = [
|
StreamController<FollowersModel> searchcontroller = StreamController();
|
||||||
{
|
|
||||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
@override
|
||||||
"title": "Ryan Dorwart",
|
void initState() {
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
// TODO: implement initState
|
||||||
},
|
var updata = "";
|
||||||
{
|
Profilegetmethod().getFollowers(updata, streamController: searchcontroller);
|
||||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
|
||||||
"title": "Ahmad Rhiel Madsen",
|
super.initState();
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
}
|
||||||
},
|
|
||||||
{
|
@override
|
||||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
void dispose() {
|
||||||
"title": "Kaylynn Vaccaro",
|
searchcontroller.close();
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
super.dispose();
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"imagePath": "assets/images/png/img2.png",
|
int? blockid;
|
||||||
"title": "Kianna Donin",
|
int? removeid;
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
|
||||||
},
|
RemoveUploadata() async {
|
||||||
{
|
utils.loader();
|
||||||
"imagePath": "assets/images/png/img2.png",
|
Map<String, dynamic> updata = {
|
||||||
"title": "Maria Herwitz",
|
"iam_principal_xid": removeid,
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
};
|
||||||
},
|
final data = await Profilepostmethod().postRemoveuser(updata);
|
||||||
{
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
Get.back();
|
||||||
"title": "Ahmad Rhiel Madsen",
|
print("block done");
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
return utils.showToast(data.message);
|
||||||
},
|
} else {
|
||||||
{
|
Get.back();
|
||||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
print("block not done");
|
||||||
"title": "Kaylynn Vaccaro",
|
return utils.showToast(data.message);
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
}
|
||||||
},
|
}
|
||||||
];
|
|
||||||
|
BlockUploadata() async {
|
||||||
|
utils.loader();
|
||||||
|
Map<String, dynamic> updata = {
|
||||||
|
"blocked_iam_principal_xid": blockid,
|
||||||
|
};
|
||||||
|
final data = await Profilepostmethod().postBlockuser(updata);
|
||||||
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
|
Get.back();
|
||||||
|
print("block done");
|
||||||
|
return utils.showToast(data.message);
|
||||||
|
} else {
|
||||||
|
Get.back();
|
||||||
|
print("block not done");
|
||||||
|
return utils.showToast(data.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -69,7 +93,8 @@ class _FollowersState extends State<Followers> {
|
|||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
fit: BoxFit.fill)),
|
fit: BoxFit.fill)),
|
||||||
), SingleChildScrollView(
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
Padding(
|
Padding(
|
||||||
@@ -86,67 +111,177 @@ class _FollowersState extends State<Followers> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
texttype: TextInputType.text,
|
||||||
|
inputFormatters: [
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
],
|
||||||
|
onInput: (value) {
|
||||||
|
Profilegetmethod().getFollowers(value,
|
||||||
|
streamController: searchcontroller);
|
||||||
|
},
|
||||||
hintText: "Search people",
|
hintText: "Search people",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
sizedBoxHeight(25.h),
|
sizedBoxHeight(25.h),
|
||||||
ListView.builder(
|
StreamBuilder<FollowersModel>(
|
||||||
|
stream: searchcontroller.stream,
|
||||||
|
builder: (ctx, snapshot) {
|
||||||
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
|
// Display shimmer effect while waiting for data
|
||||||
|
return Center(child: CircularProgressIndicator());
|
||||||
|
} else if (snapshot.hasError) {
|
||||||
|
// Handle error state
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
'${snapshot.error} occurred',
|
||||||
|
style: TextStyle(fontSize: 18),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Data has been loaded, show actual UI
|
||||||
|
return followersobj!.data!.isEmpty
|
||||||
|
? _buildNoDataBody(context)
|
||||||
|
:
|
||||||
|
// ListView.builder(
|
||||||
|
// shrinkWrap: true,
|
||||||
|
// itemCount: followersobj!.data!.length,
|
||||||
|
// itemBuilder: (context, index) {
|
||||||
|
// return Column(
|
||||||
|
// children: [
|
||||||
|
// followerWidget(
|
||||||
|
// imagePath: followersobj?.data?[index]
|
||||||
|
// .follower?.profilePhoto ??
|
||||||
|
// "",
|
||||||
|
// // followersData[index]["imagePath"],
|
||||||
|
// title: followersobj?.data?[index].follower
|
||||||
|
// ?.fullName ??
|
||||||
|
// "",
|
||||||
|
// // followersData[index]["title"],
|
||||||
|
// subtitle: followersobj?.data?[index]
|
||||||
|
// .follower?.userName ??
|
||||||
|
// "",
|
||||||
|
// blockonTap: () {
|
||||||
|
// BlockUploadata(followersobj!
|
||||||
|
// .data![index].follower!.id);
|
||||||
|
// }
|
||||||
|
// // followersData[index]["subtitle"]
|
||||||
|
// ),
|
||||||
|
// if (index != followersobj!.data!.length - 1)
|
||||||
|
// commonDivider(),
|
||||||
|
// ],
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// );
|
||||||
|
|
||||||
|
ListView.separated(
|
||||||
|
physics: ScrollPhysics(),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: followersData.length,
|
itemCount: followersobj!.data!.length,
|
||||||
|
separatorBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
return commonDivider();
|
||||||
|
},
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
followerWidget(
|
Padding(
|
||||||
imagePath: followersData[index]["imagePath"],
|
padding: EdgeInsets.symmetric(
|
||||||
title: followersData[index]["title"],
|
vertical: 16.h, horizontal: 16.w),
|
||||||
subtitle: followersData[index]["subtitle"]),
|
|
||||||
if (index != followersData.length - 1) commonDivider(),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
])
|
|
||||||
]))
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget followerWidget({
|
|
||||||
required String imagePath,
|
|
||||||
required String title,
|
|
||||||
required String subtitle,
|
|
||||||
}) {
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
followersobj!.data![index].follower!
|
||||||
backgroundImage: AssetImage(imagePath),
|
.profilePhoto ==
|
||||||
|
null ||
|
||||||
|
followersobj!
|
||||||
|
.data![index]
|
||||||
|
.follower!
|
||||||
|
.profilePhoto!
|
||||||
|
.isEmpty
|
||||||
|
? CircleAvatar(
|
||||||
|
backgroundImage: AssetImage(
|
||||||
|
'assets/images/png/Ellipse 43.png'),
|
||||||
|
radius: 25.r,
|
||||||
|
)
|
||||||
|
: CircleAvatar(
|
||||||
|
backgroundImage: NetworkImage(
|
||||||
|
followersobj!
|
||||||
|
.data![index]
|
||||||
|
.follower!
|
||||||
|
.profilePhoto!),
|
||||||
radius: 25.r,
|
radius: 25.r,
|
||||||
),
|
),
|
||||||
sizedBoxWidth(10.w),
|
sizedBoxWidth(10.w),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
text16w400_FCFCFC(title),
|
followersobj!.data![index].follower!
|
||||||
|
.fullName ==
|
||||||
|
null ||
|
||||||
|
followersobj!
|
||||||
|
.data![index]
|
||||||
|
.follower!
|
||||||
|
.fullName!
|
||||||
|
.isEmpty ==
|
||||||
|
true
|
||||||
|
? text16w400_FCFCFC("Regroup")
|
||||||
|
: text16w400_FCFCFC(
|
||||||
|
followersobj!.data![index]
|
||||||
|
.follower!.fullName!),
|
||||||
sizedBoxHeight(4.h),
|
sizedBoxHeight(4.h),
|
||||||
text12w400_FCFCFC_blur(subtitle)
|
followersobj!.data![index].follower!
|
||||||
|
.userName ==
|
||||||
|
null ||
|
||||||
|
followersobj!
|
||||||
|
.data![index]
|
||||||
|
.follower!
|
||||||
|
.userName!
|
||||||
|
.isEmpty ==
|
||||||
|
true
|
||||||
|
? text12w400_FCFCFC_blur(
|
||||||
|
"regroup")
|
||||||
|
: text12w400_FCFCFC_blur(
|
||||||
|
followersobj!.data![index]
|
||||||
|
.follower!.userName!)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
surfaceTintColor: Color(0xFF222935),
|
surfaceTintColor: Color(0xFF222935),
|
||||||
constraints: BoxConstraints.tightFor(width: 176.w),
|
constraints:
|
||||||
|
BoxConstraints.tightFor(
|
||||||
|
width: 176.w),
|
||||||
offset: Offset(0, 20),
|
offset: Offset(0, 20),
|
||||||
color: Color(0xFF222935),
|
color: Color(0xFF222935),
|
||||||
tooltip: "",
|
tooltip: "",
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
itemBuilder: (BuildContext
|
||||||
|
context) =>
|
||||||
|
<PopupMenuEntry>[
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {},
|
// onTap: () {},
|
||||||
|
onTap: () async {
|
||||||
|
setState(() {
|
||||||
|
removeid = followersobj!
|
||||||
|
.data![index]
|
||||||
|
.follower!
|
||||||
|
.id ??
|
||||||
|
0;
|
||||||
|
followersobj!.data!
|
||||||
|
.removeWhere((item) =>
|
||||||
|
item.follower!
|
||||||
|
.id ==
|
||||||
|
removeid);
|
||||||
|
RemoveUploadata();
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
padding:
|
||||||
|
EdgeInsets.symmetric(
|
||||||
|
horizontal: 12.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
text14400white("Remove user"),
|
text14400white(
|
||||||
|
"Remove user"),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
"assets/images/png/fluent_delete-28-regular.png",
|
"assets/images/png/fluent_delete-28-regular.png",
|
||||||
@@ -161,13 +296,16 @@ class _FollowersState extends State<Followers> {
|
|||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
padding:
|
||||||
|
EdgeInsets.symmetric(
|
||||||
|
horizontal: 12.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
text14400white("Message user"),
|
text14400white(
|
||||||
|
"Message user"),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
"assets/images/png/share.png",
|
"assets/images/png/fluent_chat-20-regular.png",
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
)
|
)
|
||||||
@@ -177,15 +315,32 @@ class _FollowersState extends State<Followers> {
|
|||||||
),
|
),
|
||||||
PopupMenuDivider(),
|
PopupMenuDivider(),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {},
|
onTap: () async {
|
||||||
|
setState(() {
|
||||||
|
blockid = followersobj!
|
||||||
|
.data![index]
|
||||||
|
.follower!
|
||||||
|
.id ??
|
||||||
|
0;
|
||||||
|
followersobj!.data!
|
||||||
|
.removeWhere((item) =>
|
||||||
|
item.follower!
|
||||||
|
.id ==
|
||||||
|
blockid);
|
||||||
|
BlockUploadata();
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
padding:
|
||||||
|
EdgeInsets.symmetric(
|
||||||
|
horizontal: 12.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
text14400white("Block user"),
|
text14400white(
|
||||||
|
"Block user"),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
"assets/images/png/f7_pin-fill (2).png",
|
"assets/images/png/blockchat.png",
|
||||||
height: 25.h,
|
height: 25.h,
|
||||||
width: 25.w,
|
width: 25.w,
|
||||||
)
|
)
|
||||||
@@ -207,6 +362,34 @@ class _FollowersState extends State<Followers> {
|
|||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
])
|
||||||
|
]))
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildNoDataBody(context) {
|
||||||
|
return Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"No Data Found",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonWidget.dart';
|
import 'package:regroup/Common/CommonWidget.dart';
|
||||||
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomTextformfield.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/Common/sized_box.dart';
|
||||||
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
|
|
||||||
class Following extends StatefulWidget {
|
class Following extends StatefulWidget {
|
||||||
const Following({super.key});
|
const Following({super.key});
|
||||||
@@ -15,43 +23,45 @@ class Following extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _FollowingState extends State<Following> {
|
class _FollowingState extends State<Following> {
|
||||||
List followingData = [
|
StreamController<FollowingModel> searchcontroller = StreamController();
|
||||||
{
|
|
||||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
@override
|
||||||
"title": "Ryan Dorwart",
|
void initState() {
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
// TODO: implement initState
|
||||||
},
|
var updata = "";
|
||||||
{
|
Profilegetmethod().getFollowing(updata, streamController: searchcontroller);
|
||||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
|
||||||
"title": "Ahmad Rhiel Madsen",
|
super.initState();
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
}
|
||||||
},
|
|
||||||
{
|
@override
|
||||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
void dispose() {
|
||||||
"title": "Kaylynn Vaccaro",
|
searchcontroller.close();
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
super.dispose();
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"imagePath": "assets/images/png/img2.png",
|
Uploadata() async {
|
||||||
"title": "Kianna Donin",
|
utils.loader();
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
Map<String, dynamic> updata = {
|
||||||
},
|
"following_iam_principal_xid": unfollowid,
|
||||||
{
|
};
|
||||||
"imagePath": "assets/images/png/img2.png",
|
final data = await Profilepostmethod().postunfollowuser(updata);
|
||||||
"title": "Maria Herwitz",
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
Get.back();
|
||||||
},
|
print("unfollow done");
|
||||||
{
|
// setState(() {
|
||||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
// // Assuming followingobj is a list of items, remove the item with matching user ID
|
||||||
"title": "Ahmad Rhiel Madsen",
|
// followingobj!.data!.removeWhere((item) => item.following!.id == userid);
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
// });
|
||||||
},
|
return utils.showToast(data.message);
|
||||||
{
|
} else {
|
||||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
Get.back();
|
||||||
"title": "Kaylynn Vaccaro",
|
print("unfollow not done");
|
||||||
"subtitle": "Lorem ipsum dummy text",
|
return utils.showToast(data.message);
|
||||||
},
|
}
|
||||||
];
|
}
|
||||||
|
|
||||||
|
int? unfollowid;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -69,7 +79,8 @@ class _FollowingState extends State<Following> {
|
|||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
fit: BoxFit.fill)),
|
fit: BoxFit.fill)),
|
||||||
), SingleChildScrollView(
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
Padding(
|
Padding(
|
||||||
@@ -87,66 +98,173 @@ class _FollowingState extends State<Following> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "Search people",
|
hintText: "Search people",
|
||||||
|
texttype: TextInputType.text,
|
||||||
|
inputFormatters: [
|
||||||
|
// LengthLimitingTextInputFormatter(20),
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
],
|
||||||
|
onInput: (value) {
|
||||||
|
// Onboard().postGroupsearch({"search": value},
|
||||||
|
// streamController: searchcontroller);
|
||||||
|
// searchGroups(value!);
|
||||||
|
Profilegetmethod().getFollowing(value,
|
||||||
|
streamController: searchcontroller);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
sizedBoxHeight(25.h),
|
sizedBoxHeight(25.h),
|
||||||
ListView.builder(
|
StreamBuilder<FollowingModel>(
|
||||||
shrinkWrap: true,
|
stream: searchcontroller.stream,
|
||||||
itemCount: followingData.length,
|
builder: (ctx, snapshot) {
|
||||||
itemBuilder: (context, index) {
|
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||||
return Column(
|
// Display shimmer effect while waiting for data
|
||||||
children: [
|
return Center(child: CircularProgressIndicator());
|
||||||
followingWidget(
|
} else if (snapshot.hasError) {
|
||||||
imagePath: followingData[index]["imagePath"],
|
// Handle error state
|
||||||
title: followingData[index]["title"],
|
return Center(
|
||||||
subtitle: followingData[index]["subtitle"]),
|
child: Text(
|
||||||
if (index != followingData.length - 1) commonDivider(),
|
'${snapshot.error} occurred',
|
||||||
],
|
style: TextStyle(fontSize: 18),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
// Data has been loaded, show actual UI
|
||||||
|
return followingobj!.data!.isEmpty
|
||||||
|
? _buildNoDataBody(context)
|
||||||
|
: ListView.separated(
|
||||||
|
physics: ScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: followingobj!.data!.length,
|
||||||
|
separatorBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
return commonDivider();
|
||||||
},
|
},
|
||||||
)
|
itemBuilder: (context, index) {
|
||||||
])
|
return
|
||||||
]))
|
// Column(
|
||||||
]));
|
// children: [
|
||||||
}
|
// Followinglist(
|
||||||
|
// imagePath: followingobj?.data?[index]
|
||||||
Widget followingWidget({
|
// .following?.profilePhoto ??
|
||||||
required String imagePath,
|
// '',
|
||||||
required String title,
|
// title: followingobj!
|
||||||
required String subtitle,
|
// .data?[index].following?.fullName ??
|
||||||
}) {
|
// '',
|
||||||
return Padding(
|
// subtitle: followingobj!
|
||||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
// .data?[index].following?.userName ??
|
||||||
|
// '',
|
||||||
|
// unfollowontap: (id) => Uploadata(id),
|
||||||
|
// unfollowindex: followingobj!
|
||||||
|
// .data![index].following!.id!,
|
||||||
|
// ),
|
||||||
|
// if (index != followingobj!.data!.length - 1)
|
||||||
|
// commonDivider(),
|
||||||
|
// ],
|
||||||
|
// );
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: 16.h, horizontal: 16.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
followingobj!.data![index].following!
|
||||||
backgroundImage: AssetImage(imagePath),
|
.profilePhoto ==
|
||||||
|
null ||
|
||||||
|
followingobj!
|
||||||
|
.data![index]
|
||||||
|
.following!
|
||||||
|
.profilePhoto!
|
||||||
|
.isEmpty
|
||||||
|
? CircleAvatar(
|
||||||
|
backgroundImage: AssetImage(
|
||||||
|
'assets/images/png/Ellipse 43.png'),
|
||||||
|
radius: 25.r,
|
||||||
|
)
|
||||||
|
: CircleAvatar(
|
||||||
|
backgroundImage: NetworkImage(
|
||||||
|
followingobj!
|
||||||
|
.data![index]
|
||||||
|
.following!
|
||||||
|
.profilePhoto!),
|
||||||
radius: 25.r,
|
radius: 25.r,
|
||||||
),
|
),
|
||||||
sizedBoxWidth(10.w),
|
sizedBoxWidth(10.w),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
text16w400_FCFCFC(title),
|
followingobj!
|
||||||
|
.data![index]
|
||||||
|
.following!
|
||||||
|
.fullName ==
|
||||||
|
null ||
|
||||||
|
followingobj!
|
||||||
|
.data![index]
|
||||||
|
.following!
|
||||||
|
.fullName!
|
||||||
|
.isEmpty
|
||||||
|
? text16w400_FCFCFC("Regroup")
|
||||||
|
: text16w400_FCFCFC(
|
||||||
|
followingobj!.data![index]
|
||||||
|
.following!.fullName!),
|
||||||
sizedBoxHeight(4.h),
|
sizedBoxHeight(4.h),
|
||||||
text12w400_FCFCFC_blur(subtitle)
|
followingobj!
|
||||||
|
.data![index]
|
||||||
|
.following!
|
||||||
|
.userName ==
|
||||||
|
null ||
|
||||||
|
followingobj!
|
||||||
|
.data![index]
|
||||||
|
.following!
|
||||||
|
.userName!
|
||||||
|
.isEmpty
|
||||||
|
? text12w400_FCFCFC_blur(
|
||||||
|
"regroup")
|
||||||
|
: text12w400_FCFCFC_blur(
|
||||||
|
followingobj!.data![index]
|
||||||
|
.following!.userName!)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
surfaceTintColor: Color(0xFF222935),
|
surfaceTintColor: Color(0xFF222935),
|
||||||
constraints: BoxConstraints.tightFor(width: 176.w),
|
constraints:
|
||||||
|
BoxConstraints.tightFor(
|
||||||
|
width: 176.w),
|
||||||
offset: Offset(0, 20),
|
offset: Offset(0, 20),
|
||||||
color: Color(0xFF222935),
|
color: Color(0xFF222935),
|
||||||
tooltip: "",
|
tooltip: "",
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
itemBuilder: (BuildContext
|
||||||
|
context) =>
|
||||||
|
<PopupMenuEntry>[
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {},
|
onTap: () async {
|
||||||
|
setState(() {
|
||||||
|
unfollowid =
|
||||||
|
followingobj!
|
||||||
|
.data![
|
||||||
|
index]
|
||||||
|
.following!
|
||||||
|
.id ??
|
||||||
|
0;
|
||||||
|
// followingobj!.data!.removeAt(index);
|
||||||
|
followingobj!.data!
|
||||||
|
.removeWhere((item) =>
|
||||||
|
item.following!
|
||||||
|
.id ==
|
||||||
|
unfollowid);
|
||||||
|
Uploadata();
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
padding:
|
||||||
|
EdgeInsets.symmetric(
|
||||||
|
horizontal: 12.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
text14400white("Unfollow user"),
|
text14400white(
|
||||||
|
"Unfollow user"),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
"assets/images/png/Black1323e.png",
|
"assets/images/png/Black1323e.png",
|
||||||
@@ -161,10 +279,13 @@ class _FollowingState extends State<Following> {
|
|||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
padding:
|
||||||
|
EdgeInsets.symmetric(
|
||||||
|
horizontal: 12.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
text14400white("Message user"),
|
text14400white(
|
||||||
|
"Message user"),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
"assets/images/png/fluent_chat-20-22.png",
|
"assets/images/png/fluent_chat-20-22.png",
|
||||||
@@ -189,6 +310,34 @@ class _FollowingState extends State<Following> {
|
|||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
])
|
||||||
|
]))
|
||||||
|
]));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildNoDataBody(context) {
|
||||||
|
return Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"No Data Found",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
53
lib/Feed Module/Main_Screens/ProfileTab/Model/faqModel.dart
Normal file
53
lib/Feed Module/Main_Screens/ProfileTab/Model/faqModel.dart
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
class FaqModel {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
List<Data>? data;
|
||||||
|
|
||||||
|
FaqModel({this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
FaqModel.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? id;
|
||||||
|
String? question;
|
||||||
|
String? answer;
|
||||||
|
|
||||||
|
Data({this.id, this.question, this.answer});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
question = json['question'];
|
||||||
|
answer = json['answer'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['question'] = this.question;
|
||||||
|
data['answer'] = this.answer;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
class FollowersModel {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
List<Data>? data;
|
||||||
|
|
||||||
|
FollowersModel({this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
FollowersModel.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? followingIamPrincipalXid;
|
||||||
|
int? iamPrincipalXid;
|
||||||
|
Follower? follower;
|
||||||
|
|
||||||
|
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.follower});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
followingIamPrincipalXid = json['following_iam_principal_xid'];
|
||||||
|
iamPrincipalXid = json['iam_principal_xid'];
|
||||||
|
follower = json['follower'] != null
|
||||||
|
? new Follower.fromJson(json['follower'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
|
||||||
|
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||||
|
if (this.follower != null) {
|
||||||
|
data['follower'] = this.follower!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Follower {
|
||||||
|
int? id;
|
||||||
|
String? userName;
|
||||||
|
String? fullName;
|
||||||
|
String? profilePhoto;
|
||||||
|
|
||||||
|
Follower({this.id, this.userName, this.fullName, this.profilePhoto});
|
||||||
|
|
||||||
|
Follower.fromJson(Map<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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
class FollowingModel {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
List<Data>? data;
|
||||||
|
|
||||||
|
FollowingModel({this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
FollowingModel.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? followingIamPrincipalXid;
|
||||||
|
int? iamPrincipalXid;
|
||||||
|
Following? following;
|
||||||
|
|
||||||
|
Data({this.followingIamPrincipalXid, this.iamPrincipalXid, this.following});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
followingIamPrincipalXid = json['following_iam_principal_xid'];
|
||||||
|
iamPrincipalXid = json['iam_principal_xid'];
|
||||||
|
following = json['following'] != null
|
||||||
|
? new Following.fromJson(json['following'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['following_iam_principal_xid'] = this.followingIamPrincipalXid;
|
||||||
|
data['iam_principal_xid'] = this.iamPrincipalXid;
|
||||||
|
if (this.following != null) {
|
||||||
|
data['following'] = this.following!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Following {
|
||||||
|
int? id;
|
||||||
|
String? userName;
|
||||||
|
String? fullName;
|
||||||
|
String? profilePhoto;
|
||||||
|
|
||||||
|
Following({this.id, this.userName, this.fullName, this.profilePhoto});
|
||||||
|
|
||||||
|
Following.fromJson(Map<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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
class PrivacypolicyModel {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
PrivacypolicyModel({this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
PrivacypolicyModel.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? content;
|
||||||
|
|
||||||
|
Data({this.id, this.content});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
content = json['content'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['content'] = this.content;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
class TermsConditionsModel {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
TermsConditionsModel({this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
TermsConditionsModel.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? content;
|
||||||
|
|
||||||
|
Data({this.id, this.content});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
content = json['content'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['content'] = this.content;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonButton.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/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
import 'package:regroup/resources/routes/route_name.dart';
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
@@ -19,9 +22,42 @@ class ChangePassword extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ChangePasswordState extends State<ChangePassword> {
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GestureDetector(
|
||||||
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
// key: _scaffoldKey1,
|
// key: _scaffoldKey1,
|
||||||
backgroundColor: Color(0xFF222935),
|
backgroundColor: Color(0xFF222935),
|
||||||
@@ -33,7 +69,8 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
@@ -45,6 +82,7 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
text16w400_FCFCFC("Current password"),
|
text16w400_FCFCFC("Current password"),
|
||||||
sizedBoxHeight(16.w),
|
sizedBoxHeight(16.w),
|
||||||
CustomTextFormField(
|
CustomTextFormField(
|
||||||
|
textEditingController: currentpasscontroller,
|
||||||
isInputPassword: true,
|
isInputPassword: true,
|
||||||
// textEditingController: _password,
|
// textEditingController: _password,
|
||||||
hintText: '',
|
hintText: '',
|
||||||
@@ -63,7 +101,7 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(20),
|
LengthLimitingTextInputFormatter(50),
|
||||||
RemoveEmojiInputFormatter()
|
RemoveEmojiInputFormatter()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -71,6 +109,7 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
text16w400_FCFCFC("New password"),
|
text16w400_FCFCFC("New password"),
|
||||||
sizedBoxHeight(16.w),
|
sizedBoxHeight(16.w),
|
||||||
CustomTextFormField(
|
CustomTextFormField(
|
||||||
|
textEditingController: newpasscontroller,
|
||||||
isInputPassword: true,
|
isInputPassword: true,
|
||||||
// textEditingController: _password,
|
// textEditingController: _password,
|
||||||
hintText: '',
|
hintText: '',
|
||||||
@@ -89,7 +128,7 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(20),
|
LengthLimitingTextInputFormatter(50),
|
||||||
RemoveEmojiInputFormatter()
|
RemoveEmojiInputFormatter()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -98,7 +137,7 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
sizedBoxHeight(16.w),
|
sizedBoxHeight(16.w),
|
||||||
CustomTextFormField(
|
CustomTextFormField(
|
||||||
isInputPassword: true,
|
isInputPassword: true,
|
||||||
// textEditingController: _password,
|
textEditingController: repeatpasscontroller,
|
||||||
hintText: '',
|
hintText: '',
|
||||||
leadingIcon: Image.asset(
|
leadingIcon: Image.asset(
|
||||||
'assets/images/png/lock.png',
|
'assets/images/png/lock.png',
|
||||||
@@ -112,10 +151,13 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
if (val == null || val.isEmpty) {
|
if (val == null || val.isEmpty) {
|
||||||
return 'Please enter your password';
|
return 'Please enter your password';
|
||||||
}
|
}
|
||||||
|
if (val != newpasscontroller.text) {
|
||||||
|
return 'Password does not match';
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(20),
|
LengthLimitingTextInputFormatter(50),
|
||||||
RemoveEmojiInputFormatter()
|
RemoveEmojiInputFormatter()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -123,12 +165,21 @@ class _ChangePasswordState extends State<ChangePassword> {
|
|||||||
CommonBtn(
|
CommonBtn(
|
||||||
text: "Verify",
|
text: "Verify",
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(RouteName.verifycode);
|
// Get.toNamed(RouteName.verifycode);
|
||||||
|
if (currentpasscontroller.text.isBlank! &&
|
||||||
|
newpasscontroller.text.isBlank! &&
|
||||||
|
repeatpasscontroller.text.isBlank!) {
|
||||||
|
utils.showToast('Please fill all fields');
|
||||||
|
} else {
|
||||||
|
Uploadata();
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
]));
|
])),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:regroup/Common/CommonButton.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonDropDown.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/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
|
|
||||||
import '../../../../Utils/Common/CustomTextformfield.dart';
|
import '../../../../Utils/Common/CustomTextformfield.dart';
|
||||||
|
|
||||||
@@ -18,9 +22,45 @@ class ContactUs extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ContactUsState extends State<ContactUs> {
|
class _ContactUsState extends State<ContactUs> {
|
||||||
|
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
|
||||||
|
TextEditingController fullname = TextEditingController();
|
||||||
|
TextEditingController email = TextEditingController();
|
||||||
|
TextEditingController querycontroller = TextEditingController();
|
||||||
|
|
||||||
|
String _selectedreasontocontact = '';
|
||||||
|
|
||||||
|
void _onItemSelected(String value) {
|
||||||
|
setState(() {
|
||||||
|
_selectedreasontocontact = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Uploadata() async {
|
||||||
|
utils.loader();
|
||||||
|
Map<String, dynamic> updata = {
|
||||||
|
"full_name": fullname.text,
|
||||||
|
"email": email.text,
|
||||||
|
"reason_to_contact": _selectedreasontocontact,
|
||||||
|
"query": querycontroller.text
|
||||||
|
};
|
||||||
|
final data = await Profilepostmethod().postContactus(updata);
|
||||||
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
|
Get.back();
|
||||||
|
Get.back();
|
||||||
|
print("contact us done");
|
||||||
|
return utils.showToast(data.message);
|
||||||
|
} else {
|
||||||
|
Get.back();
|
||||||
|
print("contact us not done");
|
||||||
|
return utils.showToast(data.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GestureDetector(
|
||||||
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Scaffold(
|
||||||
// key: _scaffoldKey1,
|
// key: _scaffoldKey1,
|
||||||
backgroundColor: Color(0xFF222935),
|
backgroundColor: Color(0xFF222935),
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
@@ -31,11 +71,14 @@ class _ContactUsState extends State<ContactUs> {
|
|||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
child: Form(
|
||||||
|
key: _formkey,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -55,8 +98,22 @@ class _ContactUsState extends State<ContactUs> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "Edward Hackett",
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Enter your full name ';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
inputFormatters: [
|
||||||
|
// LengthLimitingTextInputFormatter(20),
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp('[a-zA-Z ]'))
|
||||||
|
],
|
||||||
|
hintText: "Enter full name",
|
||||||
|
textEditingController: fullname,
|
||||||
),
|
),
|
||||||
|
sizedBoxHeight(10.h),
|
||||||
text16400white("Email address"),
|
text16400white("Email address"),
|
||||||
sizedBoxHeight(16.h),
|
sizedBoxHeight(16.h),
|
||||||
CustomTextFormField(
|
CustomTextFormField(
|
||||||
@@ -72,8 +129,25 @@ class _ContactUsState extends State<ContactUs> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "loremipsum@gmail.com",
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Enter your e-mail address';
|
||||||
|
}
|
||||||
|
if (!RegExp(
|
||||||
|
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
|
||||||
|
.hasMatch(value)) {
|
||||||
|
return 'Enter a valid e-mail address';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
inputFormatters: [
|
||||||
|
LengthLimitingTextInputFormatter(50),
|
||||||
|
RemoveEmojiInputFormatter()
|
||||||
|
],
|
||||||
|
textEditingController: email,
|
||||||
|
hintText: "Enter email address",
|
||||||
),
|
),
|
||||||
|
sizedBoxHeight(10.h),
|
||||||
text16400white("Reason to contact"),
|
text16400white("Reason to contact"),
|
||||||
sizedBoxHeight(16.h),
|
sizedBoxHeight(16.h),
|
||||||
CustomDropDownRadio(
|
CustomDropDownRadio(
|
||||||
@@ -85,7 +159,7 @@ class _ContactUsState extends State<ContactUs> {
|
|||||||
"Scoreboard",
|
"Scoreboard",
|
||||||
"Feedback"
|
"Feedback"
|
||||||
],
|
],
|
||||||
onItemSelected: (p0) {},
|
onItemSelected: _onItemSelected,
|
||||||
leadingImage: Image.asset(
|
leadingImage: Image.asset(
|
||||||
"assets/images/png/fluent_person-support-20-regular.png",
|
"assets/images/png/fluent_person-support-20-regular.png",
|
||||||
height: 17.h,
|
height: 17.h,
|
||||||
@@ -97,12 +171,39 @@ class _ContactUsState extends State<ContactUs> {
|
|||||||
sizedBoxHeight(16.h),
|
sizedBoxHeight(16.h),
|
||||||
CustomTextFormField2(
|
CustomTextFormField2(
|
||||||
maxlines: 3,
|
maxlines: 3,
|
||||||
hintText:
|
hintText: "Enter query",
|
||||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Enter your full name ';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
inputFormatters: [
|
||||||
|
// LengthLimitingTextInputFormatter(20),
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp('[a-zA-Z ]'))
|
||||||
|
],
|
||||||
|
textEditingController: querycontroller,
|
||||||
),
|
),
|
||||||
CommonBtn(text: "Send")
|
CustomButton(
|
||||||
|
onPressed: () {
|
||||||
|
// final isValid =
|
||||||
|
// _formkey.currentState?.validate();
|
||||||
|
if (fullname.text.isBlank! &&
|
||||||
|
email.text.isBlank! &&
|
||||||
|
querycontroller.text.isBlank! &&
|
||||||
|
_selectedreasontocontact.isEmpty) {
|
||||||
|
utils.showToast("Please fill all fields");
|
||||||
|
} else {
|
||||||
|
Uploadata();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
text: "Send")
|
||||||
]),
|
]),
|
||||||
|
),
|
||||||
))
|
))
|
||||||
]));
|
])),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
@@ -20,7 +21,10 @@ class _FaqScreenState extends State<FaqScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
isExpandedList = RxList.generate(faqcard.length, (index) => index == 0);
|
// myfuture = Profilegetmethod().getfaqs().then((value) {
|
||||||
|
// isExpandedList =
|
||||||
|
// RxList.generate(faqobj!.data!.length, (index) => index == 0);
|
||||||
|
// });
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,11 +70,67 @@ class _FaqScreenState extends State<FaqScreen> {
|
|||||||
appBar: CommonAppbar(
|
appBar: CommonAppbar(
|
||||||
titleTxt: "FAQ’s",
|
titleTxt: "FAQ’s",
|
||||||
),
|
),
|
||||||
body: Stack(children: [
|
body: FutureBuilder(
|
||||||
|
future: Profilegetmethod().getFaqs(),
|
||||||
|
builder: (ctx, snapshot) {
|
||||||
|
if (snapshot.data == null) {
|
||||||
|
return const Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
color: Color(0xFFC18948),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
'${snapshot.error} occured',
|
||||||
|
style: TextStyle(fontSize: 18.spMin),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
isExpandedList =
|
||||||
|
RxList.generate(faqobj!.data!.length, (index) => index == 0);
|
||||||
|
return faqobj!.data!.isEmpty
|
||||||
|
? _buildNoDataBody(context)
|
||||||
|
: _buildBody(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildNoDataBody(context) {
|
||||||
|
return Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"No Data Found",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildBody(context) {
|
||||||
|
return Stack(children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
@@ -81,22 +141,21 @@ class _FaqScreenState extends State<FaqScreen> {
|
|||||||
ListView.builder(
|
ListView.builder(
|
||||||
controller: ScrollController(),
|
controller: ScrollController(),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: faqcard.length,
|
itemCount: faqobj!.data!.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return Obx(
|
return Obx(
|
||||||
() {
|
() {
|
||||||
return customExpandableItem(
|
return customExpandableItem(
|
||||||
isExpanded: isExpandedList[index],
|
isExpanded: isExpandedList[index],
|
||||||
title: faqcard[index]['title'] ?? '',
|
title: faqobj!.data![index].question ?? '',
|
||||||
content: faqcard[index]['content'] ?? '',
|
content: faqobj!.data![index].answer ?? '',
|
||||||
toggleExpansion: () =>
|
toggleExpansion: () => toggleExpansion(index),
|
||||||
toggleExpansion(index),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
]))))
|
]))))
|
||||||
]));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget customExpandableItem({
|
Widget customExpandableItem({
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
class FetchNotification {
|
||||||
|
String? status;
|
||||||
|
int? statusCode;
|
||||||
|
String? message;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
FetchNotification({this.status, this.statusCode, this.message, this.data});
|
||||||
|
|
||||||
|
FetchNotification.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? groupNotification;
|
||||||
|
int? communityNotification;
|
||||||
|
int? followerNotification;
|
||||||
|
int? newFollowerNotification;
|
||||||
|
int? directMessageNotification;
|
||||||
|
|
||||||
|
Data(
|
||||||
|
{this.groupNotification,
|
||||||
|
this.communityNotification,
|
||||||
|
this.followerNotification,
|
||||||
|
this.newFollowerNotification,
|
||||||
|
this.directMessageNotification});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
groupNotification = json['group_notification'];
|
||||||
|
communityNotification = json['community_notification'];
|
||||||
|
followerNotification = json['follower_notification'];
|
||||||
|
newFollowerNotification = json['new_follower_notification'];
|
||||||
|
directMessageNotification = json['direct_message_notification'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['group_notification'] = this.groupNotification;
|
||||||
|
data['community_notification'] = this.communityNotification;
|
||||||
|
data['follower_notification'] = this.followerNotification;
|
||||||
|
data['new_follower_notification'] = this.newFollowerNotification;
|
||||||
|
data['direct_message_notification'] = this.directMessageNotification;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
||||||
import 'package:regroup/Common/CommonWidget.dart';
|
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
|
||||||
import 'package:regroup/Utils/texts.dart';
|
|
||||||
|
|
||||||
class NotificationScreen extends StatefulWidget {
|
|
||||||
const NotificationScreen({super.key});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<NotificationScreen> createState() => _NotificationScreenState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _NotificationScreenState extends State<NotificationScreen> {
|
|
||||||
List<bool> switchValues = List.generate(5, (index) => false);
|
|
||||||
bool swichvalue = false;
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
resizeToAvoidBottomInset: false,
|
|
||||||
// key: _scaffoldKey1,
|
|
||||||
backgroundColor: Color(0xFF222935),
|
|
||||||
extendBody: true,
|
|
||||||
appBar: CommonAppbar(
|
|
||||||
titleTxt: "Notifications",
|
|
||||||
),
|
|
||||||
body: Stack(children: [
|
|
||||||
Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
image: DecorationImage(
|
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
|
||||||
),
|
|
||||||
SingleChildScrollView(
|
|
||||||
child: Column(children: [
|
|
||||||
sizedBoxHeight(20.h),
|
|
||||||
rowTile(text: "Group notification", index: 0),
|
|
||||||
commonDivider(),
|
|
||||||
rowTile(text: "Community notification", index: 1),
|
|
||||||
commonDivider(),
|
|
||||||
rowTile(text: "Follower notification", index: 2),
|
|
||||||
commonDivider(),
|
|
||||||
rowTile(text: "New follower notification", index: 3),
|
|
||||||
commonDivider(),
|
|
||||||
rowTile(text: "Direct message notification", index: 4),
|
|
||||||
]))
|
|
||||||
]));
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget rowTile({required String text, required int index}) {
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
text16w400_FCFCFC(text),
|
|
||||||
Spacer(),
|
|
||||||
Transform.scale(
|
|
||||||
scaleY: 1,
|
|
||||||
child: CupertinoSwitch(
|
|
||||||
value: switchValues[index],
|
|
||||||
trackColor: Colors.white.withOpacity(0.4),
|
|
||||||
activeColor: Color(0xFF34C759),
|
|
||||||
onChanged: (bool? value) {
|
|
||||||
setState(() {
|
|
||||||
switchValues[index] = value ?? false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_html/flutter_html.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
@@ -23,28 +26,102 @@ class _PrivacyPolicyState extends State<PrivacyPolicy> {
|
|||||||
appBar: CommonAppbar(
|
appBar: CommonAppbar(
|
||||||
titleTxt: "Privacy policy",
|
titleTxt: "Privacy policy",
|
||||||
),
|
),
|
||||||
body: Stack(children: [
|
body: FutureBuilder(
|
||||||
|
future: Profilegetmethod().getPrivacypolicy(),
|
||||||
|
builder: (ctx, snapshot) {
|
||||||
|
if (snapshot.data == null) {
|
||||||
|
return Center(child: CircularProgressIndicator());
|
||||||
|
}
|
||||||
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
'${snapshot.error} occured',
|
||||||
|
style: TextStyle(fontSize: 18.spMin),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return privacyobj!.data!.isBlank!
|
||||||
|
? _buildNoDataBody(context)
|
||||||
|
: _buildBody(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildNoDataBody(context) {
|
||||||
|
return Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"No Data Found",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildBody(context) {
|
||||||
|
return Stack(children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
text18w700white(
|
|
||||||
"Regroup is a community where everyone can belong"),
|
Html(
|
||||||
sizedBoxHeight(20.h),
|
data: privacyobj!.data!.content,
|
||||||
text16400whiteblur(
|
// style: {
|
||||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
|
// "html": Style(
|
||||||
sizedBoxHeight(20.h),
|
// color: Colors.white,
|
||||||
text16400whiteblur(
|
// fontFamily: "Poppins",
|
||||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
|
// fontSize: FontSize(18.sp),
|
||||||
|
// fontWeight: FontWeight.w700,
|
||||||
|
// ),
|
||||||
|
// },
|
||||||
|
style: {
|
||||||
|
"html": Style(
|
||||||
|
color: Colors.white, // Text color
|
||||||
|
fontFamily: "Poppins", // Font family
|
||||||
|
fontSize: FontSize(18), // Font size
|
||||||
|
fontWeight: FontWeight.w700, // Font weight
|
||||||
|
),
|
||||||
|
"p": Style(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: FontSize(18.sp),
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
"a": Style(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: FontSize(18.sp),
|
||||||
|
fontWeight: FontWeight.w500
|
||||||
|
// Link color
|
||||||
|
),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
// text18w700white(
|
||||||
|
// "Regroup is a community where everyone can belong"),
|
||||||
|
// sizedBoxHeight(20.h),
|
||||||
|
// text16400whiteblur(
|
||||||
|
// "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
|
||||||
|
// sizedBoxHeight(20.h),
|
||||||
|
// text16400whiteblur(
|
||||||
|
// "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
]));
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/CommonButton.dart';
|
import 'package:regroup/Common/CommonButton.dart';
|
||||||
import 'package:regroup/Common/CommonDropDown.dart';
|
import 'package:regroup/Common/CommonDropDown.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/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||||
|
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
|
|
||||||
class ReportABug extends StatefulWidget {
|
class ReportABug extends StatefulWidget {
|
||||||
const ReportABug({super.key});
|
const ReportABug({super.key});
|
||||||
@@ -17,9 +26,47 @@ class ReportABug extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ReportABugState extends State<ReportABug> {
|
class _ReportABugState extends State<ReportABug> {
|
||||||
|
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
|
||||||
|
TextEditingController deviceoscontroller = TextEditingController();
|
||||||
|
TextEditingController versionoscontroller = TextEditingController();
|
||||||
|
TextEditingController emailcontroller = TextEditingController();
|
||||||
|
TextEditingController querycontroller = TextEditingController();
|
||||||
|
|
||||||
|
String _selectedreasontocontact = '';
|
||||||
|
|
||||||
|
void _onItemSelected(String value) {
|
||||||
|
setState(() {
|
||||||
|
_selectedreasontocontact = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Uploadata() async {
|
||||||
|
utils.loader();
|
||||||
|
Map<String, dynamic> updata = {
|
||||||
|
"device": deviceoscontroller.text,
|
||||||
|
"version": versionoscontroller.text,
|
||||||
|
"email": emailcontroller.text,
|
||||||
|
"reason_to_contact": _selectedreasontocontact,
|
||||||
|
"query": querycontroller.text,
|
||||||
|
};
|
||||||
|
final data = await Profilepostmethod().postReportandbug(updata);
|
||||||
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
|
Get.back();
|
||||||
|
Get.back();
|
||||||
|
print("report done");
|
||||||
|
return utils.showToast(data.message);
|
||||||
|
} else {
|
||||||
|
Get.back();
|
||||||
|
print("report not done");
|
||||||
|
return utils.showToast(data.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GestureDetector(
|
||||||
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Scaffold(
|
||||||
// key: _scaffoldKey1,
|
// key: _scaffoldKey1,
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: Color(0xFF222935),
|
backgroundColor: Color(0xFF222935),
|
||||||
@@ -31,11 +78,15 @@ class _ReportABugState extends State<ReportABug> {
|
|||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
Padding(
|
SingleChildScrollView(
|
||||||
|
physics: ScrollPhysics(),
|
||||||
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: SingleChildScrollView(
|
child: Form(
|
||||||
|
key: _formkey,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -65,8 +116,22 @@ class _ReportABugState extends State<ReportABug> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "Apple iphone",
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Enter your decice os';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
inputFormatters: [
|
||||||
|
// LengthLimitingTextInputFormatter(20),
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp('[a-zA-Z ]'))
|
||||||
|
],
|
||||||
|
hintText: "Enter decice os",
|
||||||
|
textEditingController: deviceoscontroller,
|
||||||
),
|
),
|
||||||
|
sizedBoxHeight(10.h),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
text16400white("OS version"),
|
text16400white("OS version"),
|
||||||
@@ -92,25 +157,54 @@ class _ReportABugState extends State<ReportABug> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "Version 16",
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Enter your os version';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
inputFormatters: [
|
||||||
|
// LengthLimitingTextInputFormatter(20),
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
],
|
||||||
|
hintText: "Enter os verison",
|
||||||
|
textEditingController: versionoscontroller,
|
||||||
),
|
),
|
||||||
|
sizedBoxHeight(10.h),
|
||||||
text16400white("Email address"),
|
text16400white("Email address"),
|
||||||
sizedBoxHeight(15.h),
|
sizedBoxHeight(15.h),
|
||||||
CustomTextFormField(
|
CustomTextFormField(
|
||||||
leadingIcon: Container(
|
leadingIcon: Container(
|
||||||
height: 17.h,
|
height: 17.h,
|
||||||
width: 22.w,
|
width: 24.w,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
"assets/images/png/Frame 12 (1).png",
|
"assets/images/png/Frame 12.png",
|
||||||
height: 17.h,
|
height: 17.h,
|
||||||
width: 22.w,
|
width: 22.w,
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "loremipsum@gmail.com",
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Enter your e-mail address';
|
||||||
|
}
|
||||||
|
if (!RegExp(
|
||||||
|
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
|
||||||
|
.hasMatch(value)) {
|
||||||
|
return 'Enter a valid e-mail address';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
inputFormatters: [
|
||||||
|
LengthLimitingTextInputFormatter(50),
|
||||||
|
RemoveEmojiInputFormatter()
|
||||||
|
],
|
||||||
|
textEditingController: emailcontroller,
|
||||||
|
hintText: "Enter email address",
|
||||||
),
|
),
|
||||||
|
sizedBoxHeight(10.h),
|
||||||
text16400white("Reason to contact"),
|
text16400white("Reason to contact"),
|
||||||
sizedBoxHeight(15.h),
|
sizedBoxHeight(15.h),
|
||||||
CustomDropDownRadio(
|
CustomDropDownRadio(
|
||||||
@@ -122,7 +216,7 @@ class _ReportABugState extends State<ReportABug> {
|
|||||||
"Constant logout",
|
"Constant logout",
|
||||||
"Unable to view post"
|
"Unable to view post"
|
||||||
],
|
],
|
||||||
onItemSelected: (p0) {},
|
onItemSelected: _onItemSelected,
|
||||||
leadingImage: Image.asset(
|
leadingImage: Image.asset(
|
||||||
"assets/images/png/codicon_bug.png",
|
"assets/images/png/codicon_bug.png",
|
||||||
height: 23.h,
|
height: 23.h,
|
||||||
@@ -135,13 +229,40 @@ class _ReportABugState extends State<ReportABug> {
|
|||||||
sizedBoxHeight(15.h),
|
sizedBoxHeight(15.h),
|
||||||
CustomTextFormField2(
|
CustomTextFormField2(
|
||||||
maxlines: 3,
|
maxlines: 3,
|
||||||
hintText:
|
hintText: "Enter query",
|
||||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
|
validator: (value) {
|
||||||
|
if (value!.isEmpty) {
|
||||||
|
return 'Enter your full name ';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
inputFormatters: [
|
||||||
|
// LengthLimitingTextInputFormatter(20),
|
||||||
|
RemoveEmojiInputFormatter(),
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp('[a-zA-Z ]'))
|
||||||
|
],
|
||||||
|
textEditingController: querycontroller,
|
||||||
),
|
),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
CommonBtn(text: "Send")
|
CustomButton(
|
||||||
])),
|
onPressed: () {
|
||||||
|
if (deviceoscontroller.text.isBlank! &&
|
||||||
|
versionoscontroller.text.isBlank! &&
|
||||||
|
querycontroller.text.isBlank! &&
|
||||||
|
emailcontroller.text.isBlank! &&
|
||||||
|
_selectedreasontocontact.isEmpty) {
|
||||||
|
utils.showToast("Please fill all fields");
|
||||||
|
} else {
|
||||||
|
Uploadata();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
text: "Send")
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
]));
|
])),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:glassmorphism/glassmorphism.dart';
|
import 'package:glassmorphism/glassmorphism.dart';
|
||||||
@@ -9,6 +10,7 @@ import 'package:regroup/Utils/Common/blureffect.dart';
|
|||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
import 'package:regroup/resources/routes/route_name.dart';
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class Settings extends StatefulWidget {
|
class Settings extends StatefulWidget {
|
||||||
const Settings({super.key});
|
const Settings({super.key});
|
||||||
@@ -56,6 +58,16 @@ class _SettingsState extends State<Settings> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
commonDivider(),
|
commonDivider(),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(RouteName.editProfile);
|
||||||
|
},
|
||||||
|
child: rowTile(
|
||||||
|
imagePath: "assets/images/png/edit 1.png",
|
||||||
|
text: "Edit profile",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
commonDivider(),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(RouteName.helpandsupport);
|
Get.toNamed(RouteName.helpandsupport);
|
||||||
@@ -146,8 +158,15 @@ class _SettingsState extends State<Settings> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
commonGlassContainer(
|
GestureDetector(
|
||||||
width: 140.w,
|
onTap: () async {
|
||||||
|
SharedPreferences prefs =
|
||||||
|
await SharedPreferences.getInstance();
|
||||||
|
await prefs.clear();
|
||||||
|
Get.offAllNamed(RouteName.loginScreen);
|
||||||
|
},
|
||||||
|
child: commonGlassContainer(
|
||||||
|
width: 130.w,
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
borderradius: 30.r,
|
borderradius: 30.r,
|
||||||
opacity1: 0.05,
|
opacity1: 0.05,
|
||||||
@@ -155,9 +174,10 @@ class _SettingsState extends State<Settings> {
|
|||||||
customWidget:
|
customWidget:
|
||||||
Center(child: text14400white("Yes, I want to")),
|
Center(child: text14400white("Yes, I want to")),
|
||||||
border: 1),
|
border: 1),
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
width: 140.w,
|
width: 130.w,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0xFFD90B2E),
|
color: Color(0xFFD90B2E),
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
borderRadius: BorderRadius.circular(30.r),
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_html/flutter_html.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
|
||||||
|
|
||||||
class TermsCondition extends StatefulWidget {
|
class TermsCondition extends StatefulWidget {
|
||||||
const TermsCondition({super.key});
|
const TermsCondition({super.key});
|
||||||
@@ -23,28 +24,85 @@ class _TermsConditionState extends State<TermsCondition> {
|
|||||||
appBar: CommonAppbar(
|
appBar: CommonAppbar(
|
||||||
titleTxt: "Terms & Condition",
|
titleTxt: "Terms & Condition",
|
||||||
),
|
),
|
||||||
body: Stack(children: [
|
body: FutureBuilder(
|
||||||
|
future: Profilegetmethod().getTermsConditions(),
|
||||||
|
builder: (ctx, snapshot) {
|
||||||
|
if (snapshot.data == null) {
|
||||||
|
return Center(child: CircularProgressIndicator());
|
||||||
|
}
|
||||||
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
return Center(
|
||||||
|
child: Text(
|
||||||
|
'${snapshot.error} occured',
|
||||||
|
style: TextStyle(fontSize: 18.spMin),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return termsobj!.data!.isBlank!
|
||||||
|
? _buildNoDataBody(context)
|
||||||
|
: _buildBody(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildNoDataBody(context) {
|
||||||
|
return Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"No Data Found",
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 16.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildBody(context) {
|
||||||
|
return Stack(children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
text18w700white(
|
Html(
|
||||||
"Regroup is a community where everyone can belong"),
|
data: termsobj!.data!.content,
|
||||||
sizedBoxHeight(20.h),
|
style: {
|
||||||
text16400whiteblur(
|
"html": Style(
|
||||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."),
|
color: Colors.white, // Text color
|
||||||
sizedBoxHeight(20.h),
|
fontFamily: "Poppins", // Font family
|
||||||
text16400whiteblur(
|
fontSize: FontSize(18), // Font size
|
||||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.")
|
fontWeight: FontWeight.w700, // Font weight
|
||||||
|
),
|
||||||
|
"p": Style(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: FontSize(18.sp),
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
"a": Style(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: FontSize(18.sp),
|
||||||
|
fontWeight: FontWeight.w500
|
||||||
|
// Link color
|
||||||
|
),
|
||||||
|
},
|
||||||
|
)
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
]));
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,20 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||||
import 'package:regroup/Common/CommonGlassmorphism.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/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.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/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/dialogs.dart';
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
import 'package:timer_button/timer_button.dart';
|
||||||
|
|
||||||
class VerifyCode extends StatefulWidget {
|
class VerifyCode extends StatefulWidget {
|
||||||
const VerifyCode({super.key});
|
const VerifyCode({super.key});
|
||||||
@@ -17,8 +24,59 @@ class VerifyCode extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _VerifyCodeState extends State<VerifyCode> {
|
class _VerifyCodeState extends State<VerifyCode> {
|
||||||
final TextEditingController pincodeController = TextEditingController();
|
TextEditingController pincodeController = TextEditingController();
|
||||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
// 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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -44,34 +102,97 @@ class _VerifyCodeState extends State<VerifyCode> {
|
|||||||
text20700white("Check your email"),
|
text20700white("Check your email"),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
text14400whiteblur(
|
text14400whiteblur(
|
||||||
"Enter the verification code that we sent to loremipsum@gmail.com"),
|
"Enter the verification code that we sent to $emailid"),
|
||||||
sizedBoxHeight(30.h),
|
sizedBoxHeight(30.h),
|
||||||
text16400white("Enter code"),
|
text16400white("Enter code"),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
commonGlassContainer(
|
PinCodeTextField(
|
||||||
width: double.infinity,
|
validator: (value) {
|
||||||
height: 50.h,
|
if (value != null && value.isEmpty) {
|
||||||
borderradius: 30.r,
|
return "Please Enter verification code";
|
||||||
border: 1,
|
} else if (value != null && value.length < 4) {
|
||||||
customWidget: CustomPinCodeField(
|
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,
|
controller: pincodeController,
|
||||||
|
onCompleted: (v) {
|
||||||
|
print("Completed");
|
||||||
|
},
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
print(value);
|
print(value);
|
||||||
|
setState(() {
|
||||||
|
// currentText = value;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onCompleted: (value) {
|
cursorColor: Colors.white,
|
||||||
print("Completed");
|
textStyle: TextStyle(
|
||||||
pincodeController.text = value;
|
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),
|
sizedBoxHeight(70.h),
|
||||||
CustomButton(
|
CustomButton(
|
||||||
text: 'Continue',
|
text: 'Continue',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (pincodeController.text.isEmpty) {
|
if (pincodeController.text.isEmpty) {
|
||||||
utils.showToast("Pin field is empty");
|
utils.showToast("Pin field is empty");
|
||||||
|
} else if (pincodeController.text.length < 4) {
|
||||||
|
utils.showToast("OTP length should be 4 digits");
|
||||||
} else {
|
} else {
|
||||||
return;
|
Uploadata();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -85,122 +206,176 @@ class _VerifyCodeState extends State<VerifyCode> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CustomPinCodeField extends StatefulWidget {
|
// class CustomPinCodeField extends StatefulWidget {
|
||||||
final TextEditingController controller;
|
// final TextEditingController controller;
|
||||||
final ValueChanged<String> onChanged;
|
// final ValueChanged<String> onChanged;
|
||||||
final ValueChanged<String> onCompleted;
|
// final ValueChanged<String> onCompleted;
|
||||||
|
|
||||||
CustomPinCodeField({
|
// CustomPinCodeField({
|
||||||
required this.controller,
|
// required this.controller,
|
||||||
required this.onChanged,
|
// required this.onChanged,
|
||||||
required this.onCompleted,
|
// required this.onCompleted,
|
||||||
});
|
// });
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
_CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
|
// _CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
|
||||||
}
|
// }
|
||||||
|
|
||||||
class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
|
// class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
|
||||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||||
late List<TextEditingController> _controllers;
|
// late List<TextEditingController> _controllers;
|
||||||
late List<FocusNode> _focusNodes;
|
// late List<FocusNode> _focusNodes;
|
||||||
String _currentText = "";
|
// String _currentText = "";
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void initState() {
|
// void initState() {
|
||||||
super.initState();
|
// super.initState();
|
||||||
_controllers = List.generate(4, (_) => TextEditingController());
|
// _controllers = List.generate(4, (_) => TextEditingController());
|
||||||
_focusNodes = List.generate(4, (_) => FocusNode());
|
// _focusNodes = List.generate(4, (_) => FocusNode());
|
||||||
}
|
// }
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
void dispose() {
|
// void dispose() {
|
||||||
_controllers.forEach((controller) => controller.dispose());
|
// _controllers.forEach((controller) => controller.dispose());
|
||||||
_focusNodes.forEach((focusNode) => focusNode.dispose());
|
// _focusNodes.forEach((focusNode) => focusNode.dispose());
|
||||||
super.dispose();
|
// super.dispose();
|
||||||
}
|
// }
|
||||||
|
|
||||||
String? _validate(int index) {
|
// String? _validate(int index) {
|
||||||
// _currentText = _controllers.map((controller) => controller.text).join();
|
// if (_controllers[index].text.isEmpty) {
|
||||||
if (_currentText[index].isEmpty) {
|
// return "Please enter verification code";
|
||||||
return "Please Enter verification code";
|
// } else if (_controllers[index].text.length > 1) {
|
||||||
} else if (_currentText.length < 4) {
|
// return "Please enter only one digit";
|
||||||
return "OTP length should be at least 4";
|
// }
|
||||||
}
|
// return null;
|
||||||
return null;
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
void _onChanged(String value, int index) {
|
// void _onChanged(String value, int index) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
_currentText = _controllers.map((controller) => controller.text).join();
|
// _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);
|
|
||||||
|
|
||||||
if (_currentText.length == 4) {
|
// if (value.isNotEmpty) {
|
||||||
widget.onCompleted(_currentText);
|
// 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
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
return Form(
|
// return Form(
|
||||||
key: _formKey,
|
// key: _formKey,
|
||||||
child: Row(
|
// child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// children: [
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
// commonGlassContainer(
|
||||||
children: List.generate(4, (index) {
|
// width: double.infinity,
|
||||||
return Row(
|
// height: 50.h,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
// borderradius: 30.r,
|
||||||
children: [
|
// border: 1,
|
||||||
Center(
|
// customWidget: Row(
|
||||||
child: Container(
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
width: 30,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
height: 40,
|
// children: List.generate(4, (index) {
|
||||||
// color: Colors.amber,
|
// return Row(
|
||||||
child: Center(
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
child: TextFormField(
|
// children: [
|
||||||
controller: _controllers[index],
|
// Center(
|
||||||
focusNode: _focusNodes[index],
|
// child: Container(
|
||||||
keyboardType: TextInputType.number,
|
// width: 30,
|
||||||
inputFormatters: [
|
// height: 40,
|
||||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
// child: Center(
|
||||||
LengthLimitingTextInputFormatter(1),
|
// child: TextFormField(
|
||||||
],
|
// controller: _controllers[index],
|
||||||
textAlign: TextAlign.center,
|
// focusNode: _focusNodes[index],
|
||||||
style: TextStyle(
|
// keyboardType: TextInputType.number,
|
||||||
color: Colors.white,
|
// inputFormatters: [
|
||||||
fontSize: 20.sp,
|
// FilteringTextInputFormatter.allow(
|
||||||
fontFamily: 'Helvetica',
|
// RegExp('[0-9]')),
|
||||||
),
|
// LengthLimitingTextInputFormatter(1),
|
||||||
decoration: InputDecoration(
|
// ],
|
||||||
border: InputBorder.none,
|
// textAlign: TextAlign.center,
|
||||||
errorStyle: TextStyle(height: 0),
|
// style: TextStyle(
|
||||||
),
|
// color: Colors.white,
|
||||||
onChanged: (value) => _onChanged(value, index),
|
// fontSize: 20,
|
||||||
validator: (value) {
|
// fontFamily: 'Helvetica',
|
||||||
if (index == 3) return _validate(index);
|
// ),
|
||||||
return null;
|
// 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,
|
// if (index != 3)
|
||||||
margin: EdgeInsets.symmetric(horizontal: 10),
|
// 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,172 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:regroup/Common/CommonWidget.dart';
|
||||||
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ViewModel/NotificationApi.dart';
|
||||||
|
import 'package:regroup/Utils/Common/CommonAppbar.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';
|
||||||
|
|
||||||
|
class NotificationScreen extends StatefulWidget {
|
||||||
|
const NotificationScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<NotificationScreen> createState() => _NotificationScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _NotificationScreenState extends State<NotificationScreen> {
|
||||||
|
var switchValues = List<bool>.generate(5, (index) => false).obs;
|
||||||
|
|
||||||
|
void toggleSwitch(int index, bool value) {
|
||||||
|
switchValues[index] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
String switchValueFinal(int index) {
|
||||||
|
return switchValues[index] ? '1' : '0';
|
||||||
|
}
|
||||||
|
|
||||||
|
void switchValueBool() {
|
||||||
|
final notifications = [
|
||||||
|
fetchNoti!.data!.groupNotification,
|
||||||
|
fetchNoti!.data!.communityNotification,
|
||||||
|
fetchNoti!.data!.followerNotification,
|
||||||
|
fetchNoti!.data!.newFollowerNotification,
|
||||||
|
fetchNoti!.data!.directMessageNotification,
|
||||||
|
];
|
||||||
|
|
||||||
|
for (int i = 0; i < notifications.length; i++) {
|
||||||
|
toggleSwitch(i, notifications[i] == 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> updateNotification() async {
|
||||||
|
Map<String, String> updata = {
|
||||||
|
"group_notification": switchValueFinal(0),
|
||||||
|
"community_notification": switchValueFinal(1),
|
||||||
|
"follower_notification": switchValueFinal(2),
|
||||||
|
"new_follower_notification": switchValueFinal(3),
|
||||||
|
"direct_message_notification": switchValueFinal(4),
|
||||||
|
};
|
||||||
|
final data = await NotificationAPI().notificationPostApi(updata);
|
||||||
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
|
utils.showToast('Notification updated');
|
||||||
|
} else {
|
||||||
|
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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
late Future myfuture;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
myfuture = NotificationAPI().getNotification();
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
|
backgroundColor: Color(0xFF222935),
|
||||||
|
extendBody: true,
|
||||||
|
appBar: CommonAppbar(
|
||||||
|
titleTxt: "Notifications",
|
||||||
|
),
|
||||||
|
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) {
|
||||||
|
switchValueBool();
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
sizedBoxHeight(20.h),
|
||||||
|
rowTile(text: "Group notification", index: 0),
|
||||||
|
commonDivider(),
|
||||||
|
rowTile(text: "Community notification", index: 1),
|
||||||
|
commonDivider(),
|
||||||
|
rowTile(text: "Follower notification", index: 2),
|
||||||
|
commonDivider(),
|
||||||
|
rowTile(text: "New follower notification", index: 3),
|
||||||
|
commonDivider(),
|
||||||
|
rowTile(text: "Direct message notification", index: 4),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Container();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget rowTile({required String text, required int index}) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 20.h),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
text16w400_FCFCFC(text),
|
||||||
|
Spacer(),
|
||||||
|
Obx(
|
||||||
|
() => Transform.scale(
|
||||||
|
scaleY: 1,
|
||||||
|
child: CupertinoSwitch(
|
||||||
|
value: switchValues[index],
|
||||||
|
trackColor: Colors.white.withOpacity(0.4),
|
||||||
|
activeColor: Color(0xFF34C759),
|
||||||
|
onChanged: (bool? value) {
|
||||||
|
toggleSwitch(index, value ?? false);
|
||||||
|
updateNotification();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
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/FetchNotification.dart';
|
||||||
|
|
||||||
|
FetchNotification? fetchNoti;
|
||||||
|
|
||||||
|
class NotificationAPI {
|
||||||
|
NotificationAPI();
|
||||||
|
// class otpAPI {
|
||||||
|
// otpAPI(this.data);
|
||||||
|
// var data;
|
||||||
|
Future<ResponseData<dynamic>> notificationPostApi(var data) async {
|
||||||
|
final response = await NetworkApiServices().postApi(
|
||||||
|
data,
|
||||||
|
ApiUrls.postnotification,
|
||||||
|
// "https://regroup.betadelivery.com/api/v1/forgot-password",
|
||||||
|
);
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> getNotification() async {
|
||||||
|
final response = await NetworkApiServices().getApi(
|
||||||
|
ApiUrls.getnotification,
|
||||||
|
);
|
||||||
|
fetchNoti = FetchNotification.fromJson(response.data);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import 'package:regroup/Common/CommonButton.dart';
|
|||||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||||
import 'package:regroup/Common/CommonWidget.dart';
|
import 'package:regroup/Common/CommonWidget.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.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/CustomTextformfield.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
@@ -22,6 +23,19 @@ class _AddTimelineState extends State<AddTimeline> {
|
|||||||
TextEditingController dateController = TextEditingController();
|
TextEditingController dateController = TextEditingController();
|
||||||
TextEditingController dateController2 = TextEditingController();
|
TextEditingController dateController2 = TextEditingController();
|
||||||
|
|
||||||
|
final List<String> _dropdownProductItems = [
|
||||||
|
'Individual',
|
||||||
|
'Business',
|
||||||
|
];
|
||||||
|
|
||||||
|
String _selectedAccountType = '';
|
||||||
|
|
||||||
|
void _onItemSelected(String value) {
|
||||||
|
setState(() {
|
||||||
|
_selectedAccountType = value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
RxBool isChecked = false.obs;
|
RxBool isChecked = false.obs;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
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),
|
sizedBoxHeight(80.h),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:developer';
|
||||||
|
|
||||||
|
import 'package:regroup/Common/api_urls.dart';
|
||||||
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/faqModel.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followersModel.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/followingModel.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/privacyPolicyModel.dart';
|
||||||
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Model/termsconditionsModel.dart';
|
||||||
|
|
||||||
|
FaqModel? faqobj;
|
||||||
|
PrivacypolicyModel? privacyobj;
|
||||||
|
TermsConditionsModel? termsobj;
|
||||||
|
FollowersModel? followersobj;
|
||||||
|
FollowingModel? followingobj;
|
||||||
|
|
||||||
|
class Profilegetmethod {
|
||||||
|
Future<ResponseData<dynamic>> getFaqs() async {
|
||||||
|
final response = await NetworkApiServices().getApi(
|
||||||
|
ApiUrls.getfaqs,
|
||||||
|
// optionalpar: false
|
||||||
|
);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
faqobj = FaqModel.fromJson(response.data);
|
||||||
|
log(faqobj!.data.toString());
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> getPrivacypolicy() async {
|
||||||
|
final response = await NetworkApiServices().getApi(
|
||||||
|
ApiUrls.getprivacypolicy,
|
||||||
|
// optionalpar: false
|
||||||
|
);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
privacyobj = PrivacypolicyModel.fromJson(response.data);
|
||||||
|
log(privacyobj!.data.toString());
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> getTermsConditions() async {
|
||||||
|
final response = await NetworkApiServices().getApi(
|
||||||
|
ApiUrls.gettermsconditios,
|
||||||
|
// optionalpar: false
|
||||||
|
);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
termsobj = TermsConditionsModel.fromJson(response.data);
|
||||||
|
log(termsobj!.data.toString());
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> getFollowers(updata,
|
||||||
|
{required StreamController<FollowersModel> streamController}) async {
|
||||||
|
final response = await NetworkApiServices().getApi(
|
||||||
|
"${ApiUrls.getfollowers}?search=$updata",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
followersobj = FollowersModel.fromJson(response.data);
|
||||||
|
if (!streamController.isClosed) streamController.sink.add(followersobj!);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> getFollowing(updata,
|
||||||
|
{required StreamController<FollowingModel> streamController}) async {
|
||||||
|
final response = await NetworkApiServices().getApi(
|
||||||
|
"${ApiUrls.getfollowing}?search=$updata",
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
followingobj = FollowingModel.fromJson(response.data);
|
||||||
|
if (!streamController.isClosed) streamController.sink.add(followingobj!);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
import 'package:regroup/Common/api_urls.dart';
|
||||||
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||||
|
|
||||||
|
class Profilepostmethod {
|
||||||
|
Profilepostmethod();
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> postContactus(updata) async {
|
||||||
|
print("updata is $updata");
|
||||||
|
final response = await NetworkApiServices().postApi(
|
||||||
|
updata,
|
||||||
|
ApiUrls.postcontactus,
|
||||||
|
);
|
||||||
|
print("response is ${response.data}");
|
||||||
|
print("response message is ${response.message}");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> postReportandbug(updata) async {
|
||||||
|
print("updata is $updata");
|
||||||
|
final response = await NetworkApiServices().postApi(
|
||||||
|
updata,
|
||||||
|
ApiUrls.postreportbug,
|
||||||
|
);
|
||||||
|
print("response is ${response.data}");
|
||||||
|
print("response message is ${response.message}");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> postBlockuser(updata) async {
|
||||||
|
print("updata is $updata");
|
||||||
|
final response = await NetworkApiServices().postApi(
|
||||||
|
updata,
|
||||||
|
ApiUrls.postblock,
|
||||||
|
);
|
||||||
|
print("response is ${response.data}");
|
||||||
|
print("response message is ${response.message}");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> postunfollowuser(updata) async {
|
||||||
|
print("updata is $updata");
|
||||||
|
final response = await NetworkApiServices().postApi(
|
||||||
|
updata,
|
||||||
|
ApiUrls.postunfollow,
|
||||||
|
);
|
||||||
|
print("response is ${response.data}");
|
||||||
|
print("response message is ${response.message}");
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData<dynamic>> postRemoveuser(updata) async {
|
||||||
|
print("updata is $updata");
|
||||||
|
final response = await NetworkApiServices().postApi(
|
||||||
|
updata,
|
||||||
|
ApiUrls.postremoveuser,
|
||||||
|
);
|
||||||
|
print("response is ${response.data}");
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,12 +50,13 @@ class _AnnouncementsState extends State<Announcements> {
|
|||||||
titleTxt: "Announcements",
|
titleTxt: "Announcements",
|
||||||
),
|
),
|
||||||
body: Stack(children: [
|
body: Stack(children: [
|
||||||
const CommonBlurLeftRed(),
|
Container(
|
||||||
const CommonBlurRightRed(),
|
decoration: const BoxDecoration(
|
||||||
const CommonBlurLeft(),
|
image: DecorationImage(
|
||||||
const CommonBlurRight(),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
Positioned.fill(
|
fit: BoxFit.fill)),
|
||||||
child: Padding(
|
),
|
||||||
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -89,7 +90,8 @@ class _AnnouncementsState extends State<Announcements> {
|
|||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
]))))
|
])),
|
||||||
|
),
|
||||||
]),
|
]),
|
||||||
floatingActionButton: Container(
|
floatingActionButton: Container(
|
||||||
height: 55.h,
|
height: 55.h,
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@@ -13,6 +15,7 @@ import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
|||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/dialogs.dart';
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart';
|
||||||
import 'package:regroup/resources/routes/route_name.dart';
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
|
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
|
||||||
@@ -27,9 +30,7 @@ class LoginScreen extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _LoginScreenState extends State<LoginScreen> {
|
class _LoginScreenState extends State<LoginScreen> {
|
||||||
String _accessToken = "";
|
AccessToken? _accessToken;
|
||||||
Map _userData = {};
|
|
||||||
bool _checking = true;
|
|
||||||
final TextEditingController _emailController = TextEditingController();
|
final TextEditingController _emailController = TextEditingController();
|
||||||
RxBool isObscured = true.obs;
|
RxBool isObscured = true.obs;
|
||||||
final TextEditingController _passwordController = TextEditingController();
|
final TextEditingController _passwordController = TextEditingController();
|
||||||
@@ -46,13 +47,20 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
|
|
||||||
_loginWithGoogle() {
|
_loginWithGoogle() {
|
||||||
googleSigninController.handleGoogleSignIn().then((value) async {
|
googleSigninController.handleGoogleSignIn().then((value) async {
|
||||||
if (value != 'Google Sign-In canceled') {
|
|
||||||
final resp = await LoginAPI().storeGoogleSignin(
|
final resp = await LoginAPI().storeGoogleSignin(
|
||||||
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
||||||
|
if (value != 'Google Sign-In canceled') {
|
||||||
if (resp.message == "go-to-signin-via-oauth") {
|
if (resp.message == "go-to-signin-via-oauth") {
|
||||||
// Get.to(()=> );
|
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
arguments: {"email": resp.data});
|
||||||
logger.d("go to sign in");
|
} else if (value == null) {
|
||||||
|
Get.snackbar(
|
||||||
|
'Error',
|
||||||
|
resp.data["message"][0],
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
colorText: Colors.white,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Success!",
|
"Success!",
|
||||||
@@ -64,14 +72,13 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
snackStyle: SnackStyle.FLOATING,
|
snackStyle: SnackStyle.FLOATING,
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
);
|
);
|
||||||
|
|
||||||
Get.toNamed(RouteName.mainscreen);
|
Get.toNamed(RouteName.mainscreen);
|
||||||
logger.d("go to login");
|
logger.d("go to login");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
'Error',
|
'Error',
|
||||||
'Google Sign-In canceled',
|
resp.data["message"][0],
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
colorText: Colors.white,
|
colorText: Colors.white,
|
||||||
@@ -80,54 +87,46 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// _checkIfisLoggedIn() async {
|
_checkIfisLoggedIn() async {
|
||||||
// //user token
|
await _logout();
|
||||||
// final accessToken = await FacebookAuth.instance.accessToken;
|
final accessToken = await FacebookAuth.instance.accessToken;
|
||||||
|
if (accessToken != null) {
|
||||||
|
print("/////////////////////////////////////////xcheck");
|
||||||
|
|
||||||
// setState(() {
|
final userData = await FacebookAuth.instance.getUserData();
|
||||||
// _checking = false;
|
|
||||||
// });
|
|
||||||
|
|
||||||
// if (accessToken != null) {
|
logger.i(accessToken.token);
|
||||||
// print("/////////////////////////////////////////xcheck");
|
logger.i(userData.toString());
|
||||||
// print("worked");
|
} else {
|
||||||
// print(accessToken.toJson());
|
print("/////////////////////////////////////////check");
|
||||||
// final userData = await FacebookAuth.instance.getUserData();
|
_login();
|
||||||
// // _accessToken = accessToken;
|
}
|
||||||
// setState(() {
|
}
|
||||||
// _userData = userData;
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// print("/////////////////////////////////////////check");
|
|
||||||
|
|
||||||
// print("not worked");
|
_login() async {
|
||||||
// _login();
|
final LoginResult result = await FacebookAuth.instance.login();
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _login() async {
|
if (result.status == LoginStatus.success) {
|
||||||
// final LoginResult result = await FacebookAuth.instance.login();
|
_accessToken = result.accessToken;
|
||||||
|
|
||||||
// if (result.status == LoginStatus.success) {
|
final userData = await FacebookAuth.instance.getUserData();
|
||||||
// _accessToken = result.accessToken;
|
logger.i(userData['email']);
|
||||||
|
logger.i(userData['id']);
|
||||||
|
|
||||||
// final userData = await FacebookAuth.instance.getUserData();
|
await LoginAPI().storeFacebookSignin(
|
||||||
// _userData = userData;
|
{"facebook_auth_token": userData['id']},
|
||||||
// } else {
|
emailReceived: userData['email']);
|
||||||
// print(result.status);
|
} else {
|
||||||
// print(result.message);
|
print(result.status);
|
||||||
// }
|
print(result.message);
|
||||||
// setState(() {
|
}
|
||||||
// _checking = false;
|
}
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _logout() async {
|
_logout() async {
|
||||||
// await FacebookAuth.instance.logOut();
|
await FacebookAuth.instance.logOut();
|
||||||
// _accessToken = null;
|
_accessToken = null;
|
||||||
// _userData = null;
|
setState(() {});
|
||||||
// setState(() {});
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
_logincheck() async {
|
_logincheck() async {
|
||||||
if (_emailController.text.isBlank! || _passwordController.text.isBlank!) {
|
if (_emailController.text.isBlank! || _passwordController.text.isBlank!) {
|
||||||
@@ -199,7 +198,9 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GestureDetector(
|
||||||
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Scaffold(
|
||||||
resizeToAvoidBottomInset:
|
resizeToAvoidBottomInset:
|
||||||
false, // Prevent resizing when the keyboard opens
|
false, // Prevent resizing when the keyboard opens
|
||||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||||
@@ -397,12 +398,12 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 220.w,
|
width: 220.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
|
if (Platform.isIOS)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_loginWithApple();
|
_loginWithApple();
|
||||||
Get.toNamed(
|
|
||||||
RouteName.verifygoogleapplepage);
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 55,
|
width: 55,
|
||||||
@@ -428,7 +429,8 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
'assets/images/png/login2.png'))),
|
'assets/images/png/login2.png'))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
// const Spacer(),
|
||||||
|
if (Platform.isAndroid)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_loginWithGoogle();
|
_loginWithGoogle();
|
||||||
@@ -457,19 +459,10 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
'assets/images/png/login3.png'))),
|
'assets/images/png/login3.png'))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
// const Spacer(),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
/* FacebookAuth.instance.login(
|
_checkIfisLoggedIn();
|
||||||
permissions: ['public_profile', 'email'],
|
|
||||||
).then((value) {
|
|
||||||
FacebookAuth.instance.getUserData().then((userData) {
|
|
||||||
setState(() {
|
|
||||||
/* _isLoggedIn = true;
|
|
||||||
_userObj = userData; */
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}); */
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 55,
|
width: 55,
|
||||||
@@ -499,7 +492,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
sizedBoxHeight(100)
|
// sizedBoxHeight(100)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -509,6 +502,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:glassmorphism/glassmorphism.dart';
|
import 'package:glassmorphism/glassmorphism.dart';
|
||||||
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
import 'package:regroup/Common/controller/CommonTextFormField.dart';
|
import 'package:regroup/Common/controller/CommonTextFormField.dart';
|
||||||
|
import 'package:regroup/Global.dart';
|
||||||
|
import 'package:regroup/Login/ViewModel/LoginApi.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||||
@@ -10,10 +14,13 @@ import 'package:regroup/Utils/Common/blureffect.dart';
|
|||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/dialogs.dart';
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
|
|
||||||
class Verifygoogleandapple extends StatefulWidget {
|
class Verifygoogleandapple extends StatefulWidget {
|
||||||
const Verifygoogleandapple({super.key});
|
Verifygoogleandapple({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<Verifygoogleandapple> createState() => _VerifygoogleandappleState();
|
State<Verifygoogleandapple> createState() => _VerifygoogleandappleState();
|
||||||
@@ -22,20 +29,53 @@ class Verifygoogleandapple extends StatefulWidget {
|
|||||||
class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
|
class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
|
||||||
TextEditingController emailidcontroller = TextEditingController();
|
TextEditingController emailidcontroller = TextEditingController();
|
||||||
|
|
||||||
final Map<String, int> _accountTypeMap = {
|
|
||||||
'Individual': 1,
|
|
||||||
'Business': 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
String _selectedAccountType = '';
|
String _selectedAccountType = '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
emailidcontroller.text = Get.arguments['email'];
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
void _onItemSelected(String value) {
|
void _onItemSelected(String value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_selectedAccountType = value;
|
_selectedAccountType = value;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getIdFromAccountType() {
|
||||||
|
if (_selectedAccountType == 'Individual') {
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_createAccountWithOAuth() async {
|
||||||
|
var updata = {
|
||||||
|
"principal_type_xid": getIdFromAccountType(),
|
||||||
|
"email_address": emailidcontroller.text,
|
||||||
|
};
|
||||||
|
|
||||||
|
final resp = await LoginAPI()
|
||||||
|
.storeUserDetailsWhenComingFromGoogleAppleSignin(updata);
|
||||||
|
|
||||||
|
if (resp.status == ResponseStatus.SUCCESS) {
|
||||||
|
if (_selectedAccountType == 'Individual') {
|
||||||
|
Get.toNamed(RouteName.tellusindividualscreen);
|
||||||
|
} else {
|
||||||
|
Get.toNamed(RouteName.tellusbusinessscreen);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Get.snackbar(
|
||||||
|
'Error',
|
||||||
|
'Google Sign-In canceled',
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
colorText: Colors.white,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -169,13 +209,11 @@ class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
|
|||||||
CustomButton(
|
CustomButton(
|
||||||
text: "Continue",
|
text: "Continue",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (
|
if (emailidcontroller.text.isEmpty &&
|
||||||
// isValid!
|
|
||||||
emailidcontroller.text.isEmpty &&
|
|
||||||
_selectedAccountType.isEmpty) {
|
_selectedAccountType.isEmpty) {
|
||||||
utils.showToast('Please fill all fields');
|
utils.showToast('Please fill all fields');
|
||||||
} else {
|
} else {
|
||||||
// Uploadata();
|
_createAccountWithOAuth();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
const Spacer()
|
const Spacer()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:regroup/Common/base_manager.dart';
|
|||||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||||
import 'package:regroup/Global.dart';
|
import 'package:regroup/Global.dart';
|
||||||
import 'package:regroup/Login/Model/LoginModel.dart';
|
import 'package:regroup/Login/Model/LoginModel.dart';
|
||||||
|
import 'package:regroup/onboarding/Signup/view_model/getUserprofile.dart';
|
||||||
import 'package:regroup/resources/routes/route_name.dart';
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
@@ -14,6 +15,7 @@ class LoginAPI {
|
|||||||
.postApi(data, ApiUrls.getlogin, optionalpar: true);
|
.postApi(data, ApiUrls.getlogin, optionalpar: true);
|
||||||
|
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
String? accountype;
|
||||||
if (response.data['status'] == 'success') {
|
if (response.data['status'] == 'success') {
|
||||||
LoginModel loginObj = LoginModel.fromJson(response.data);
|
LoginModel loginObj = LoginModel.fromJson(response.data);
|
||||||
await prefs.setString('access-token', loginObj.data!.accessToken!);
|
await prefs.setString('access-token', loginObj.data!.accessToken!);
|
||||||
@@ -31,16 +33,17 @@ class LoginAPI {
|
|||||||
myusername = loginObj.data?.userData?.userName;
|
myusername = loginObj.data?.userData?.userName;
|
||||||
fullname = loginObj.data?.userData?.fullName;
|
fullname = loginObj.data?.userData?.fullName;
|
||||||
phonenumber = loginObj.data?.userData?.phoneNumber;
|
phonenumber = loginObj.data?.userData?.phoneNumber;
|
||||||
|
await prefs.setString('accountTypefromLogin',
|
||||||
|
loginObj.data?.userData?.principalTypeXid.toString() ?? "");
|
||||||
print("token is ${loginObj.data!.accessToken!}");
|
print("token is ${loginObj.data!.accessToken!}");
|
||||||
|
|
||||||
if (loginObj.data?.userData?.isProfileUpdated == 0) {
|
if (loginObj.data?.userData?.isProfileUpdated == 0) {
|
||||||
String? accountype =
|
accountype = loginObj.data?.userData?.principalTypeXid.toString();
|
||||||
loginObj.data?.userData?.principalTypeXid.toString();
|
|
||||||
|
|
||||||
if (accountype == "1") {
|
if (accountype == "1") {
|
||||||
print('tell us individyal');
|
print('tell us individyal');
|
||||||
Get.toNamed(RouteName.tellusindividualscreen,
|
Get.toNamed(
|
||||||
|
RouteName.tellusindividualscreen,
|
||||||
// arguments: {
|
// arguments: {
|
||||||
// 'pageroute' : "mainscreen"
|
// 'pageroute' : "mainscreen"
|
||||||
// }
|
// }
|
||||||
@@ -48,7 +51,8 @@ class LoginAPI {
|
|||||||
} else if (accountype == "2") {
|
} else if (accountype == "2") {
|
||||||
print('tell us business');
|
print('tell us business');
|
||||||
|
|
||||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
Get.toNamed(
|
||||||
|
RouteName.tellusbusinessscreen,
|
||||||
// arguments: {
|
// arguments: {
|
||||||
// 'pageroute' : "mainscreen"
|
// 'pageroute' : "mainscreen"
|
||||||
// }
|
// }
|
||||||
@@ -73,9 +77,52 @@ class LoginAPI {
|
|||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
await prefs.setString('access-token', response.data['data']['token']);
|
await prefs.setString('access-token', response.data['data']['token']);
|
||||||
if (response.data['data']['is_account_type_updated'] == 3) {
|
if (response.data['data']['is_account_type_updated'] == 3) {
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
"go-to-signin-via-oauth", ResponseStatus.SUCCESS,
|
||||||
|
data: response.data['data']['email']);
|
||||||
|
} else {
|
||||||
|
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData> storeAppleSignin(var data,
|
||||||
|
{String? emailReceived}) async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
final response = await NetworkApiServices()
|
||||||
|
.postApi(data, ApiUrls.applelogin, optionalpar: true);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
await prefs.setString('access-token', response.data['data']['token']);
|
||||||
|
if (response.data['data']['is_account_type_updated'] == 3) {
|
||||||
|
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||||
|
arguments: {"email": emailReceived});
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
|
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
|
||||||
} else {
|
} else {
|
||||||
|
Get.toNamed(RouteName.mainscreen);
|
||||||
|
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ResponseData> storeFacebookSignin(var data,
|
||||||
|
{String? emailReceived}) async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
final response = await NetworkApiServices()
|
||||||
|
.postApi(data, ApiUrls.facebooklogin, optionalpar: true);
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
await prefs.setString('access-token', response.data['data']['token']);
|
||||||
|
if (response.data['data']['is_account_type_updated'] == 3) {
|
||||||
|
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||||
|
arguments: {"email": emailReceived});
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
|
||||||
|
} else {
|
||||||
|
Get.toNamed(RouteName.mainscreen);
|
||||||
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
|
return ResponseData<dynamic>("go-to-login", ResponseStatus.SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,10 +132,12 @@ class LoginAPI {
|
|||||||
|
|
||||||
Future<ResponseData> storeUserDetailsWhenComingFromGoogleAppleSignin(
|
Future<ResponseData> storeUserDetailsWhenComingFromGoogleAppleSignin(
|
||||||
var data) async {
|
var data) async {
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
||||||
final response = await NetworkApiServices()
|
final response = await NetworkApiServices()
|
||||||
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: true);
|
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: false);
|
||||||
if (response.status == ResponseStatus.SUCCESS) {}
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
response.data['message'], ResponseStatus.SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:regroup/Login/ViewModel/LoginApi.dart';
|
||||||
import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
||||||
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
|
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
|
||||||
|
|
||||||
@@ -15,6 +16,8 @@ class AppleOAuthService {
|
|||||||
logger.d("fullname is ${credential.givenName}");
|
logger.d("fullname is ${credential.givenName}");
|
||||||
logger.d("token is ${credential.userIdentifier}");
|
logger.d("token is ${credential.userIdentifier}");
|
||||||
|
|
||||||
|
await LoginAPI()
|
||||||
|
.storeAppleSignin({"apple_auth_token": credential.userIdentifier}, emailReceived:credential.email );
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print("Error occured");
|
print("Error occured");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||||
@@ -12,7 +13,7 @@ class CustomDropDownWidgetSignup extends StatefulWidget {
|
|||||||
required this.title,
|
required this.title,
|
||||||
required this.listData,
|
required this.listData,
|
||||||
required this.onItemSelected,
|
required this.onItemSelected,
|
||||||
required this.leadingImage,
|
this.leadingImage,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final String header;
|
final String header;
|
||||||
@@ -73,7 +74,13 @@ class _CustomDropDownWidgetSignupState
|
|||||||
// 'assets/images/png/user.png',
|
// 'assets/images/png/user.png',
|
||||||
// ),
|
// ),
|
||||||
|
|
||||||
widget.leadingImage!,
|
widget.leadingImage == null
|
||||||
|
?
|
||||||
|
SizedBox()
|
||||||
|
:
|
||||||
|
widget.leadingImage!
|
||||||
|
,
|
||||||
|
|
||||||
SizedBox(width: 16.w),
|
SizedBox(width: 16.w),
|
||||||
Text(
|
Text(
|
||||||
selectedValue.value.isEmpty
|
selectedValue.value.isEmpty
|
||||||
@@ -493,6 +500,7 @@ class _CustomDropDownTagState extends State<CustomDropDownTag> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
class CustomDropDownRadio extends StatefulWidget {
|
class CustomDropDownRadio extends StatefulWidget {
|
||||||
const CustomDropDownRadio({
|
const CustomDropDownRadio({
|
||||||
Key? key,
|
Key? key,
|
||||||
@@ -533,6 +541,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
|||||||
selectedValue.value = item;
|
selectedValue.value = item;
|
||||||
_textController.clear();
|
_textController.clear();
|
||||||
widget.onItemSelected(item);
|
widget.onItemSelected(item);
|
||||||
|
onDropTap.value = !onDropTap.value;
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
@@ -662,9 +671,11 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 50.h,
|
height: 52.h,
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
top: 14.0, bottom: 14.0, right: 22.w, left: 12.w),
|
right: 22.w,
|
||||||
|
left: 12.w,
|
||||||
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||||
borderRadius: onDropTap.value
|
borderRadius: onDropTap.value
|
||||||
@@ -682,13 +693,13 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
|||||||
),
|
),
|
||||||
border: Border.all(color: const Color(0xFF434A53)),
|
border: Border.all(color: const Color(0xFF434A53)),
|
||||||
),
|
),
|
||||||
|
child: Center(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
Row(
|
|
||||||
children: [
|
children: [
|
||||||
widget.leadingImage!,
|
widget.leadingImage!,
|
||||||
SizedBox(width: 16.w),
|
SizedBox(width: 12.w),
|
||||||
Text(
|
Text(
|
||||||
selectedValue.value.isEmpty
|
selectedValue.value.isEmpty
|
||||||
? widget.header
|
? widget.header
|
||||||
@@ -699,8 +710,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
|||||||
fontFamily: 'Helvetica',
|
fontFamily: 'Helvetica',
|
||||||
fontWeight: FontWeight.w400),
|
fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
],
|
Spacer(),
|
||||||
),
|
|
||||||
onDropTap.value
|
onDropTap.value
|
||||||
? Image.asset('assets/images/png/arrowup.png')
|
? Image.asset('assets/images/png/arrowup.png')
|
||||||
: Image.asset('assets/images/png/arrowdown.png'),
|
: Image.asset('assets/images/png/arrowdown.png'),
|
||||||
@@ -708,6 +718,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
if (onDropTap.value)
|
if (onDropTap.value)
|
||||||
Scrollbar(
|
Scrollbar(
|
||||||
// thumbVisibility: true,
|
// thumbVisibility: true,
|
||||||
@@ -742,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 {
|
class CustomDropDownCheckBox extends StatefulWidget {
|
||||||
const CustomDropDownCheckBox({
|
const CustomDropDownCheckBox({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
|||||||
prefixIcon: widget.leadingIcon == null
|
prefixIcon: widget.leadingIcon == null
|
||||||
? null
|
? null
|
||||||
: Padding(
|
: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w, vertical: 13.h),
|
||||||
child: widget.leadingIcon!,
|
child: widget.leadingIcon!,
|
||||||
),
|
),
|
||||||
suffixIcon: widget.isInputPassword
|
suffixIcon: widget.isInputPassword
|
||||||
@@ -164,7 +165,7 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
|||||||
: widget.suffixIcon!,
|
: widget.suffixIcon!,
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
contentPadding:
|
contentPadding:
|
||||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
EdgeInsets.symmetric(horizontal: 20.h, vertical: 13.w),
|
||||||
),
|
),
|
||||||
keyboardType: widget.texttype,
|
keyboardType: widget.texttype,
|
||||||
inputFormatters: widget.inputFormatters,
|
inputFormatters: widget.inputFormatters,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class ImageUploadBottomSheet {
|
|||||||
.getImage(ImageSource.camera);
|
.getImage(ImageSource.camera);
|
||||||
onImagePicked(result);
|
onImagePicked(result);
|
||||||
|
|
||||||
Get.back();
|
// Get.back();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -116,7 +116,7 @@ class ImageUploadBottomSheet {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
var result = await FilePickerMethod().pickFile();
|
var result = await FilePickerMethod().pickFile();
|
||||||
onImagePicked(result?.path ?? "");
|
onImagePicked(result?.path ?? "");
|
||||||
Get.back();
|
// Get.back();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -155,7 +155,7 @@ class ImageUploadBottomSheet {
|
|||||||
.getImage(ImageSource.camera);
|
.getImage(ImageSource.camera);
|
||||||
onImagePicked(result);
|
onImagePicked(result);
|
||||||
|
|
||||||
Get.back();
|
// Get.back();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -187,7 +187,7 @@ class ImageUploadBottomSheet {
|
|||||||
var result = await ImagePickerMethod()
|
var result = await ImagePickerMethod()
|
||||||
.getImage(ImageSource.gallery);
|
.getImage(ImageSource.gallery);
|
||||||
onImagePicked(result);
|
onImagePicked(result);
|
||||||
Get.back();
|
// Get.back();
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -32,16 +32,6 @@ class GoogleAuthService extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> handleGoogleSignIn() async {
|
Future<String?> handleGoogleSignIn() async {
|
||||||
// await FirebaseAuth.instance.signOut();
|
|
||||||
|
|
||||||
// Map<String, dynamic> updata = {
|
|
||||||
// "username": "kishan1",
|
|
||||||
// "email": "kishan1@gmail.com",
|
|
||||||
// "phone": "123456564",
|
|
||||||
// "ID": "efsfsfsefsef"
|
|
||||||
// };
|
|
||||||
// GoogleSigninApi().googleSigninApi(updata);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Sign out the user if they are already signed in
|
// Sign out the user if they are already signed in
|
||||||
await _googleSignIn.signOut();
|
await _googleSignIn.signOut();
|
||||||
@@ -88,7 +78,7 @@ class GoogleAuthService extends GetxController {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Handle any errors that occurred during the sign-in process.
|
// Handle any errors that occurred during the sign-in process.
|
||||||
print('Error during Google Sign-In: $error');
|
print('Error during Google Sign-In: $error');
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ class utils {
|
|||||||
elevation: 0,
|
elevation: 0,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
child: WillPopScope(
|
child: WillPopScope(
|
||||||
child: Container(
|
child: const Column(
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
@@ -24,7 +23,6 @@ class utils {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
onWillPop: () async => false),
|
onWillPop: () async => false),
|
||||||
),
|
),
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
|
|||||||
@@ -414,6 +414,16 @@ Widget text10400white(String text) {
|
|||||||
fontWeight: FontWeight.w400),
|
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) {
|
Widget text6400white(String text) {
|
||||||
return Text(
|
return Text(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
import 'package:device_info_plus/device_info_plus.dart';
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
@@ -98,11 +99,11 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
// _connectionStatus = result;
|
// _connectionStatus = result;
|
||||||
// });
|
// });
|
||||||
|
|
||||||
if (result.contains(ConnectivityResult.wifi) || result.contains(ConnectivityResult.mobile)) {
|
if (result.contains(ConnectivityResult.wifi) ||
|
||||||
|
result.contains(ConnectivityResult.mobile)) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_connectionStatus = result;
|
_connectionStatus = result;
|
||||||
Get.back(result: true);
|
Get.back(result: true);
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -159,9 +160,9 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||||
|
|
||||||
//do not remove this coomented code
|
//do not remove this coomented code
|
||||||
// if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
// _getStoragePermission();
|
_getStoragePermission();
|
||||||
// }
|
}
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +182,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||||||
fontFamily: 'Cambria',
|
fontFamily: 'Cambria',
|
||||||
),
|
),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
initialRoute: RouteName.splashScreen,
|
initialRoute: RouteName.profiletabbusguest,
|
||||||
getPages: AppRoutes.appRoutes(),
|
getPages: AppRoutes.appRoutes(),
|
||||||
),
|
),
|
||||||
designSize: const Size(390, 844),
|
designSize: const Size(390, 844),
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
];
|
];
|
||||||
|
|
||||||
String _selectedbusinesstype = '';
|
String _selectedbusinesstype = '';
|
||||||
// String business_type = '';
|
|
||||||
|
|
||||||
void _onItemSelected(String value) {
|
void _onItemSelected(String value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -46,8 +45,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// String pagename = Get.arguments["pageroute"];
|
|
||||||
|
|
||||||
String getBusinessTypeId(String selectedBusinessType) {
|
String getBusinessTypeId(String selectedBusinessType) {
|
||||||
if (selectedBusinessType.contains("Retail")) {
|
if (selectedBusinessType.contains("Retail")) {
|
||||||
return '1';
|
return '1';
|
||||||
@@ -91,120 +88,71 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
};
|
};
|
||||||
final data = await BusinessAPI().tellUsBusinessApi(updata);
|
final data = await BusinessAPI().tellUsBusinessApi(updata);
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
// await global.setname();
|
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Success!",
|
"Success!",
|
||||||
'success!',
|
'success!',
|
||||||
duration: Duration(seconds: 2),
|
duration: const Duration(seconds: 2),
|
||||||
colorText: Colors.white,
|
colorText: Colors.white,
|
||||||
backgroundColor: Colors.green,
|
backgroundColor: Colors.green,
|
||||||
margin: EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
snackStyle: SnackStyle.FLOATING,
|
snackStyle: SnackStyle.FLOATING,
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
);
|
);
|
||||||
|
|
||||||
// if (pagename == "nextscreen") {
|
|
||||||
Get.toNamed(RouteName.businessletusunderstandstep1);
|
Get.toNamed(RouteName.businessletusunderstandstep1);
|
||||||
|
|
||||||
// } else if (pagename == "mainscreen") {
|
|
||||||
// Get.toNamed(RouteName.mainscreen);
|
|
||||||
// }
|
|
||||||
|
|
||||||
} else if (data.status == ResponseStatus.FAILED) {
|
} else if (data.status == ResponseStatus.FAILED) {
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error!",
|
"Error!",
|
||||||
data.message,
|
data.message,
|
||||||
duration: Duration(seconds: 2),
|
duration: const Duration(seconds: 2),
|
||||||
colorText: Colors.white,
|
colorText: Colors.white,
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
margin: EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
snackStyle: SnackStyle.FLOATING,
|
snackStyle: SnackStyle.FLOATING,
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
);
|
);
|
||||||
// _controller.isTextFieldEnabled.value = true;
|
|
||||||
} else {
|
} else {
|
||||||
// btnController.reset();
|
|
||||||
Get.snackbar(
|
Get.snackbar(
|
||||||
"Error!",
|
"Error!",
|
||||||
data.data['message'],
|
data.data['message'],
|
||||||
duration: Duration(seconds: 2),
|
duration: const Duration(seconds: 2),
|
||||||
colorText: Colors.white,
|
colorText: Colors.white,
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
margin: EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
snackStyle: SnackStyle.FLOATING,
|
snackStyle: SnackStyle.FLOATING,
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
);
|
);
|
||||||
// _controller.isTextFieldEnabled.value = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return GestureDetector(
|
||||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
|
child: Scaffold(
|
||||||
|
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||||
body: Stack(children: [
|
body: Stack(children: [
|
||||||
// Positioned(top: 90, left: -30, child: CommonBlurLeftSecond()),
|
|
||||||
// Positioned(top: 300, right: -30, child: CommonBlurRightSecond()),
|
|
||||||
// Positioned(top: 490, left: -30, child: CommonBlurLeftBlue()),
|
|
||||||
// GlassmorphicContainer(
|
|
||||||
// width: MediaQuery.of(context).size.width,
|
|
||||||
// height:
|
|
||||||
// // 500.h,
|
|
||||||
// MediaQuery.of(context).size.height,
|
|
||||||
// borderRadius: 2,
|
|
||||||
// blur: 6,
|
|
||||||
// alignment: Alignment.bottomLeft,
|
|
||||||
// border: 2,
|
|
||||||
// linearGradient: LinearGradient(
|
|
||||||
// begin: Alignment.topCenter,
|
|
||||||
// end: Alignment.bottomCenter,
|
|
||||||
// colors: [
|
|
||||||
// Color(0XFF222935).withOpacity(0.60),
|
|
||||||
// Color(0XFF222935).withOpacity(0.60),
|
|
||||||
// Color(0XFF222935).withOpacity(0.60),
|
|
||||||
// Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// borderGradient: LinearGradient(
|
|
||||||
// begin: Alignment.topCenter,
|
|
||||||
// end: Alignment.bottomCenter,
|
|
||||||
// colors: [
|
|
||||||
// // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// // Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color(0XFF222935).withOpacity(0.60),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
fit: BoxFit.fill)),
|
fit: BoxFit.fill)),
|
||||||
),
|
),
|
||||||
|
ListView(physics: const ScrollPhysics(), children: [
|
||||||
ListView(physics: ScrollPhysics(), children: [
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// const Spacer(flex: 1),
|
|
||||||
sizedBoxHeight(60.h),
|
sizedBoxHeight(60.h),
|
||||||
Center(child: text20400white('Tell us about your business')),
|
Center(
|
||||||
|
child: text20400white('Tell us about your business')),
|
||||||
sizedBoxHeight(10.w),
|
sizedBoxHeight(10.w),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 154,
|
width: 154,
|
||||||
decoration: ShapeDecoration(
|
decoration: const ShapeDecoration(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
width: 1,
|
width: 1,
|
||||||
@@ -221,14 +169,11 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
textEditingController: businessownerController,
|
textEditingController: businessownerController,
|
||||||
texttype: TextInputType.text,
|
texttype: TextInputType.text,
|
||||||
hintText: "Enter your business owner name",
|
hintText: "Enter your business owner name",
|
||||||
leadingIcon:
|
leadingIcon: Image.asset(
|
||||||
// const Icon(Icons.mail_outline),
|
|
||||||
Image.asset(
|
|
||||||
width: 22.w,
|
width: 22.w,
|
||||||
height: 17.h,
|
height: 17.h,
|
||||||
'assets/images/png/user.png',
|
'assets/images/png/user.png',
|
||||||
),
|
),
|
||||||
// validatorText: "Enter your business owner name",
|
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
return 'Enter your business owner name';
|
return 'Enter your business owner name';
|
||||||
@@ -236,7 +181,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// LengthLimitingTextInputFormatter(20),
|
|
||||||
RemoveEmojiInputFormatter(),
|
RemoveEmojiInputFormatter(),
|
||||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||||
],
|
],
|
||||||
@@ -248,14 +192,11 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
textEditingController: businessNameController,
|
textEditingController: businessNameController,
|
||||||
texttype: TextInputType.text,
|
texttype: TextInputType.text,
|
||||||
hintText: "Enter your business name",
|
hintText: "Enter your business name",
|
||||||
leadingIcon:
|
leadingIcon: Image.asset(
|
||||||
// const Icon(Icons.mail_outline),
|
|
||||||
Image.asset(
|
|
||||||
width: 22.w,
|
width: 22.w,
|
||||||
height: 17.h,
|
height: 17.h,
|
||||||
'assets/images/png/briefcase.png',
|
'assets/images/png/briefcase.png',
|
||||||
),
|
),
|
||||||
// validatorText: "Enter your business name",
|
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
return 'Enter your business name ';
|
return 'Enter your business name ';
|
||||||
@@ -263,7 +204,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// LengthLimitingTextInputFormatter(20),
|
|
||||||
RemoveEmojiInputFormatter(),
|
RemoveEmojiInputFormatter(),
|
||||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||||
],
|
],
|
||||||
@@ -275,14 +215,11 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
textEditingController: businesslocationController,
|
textEditingController: businesslocationController,
|
||||||
texttype: TextInputType.text,
|
texttype: TextInputType.text,
|
||||||
hintText: "Enter your business location",
|
hintText: "Enter your business location",
|
||||||
leadingIcon:
|
leadingIcon: Image.asset(
|
||||||
// const Icon(Icons.mail_outline),
|
|
||||||
Image.asset(
|
|
||||||
width: 22.w,
|
width: 22.w,
|
||||||
height: 17.h,
|
height: 17.h,
|
||||||
'assets/images/png/location.png',
|
'assets/images/png/location.png',
|
||||||
),
|
),
|
||||||
// validatorText: "Enter your business location",
|
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
return 'Enter your business location ';
|
return 'Enter your business location ';
|
||||||
@@ -290,7 +227,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// LengthLimitingTextInputFormatter(20),
|
|
||||||
RemoveEmojiInputFormatter(),
|
RemoveEmojiInputFormatter(),
|
||||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||||
],
|
],
|
||||||
@@ -298,7 +234,7 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
text16400white('Type of business'),
|
text16400white('Type of business'),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
CustomDropDownWidgetSignup(
|
CustomDropDownRadio(
|
||||||
header: 'Select type of business',
|
header: 'Select type of business',
|
||||||
title: '',
|
title: '',
|
||||||
listData: _businesslist,
|
listData: _businesslist,
|
||||||
@@ -306,29 +242,18 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
|||||||
leadingImage:
|
leadingImage:
|
||||||
Image.asset('assets/images/png/briefcase.png'),
|
Image.asset('assets/images/png/briefcase.png'),
|
||||||
),
|
),
|
||||||
|
|
||||||
sizedBoxHeight(50.h),
|
sizedBoxHeight(50.h),
|
||||||
CustomButton(
|
CustomButton(
|
||||||
text: "Continue",
|
text: "Continue",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_tellUsBusinessDone();
|
_tellUsBusinessDone();
|
||||||
// if (_selectedbusinesstype.isNotEmpty) {
|
|
||||||
// Get.toNamed(RouteName.businessletusunderstandstep1);
|
|
||||||
|
|
||||||
// // Get.to(() => BusinessPage());
|
|
||||||
// } else {
|
|
||||||
// // Handle case where no selection is made
|
|
||||||
// utils.showToast('Please select an gender type');
|
|
||||||
// }
|
|
||||||
}),
|
}),
|
||||||
sizedBoxHeight(30.h),
|
sizedBoxHeight(30.h),
|
||||||
// const Spacer(
|
|
||||||
// flex: 3,
|
|
||||||
// )
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
]));
|
])),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,17 +8,11 @@ class BusinessAPI {
|
|||||||
|
|
||||||
Future<ResponseData<dynamic>> tellUsBusinessApi(var data) async {
|
Future<ResponseData<dynamic>> tellUsBusinessApi(var data) async {
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
final response = await NetworkApiServices().postApi(
|
final response =
|
||||||
data,
|
await NetworkApiServices().postApi(data, ApiUrls.tellUsBusinessApi);
|
||||||
ApiUrls.tellUsBusinessApi
|
|
||||||
// "https://regroup.betadelivery.com/api/v1/tell-us-about-your-business",
|
|
||||||
// optionalpar: true
|
|
||||||
);
|
|
||||||
|
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
|
||||||
if (response.data['status'] == 'success') {
|
if (response.data['status'] == 'success') {
|
||||||
// LoginModel loginObj = LoginModel.fromJson(response.data);
|
|
||||||
} else {
|
} else {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
response.data['message'], ResponseStatus.FAILED);
|
response.data['message'], ResponseStatus.FAILED);
|
||||||
@@ -27,16 +21,13 @@ class BusinessAPI {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
|
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
|
||||||
final response = await NetworkApiServices().postApi(
|
final response = await NetworkApiServices().postApi(
|
||||||
data,
|
data,
|
||||||
ApiUrls.letUsUnderstandApi,
|
ApiUrls.letUsUnderstandApi,
|
||||||
// "https://regroup.betadelivery.com/api/v1/update-business-profile-step-1",
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
|
||||||
if (response.data['status'] == "success") {
|
if (response.data['status'] == "success") {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
response.data['message'], ResponseStatus.SUCCESS);
|
response.data['message'], ResponseStatus.SUCCESS);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
|
|
||||||
Color _getGradientColor(int id) {
|
Color _getGradientColor(int id) {
|
||||||
if (_selectedIndices.contains(id)) {
|
if (_selectedIndices.contains(id)) {
|
||||||
return Color(0XFFD90B2E); // Selected color
|
return const Color(0XFFD90B2E); // Selected color
|
||||||
}
|
}
|
||||||
return Colors.transparent; // Default color
|
return Colors.transparent; // Default color
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||||
bottomNavigationBar: Padding(
|
bottomNavigationBar: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||||
child: CustomButton(
|
child: CustomButton(
|
||||||
@@ -129,7 +129,8 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
// RouteName.individualgroupstep3);
|
// RouteName.individualgroupstep3);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
body: FutureBuilder(
|
body: SafeArea(
|
||||||
|
child: FutureBuilder(
|
||||||
future: Getonboard().getIndividualactivity(),
|
future: Getonboard().getIndividualactivity(),
|
||||||
builder: (ctx, snapshot) {
|
builder: (ctx, snapshot) {
|
||||||
if (snapshot.data == null) {
|
if (snapshot.data == null) {
|
||||||
@@ -152,44 +153,14 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
|
Container(
|
||||||
Positioned(
|
decoration: const BoxDecoration(
|
||||||
top: 450, right: -30, child: CommonBlurRightSecond()),
|
image: DecorationImage(
|
||||||
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
|
image: AssetImage(
|
||||||
GlassmorphicContainer(
|
"assets/images/png/Ellipse 1496.png"),
|
||||||
width: MediaQuery.of(context).size.width,
|
fit: BoxFit.fill)),
|
||||||
height: MediaQuery.of(context).size.height,
|
|
||||||
borderRadius: 2,
|
|
||||||
blur: 6,
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
border: 2,
|
|
||||||
linearGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
borderGradient: LinearGradient(
|
Padding(
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
|
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
@@ -224,7 +195,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
height: 25.h,
|
height: 25.h,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: const BorderSide(
|
||||||
width: 1, color: Color(0xFF434A53)),
|
width: 1, color: Color(0xFF434A53)),
|
||||||
borderRadius: BorderRadius.circular(30),
|
borderRadius: BorderRadius.circular(30),
|
||||||
),
|
),
|
||||||
@@ -238,7 +209,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
width: 120.w,
|
width: 120.w,
|
||||||
height: 15.h,
|
height: 15.h,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: const LinearGradient(
|
||||||
begin: Alignment(0.98, -0.21),
|
begin: Alignment(0.98, -0.21),
|
||||||
end: Alignment(-0.98, 0.21),
|
end: Alignment(-0.98, 0.21),
|
||||||
colors: [
|
colors: [
|
||||||
@@ -259,7 +230,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
width: 15,
|
width: 15,
|
||||||
height: 15,
|
height: 15,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: const LinearGradient(
|
||||||
begin: Alignment(0.98, -0.21),
|
begin: Alignment(0.98, -0.21),
|
||||||
end: Alignment(-0.98, 0.21),
|
end: Alignment(-0.98, 0.21),
|
||||||
colors: [
|
colors: [
|
||||||
@@ -296,7 +267,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 154.w,
|
width: 154.w,
|
||||||
decoration: ShapeDecoration(
|
decoration: const ShapeDecoration(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
width: 1,
|
width: 1,
|
||||||
@@ -310,7 +281,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
),
|
),
|
||||||
sizedBoxHeight(30.h),
|
sizedBoxHeight(30.h),
|
||||||
GridView.builder(
|
GridView.builder(
|
||||||
physics: ScrollPhysics(),
|
physics: const ScrollPhysics(),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
gridDelegate:
|
gridDelegate:
|
||||||
SliverGridDelegateWithFixedCrossAxisCount(
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
@@ -430,11 +401,11 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
//
|
//
|
||||||
),
|
),
|
||||||
@@ -471,12 +442,12 @@ class ActivityContainer extends StatelessWidget {
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () => onTap(index),
|
onTap: () => onTap(index),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 110.w,
|
// width: 110.w,
|
||||||
height: 120.h,
|
// height: 120.h,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin: const Alignment(0.98, -0.21),
|
begin: const Alignment(0.98, -0.21),
|
||||||
end: Alignment(-0.98, 0.21),
|
end: const Alignment(-0.98, 0.21),
|
||||||
colors: isSelected
|
colors: isSelected
|
||||||
? [
|
? [
|
||||||
gradientColor.withOpacity(0.80),
|
gradientColor.withOpacity(0.80),
|
||||||
@@ -490,12 +461,12 @@ class ActivityContainer extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
side: const BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
padding: EdgeInsets.symmetric(horizontal: 0.w, vertical: 10.h),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@@ -523,7 +494,7 @@ class ActivityContainer extends StatelessWidget {
|
|||||||
width: 50.w,
|
width: 50.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
),
|
),
|
||||||
Spacer(flex: 3),
|
const Spacer(flex: 3),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: Text(
|
child: Text(
|
||||||
titleString,
|
titleString,
|
||||||
|
|||||||
@@ -83,70 +83,16 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
|||||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||||
bottomNavigationBar: Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
|
||||||
child: CustomButton(
|
|
||||||
text: "Continue",
|
|
||||||
onPressed: () {
|
|
||||||
// Get.toNamed(RouteName.individualcommunitystep4);
|
|
||||||
if (_selectedIndices.isEmpty) {
|
|
||||||
utils.showToast('Please select activity');
|
|
||||||
} else {
|
|
||||||
print(_selectedIndices.toString());
|
|
||||||
// String selectedIndicesString =
|
|
||||||
// _selectedIndices.join(',');
|
|
||||||
// print(
|
|
||||||
// 'Selected Indices: [$selectedIndicesString]');
|
|
||||||
Uploadata();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
|
Container(
|
||||||
Positioned(top: 400, right: -30, child: CommonBlurRightSecond()),
|
decoration: const BoxDecoration(
|
||||||
Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()),
|
image: DecorationImage(
|
||||||
SingleChildScrollView(
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
child: GlassmorphicContainer(
|
fit: BoxFit.fill)),
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
height:
|
|
||||||
// 500.h,
|
|
||||||
MediaQuery.of(context).size.height,
|
|
||||||
borderRadius: 2,
|
|
||||||
blur: 6,
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
border: 2,
|
|
||||||
linearGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
borderGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child:
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 40.h),
|
||||||
horizontal: 16.w, vertical: 50.h),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -178,8 +124,7 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
|||||||
height: 25.h,
|
height: 25.h,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||||
width: 1, color: Color(0xFF434A53)),
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
borderRadius: BorderRadius.circular(30),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -201,13 +146,11 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(30),
|
||||||
BorderRadius.circular(30),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
MainAxisAlignment.end,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 15,
|
width: 15,
|
||||||
@@ -240,8 +183,7 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
|||||||
children: [
|
children: [
|
||||||
text20400white('Find your group'),
|
text20400white('Find your group'),
|
||||||
sizedBoxWidth(5.w),
|
sizedBoxWidth(5.w),
|
||||||
Image.asset(
|
Image.asset('assets/images/png/informationicon.png')
|
||||||
'assets/images/png/informationicon.png')
|
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
sizedBoxHeight(10.w),
|
sizedBoxHeight(10.w),
|
||||||
@@ -299,8 +241,7 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
|||||||
if (snapshot.connectionState ==
|
if (snapshot.connectionState ==
|
||||||
ConnectionState.waiting) {
|
ConnectionState.waiting) {
|
||||||
// Display shimmer effect while waiting for data
|
// Display shimmer effect while waiting for data
|
||||||
return Center(
|
return Center(child: CircularProgressIndicator());
|
||||||
child: CircularProgressIndicator());
|
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
// Handle error state
|
// Handle error state
|
||||||
return Center(
|
return Center(
|
||||||
@@ -328,17 +269,14 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
|||||||
height:
|
height:
|
||||||
150.0, // Adjust this height according to your design
|
150.0, // Adjust this height according to your design
|
||||||
child: GroupSelect(
|
child: GroupSelect(
|
||||||
titleString: grouplistobj!
|
titleString:
|
||||||
.data![index].title!,
|
grouplistobj!.data![index].title!,
|
||||||
image: grouplistobj
|
image: grouplistobj
|
||||||
?.data?[index]
|
?.data?[index]?.groupImage ??
|
||||||
?.groupImage ??
|
|
||||||
'',
|
'',
|
||||||
index: grouplistobj!
|
index: grouplistobj!.data![index].id!,
|
||||||
.data![index].id!,
|
isSelected: _selectedIndices.contains(
|
||||||
isSelected: _selectedIndices
|
grouplistobj!.data![index].id!),
|
||||||
.contains(grouplistobj!
|
|
||||||
.data![index].id!),
|
|
||||||
onTap: _onContainerTap,
|
onTap: _onContainerTap,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -348,9 +286,25 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
// sizedBoxHeight(40.h),
|
||||||
|
CustomButton(
|
||||||
|
text: "Continue",
|
||||||
|
onPressed: () {
|
||||||
|
// Get.toNamed(RouteName.individualcommunitystep4);
|
||||||
|
if (_selectedIndices.isEmpty) {
|
||||||
|
utils.showToast('Please select activity');
|
||||||
|
} else {
|
||||||
|
print(_selectedIndices.toString());
|
||||||
|
// String selectedIndicesString =
|
||||||
|
// _selectedIndices.join(',');
|
||||||
|
// print(
|
||||||
|
// 'Selected Indices: [$selectedIndicesString]');
|
||||||
|
Uploadata();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
|||||||
@@ -84,69 +84,16 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
|||||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||||
bottomNavigationBar: Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
|
||||||
child: CustomButton(
|
|
||||||
text: "Continue",
|
|
||||||
onPressed: () {
|
|
||||||
// Get.toNamed(RouteName.individualcommunitystep4);
|
|
||||||
if (_selectedIndices.isEmpty) {
|
|
||||||
utils.showToast('Please select activity');
|
|
||||||
} else {
|
|
||||||
print(_selectedIndices.toString());
|
|
||||||
// String selectedIndicesString =
|
|
||||||
// _selectedIndices.join(',');
|
|
||||||
// print(
|
|
||||||
// 'Selected Indices: [$selectedIndicesString]');
|
|
||||||
Uploadata();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
|
Container(
|
||||||
Positioned(top: 400, right: -30, child: CommonBlurRightSecond()),
|
decoration: const BoxDecoration(
|
||||||
Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()),
|
image: DecorationImage(
|
||||||
SingleChildScrollView(
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
child: GlassmorphicContainer(
|
fit: BoxFit.fill)),
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
height:
|
|
||||||
// 500.h,
|
|
||||||
MediaQuery.of(context).size.height,
|
|
||||||
borderRadius: 2,
|
|
||||||
blur: 6,
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
border: 2,
|
|
||||||
linearGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
borderGradient: LinearGradient(
|
Padding(
|
||||||
begin: Alignment.topCenter,
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 40.h),
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 16.w, vertical: 50.h),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -178,8 +125,7 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
|||||||
height: 25.h,
|
height: 25.h,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||||
width: 1, color: Color(0xFF434A53)),
|
|
||||||
borderRadius: BorderRadius.circular(30),
|
borderRadius: BorderRadius.circular(30),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -202,21 +148,18 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius: BorderRadius.circular(30),
|
||||||
BorderRadius.circular(30),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
MainAxisAlignment.end,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 15,
|
width: 15,
|
||||||
height: 15,
|
height: 15,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin:
|
begin: Alignment(0.98, -0.21),
|
||||||
Alignment(0.98, -0.21),
|
|
||||||
end: Alignment(-0.98, 0.21),
|
end: Alignment(-0.98, 0.21),
|
||||||
colors: [
|
colors: [
|
||||||
Color(0xFFD90B2E),
|
Color(0xFFD90B2E),
|
||||||
@@ -225,8 +168,7 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
|||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(
|
BorderRadius.circular(30),
|
||||||
30),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -302,8 +244,7 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
|||||||
if (snapshot.connectionState ==
|
if (snapshot.connectionState ==
|
||||||
ConnectionState.waiting) {
|
ConnectionState.waiting) {
|
||||||
// Display shimmer effect while waiting for data
|
// Display shimmer effect while waiting for data
|
||||||
return Center(
|
return Center(child: CircularProgressIndicator());
|
||||||
child: CircularProgressIndicator());
|
|
||||||
} else if (snapshot.hasError) {
|
} else if (snapshot.hasError) {
|
||||||
// Handle error state
|
// Handle error state
|
||||||
return Center(
|
return Center(
|
||||||
@@ -325,24 +266,21 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
|||||||
crossAxisSpacing: 12.0,
|
crossAxisSpacing: 12.0,
|
||||||
mainAxisSpacing: 12.0,
|
mainAxisSpacing: 12.0,
|
||||||
),
|
),
|
||||||
itemCount:
|
itemCount: communitylistobj!.data!.length,
|
||||||
communitylistobj!.data!.length,
|
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height:
|
height:
|
||||||
150.0, // Adjust this height according to your design
|
150.0, // Adjust this height according to your design
|
||||||
child: CommunitySelect(
|
child: CommunitySelect(
|
||||||
titleString: communitylistobj!
|
titleString: communitylistobj!
|
||||||
.data![index]
|
.data![index].communityName!,
|
||||||
.communityName!,
|
image: communitylistobj?.data?[index]
|
||||||
image: communitylistobj
|
|
||||||
?.data?[index]
|
|
||||||
?.communityProfilePhoto ??
|
?.communityProfilePhoto ??
|
||||||
'',
|
'',
|
||||||
index: communitylistobj!
|
index: communitylistobj!
|
||||||
.data![index].id!,
|
.data![index].id!,
|
||||||
isSelected: _selectedIndices
|
isSelected: _selectedIndices.contains(
|
||||||
.contains(communitylistobj!
|
communitylistobj!
|
||||||
.data![index].id!),
|
.data![index].id!),
|
||||||
onTap: _onContainerTap,
|
onTap: _onContainerTap,
|
||||||
),
|
),
|
||||||
@@ -353,9 +291,25 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
// sizedBoxHeight(30),
|
||||||
|
CustomButton(
|
||||||
|
text: "Continue",
|
||||||
|
onPressed: () {
|
||||||
|
// Get.toNamed(RouteName.individualcommunitystep4);
|
||||||
|
if (_selectedIndices.isEmpty) {
|
||||||
|
utils.showToast('Please select activity');
|
||||||
|
} else {
|
||||||
|
print(_selectedIndices.toString());
|
||||||
|
// String selectedIndicesString =
|
||||||
|
// _selectedIndices.join(',');
|
||||||
|
// print(
|
||||||
|
// 'Selected Indices: [$selectedIndicesString]');
|
||||||
|
Uploadata();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
TextEditingController datecontroller = TextEditingController();
|
TextEditingController datecontroller = TextEditingController();
|
||||||
TextEditingController locationcontroller = TextEditingController();
|
TextEditingController locationcontroller = TextEditingController();
|
||||||
|
|
||||||
// String pagename = Get.arguments["pageroute"];
|
|
||||||
|
|
||||||
|
|
||||||
DateTime? _selectedDate;
|
DateTime? _selectedDate;
|
||||||
final photographController = TextEditingController();
|
final photographController = TextEditingController();
|
||||||
|
|
||||||
@@ -46,9 +43,24 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
Get.put(ProfileImageController());
|
Get.put(ProfileImageController());
|
||||||
|
|
||||||
Future<void> _selectDate(BuildContext context) async {
|
Future<void> _selectDate(BuildContext context) async {
|
||||||
DateTime yesterday = DateTime.now().subtract(Duration(days: 1));
|
DateTime yesterday = DateTime.now().subtract(const Duration(days: 1));
|
||||||
DateTime eighteenYearsAgo =
|
DateTime eighteenYearsAgo =
|
||||||
DateTime.now().subtract(const Duration(days: 365 * 18));
|
DateTime.now().subtract(const Duration(days: 365 * 18));
|
||||||
|
|
||||||
|
final ThemeData customTheme = Theme.of(context).copyWith(
|
||||||
|
colorScheme: const ColorScheme.light(
|
||||||
|
primary: Color(0xFFD90B2E),
|
||||||
|
surfaceTint: Color(0xFF222935),
|
||||||
|
surface: Color(0xFF222935),
|
||||||
|
onPrimary: Colors.white,
|
||||||
|
onSurface: Colors.white,
|
||||||
|
onSecondary: Colors.white),
|
||||||
|
textButtonTheme: TextButtonThemeData(
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: const Color(0xFFD90B2E),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
final DateTime? pickedDate = await showDatePicker(
|
final DateTime? pickedDate = await showDatePicker(
|
||||||
context: context,
|
context: context,
|
||||||
initialDate: yesterday,
|
initialDate: yesterday,
|
||||||
@@ -56,68 +68,54 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
lastDate: DateTime(2026),
|
lastDate: DateTime(2026),
|
||||||
builder: (BuildContext context, Widget? child) {
|
builder: (BuildContext context, Widget? child) {
|
||||||
return Theme(
|
return Theme(
|
||||||
data: ThemeData.light().copyWith(
|
data: customTheme,
|
||||||
colorScheme: ColorScheme.dark(
|
// ThemeData.light().copyWith(
|
||||||
primary:
|
// colorScheme: ColorScheme.dark(
|
||||||
Color(0XFF222935).withOpacity(0.60), // Change primary color
|
// primary: Color(0XFF222935).withOpacity(0.60),
|
||||||
onPrimary:
|
// onPrimary: Colors.white, // Change text color
|
||||||
// Color(0XFF222935).withOpacity(0.60), // Change primary color
|
// ),
|
||||||
Colors.white
|
// textButtonTheme: TextButtonThemeData(
|
||||||
|
// style: TextButton.styleFrom(
|
||||||
// Colors.white, // Change text color
|
// foregroundColor: Colors.white, // Change button text color
|
||||||
),
|
// ),
|
||||||
textButtonTheme: TextButtonThemeData(
|
// ),
|
||||||
style: TextButton.styleFrom(
|
// dialogBackgroundColor: Color(0XFF222935)
|
||||||
foregroundColor: Colors.white, // Change button text color
|
// .withOpacity(0.60), // Change dialog background color
|
||||||
),
|
// ),
|
||||||
),
|
|
||||||
dialogBackgroundColor:
|
|
||||||
// Color(0xFF434A53),
|
|
||||||
Color(0XFF222935).withOpacity(0.60), // Change primary color
|
|
||||||
|
|
||||||
// // Change dialog background color
|
|
||||||
),
|
|
||||||
child: child!,
|
child: child!,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pickedDate != null) {
|
if (pickedDate != null) {
|
||||||
// if (pickedDate.isBefore(eighteenYearsAgo)) {
|
if (pickedDate.isBefore(eighteenYearsAgo)) {
|
||||||
setState(() {
|
setState(() {
|
||||||
// selectedDate.value = pickedDate;
|
|
||||||
_selectedDate = pickedDate;
|
_selectedDate = pickedDate;
|
||||||
datecontroller.text =
|
datecontroller.text =
|
||||||
"${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}";
|
"${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}";
|
||||||
});
|
});
|
||||||
// // } else {
|
} else {
|
||||||
// showDialog(
|
setState(() {
|
||||||
// context: context,
|
_selectedDate = null;
|
||||||
// builder: (context) {
|
datecontroller.text = ''; // Clear the text field
|
||||||
// return AlertDialog(
|
});
|
||||||
// backgroundColor: Colors.black,
|
|
||||||
// title: const Text(
|
Get.snackbar(
|
||||||
// "Age Restriction",
|
"Error!",
|
||||||
// style: TextStyle(color: Colors.white),
|
'User should be 18+',
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
colorText: Colors.white,
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
margin: const EdgeInsets.all(8),
|
||||||
|
snackStyle: SnackStyle.FLOATING,
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
);
|
||||||
|
// ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
// SnackBar(
|
||||||
|
// content: Text('User should be 18+'),
|
||||||
// ),
|
// ),
|
||||||
// content: const Text(
|
|
||||||
// "Sorry, you must be above 18 years age",
|
|
||||||
// style: TextStyle(color: Colors.white),
|
|
||||||
// ),
|
|
||||||
// actions: [
|
|
||||||
// TextButton(
|
|
||||||
// onPressed: () {
|
|
||||||
// Navigator.of(context).pop();
|
|
||||||
// },
|
|
||||||
// child: const Text(
|
|
||||||
// "OK",
|
|
||||||
// style: TextStyle(color: Colors.white),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
// );
|
||||||
// },
|
}
|
||||||
// );
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,36 +138,20 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
filename: path.basename(editProfileImage.profilePicPath.value),
|
filename: path.basename(editProfileImage.profilePicPath.value),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// imageFile = await Helper.assetImageToMultipartFile(
|
|
||||||
// "assets/images/png/camera.png", "profile");
|
|
||||||
// }
|
|
||||||
|
|
||||||
FormData formData = FormData.fromMap({
|
FormData formData = FormData.fromMap({
|
||||||
"full_name": fullNameController.text,
|
"full_name": fullNameController.text,
|
||||||
"username": userNameController.text,
|
"username": userNameController.text,
|
||||||
"date_of_birth": datecontroller.text,
|
"date_of_birth": datecontroller.text,
|
||||||
"gender": _selectedgendertype,
|
"gender": _selectedgendertype,
|
||||||
'profile_photo':
|
'profile_photo': imageFile,
|
||||||
// editProfileImage.profilePicPath.value.isNotEmpty ?
|
|
||||||
imageFile,
|
|
||||||
// : null,
|
|
||||||
'location': locationcontroller.text,
|
'location': locationcontroller.text,
|
||||||
});
|
});
|
||||||
|
|
||||||
print("formData is $formData");
|
|
||||||
log(formData.toString());
|
|
||||||
final data = await Onboard().PosttellusIndividual(formData);
|
final data = await Onboard().PosttellusIndividual(formData);
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
utils.showToast("tell us done Successfully!");
|
|
||||||
Get.back();
|
Get.back();
|
||||||
// Get.toNamed(RouteName.individualprofilestep1);
|
|
||||||
// if (pagename == "nextscreen") {
|
|
||||||
Get.toNamed(RouteName.individualactivitystep2);
|
Get.toNamed(RouteName.individualactivitystep2);
|
||||||
|
|
||||||
// } else if (pagename == "mainscreen") {
|
|
||||||
// Get.toNamed(RouteName.mainscreen);
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
return utils.showToast(data.message);
|
return utils.showToast(data.message);
|
||||||
@@ -178,57 +160,19 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WillPopScope(
|
return GestureDetector(
|
||||||
onWillPop: () async {
|
|
||||||
SystemNavigator.pop();
|
|
||||||
Navigator.pop(context);
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
|
Container(
|
||||||
Positioned(top: 310, right: -30, child: CommonBlurRightSecond()),
|
decoration: const BoxDecoration(
|
||||||
Positioned(top: 510, left: -30, child: CommonBlurLeftBlue()),
|
image: DecorationImage(
|
||||||
GlassmorphicContainer(
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
width: MediaQuery.of(context).size.width,
|
fit: BoxFit.fill)),
|
||||||
height:
|
|
||||||
// 500.h,
|
|
||||||
MediaQuery.of(context).size.height,
|
|
||||||
borderRadius: 2,
|
|
||||||
blur: 6,
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
border: 2,
|
|
||||||
linearGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
borderGradient: LinearGradient(
|
ListView(physics: const ScrollPhysics(), children: [
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: ListView(physics: ScrollPhysics(), children: [
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -236,13 +180,12 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
children: [
|
children: [
|
||||||
// const Spacer(flex: 1),
|
// const Spacer(flex: 1),
|
||||||
sizedBoxHeight(50.h),
|
sizedBoxHeight(50.h),
|
||||||
Center(
|
Center(child: text20400white('Tell us about yourself')),
|
||||||
child: text20400white('Tell us about yourself')),
|
|
||||||
sizedBoxHeight(10.w),
|
sizedBoxHeight(10.w),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 154,
|
width: 154,
|
||||||
decoration: ShapeDecoration(
|
decoration: const ShapeDecoration(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
width: 1,
|
width: 1,
|
||||||
@@ -260,8 +203,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
false,
|
false,
|
||||||
(result) {
|
(result) {
|
||||||
print("File path is $result");
|
print("File path is $result");
|
||||||
editProfileImage.profilePicPath.value =
|
editProfileImage.profilePicPath.value = result;
|
||||||
result;
|
|
||||||
var filenameresult = extractFileName(result);
|
var filenameresult = extractFileName(result);
|
||||||
print("File name is $filenameresult");
|
print("File name is $filenameresult");
|
||||||
photographController.text = filenameresult;
|
photographController.text = filenameresult;
|
||||||
@@ -282,7 +224,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Color(0XFFD90B2E)
|
color: const Color(0XFFD90B2E)
|
||||||
.withOpacity(0.50),
|
.withOpacity(0.50),
|
||||||
width: 2),
|
width: 2),
|
||||||
),
|
),
|
||||||
@@ -295,7 +237,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Color(0XFFD90B2E)
|
color: const Color(0XFFD90B2E)
|
||||||
.withOpacity(0.50),
|
.withOpacity(0.50),
|
||||||
width: 2),
|
width: 2),
|
||||||
),
|
),
|
||||||
@@ -306,23 +248,16 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: Color(0XFFD90B2E)
|
color: const Color(0XFFD90B2E)
|
||||||
.withOpacity(0.50),
|
.withOpacity(0.50),
|
||||||
width: 2),
|
width: 2),
|
||||||
),
|
),
|
||||||
child: Obx(() =>
|
child: Obx(() => editProfileImage
|
||||||
// editProfileImage
|
.profilePicPath.value !=
|
||||||
// .profilePicPath.value !=
|
|
||||||
// ''
|
|
||||||
// ?
|
|
||||||
editProfileImage.profilePicPath
|
|
||||||
.value !=
|
|
||||||
''
|
''
|
||||||
? ClipOval(
|
? ClipOval(
|
||||||
child:
|
child: SizedBox.fromSize(
|
||||||
SizedBox.fromSize(
|
size: Size.fromRadius(50.r),
|
||||||
size: Size.fromRadius(
|
|
||||||
50.r),
|
|
||||||
child: Image(
|
child: Image(
|
||||||
image: FileImage(
|
image: FileImage(
|
||||||
File(
|
File(
|
||||||
@@ -374,8 +309,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// LengthLimitingTextInputFormatter(20),
|
// LengthLimitingTextInputFormatter(20),
|
||||||
RemoveEmojiInputFormatter(),
|
RemoveEmojiInputFormatter(),
|
||||||
FilteringTextInputFormatter.allow(
|
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||||
RegExp('[a-zA-Z ]'))
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
@@ -402,8 +336,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// LengthLimitingTextInputFormatter(20),
|
// LengthLimitingTextInputFormatter(20),
|
||||||
RemoveEmojiInputFormatter(),
|
RemoveEmojiInputFormatter(),
|
||||||
FilteringTextInputFormatter.allow(
|
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||||
RegExp('[a-zA-Z ]'))
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
@@ -435,7 +368,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
text16400white('Gender'),
|
text16400white('Gender'),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
CustomDropDownWidgetSignup(
|
CustomDropDownRadio(
|
||||||
header: 'Select gender',
|
header: 'Select gender',
|
||||||
title: '',
|
title: '',
|
||||||
listData: _gender,
|
listData: _gender,
|
||||||
@@ -448,8 +381,7 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
children: [
|
children: [
|
||||||
text16400white('Location'),
|
text16400white('Location'),
|
||||||
sizedBoxWidth(5.w),
|
sizedBoxWidth(5.w),
|
||||||
Image.asset(
|
Image.asset('assets/images/png/informationicon.png')
|
||||||
'assets/images/png/informationicon.png')
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
@@ -474,30 +406,19 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
// LengthLimitingTextInputFormatter(20),
|
// LengthLimitingTextInputFormatter(20),
|
||||||
RemoveEmojiInputFormatter(),
|
RemoveEmojiInputFormatter(),
|
||||||
FilteringTextInputFormatter.allow(
|
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||||
RegExp('[a-zA-Z ]'))
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
CustomButton(
|
CustomButton(
|
||||||
text: "Continue",
|
text: "Continue",
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (
|
if (fullNameController.text.isBlank! ||
|
||||||
// isValid!
|
|
||||||
// fullNameController.text.isBlank! &&
|
|
||||||
// userNameController.text.isBlank! &&
|
|
||||||
// datecontroller.text.isBlank! &&
|
|
||||||
// _selectedgendertype.isEmpty &&
|
|
||||||
// locationcontroller.text.isBlank! &&
|
|
||||||
// editProfileImage.profilePicPath.value ==
|
|
||||||
// ''
|
|
||||||
fullNameController.text.isBlank! ||
|
|
||||||
userNameController.text.isBlank! ||
|
userNameController.text.isBlank! ||
|
||||||
datecontroller.text.isBlank! ||
|
datecontroller.text.isBlank! ||
|
||||||
_selectedgendertype.isEmpty ||
|
_selectedgendertype.isEmpty ||
|
||||||
locationcontroller.text.isBlank! ||
|
locationcontroller.text.isBlank! ||
|
||||||
editProfileImage.profilePicPath.value ==
|
editProfileImage.profilePicPath.value == '') {
|
||||||
'') {
|
|
||||||
utils.showToast('Please fill all fields');
|
utils.showToast('Please fill all fields');
|
||||||
} else {
|
} else {
|
||||||
TellusUploadData();
|
TellusUploadData();
|
||||||
@@ -518,10 +439,9 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
])),
|
])
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,47 +23,14 @@ class _CommunitycommitmentState extends State<Communitycommitment> {
|
|||||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
// Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
|
Container(
|
||||||
Positioned(top: 230, right: -30, child: CommonBlurRightSecond()),
|
decoration: const BoxDecoration(
|
||||||
// Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
|
image: DecorationImage(
|
||||||
GlassmorphicContainer(
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
width: MediaQuery.of(context).size.width,
|
fit: BoxFit.fill)),
|
||||||
height:
|
|
||||||
// 500.h,
|
|
||||||
MediaQuery.of(context).size.height,
|
|
||||||
borderRadius: 2,
|
|
||||||
blur: 6,
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
border: 2,
|
|
||||||
linearGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
borderGradient: LinearGradient(
|
Padding(
|
||||||
begin: Alignment.topCenter,
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -83,14 +50,13 @@ class _CommunitycommitmentState extends State<Communitycommitment> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(width: 0.80, color: Color(0xFF434A53)),
|
||||||
width: 0.80, color: Color(0xFF434A53)),
|
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.symmetric(
|
padding:
|
||||||
horizontal: 16.w, vertical: 0.h),
|
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
thumbVisibility: true,
|
thumbVisibility: true,
|
||||||
radius: Radius.circular(20.r),
|
radius: Radius.circular(20.r),
|
||||||
@@ -110,8 +76,7 @@ class _CommunitycommitmentState extends State<Communitycommitment> {
|
|||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
width: 1,
|
width: 1,
|
||||||
strokeAlign:
|
strokeAlign: BorderSide.strokeAlignCenter,
|
||||||
BorderSide.strokeAlignCenter,
|
|
||||||
color: Color(0xFF858585),
|
color: Color(0xFF858585),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -146,7 +111,7 @@ class _CommunitycommitmentState extends State<Communitycommitment> {
|
|||||||
})
|
})
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
)
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,46 +23,13 @@ class _SignupendPageState extends State<SignupendPage> {
|
|||||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned(top: 100, left: -30, child: CommonBlurLeftSecond()),
|
Container(
|
||||||
Positioned(top: 300, right: -30, child: CommonBlurRightSecond()),
|
decoration: const BoxDecoration(
|
||||||
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
|
image: DecorationImage(
|
||||||
Positioned(top: 750, right: 40, child: CommonBlurRightSecond()),
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
GlassmorphicContainer(
|
fit: BoxFit.fill)),
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
height:
|
|
||||||
// 500.h,
|
|
||||||
MediaQuery.of(context).size.height,
|
|
||||||
borderRadius: 2,
|
|
||||||
blur: 6,
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
border: 2,
|
|
||||||
linearGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
borderGradient: LinearGradient(
|
Center(
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Center(
|
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 358.w,
|
width: 358.w,
|
||||||
height: 519.h,
|
height: 519.h,
|
||||||
@@ -76,8 +43,7 @@ class _SignupendPageState extends State<SignupendPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
side:
|
side: BorderSide(width: 0.80, color: Color(0xFF434A53)),
|
||||||
BorderSide(width: 0.80, color: Color(0xFF434A53)),
|
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -87,8 +53,7 @@ class _SignupendPageState extends State<SignupendPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset('assets/images/png/regroupredtexticon.png'),
|
||||||
'assets/images/png/regroupredtexticon.png'),
|
|
||||||
sizedBoxHeight(30.h),
|
sizedBoxHeight(30.h),
|
||||||
text25700white('Welcome Edward '),
|
text25700white('Welcome Edward '),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
@@ -113,7 +78,7 @@ class _SignupendPageState extends State<SignupendPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
)),
|
)
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,25 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:regroup/Common/base_manager.dart';
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
|
import 'package:regroup/Login/ViewModel/LoginApi.dart';
|
||||||
|
import 'package:regroup/Utils/Common/AppleOAuthService.dart';
|
||||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||||
|
import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/dialogs.dart';
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
|
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
|
||||||
import 'package:regroup/resources/routes/route_name.dart';
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class SignupScreen extends StatefulWidget {
|
class SignupScreen extends StatefulWidget {
|
||||||
const SignupScreen({super.key});
|
const SignupScreen({super.key});
|
||||||
@@ -24,13 +32,10 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
TextEditingController emailidcontroller = TextEditingController();
|
TextEditingController emailidcontroller = TextEditingController();
|
||||||
TextEditingController passwordController = TextEditingController();
|
TextEditingController passwordController = TextEditingController();
|
||||||
TextEditingController confirmpasscontroller = TextEditingController();
|
TextEditingController confirmpasscontroller = TextEditingController();
|
||||||
|
AccessToken? _accessToken;
|
||||||
|
|
||||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||||
|
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
|
||||||
List<String> _dropdownProductItems = [
|
|
||||||
'Individual',
|
|
||||||
'Business',
|
|
||||||
];
|
|
||||||
|
|
||||||
final Map<String, int> _accountTypeMap = {
|
final Map<String, int> _accountTypeMap = {
|
||||||
'Individual': 1,
|
'Individual': 1,
|
||||||
@@ -45,37 +50,96 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// void _Signincheck() async {
|
_loginWithApple() {
|
||||||
// if (emailidcontroller.text.isBlank! ||
|
AppleOAuthService().logIn();
|
||||||
// passwordController.text.isBlank! ||
|
}
|
||||||
// confirmpasscontroller.text.isBlank!) {
|
|
||||||
// Get.snackbar(
|
_loginWithGoogle() {
|
||||||
// 'Error',
|
googleSigninController.handleGoogleSignIn().then((value) async {
|
||||||
// 'Enter your credentials',
|
final resp = await LoginAPI().storeGoogleSignin(
|
||||||
// snackPosition: SnackPosition.BOTTOM,
|
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
||||||
// backgroundColor: Colors.red,
|
if (value != 'Google Sign-In canceled') {
|
||||||
// colorText: Colors.white,
|
if (resp.message == "go-to-signin-via-oauth") {
|
||||||
// );
|
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||||
// } else if (!emailidcontroller.text.isEmail) {
|
arguments: {"email": resp.data});
|
||||||
// Get.snackbar(
|
} else if (value == null) {
|
||||||
// 'Error',
|
Get.snackbar(
|
||||||
// 'Enter a valid e-mail address',
|
'Error',
|
||||||
// snackPosition: SnackPosition.BOTTOM,
|
resp.data["message"][0],
|
||||||
// backgroundColor: Colors.red,
|
duration: const Duration(seconds: 2),
|
||||||
// colorText: Colors.white,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
// );
|
backgroundColor: Colors.red,
|
||||||
// } else if (_selectedAccountType == 'Individual') {
|
colorText: Colors.white,
|
||||||
// print('individual selected');
|
);
|
||||||
// Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
|
} else {
|
||||||
// } else if (_selectedAccountType == 'Business') {
|
Get.snackbar(
|
||||||
// print('business selected');
|
"Success!",
|
||||||
// Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
|
'Login successful!',
|
||||||
// } else {
|
duration: const Duration(seconds: 2),
|
||||||
// utils.showToast('Please select an account type');
|
colorText: Colors.white,
|
||||||
// }
|
backgroundColor: Colors.green,
|
||||||
// }
|
margin: const EdgeInsets.all(8),
|
||||||
|
snackStyle: SnackStyle.FLOATING,
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
);
|
||||||
|
//Get.toNamed(RouteName.mainscreen);
|
||||||
|
logger.d("go to login");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Get.snackbar(
|
||||||
|
'Error',
|
||||||
|
resp.data["message"][0],
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
colorText: Colors.white,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_checkIfisLoggedIn() async {
|
||||||
|
await _logout();
|
||||||
|
final accessToken = await FacebookAuth.instance.accessToken;
|
||||||
|
if (accessToken != null) {
|
||||||
|
print("/////////////////////////////////////////xcheck");
|
||||||
|
|
||||||
|
final userData = await FacebookAuth.instance.getUserData();
|
||||||
|
|
||||||
|
logger.i(accessToken.token);
|
||||||
|
logger.i(userData.toString());
|
||||||
|
} else {
|
||||||
|
print("/////////////////////////////////////////check");
|
||||||
|
_login();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_login() async {
|
||||||
|
final LoginResult result = await FacebookAuth.instance.login();
|
||||||
|
|
||||||
|
if (result.status == LoginStatus.success) {
|
||||||
|
_accessToken = result.accessToken;
|
||||||
|
|
||||||
|
final userData = await FacebookAuth.instance.getUserData();
|
||||||
|
logger.i(userData['email']);
|
||||||
|
logger.i(userData['id']);
|
||||||
|
|
||||||
|
await LoginAPI().storeFacebookSignin(
|
||||||
|
{"facebook_auth_token": userData['id']},
|
||||||
|
emailReceived: userData['email']);
|
||||||
|
} else {
|
||||||
|
print(result.status);
|
||||||
|
print(result.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_logout() async {
|
||||||
|
await FacebookAuth.instance.logOut();
|
||||||
|
_accessToken = null;
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
Uploadata() async {
|
Uploadata() async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
utils.loader();
|
utils.loader();
|
||||||
int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0;
|
int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0;
|
||||||
Map<String, dynamic> updata = {
|
Map<String, dynamic> updata = {
|
||||||
@@ -83,6 +147,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
"password": passwordController.text,
|
"password": passwordController.text,
|
||||||
"account_type": accountTypeValue,
|
"account_type": accountTypeValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
final data = await Onboard().Postregisteration(updata);
|
final data = await Onboard().Postregisteration(updata);
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
Get.back();
|
Get.back();
|
||||||
@@ -90,43 +155,14 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
|
|
||||||
String selectedCategory = _selectedAccountType;
|
String selectedCategory = _selectedAccountType;
|
||||||
|
|
||||||
Get.toNamed(RouteName.verifyusercreen,
|
Get.toNamed(RouteName.verifyusercreen, arguments: {
|
||||||
arguments:
|
"emailid": emailidcontroller.text,
|
||||||
{
|
"password": passwordController.text,
|
||||||
"emailid" : emailidcontroller.text,
|
"accounttype": selectedCategory,
|
||||||
"password" : passwordController.text,
|
'accountypenumber': accountTypeValue
|
||||||
"accounttype" : selectedCategory,
|
});
|
||||||
'accountypenumber' : accountTypeValue
|
await prefs.setString(
|
||||||
|
'accountTypeValue', accountTypeValue.toString() ?? "");
|
||||||
}
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
// if (selectedCategory == "Individual") {
|
|
||||||
// Get.toNamed(RouteName.verifyusercreen,
|
|
||||||
// arguments:
|
|
||||||
// {
|
|
||||||
// "emailid" : emailidcontroller.text,
|
|
||||||
// "password" : passwordController.text,
|
|
||||||
// "accounttype" : selectedCategory,
|
|
||||||
// 'accountypenumber' : accountTypeValue
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// );
|
|
||||||
// } else if (selectedCategory == "Individual") {
|
|
||||||
// Get.toNamed(RouteName.verifyusercreen,
|
|
||||||
// arguments:
|
|
||||||
// {
|
|
||||||
// "emailid" : emailidcontroller.text,
|
|
||||||
// "password" : passwordController.text,
|
|
||||||
// "accounttype" : selectedCategory,
|
|
||||||
// 'accountypenumber' : accountTypeValue
|
|
||||||
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
return utils.showToast(data.message);
|
return utils.showToast(data.message);
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
@@ -282,7 +318,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 320.w,
|
width: 320.w,
|
||||||
height: 42.h,
|
// height: 42.h,
|
||||||
child: Text.rich(
|
child: Text.rich(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
children: [
|
children: [
|
||||||
@@ -402,19 +438,23 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 220.w,
|
width: 220.w,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
|
if (Platform.isIOS)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
_loginWithApple();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 55,
|
height: 55,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin:
|
begin: const Alignment(
|
||||||
const Alignment(0.71, -0.70),
|
0.71, -0.70),
|
||||||
end: const Alignment(-0.71, 0.7),
|
end: const Alignment(
|
||||||
|
-0.71, 0.7),
|
||||||
colors: [
|
colors: [
|
||||||
Colors.white.withOpacity(
|
Colors.white.withOpacity(
|
||||||
0.07999999821186066),
|
0.07999999821186066),
|
||||||
@@ -432,20 +472,20 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
'assets/images/png/login2.png'))),
|
'assets/images/png/login2.png'))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
if (Platform.isAndroid)
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
_loginWithGoogle();
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 55,
|
height: 55,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin:
|
begin: const Alignment(
|
||||||
const Alignment(0.71, -0.70),
|
0.71, -0.70),
|
||||||
end: const Alignment(-0.71, 0.7),
|
end: const Alignment(
|
||||||
|
-0.71, 0.7),
|
||||||
colors: [
|
colors: [
|
||||||
Colors.white.withOpacity(
|
Colors.white.withOpacity(
|
||||||
0.07999999821186066),
|
0.07999999821186066),
|
||||||
@@ -463,15 +503,19 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
'assets/images/png/login3.png'))),
|
'assets/images/png/login3.png'))),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Spacer(),
|
GestureDetector(
|
||||||
Container(
|
onTap: () async {
|
||||||
|
_checkIfisLoggedIn();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
width: 55,
|
width: 55,
|
||||||
height: 55,
|
height: 55,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
begin:
|
begin: const Alignment(
|
||||||
const Alignment(0.71, -0.70),
|
0.71, -0.70),
|
||||||
end: const Alignment(-0.71, 0.7),
|
end:
|
||||||
|
const Alignment(-0.71, 0.7),
|
||||||
colors: [
|
colors: [
|
||||||
Colors.white.withOpacity(
|
Colors.white.withOpacity(
|
||||||
0.07999999821186066),
|
0.07999999821186066),
|
||||||
@@ -488,6 +532,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
|||||||
image: AssetImage(
|
image: AssetImage(
|
||||||
'assets/images/png/login4.png'))),
|
'assets/images/png/login4.png'))),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,27 +1,19 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:glassmorphism/glassmorphism.dart';
|
|
||||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||||
import 'package:regroup/Common/base_manager.dart';
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
|
|
||||||
import 'package:regroup/Global.dart';
|
|
||||||
|
|
||||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
|
||||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||||
import 'package:regroup/Utils/dialogs.dart';
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/Utils/texts.dart';
|
import 'package:regroup/Utils/texts.dart';
|
||||||
|
|
||||||
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
|
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
|
||||||
import 'package:regroup/resources/routes/route_name.dart';
|
import 'package:regroup/resources/routes/route_name.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
|
||||||
import 'package:timer_button/timer_button.dart';
|
import 'package:timer_button/timer_button.dart';
|
||||||
|
|
||||||
|
|
||||||
class VerifyuserScreenState extends StatefulWidget {
|
class VerifyuserScreenState extends StatefulWidget {
|
||||||
const VerifyuserScreenState({super.key});
|
const VerifyuserScreenState({super.key});
|
||||||
|
|
||||||
@@ -47,33 +39,52 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
|||||||
"account_type": accounttypenumber,
|
"account_type": accounttypenumber,
|
||||||
"otp": pincode.text
|
"otp": pincode.text
|
||||||
};
|
};
|
||||||
final data = await Onboard().Postverifyregisteration(updata);
|
// final data = res
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
final res = await Onboard().Postverifyregisteration(updata);
|
||||||
|
if (res.status == ResponseStatus.SUCCESS) {
|
||||||
Get.back();
|
Get.back();
|
||||||
print("verification done");
|
print("verification done");
|
||||||
|
|
||||||
if (accounttype == 'Individual') {
|
if (accounttype == 'Individual') {
|
||||||
print('individual selected');
|
print('individual selected');
|
||||||
Get.toNamed(RouteName.tellusindividualscreen,
|
Get.toNamed(
|
||||||
|
RouteName.tellusindividualscreen,
|
||||||
// arguments: {
|
// arguments: {
|
||||||
// 'pageroute' : "nextscreen"
|
// 'pageroute' : "nextscreen"
|
||||||
// }
|
// }
|
||||||
);
|
);
|
||||||
} else if (accounttype == 'Business') {
|
} else if (accounttype == 'Business') {
|
||||||
print('business selected');
|
print('business selected');
|
||||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
Get.toNamed(
|
||||||
|
RouteName.tellusbusinessscreen,
|
||||||
// arguments: {
|
// arguments: {
|
||||||
// 'pageroute' : "nextscreen"
|
// 'pageroute' : "nextscreen"
|
||||||
// }
|
// }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return utils.showToast(data.message);
|
return utils.showToast(res.message);
|
||||||
} else {
|
} else {
|
||||||
Get.back();
|
Get.back();
|
||||||
print("verification not done");
|
// btnController.error();
|
||||||
return utils.showToast(data.message);
|
// btnController.reset();
|
||||||
|
Get.snackbar(
|
||||||
|
"Error!",
|
||||||
|
res.data['message'],
|
||||||
|
duration: Duration(seconds: 2),
|
||||||
|
colorText: Colors.white,
|
||||||
|
backgroundColor: Colors.red,
|
||||||
|
margin: EdgeInsets.all(8),
|
||||||
|
snackStyle: SnackStyle.FLOATING,
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// else {
|
||||||
|
// Get.back();
|
||||||
|
// print("verification not done");
|
||||||
|
// return utils.showToast(data.message);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
Uploadataresendotp() async {
|
Uploadataresendotp() async {
|
||||||
@@ -86,15 +97,45 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
|||||||
final data = await Onboard().Postregisteration(updata);
|
final data = await Onboard().Postregisteration(updata);
|
||||||
if (data.status == ResponseStatus.SUCCESS) {
|
if (data.status == ResponseStatus.SUCCESS) {
|
||||||
Get.back();
|
Get.back();
|
||||||
print("resend up done");
|
// print("resend up done");
|
||||||
return utils.showToast(data.message);
|
// return utils.showToast(data.message);
|
||||||
} else {
|
Get.snackbar(
|
||||||
Get.back();
|
"Success!",
|
||||||
print("resend not done");
|
'OTP has been sent to your email address!',
|
||||||
return utils.showToast(data.message);
|
duration: Duration(seconds: 2),
|
||||||
}
|
colorText: Colors.white,
|
||||||
|
backgroundColor: Colors.green,
|
||||||
|
margin: EdgeInsets.all(8),
|
||||||
|
snackStyle: SnackStyle.FLOATING,
|
||||||
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
|
);
|
||||||
|
setState(() {
|
||||||
|
pincode.clear();
|
||||||
|
// turnValidation = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// Get.back();
|
||||||
|
// print("resend not done");
|
||||||
|
// return utils.showToast(data.message);
|
||||||
|
// }
|
||||||
|
|
||||||
|
else {
|
||||||
|
Get.back();
|
||||||
|
// btnController.error();
|
||||||
|
// 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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -105,45 +146,13 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
|||||||
),
|
),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
// CommonBlurLeftSecond(),
|
Container(
|
||||||
Positioned(top: 150, right: -30, child: CommonBlurRightSecond()),
|
decoration: const BoxDecoration(
|
||||||
Positioned(top: 350, left: -30, child: CommonBlurLeftBlue()),
|
image: DecorationImage(
|
||||||
GlassmorphicContainer(
|
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||||
width: MediaQuery.of(context).size.width,
|
fit: BoxFit.fill)),
|
||||||
height:
|
|
||||||
// 500.h,
|
|
||||||
MediaQuery.of(context).size.height,
|
|
||||||
borderRadius: 2,
|
|
||||||
blur: 6,
|
|
||||||
alignment: Alignment.bottomLeft,
|
|
||||||
border: 2,
|
|
||||||
linearGradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
borderGradient: LinearGradient(
|
Padding(
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
// Color.fromARGB(255, 18, 32, 47).withOpacity(0.50),
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
|
|
||||||
Color(0XFF222935).withOpacity(0.60),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -153,9 +162,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
|||||||
text22400white('Check your email'),
|
text22400white('Check your email'),
|
||||||
sizedBoxHeight(10.h),
|
sizedBoxHeight(10.h),
|
||||||
text14400white(
|
text14400white(
|
||||||
|
|
||||||
'Enter the verification code that we sent to $email'),
|
'Enter the verification code that we sent to $email'),
|
||||||
|
|
||||||
sizedBoxHeight(40.h),
|
sizedBoxHeight(40.h),
|
||||||
text16400white('Enter code'),
|
text16400white('Enter code'),
|
||||||
sizedBoxHeight(20.h),
|
sizedBoxHeight(20.h),
|
||||||
@@ -241,7 +248,6 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
|||||||
CustomButton(
|
CustomButton(
|
||||||
text: 'Continue',
|
text: 'Continue',
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|
||||||
if (pincode.text.isEmpty) {
|
if (pincode.text.isEmpty) {
|
||||||
utils.showToast('Pin field is empty');
|
utils.showToast('Pin field is empty');
|
||||||
} else if (pincode.text.length < 4) {
|
} else if (pincode.text.length < 4) {
|
||||||
@@ -258,14 +264,13 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
|||||||
// Get.toNamed(RouteName.tellusbusinessscreen);
|
// Get.toNamed(RouteName.tellusbusinessscreen);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
}),
|
}),
|
||||||
const Spacer(
|
const Spacer(
|
||||||
// flex: 2,
|
// flex: 2,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:regroup/Common/api_urls.dart';
|
|||||||
import 'package:regroup/Common/base_manager.dart';
|
import 'package:regroup/Common/base_manager.dart';
|
||||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||||
import 'package:regroup/Global.dart';
|
import 'package:regroup/Global.dart';
|
||||||
|
import 'package:regroup/Utils/dialogs.dart';
|
||||||
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/tellusIndividual.dart';
|
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/tellusIndividual.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
@@ -16,6 +17,12 @@ class Onboard {
|
|||||||
.postApi(updata, ApiUrls.registeration, optionalpar: true);
|
.postApi(updata, ApiUrls.registeration, optionalpar: true);
|
||||||
print("response is ${response.data}");
|
print("response is ${response.data}");
|
||||||
print("response message is ${response.message}");
|
print("response message is ${response.message}");
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||||
|
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
response.data['message'], ResponseStatus.SUCCESS);
|
||||||
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,18 +32,34 @@ class Onboard {
|
|||||||
.postApi(updata, ApiUrls.verifyregisteration, optionalpar: true);
|
.postApi(updata, ApiUrls.verifyregisteration, optionalpar: true);
|
||||||
print("response is ${response.data}");
|
print("response is ${response.data}");
|
||||||
print("response message is ${response.message}");
|
print("response message is ${response.message}");
|
||||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
// final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
Map<String, dynamic> res = response.data;
|
// Map<String, dynamic> res = response.data;
|
||||||
print("res is $res");
|
// print("res is $res");
|
||||||
await prefs.setString('access-token', res['data']['token']);
|
// await prefs.setString('access-token', res['data']['token']);
|
||||||
// await prefs.setInt('isprofileupdate', res['data']['is_profile_updated']);
|
// await prefs.setInt('isprofileupdate', res['data']['is_profile_updated']);
|
||||||
|
|
||||||
token = res['data']['token'];
|
// token = res['data']['token'];
|
||||||
|
|
||||||
print("token is $token");
|
print("token is $token");
|
||||||
print("email is $emailid");
|
print("email is $emailid");
|
||||||
print("profile update value is $isprofileupdated");
|
print("profile update value is $isprofileupdated");
|
||||||
|
|
||||||
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
|
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||||
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
Map<String, dynamic> res = response.data;
|
||||||
|
print("res is $res");
|
||||||
|
await prefs.setString('access-token', res['data']['token']);
|
||||||
|
token = res['data']['token'];
|
||||||
|
|
||||||
|
// if (response.data['status'] == "error") {
|
||||||
|
// // return ResponseData<dynamic>(
|
||||||
|
// // response.data['message'], ResponseStatus.SUCCESS);
|
||||||
|
// return utils.showToast(response.data['message']);
|
||||||
|
// }
|
||||||
|
return ResponseData<dynamic>(
|
||||||
|
response.data['message'], ResponseStatus.SUCCESS);
|
||||||
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +73,8 @@ class Onboard {
|
|||||||
|
|
||||||
if (response.status == ResponseStatus.SUCCESS) {
|
if (response.status == ResponseStatus.SUCCESS) {
|
||||||
if (response.data['status'] == 'success') {
|
if (response.data['status'] == 'success') {
|
||||||
TellusIndividualModel tellusindiObj = TellusIndividualModel.fromJson(response.data);
|
TellusIndividualModel tellusindiObj =
|
||||||
|
TellusIndividualModel.fromJson(response.data);
|
||||||
// await prefs.setString('fullname', tellusindiObj.data?.profile?.fullName ?? "");
|
// await prefs.setString('fullname', tellusindiObj.data?.profile?.fullName ?? "");
|
||||||
// await prefs.setString('username', tellusindiObj.data?.profile?.userName ?? "");
|
// await prefs.setString('username', tellusindiObj.data?.profile?.userName ?? "");
|
||||||
// await prefs.setString('email', tellusindiObj.data?.profile?.emailAddress ?? "");
|
// await prefs.setString('email', tellusindiObj.data?.profile?.emailAddress ?? "");
|
||||||
@@ -60,7 +84,6 @@ class Onboard {
|
|||||||
// myusername = tellusindiObj.data?.profile?.userName;
|
// myusername = tellusindiObj.data?.profile?.userName;
|
||||||
// fullname = tellusindiObj.data?.profile?.fullName;
|
// fullname = tellusindiObj.data?.profile?.fullName;
|
||||||
// phonenumber = tellusindiObj.data?.profile?.phoneNumber;
|
// phonenumber = tellusindiObj.data?.profile?.phoneNumber;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
response.data['message'], ResponseStatus.FAILED);
|
response.data['message'], ResponseStatus.FAILED);
|
||||||
|
|||||||
@@ -22,66 +22,12 @@ class SplashScreen extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _SplashScreenState extends State<SplashScreen> {
|
class _SplashScreenState extends State<SplashScreen> {
|
||||||
// var _connectionStatus;
|
|
||||||
final Connectivity _connectivity = Connectivity();
|
|
||||||
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
|
|
||||||
|
|
||||||
// Future<void> checkInternet() async {
|
|
||||||
// final connectivityResult = await (Connectivity().checkConnectivity());
|
|
||||||
|
|
||||||
// if (connectivityResult == ConnectivityResult.wifi ||
|
|
||||||
// connectivityResult == ConnectivityResult.mobile) {
|
|
||||||
// setState(() {
|
|
||||||
// _connectionStatus = connectivityResult;
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// setState(() {
|
|
||||||
// _connectionStatus = connectivityResult;
|
|
||||||
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
Future<void> initConnectivity() async {
|
|
||||||
late List<ConnectivityResult> result;
|
|
||||||
try {
|
|
||||||
result = await _connectivity.checkConnectivity();
|
|
||||||
} on PlatformException catch (e) {
|
|
||||||
log('Couldn\'t check connectivity status', error: e);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
return Future.value(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
return _updateConnectionStatus(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _updateConnectionStatus(List<ConnectivityResult> result) async {
|
|
||||||
setState(() {
|
|
||||||
_connectionStatus = result;
|
|
||||||
});
|
|
||||||
|
|
||||||
// ignore: avoid_print
|
|
||||||
print('Connectivity changed: $_connectionStatus');
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
|
||||||
super.initState();
|
super.initState();
|
||||||
initConnectivity();
|
|
||||||
log(_connectionStatus.toString());
|
|
||||||
|
|
||||||
Future.delayed(Duration(seconds: 2), () async {
|
Future.delayed(const Duration(seconds: 2), () async {
|
||||||
if (_connectionStatus.contains(ConnectivityResult.none)) {
|
|
||||||
var result = await Get.to(NoInternet());
|
|
||||||
if (result != null && result) {
|
|
||||||
print('this is first');
|
|
||||||
Timer(const Duration(seconds: 1), () async {
|
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
token = prefs.getString('access-token');
|
token = prefs.getString('access-token');
|
||||||
emailid = prefs.getString('email');
|
emailid = prefs.getString('email');
|
||||||
myusername = prefs.getString('username');
|
myusername = prefs.getString('username');
|
||||||
@@ -91,99 +37,25 @@ class _SplashScreenState extends State<SplashScreen> {
|
|||||||
if (token == null || token!.isEmpty) {
|
if (token == null || token!.isEmpty) {
|
||||||
Get.toNamed(RouteName.onboarding1);
|
Get.toNamed(RouteName.onboarding1);
|
||||||
} else {
|
} else {
|
||||||
Getuserdetails().Getuser().then((value) {
|
await Getuserdetails().Getuser().then((value) {
|
||||||
print(getuserobj!.data!.userData!.isProfileUpdated!);
|
|
||||||
// .then((value) {
|
|
||||||
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
||||||
String? accountype =
|
String? accountype =
|
||||||
getuserobj?.data?.userData?.principalTypeXid.toString();
|
getuserobj?.data?.userData?.principalTypeXid.toString();
|
||||||
|
|
||||||
if (accountype == "1") {
|
if (accountype == "1") {
|
||||||
Get.toNamed(RouteName.tellusindividualscreen,
|
Get.toNamed(RouteName.tellusindividualscreen,
|
||||||
// arguments: {'pageroute': "mainscreen"}
|
arguments: {'pageroute': "mainscreen"});
|
||||||
);
|
|
||||||
} else if (accountype == "2") {
|
} else if (accountype == "2") {
|
||||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
Get.toNamed(RouteName.tellusbusinessscreen,
|
||||||
// arguments: {'pageroute': "mainscreen"}
|
arguments: {'pageroute': "mainscreen"});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed(RouteName.mainscreen);
|
Get.toNamed(RouteName.mainscreen);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// print(getuserobj!.data!.userData!.isProfileUpdated!);
|
|
||||||
|
|
||||||
// // .then((value) {
|
|
||||||
// if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
|
||||||
// String? accountype =
|
|
||||||
// getuserobj?.data?.userData?.principalTypeXid.toString();
|
|
||||||
|
|
||||||
// if (accountype == "1") {
|
|
||||||
// Get.toNamed(RouteName.tellusindividualscreen,
|
|
||||||
// arguments: {
|
|
||||||
// 'pageroute' : "mainscreen"
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
// } else if (accountype == "2") {
|
|
||||||
// Get.toNamed(RouteName.tellusbusinessscreen);
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// Get.toNamed(RouteName.mainscreen);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Timer(const Duration(seconds: 2), () async {
|
|
||||||
print('this is second');
|
|
||||||
|
|
||||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
||||||
|
|
||||||
token = prefs.getString('access-token');
|
|
||||||
emailid = prefs.getString('email');
|
|
||||||
myusername = prefs.getString('username');
|
|
||||||
fullname = prefs.getString('fullname');
|
|
||||||
phonenumber = prefs.getString('phone');
|
|
||||||
|
|
||||||
if (token == null || token!.isEmpty) {
|
|
||||||
Get.toNamed(RouteName.onboarding1);
|
|
||||||
} else {
|
|
||||||
Getuserdetails().Getuser().then((value) {
|
|
||||||
print(getuserobj!.data!.userData!.isProfileUpdated!);
|
|
||||||
// .then((value) {
|
|
||||||
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
|
||||||
String? accountype =
|
|
||||||
getuserobj?.data?.userData?.principalTypeXid.toString();
|
|
||||||
|
|
||||||
if (accountype == "1") {
|
|
||||||
Get.toNamed(RouteName.tellusindividualscreen,
|
|
||||||
// arguments: {'pageroute': "mainscreen"}
|
|
||||||
);
|
|
||||||
} else if (accountype == "2") {
|
|
||||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
|
||||||
// arguments: {'pageroute': "mainscreen"}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Get.toNamed(RouteName.mainscreen);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Future.delayed(Duration(seconds: 2), () async {
|
|
||||||
// Timer(const Duration(seconds: 1), () async {
|
|
||||||
// Get.toNamed(RouteName.onboarding1);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -197,11 +69,11 @@ class _SplashScreenState extends State<SplashScreen> {
|
|||||||
begin: Alignment.topLeft,
|
begin: Alignment.topLeft,
|
||||||
end: Alignment.bottomRight,
|
end: Alignment.bottomRight,
|
||||||
colors: [
|
colors: [
|
||||||
Color(0xff009DAB).withOpacity(0.25),
|
const Color(0xff009DAB).withOpacity(0.25),
|
||||||
Color(0xff35798C).withOpacity(0.44),
|
const Color(0xff35798C).withOpacity(0.44),
|
||||||
Color(0xffD90B2E).withOpacity(0.33),
|
const Color(0xffD90B2E).withOpacity(0.33),
|
||||||
Color(0xffD90B2E).withOpacity(0.52),
|
const Color(0xffD90B2E).withOpacity(0.52),
|
||||||
Color(0xffD90B2E).withOpacity(0.59),
|
const Color(0xffD90B2E).withOpacity(0.59),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -52,11 +52,9 @@ class _ForgotPassState extends State<ForgotPass> {
|
|||||||
snackPosition: SnackPosition.BOTTOM,
|
snackPosition: SnackPosition.BOTTOM,
|
||||||
);
|
);
|
||||||
prefs.setString('email', emailController.text);
|
prefs.setString('email', emailController.text);
|
||||||
prefs.setInt(
|
prefs.setInt('principal_xid', resp.data['data']['iam_principal_xid']);
|
||||||
'principal_xid', resp.data['data']['iam_principal_xid']);
|
|
||||||
Future.delayed(Duration(seconds: 1), () {
|
Future.delayed(Duration(seconds: 1), () {
|
||||||
Get.toNamed(RouteName.forgotOtp,
|
Get.toNamed(RouteName.forgotOtp, arguments: emailController.text);
|
||||||
arguments: emailController.text);
|
|
||||||
});
|
});
|
||||||
// print('success');
|
// print('success');
|
||||||
} else if (resp.status == ResponseStatus.FAILED) {
|
} else if (resp.status == ResponseStatus.FAILED) {
|
||||||
@@ -134,7 +132,7 @@ class _ForgotPassState extends State<ForgotPass> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: "loremipsum@gmail.comess",
|
// hintText: "loremipsum@gmail.comess",
|
||||||
validator: (value) {
|
validator: (value) {
|
||||||
if (value!.isEmpty) {
|
if (value!.isEmpty) {
|
||||||
return 'Enter your e-mail address';
|
return 'Enter your e-mail address';
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ class ForgotPassAPI {
|
|||||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||||
if (response.data['status'] == "success") {
|
if (response.data['status'] == "success") {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
response.data['message'], ResponseStatus.SUCCESS,data: response.data);
|
response.data['message'], ResponseStatus.SUCCESS,
|
||||||
|
data: response.data);
|
||||||
} else {
|
} else {
|
||||||
return ResponseData<dynamic>(
|
return ResponseData<dynamic>(
|
||||||
response.data['message'], ResponseStatus.FAILED);
|
response.data['message'], ResponseStatus.FAILED);
|
||||||
@@ -50,4 +51,3 @@ class ForgotPassAPI {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ class RouteName {
|
|||||||
|
|
||||||
static const String userchatpage = '/userchatpage';
|
static const String userchatpage = '/userchatpage';
|
||||||
|
|
||||||
|
static const String profiletab = '/profiletab';
|
||||||
|
static const String mynetwork = '/mynetwork';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static const String groupchatpage = '/groupchatpage';
|
static const String groupchatpage = '/groupchatpage';
|
||||||
static const String managememberscal = '/managememberscal';
|
static const String managememberscal = '/managememberscal';
|
||||||
static const String shareProfile = '/shareProfile';
|
static const String shareProfile = '/shareProfile';
|
||||||
@@ -67,6 +72,7 @@ class RouteName {
|
|||||||
static const String settings = '/settings';
|
static const String settings = '/settings';
|
||||||
static const String accountsettings = '/accountsettings';
|
static const String accountsettings = '/accountsettings';
|
||||||
static const String editProfile = '/editProfile';
|
static const String editProfile = '/editProfile';
|
||||||
|
static const String buseditprofile = '/buseditprofile';
|
||||||
static const String notifications = '/notifications';
|
static const String notifications = '/notifications';
|
||||||
static const String helpandsupport = '/helpandsupport';
|
static const String helpandsupport = '/helpandsupport';
|
||||||
static const String privacypolicy = '/privacypolicy';
|
static const String privacypolicy = '/privacypolicy';
|
||||||
@@ -116,4 +122,13 @@ class RouteName {
|
|||||||
|
|
||||||
static const String verifygoogleapplepage = '/verifygoogleapplepage';
|
static const String verifygoogleapplepage = '/verifygoogleapplepage';
|
||||||
|
|
||||||
|
|
||||||
|
//profiletabIndGestUser
|
||||||
|
|
||||||
|
static const String profiletabindguest = '/profiletabindguest';
|
||||||
|
|
||||||
|
//profiletabBusGestUser
|
||||||
|
|
||||||
|
static const String profiletabbusguest = '/profiletabbusguest';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,18 +34,23 @@ 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/Badges/Badges.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Certificate/Certificate.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/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/Followers/Followers.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Following/Following.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/AccountSessions.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/AccountSetting.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/ChangePassword.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ContactUs.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ContactUs.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/DeleteAccount.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/FaqScreen.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/HelpAndSupport.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Notification.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/View/Notification.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/PrivacyPolicy.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ReportABug.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ReportABug.dart';
|
||||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Settings.dart';
|
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Settings.dart';
|
||||||
@@ -495,7 +500,28 @@ class AppRoutes {
|
|||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: RouteName.verifygoogleapplepage,
|
name: RouteName.verifygoogleapplepage,
|
||||||
page: () => const Verifygoogleandapple(),
|
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(),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
32
pubspec.lock
32
pubspec.lock
@@ -105,6 +105,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.3"
|
version: "3.0.3"
|
||||||
|
csslib:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: csslib
|
||||||
|
sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.17.3"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -310,6 +318,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.1"
|
version: "5.0.1"
|
||||||
|
flutter_html:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_html
|
||||||
|
sha256: "02ad69e813ecfc0728a455e4bf892b9379983e050722b1dce00192ee2e41d1ee"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.0-beta.2"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -528,6 +544,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.4+1"
|
version: "0.12.4+1"
|
||||||
|
html:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: html
|
||||||
|
sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.15.4"
|
||||||
http:
|
http:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -688,6 +712,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.1"
|
version: "2.0.1"
|
||||||
|
list_counter:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: list_counter
|
||||||
|
sha256: c447ae3dfcd1c55f0152867090e67e219d42fe6d4f2807db4bbe8b8d69912237
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.2"
|
||||||
logger:
|
logger:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ dependencies:
|
|||||||
logger: ^2.3.0
|
logger: ^2.3.0
|
||||||
sign_in_with_apple: any
|
sign_in_with_apple: any
|
||||||
timer_button: ^2.1.1
|
timer_button: ^2.1.1
|
||||||
|
flutter_html: ^3.0.0-beta.2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user