Compare commits
33 Commits
getuserlog
...
b66101418b
| Author | SHA1 | Date | |
|---|---|---|---|
| b66101418b | |||
|
|
c2ba93738d | ||
| ab9c2367bf | |||
|
|
e969cbc458 | ||
|
|
b11e16340c | ||
|
|
2fa64b61ca | ||
| 18be485ec9 | |||
|
|
04544aa0eb | ||
|
|
c45ee2e088 | ||
|
|
47c735da45 | ||
|
|
1af9882526 | ||
|
|
9365b858f9 | ||
|
|
dd878393c6 | ||
| 80448b4ddd | |||
|
|
a31e34e790 | ||
|
|
2bfe5c8ef8 | ||
|
|
7c9b97b41f | ||
| ce03d94249 | |||
|
|
fb304ca5d8 | ||
|
|
ccc2a73929 | ||
|
|
a9ae9ac028 | ||
|
|
54da408ce1 | ||
| 14136cc499 | |||
| 37c5cb9fdf | |||
| 137945e7d2 | |||
| bfeddd6bc7 | |||
| f29fd7f32d | |||
| e70bd44641 | |||
| abf29d2441 | |||
| 483b4a23d8 | |||
| a0fe7caa34 | |||
| d73570e7bc | |||
| 62fbca723e |
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.READ_MEDIA_VIDEO" />
|
||||
<application
|
||||
android:label="regroup"
|
||||
android:label="ReGroup"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:name="${applicationName}"
|
||||
android:icon="@mipmap/ic_launcher">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">ReGroup123</string>
|
||||
<string name="facebook_app_id">8076081959097016</string>
|
||||
<string name="fb_login_protocol_scheme">fb8076081959097016</string>
|
||||
<string name="facebook_client_token">ca5a1805872edbec0d3a0a0b02229ba5</string>
|
||||
<string name="app_name">Regroup</string>
|
||||
<string name="facebook_app_id">803386025107790</string>
|
||||
<string name="fb_login_protocol_scheme">fb803386025107790</string>
|
||||
<string name="facebook_client_token">fa69ee794ff94e50c7ddbfac1e035cb9</string>
|
||||
</resources>
|
||||
@@ -151,6 +151,8 @@
|
||||
dependencies = (
|
||||
);
|
||||
name = Runner;
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = Runner;
|
||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
@@ -179,6 +181,8 @@
|
||||
Base,
|
||||
);
|
||||
mainGroup = 97C146E51CF9000F007C117D;
|
||||
packageReferences = (
|
||||
);
|
||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||
projectDirPath = "";
|
||||
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>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<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>
|
||||
</plist>
|
||||
|
||||
@@ -3,7 +3,7 @@ class ApiUrls {
|
||||
|
||||
static const getlogin = "${baseUrl}login";
|
||||
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 letUsUnderstandApi = "${baseUrl}update-business-profile-step-1";
|
||||
static const resetpassword = "${baseUrl}reset-password";
|
||||
@@ -27,9 +27,43 @@ class ApiUrls {
|
||||
static const postcommunities = "${baseUrl}select-communities";
|
||||
|
||||
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 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";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -72,6 +72,9 @@ class NetworkApiServices {
|
||||
if (response.statusCode == 200) {
|
||||
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else if (response.statusCode == 201) {
|
||||
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else if (response.statusCode == 404) {
|
||||
return ResponseData<dynamic>("error", ResponseStatus.ERROR,
|
||||
data: response.data);
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
import 'dart:async';
|
||||
|
||||
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/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/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class Followers extends StatefulWidget {
|
||||
const Followers({super.key});
|
||||
@@ -15,43 +23,59 @@ class Followers extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FollowersState extends State<Followers> {
|
||||
List followersData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwart",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Kianna Donin",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Maria Herwitz",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
StreamController<FollowersModel> searchcontroller = StreamController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
var updata = "";
|
||||
Profilegetmethod().getFollowers(updata, streamController: searchcontroller);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
int? blockid;
|
||||
int? removeid;
|
||||
|
||||
RemoveUploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"iam_principal_xid": removeid,
|
||||
};
|
||||
final data = await Profilepostmethod().postRemoveuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("block done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("block not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
BlockUploadata() async {
|
||||
utils.loader();
|
||||
Map<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
|
||||
Widget build(BuildContext context) {
|
||||
@@ -64,13 +88,14 @@ class _FollowersState extends State<Followers> {
|
||||
),
|
||||
resizeToAvoidBottomInset: false,
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
@@ -86,125 +111,283 @@ class _FollowersState extends State<Followers> {
|
||||
),
|
||||
),
|
||||
),
|
||||
texttype: TextInputType.text,
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
Profilegetmethod().getFollowers(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
hintText: "Search people",
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: followersData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
followerWidget(
|
||||
imagePath: followersData[index]["imagePath"],
|
||||
title: followersData[index]["title"],
|
||||
subtitle: followersData[index]["subtitle"]),
|
||||
if (index != followersData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
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,
|
||||
itemCount: followersobj!.data!.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
followersobj!.data![index].follower!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.profilePhoto!
|
||||
.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
followersobj!.data![index].follower!
|
||||
.fullName ==
|
||||
null ||
|
||||
followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.fullName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text16w400_FCFCFC("Regroup")
|
||||
: text16w400_FCFCFC(
|
||||
followersobj!.data![index]
|
||||
.follower!.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
followersobj!.data![index].follower!
|
||||
.userName ==
|
||||
null ||
|
||||
followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.userName!
|
||||
.isEmpty ==
|
||||
true
|
||||
? text12w400_FCFCFC_blur(
|
||||
"regroup")
|
||||
: text12w400_FCFCFC_blur(
|
||||
followersobj!.data![index]
|
||||
.follower!.userName!)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints:
|
||||
BoxConstraints.tightFor(
|
||||
width: 176.w),
|
||||
offset: Offset(0, 20),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext
|
||||
context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
// onTap: () {},
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
removeid = followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.id ??
|
||||
0;
|
||||
followersobj!.data!
|
||||
.removeWhere((item) =>
|
||||
item.follower!
|
||||
.id ==
|
||||
removeid);
|
||||
RemoveUploadata();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Remove user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_delete-28-regular.png",
|
||||
height: 15.h,
|
||||
width: 15.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_chat-20-regular.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
blockid = followersobj!
|
||||
.data![index]
|
||||
.follower!
|
||||
.id ??
|
||||
0;
|
||||
followersobj!.data!
|
||||
.removeWhere((item) =>
|
||||
item.follower!
|
||||
.id ==
|
||||
blockid);
|
||||
BlockUploadata();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Block user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/blockchat.png",
|
||||
height: 25.h,
|
||||
width: 25.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
),
|
||||
])
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget followerWidget({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required String subtitle,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
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(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 176.w),
|
||||
offset: Offset(0, 20),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
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/share.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white("Block user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/f7_pin-fill (2).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,
|
||||
),
|
||||
),
|
||||
)),
|
||||
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_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/Model/followingModel.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profileGetmethod.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class Following extends StatefulWidget {
|
||||
const Following({super.key});
|
||||
@@ -15,43 +23,45 @@ class Following extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FollowingState extends State<Following> {
|
||||
List followingData = [
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwart",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Kianna Donin",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/img2.png",
|
||||
"title": "Maria Herwitz",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 43.png",
|
||||
"title": "Ahmad Rhiel Madsen",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
{
|
||||
"imagePath": "assets/images/png/Ellipse 48.png",
|
||||
"title": "Kaylynn Vaccaro",
|
||||
"subtitle": "Lorem ipsum dummy text",
|
||||
},
|
||||
];
|
||||
StreamController<FollowingModel> searchcontroller = StreamController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
var updata = "";
|
||||
Profilegetmethod().getFollowing(updata, streamController: searchcontroller);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
searchcontroller.close();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"following_iam_principal_xid": unfollowid,
|
||||
};
|
||||
final data = await Profilepostmethod().postunfollowuser(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("unfollow done");
|
||||
// setState(() {
|
||||
// // Assuming followingobj is a list of items, remove the item with matching user ID
|
||||
// followingobj!.data!.removeWhere((item) => item.following!.id == userid);
|
||||
// });
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("unfollow not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
int? unfollowid;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -64,13 +74,14 @@ class _FollowingState extends State<Following> {
|
||||
titleTxt: "Following",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
), SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
@@ -87,106 +98,244 @@ class _FollowingState extends State<Following> {
|
||||
),
|
||||
),
|
||||
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),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: followingData.length,
|
||||
itemBuilder: (context, index) {
|
||||
return Column(
|
||||
children: [
|
||||
followingWidget(
|
||||
imagePath: followingData[index]["imagePath"],
|
||||
title: followingData[index]["title"],
|
||||
subtitle: followingData[index]["subtitle"]),
|
||||
if (index != followingData.length - 1) commonDivider(),
|
||||
],
|
||||
);
|
||||
StreamBuilder<FollowingModel>(
|
||||
stream: searchcontroller.stream,
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
// Display shimmer effect while waiting for data
|
||||
return Center(child: CircularProgressIndicator());
|
||||
} else if (snapshot.hasError) {
|
||||
// Handle error state
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occurred',
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return followingobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: ListView.separated(
|
||||
physics: ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: followingobj!.data!.length,
|
||||
separatorBuilder:
|
||||
(BuildContext context, int index) {
|
||||
return commonDivider();
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return
|
||||
// Column(
|
||||
// children: [
|
||||
// Followinglist(
|
||||
// imagePath: followingobj?.data?[index]
|
||||
// .following?.profilePhoto ??
|
||||
// '',
|
||||
// title: followingobj!
|
||||
// .data?[index].following?.fullName ??
|
||||
// '',
|
||||
// subtitle: followingobj!
|
||||
// .data?[index].following?.userName ??
|
||||
// '',
|
||||
// unfollowontap: (id) => Uploadata(id),
|
||||
// unfollowindex: followingobj!
|
||||
// .data![index].following!.id!,
|
||||
// ),
|
||||
// if (index != followingobj!.data!.length - 1)
|
||||
// commonDivider(),
|
||||
// ],
|
||||
// );
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
children: [
|
||||
followingobj!.data![index].following!
|
||||
.profilePhoto ==
|
||||
null ||
|
||||
followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.profilePhoto!
|
||||
.isEmpty
|
||||
? CircleAvatar(
|
||||
backgroundImage: AssetImage(
|
||||
'assets/images/png/Ellipse 43.png'),
|
||||
radius: 25.r,
|
||||
)
|
||||
: CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.profilePhoto!),
|
||||
radius: 25.r,
|
||||
),
|
||||
sizedBoxWidth(10.w),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.fullName ==
|
||||
null ||
|
||||
followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.fullName!
|
||||
.isEmpty
|
||||
? text16w400_FCFCFC("Regroup")
|
||||
: text16w400_FCFCFC(
|
||||
followingobj!.data![index]
|
||||
.following!.fullName!),
|
||||
sizedBoxHeight(4.h),
|
||||
followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.userName ==
|
||||
null ||
|
||||
followingobj!
|
||||
.data![index]
|
||||
.following!
|
||||
.userName!
|
||||
.isEmpty
|
||||
? text12w400_FCFCFC_blur(
|
||||
"regroup")
|
||||
: text12w400_FCFCFC_blur(
|
||||
followingobj!.data![index]
|
||||
.following!.userName!)
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints:
|
||||
BoxConstraints.tightFor(
|
||||
width: 176.w),
|
||||
offset: Offset(0, 20),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext
|
||||
context) =>
|
||||
<PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
setState(() {
|
||||
unfollowid =
|
||||
followingobj!
|
||||
.data![
|
||||
index]
|
||||
.following!
|
||||
.id ??
|
||||
0;
|
||||
// followingobj!.data!.removeAt(index);
|
||||
followingobj!.data!
|
||||
.removeWhere((item) =>
|
||||
item.following!
|
||||
.id ==
|
||||
unfollowid);
|
||||
Uploadata();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Unfollow user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black1323e.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white(
|
||||
"Message user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_chat-20-22.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
),
|
||||
])
|
||||
]))
|
||||
]));
|
||||
}
|
||||
|
||||
Widget followingWidget({
|
||||
required String imagePath,
|
||||
required String title,
|
||||
required String subtitle,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 16.w),
|
||||
child: Row(
|
||||
Widget _buildNoDataBody(context) {
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
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(),
|
||||
PopupMenuButton(
|
||||
surfaceTintColor: Color(0xFF222935),
|
||||
constraints: BoxConstraints.tightFor(width: 176.w),
|
||||
offset: Offset(0, 20),
|
||||
color: Color(0xFF222935),
|
||||
tooltip: "",
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white("Unfollow user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/Black1323e.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
onTap: () {},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Row(
|
||||
children: [
|
||||
text14400white("Message user"),
|
||||
Spacer(),
|
||||
Image.asset(
|
||||
"assets/images/png/fluent_chat-20-22.png",
|
||||
height: 20.h,
|
||||
width: 20.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
child: Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 1000004071.png",
|
||||
height: 22.h,
|
||||
width: 4.w,
|
||||
),
|
||||
),
|
||||
)),
|
||||
Text(
|
||||
"No Data Found",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w600),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,13 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
@@ -19,116 +22,164 @@ class ChangePassword extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ChangePasswordState extends State<ChangePassword> {
|
||||
TextEditingController currentpasscontroller = TextEditingController();
|
||||
TextEditingController newpasscontroller = TextEditingController();
|
||||
TextEditingController repeatpasscontroller = TextEditingController();
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"current_password": currentpasscontroller.text,
|
||||
"new_password": newpasscontroller.text,
|
||||
"confirm_password": repeatpasscontroller.text,
|
||||
};
|
||||
final data = await Profilepostmethod().postChangepassword(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("Change pass up done");
|
||||
|
||||
Get.toNamed(RouteName.verifycode,
|
||||
arguments: {
|
||||
"currentpass" : currentpasscontroller.text,
|
||||
"newpass" : newpasscontroller.text,
|
||||
"confirmpass" : repeatpasscontroller.text
|
||||
}
|
||||
);
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("change pass not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Change password",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Change password",
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Current password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("New password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Repeat password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CommonBtn(
|
||||
text: "Verify",
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.verifycode);
|
||||
},
|
||||
)
|
||||
]),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
)
|
||||
]));
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Current password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
textEditingController: currentpasscontroller,
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("New password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
textEditingController: newpasscontroller,
|
||||
isInputPassword: true,
|
||||
// textEditingController: _password,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16w400_FCFCFC("Repeat password"),
|
||||
sizedBoxHeight(16.w),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
textEditingController: repeatpasscontroller,
|
||||
hintText: '',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
|
||||
// const Icon(Icons.lock_outline),
|
||||
// validationMessage: "Enter your password",
|
||||
validator: (val) {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
if (val != newpasscontroller.text) {
|
||||
return 'Password does not match';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CommonBtn(
|
||||
text: "Verify",
|
||||
onTap: () {
|
||||
// Get.toNamed(RouteName.verifycode);
|
||||
if (currentpasscontroller.text.isBlank! &&
|
||||
newpasscontroller.text.isBlank! &&
|
||||
repeatpasscontroller.text.isBlank!) {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else {
|
||||
Uploadata();
|
||||
|
||||
}
|
||||
},
|
||||
)
|
||||
]),
|
||||
),
|
||||
)
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:regroup/Common/CommonButton.dart';
|
||||
import 'package:regroup/Common/CommonDropDown.dart';
|
||||
import 'package:get/get.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/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/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
import '../../../../Utils/Common/CustomTextformfield.dart';
|
||||
|
||||
@@ -18,91 +22,188 @@ class ContactUs extends StatefulWidget {
|
||||
}
|
||||
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Contact us",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Contact us",
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Full name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: _formkey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Full name"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 24.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
hintText: "Edward Hackett",
|
||||
),
|
||||
text16400white("Email address"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 12.png",
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white("Email address"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 12.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
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"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: [
|
||||
"Feature suggestion",
|
||||
"Issues with app",
|
||||
"Scoreboard",
|
||||
"Feedback"
|
||||
],
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/fluent_person-support-20-regular.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "loremipsum@gmail.com",
|
||||
),
|
||||
text16400white("Reason to contact"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: [
|
||||
"Feature suggestion",
|
||||
"Issues with app",
|
||||
"Scoreboard",
|
||||
"Feedback"
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/fluent_person-support-20-regular.png",
|
||||
height: 17.h,
|
||||
width: 18.w,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Query"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText:
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
|
||||
),
|
||||
CommonBtn(text: "Send")
|
||||
]),
|
||||
))
|
||||
]));
|
||||
sizedBoxHeight(25.h),
|
||||
text16400white("Query"),
|
||||
sizedBoxHeight(16.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText: "Enter query",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
textEditingController: querycontroller,
|
||||
),
|
||||
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:get/get.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
@@ -20,7 +21,10 @@ class _FaqScreenState extends State<FaqScreen> {
|
||||
|
||||
@override
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -59,44 +63,99 @@ class _FaqScreenState extends State<FaqScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
resizeToAvoidBottomInset: false,
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "FAQ’s",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.builder(
|
||||
controller: ScrollController(),
|
||||
shrinkWrap: true,
|
||||
itemCount: faqcard.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Obx(
|
||||
() {
|
||||
return customExpandableItem(
|
||||
isExpanded: isExpandedList[index],
|
||||
title: faqcard[index]['title'] ?? '',
|
||||
content: faqcard[index]['content'] ?? '',
|
||||
toggleExpansion: () =>
|
||||
toggleExpansion(index),
|
||||
);
|
||||
},
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
resizeToAvoidBottomInset: false,
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "FAQ’s",
|
||||
),
|
||||
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(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Positioned.fill(
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(25.h),
|
||||
ListView.builder(
|
||||
controller: ScrollController(),
|
||||
shrinkWrap: true,
|
||||
itemCount: faqobj!.data!.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Obx(
|
||||
() {
|
||||
return customExpandableItem(
|
||||
isExpanded: isExpandedList[index],
|
||||
title: faqobj!.data![index].question ?? '',
|
||||
content: faqobj!.data![index].answer ?? '',
|
||||
toggleExpansion: () => toggleExpansion(index),
|
||||
);
|
||||
})
|
||||
]))))
|
||||
]));
|
||||
},
|
||||
);
|
||||
})
|
||||
]))))
|
||||
]);
|
||||
}
|
||||
|
||||
Widget customExpandableItem({
|
||||
|
||||
@@ -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_html/flutter_html.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
@@ -16,35 +19,109 @@ class _PrivacyPolicyState extends State<PrivacyPolicy> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Privacy policy",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
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.")
|
||||
]),
|
||||
),
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Privacy policy",
|
||||
),
|
||||
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(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
|
||||
Html(
|
||||
data: privacyobj!.data!.content,
|
||||
// style: {
|
||||
// "html": Style(
|
||||
// color: Colors.white,
|
||||
// fontFamily: "Poppins",
|
||||
// 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/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Common/CommonButton.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/CommonDropdown.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class ReportABug extends StatefulWidget {
|
||||
const ReportABug({super.key});
|
||||
@@ -17,131 +26,243 @@ class ReportABug extends StatefulWidget {
|
||||
}
|
||||
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Report a bug",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Report a bug",
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("Device OS"),
|
||||
sizedBoxWidth(8.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 25.h,
|
||||
width: 15.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/VectorDevice.png",
|
||||
height: 25.h,
|
||||
width: 15.w,
|
||||
fit: BoxFit.cover,
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
physics: ScrollPhysics(),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Form(
|
||||
key: _formkey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("Device OS"),
|
||||
sizedBoxWidth(8.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Apple iphone",
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("OS version"),
|
||||
sizedBoxWidth(8.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/setting2.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
fit: BoxFit.cover,
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 25.h,
|
||||
width: 15.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/VectorDevice.png",
|
||||
height: 25.h,
|
||||
width: 15.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "Version 16",
|
||||
),
|
||||
text16400white("Email address"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 22.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 12 (1).png",
|
||||
height: 17.h,
|
||||
width: 22.w,
|
||||
fit: BoxFit.cover,
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white("OS version"),
|
||||
sizedBoxWidth(8.w),
|
||||
Image.asset(
|
||||
"assets/images/png/octicon_question-24.png",
|
||||
height: 16.h,
|
||||
width: 16.w,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
hintText: "loremipsum@gmail.com",
|
||||
),
|
||||
text16400white("Reason to contact"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: [
|
||||
"Messaging",
|
||||
"Crashes",
|
||||
"Constant logout",
|
||||
"Unable to view post"
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/codicon_bug.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
showOtherOption: true,
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Query"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText:
|
||||
"Lorem Ipsum has been the industry's standard dummy text ever since the 1500s. Lorem Ipsum has been the industry's standard",
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CommonBtn(text: "Send")
|
||||
])),
|
||||
)
|
||||
]));
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/setting2.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
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"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField(
|
||||
leadingIcon: Container(
|
||||
height: 17.h,
|
||||
width: 24.w,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Frame 12.png",
|
||||
height: 17.h,
|
||||
width: 22.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
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"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomDropDownRadio(
|
||||
header: "",
|
||||
title: "",
|
||||
listData: [
|
||||
"Messaging",
|
||||
"Crashes",
|
||||
"Constant logout",
|
||||
"Unable to view post"
|
||||
],
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage: Image.asset(
|
||||
"assets/images/png/codicon_bug.png",
|
||||
height: 23.h,
|
||||
width: 23.w,
|
||||
),
|
||||
showOtherOption: true,
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white("Query"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomTextFormField2(
|
||||
maxlines: 3,
|
||||
hintText: "Enter query",
|
||||
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),
|
||||
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/widgets.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.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/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class Settings extends StatefulWidget {
|
||||
const Settings({super.key});
|
||||
@@ -146,18 +148,26 @@ class _SettingsState extends State<Settings> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
commonGlassContainer(
|
||||
width: 140.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
customWidget:
|
||||
Center(child: text14400white("Yes, I want to")),
|
||||
border: 1),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
SharedPreferences prefs =
|
||||
await SharedPreferences.getInstance();
|
||||
await prefs.clear();
|
||||
Get.offAllNamed(RouteName.loginScreen);
|
||||
},
|
||||
child: commonGlassContainer(
|
||||
width: 130.w,
|
||||
height: 40.h,
|
||||
borderradius: 30.r,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.07,
|
||||
customWidget:
|
||||
Center(child: text14400white("Yes, I want to")),
|
||||
border: 1),
|
||||
),
|
||||
Container(
|
||||
height: 40.h,
|
||||
width: 140.w,
|
||||
width: 130.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xFFD90B2E),
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.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/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
class TermsCondition extends StatefulWidget {
|
||||
const TermsCondition({super.key});
|
||||
@@ -16,35 +17,92 @@ class _TermsConditionState extends State<TermsCondition> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Terms & Condition",
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
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.")
|
||||
]),
|
||||
),
|
||||
// key: _scaffoldKey1,
|
||||
backgroundColor: Color(0xFF222935),
|
||||
extendBody: true,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: CommonAppbar(
|
||||
titleTxt: "Terms & Condition",
|
||||
),
|
||||
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(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(children: [
|
||||
sizedBoxHeight(20.h),
|
||||
Html(
|
||||
data: termsobj!.data!.content,
|
||||
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
|
||||
),
|
||||
},
|
||||
)
|
||||
]),
|
||||
),
|
||||
)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||
import 'package:regroup/Common/CommonGlassmorphism.dart';
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/view_model/profilePostmethod.dart';
|
||||
import 'package:regroup/Global.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:timer_button/timer_button.dart';
|
||||
|
||||
class VerifyCode extends StatefulWidget {
|
||||
const VerifyCode({super.key});
|
||||
@@ -17,8 +24,59 @@ class VerifyCode extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _VerifyCodeState extends State<VerifyCode> {
|
||||
final TextEditingController pincodeController = TextEditingController();
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
TextEditingController pincodeController = TextEditingController();
|
||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
String currentpassword = Get.arguments['currentpass'];
|
||||
String newpassword = Get.arguments['newpass'];
|
||||
String confirmpassword = Get.arguments['confirmpass'];
|
||||
|
||||
Uploadata() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"otp": pincodeController.text,
|
||||
"new_password": newpassword,
|
||||
};
|
||||
// final data = res
|
||||
final res = await Profilepostmethod().postChangepassverifyotp(updata);
|
||||
if (res.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("verification done");
|
||||
|
||||
Get.back();
|
||||
Get.back();
|
||||
|
||||
return utils.showToast(res.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("change pass not done");
|
||||
return utils.showToast(res.message);
|
||||
}
|
||||
}
|
||||
|
||||
Uploadataresendotp() async {
|
||||
utils.loader();
|
||||
Map<String, dynamic> updata = {
|
||||
"current_password": currentpassword,
|
||||
"new_password": newpassword,
|
||||
"confirm_password": confirmpassword,
|
||||
};
|
||||
final data = await Profilepostmethod().postChangepassword(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("otp done");
|
||||
|
||||
setState(() {
|
||||
pincodeController.clear();
|
||||
// turnValidation = false;
|
||||
});
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("otp not done");
|
||||
return utils.showToast(data.message);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -44,34 +102,97 @@ class _VerifyCodeState extends State<VerifyCode> {
|
||||
text20700white("Check your email"),
|
||||
sizedBoxHeight(10.h),
|
||||
text14400whiteblur(
|
||||
"Enter the verification code that we sent to loremipsum@gmail.com"),
|
||||
"Enter the verification code that we sent to $emailid"),
|
||||
sizedBoxHeight(30.h),
|
||||
text16400white("Enter code"),
|
||||
sizedBoxHeight(20.h),
|
||||
commonGlassContainer(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
borderradius: 30.r,
|
||||
border: 1,
|
||||
customWidget: CustomPinCodeField(
|
||||
controller: pincodeController,
|
||||
onChanged: (value) {
|
||||
print(value);
|
||||
},
|
||||
onCompleted: (value) {
|
||||
print("Completed");
|
||||
pincodeController.text = value;
|
||||
PinCodeTextField(
|
||||
validator: (value) {
|
||||
if (value != null && value.isEmpty) {
|
||||
return "Please Enter verification code";
|
||||
} else if (value != null && value.length < 4) {
|
||||
return "OTP length should be at least 4";
|
||||
}
|
||||
return null;
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
length: 4,
|
||||
obscureText: false,
|
||||
animationType: AnimationType.fade,
|
||||
pinTheme: PinTheme(
|
||||
selectedFillColor: Color(0xFF434A53),
|
||||
inactiveFillColor: Color(0xFF434A53),
|
||||
inactiveColor: Color(0xFF434A53),
|
||||
activeColor: Color(0xFF434A53),
|
||||
selectedColor: Color(0xFF434A53),
|
||||
shape: PinCodeFieldShape.underline,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
fieldHeight: 70,
|
||||
fieldWidth: 70,
|
||||
activeFillColor:
|
||||
// Colors.white
|
||||
Color(0xFF303030).withOpacity(0.4),
|
||||
// textStyle: TextStyle(color: Colors.white, fontSize: 20), // Change text color and font size
|
||||
),
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
enableActiveFill: true,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
controller: pincodeController,
|
||||
onCompleted: (v) {
|
||||
print("Completed");
|
||||
},
|
||||
onChanged: (value) {
|
||||
print(value);
|
||||
setState(() {
|
||||
// currentText = value;
|
||||
});
|
||||
},
|
||||
cursorColor: Colors.white,
|
||||
textStyle: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
beforeTextPaste: (text) {
|
||||
print("Allowing to paste $text");
|
||||
return true;
|
||||
},
|
||||
appContext: context,
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Center(
|
||||
child: TimerButton(
|
||||
disabledTextStyle: TextStyle(color: Colors.red),
|
||||
activeTextStyle: TextStyle(color: Colors.white),
|
||||
disabledColor: Color(0XFF222935).withOpacity(0.10),
|
||||
buttonType: ButtonType.textButton,
|
||||
label: "Resend OTP",
|
||||
timeOutInSeconds: 6,
|
||||
//mobile.text.isEmpty ? 1 : 60,
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
Uploadataresendotp();
|
||||
});
|
||||
},
|
||||
// disabledColor: Colors.white,
|
||||
color: Color(0XFF222935).withOpacity(0.10),
|
||||
),
|
||||
),
|
||||
// ),
|
||||
sizedBoxHeight(70.h),
|
||||
CustomButton(
|
||||
text: 'Continue',
|
||||
onPressed: () {
|
||||
if (pincodeController.text.isEmpty) {
|
||||
utils.showToast("Pin field is empty");
|
||||
} else if (pincodeController.text.length < 4) {
|
||||
utils.showToast("OTP length should be 4 digits");
|
||||
} else {
|
||||
return;
|
||||
Uploadata();
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -85,122 +206,176 @@ class _VerifyCodeState extends State<VerifyCode> {
|
||||
}
|
||||
}
|
||||
|
||||
class CustomPinCodeField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
final ValueChanged<String> onChanged;
|
||||
final ValueChanged<String> onCompleted;
|
||||
// class CustomPinCodeField extends StatefulWidget {
|
||||
// final TextEditingController controller;
|
||||
// final ValueChanged<String> onChanged;
|
||||
// final ValueChanged<String> onCompleted;
|
||||
|
||||
CustomPinCodeField({
|
||||
required this.controller,
|
||||
required this.onChanged,
|
||||
required this.onCompleted,
|
||||
});
|
||||
// CustomPinCodeField({
|
||||
// required this.controller,
|
||||
// required this.onChanged,
|
||||
// required this.onCompleted,
|
||||
// });
|
||||
|
||||
@override
|
||||
_CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
|
||||
}
|
||||
// @override
|
||||
// _CustomPinCodeFieldState createState() => _CustomPinCodeFieldState();
|
||||
// }
|
||||
|
||||
class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
late List<TextEditingController> _controllers;
|
||||
late List<FocusNode> _focusNodes;
|
||||
String _currentText = "";
|
||||
// class _CustomPinCodeFieldState extends State<CustomPinCodeField> {
|
||||
// final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
// late List<TextEditingController> _controllers;
|
||||
// late List<FocusNode> _focusNodes;
|
||||
// String _currentText = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_controllers = List.generate(4, (_) => TextEditingController());
|
||||
_focusNodes = List.generate(4, (_) => FocusNode());
|
||||
}
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// _controllers = List.generate(4, (_) => TextEditingController());
|
||||
// _focusNodes = List.generate(4, (_) => FocusNode());
|
||||
// }
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controllers.forEach((controller) => controller.dispose());
|
||||
_focusNodes.forEach((focusNode) => focusNode.dispose());
|
||||
super.dispose();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _controllers.forEach((controller) => controller.dispose());
|
||||
// _focusNodes.forEach((focusNode) => focusNode.dispose());
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
String? _validate(int index) {
|
||||
// _currentText = _controllers.map((controller) => controller.text).join();
|
||||
if (_currentText[index].isEmpty) {
|
||||
return "Please Enter verification code";
|
||||
} else if (_currentText.length < 4) {
|
||||
return "OTP length should be at least 4";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
// String? _validate(int index) {
|
||||
// if (_controllers[index].text.isEmpty) {
|
||||
// return "Please enter verification code";
|
||||
// } else if (_controllers[index].text.length > 1) {
|
||||
// return "Please enter only one digit";
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
void _onChanged(String value, int index) {
|
||||
setState(() {
|
||||
_currentText = _controllers.map((controller) => controller.text).join();
|
||||
});
|
||||
if (value.length == 1 && index != 3) {
|
||||
FocusScope.of(context).nextFocus();
|
||||
} else if (value.isEmpty && index != 0) {
|
||||
FocusScope.of(context).previousFocus();
|
||||
}
|
||||
widget.onChanged(_currentText);
|
||||
// void _onChanged(String value, int index) {
|
||||
// setState(() {
|
||||
// _currentText = _controllers.map((controller) => controller.text).join();
|
||||
// });
|
||||
|
||||
if (_currentText.length == 4) {
|
||||
widget.onCompleted(_currentText);
|
||||
}
|
||||
}
|
||||
// if (value.isNotEmpty) {
|
||||
// if (index < _controllers.length - 1) {
|
||||
// FocusScope.of(context).nextFocus();
|
||||
// } else {
|
||||
// // Last field, trigger onCompleted directly
|
||||
// if (_currentText.length == _controllers.length) {
|
||||
// widget.onCompleted(_currentText);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// // Empty value, focus to previous field if not the first field
|
||||
// if (index > 0) {
|
||||
// FocusScope.of(context).previousFocus();
|
||||
// }
|
||||
// }
|
||||
// widget.onChanged(_currentText);
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Form(
|
||||
key: _formKey,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: List.generate(4, (index) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 40,
|
||||
// color: Colors.amber,
|
||||
child: Center(
|
||||
child: TextFormField(
|
||||
controller: _controllers[index],
|
||||
focusNode: _focusNodes[index],
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
LengthLimitingTextInputFormatter(1),
|
||||
],
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
errorStyle: TextStyle(height: 0),
|
||||
),
|
||||
onChanged: (value) => _onChanged(value, index),
|
||||
validator: (value) {
|
||||
if (index == 3) return _validate(index);
|
||||
return null;
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (index != 3)
|
||||
Container(
|
||||
width: 12,
|
||||
height: 2,
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.symmetric(horizontal: 10),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Form(
|
||||
// key: _formKey,
|
||||
// child: Column(
|
||||
// children: [
|
||||
// commonGlassContainer(
|
||||
// width: double.infinity,
|
||||
// height: 50.h,
|
||||
// borderradius: 30.r,
|
||||
// border: 1,
|
||||
// customWidget: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: List.generate(4, (index) {
|
||||
// return Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// Center(
|
||||
// child: Container(
|
||||
// width: 30,
|
||||
// height: 40,
|
||||
// child: Center(
|
||||
// child: TextFormField(
|
||||
// controller: _controllers[index],
|
||||
// focusNode: _focusNodes[index],
|
||||
// keyboardType: TextInputType.number,
|
||||
// inputFormatters: [
|
||||
// FilteringTextInputFormatter.allow(
|
||||
// RegExp('[0-9]')),
|
||||
// LengthLimitingTextInputFormatter(1),
|
||||
// ],
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(
|
||||
// color: Colors.white,
|
||||
// fontSize: 20,
|
||||
// fontFamily: 'Helvetica',
|
||||
// ),
|
||||
// decoration: InputDecoration(
|
||||
// border: InputBorder.none,
|
||||
// errorStyle: TextStyle(height: 0),
|
||||
// ),
|
||||
// onChanged: (value) => _onChanged(value, index),
|
||||
// validator: (value) => _validate(index),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// if (index != 3)
|
||||
// Container(
|
||||
// width: 12,
|
||||
// height: 2,
|
||||
// color: Colors.white,
|
||||
// margin: EdgeInsets.symmetric(horizontal: 10),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// }),
|
||||
// ),
|
||||
// ),
|
||||
// sizedBoxHeight(10.h),
|
||||
// Text(
|
||||
// _validateErrors(),
|
||||
// style: TextStyle(color: Colors.red),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
// String _validateErrors() {
|
||||
// for (int i = 0; i < _controllers.length; i++) {
|
||||
// String? error = _validate(i);
|
||||
// if (error != null) {
|
||||
// return error;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Check if OTP length is less than 4
|
||||
// if (_currentText.length < 4) {
|
||||
// return "OTP length should be 4 digits";
|
||||
// }
|
||||
|
||||
// return "";
|
||||
// }
|
||||
|
||||
// // String _validateErrors() {
|
||||
// // List<String> errors = [];
|
||||
|
||||
// // // Validate each TextFormField
|
||||
// // for (int i = 0; i < _controllers.length; i++) {
|
||||
// // String? error = _validate(i);
|
||||
// // if (error != null && !errors.contains(error)) {
|
||||
// // errors.add(error);
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // // Check OTP length only if there are no other errors
|
||||
// // if (errors.isEmpty && _currentText.length < 4) {
|
||||
// // errors.add("OTP length should be 4 digits");
|
||||
// // }
|
||||
|
||||
// // // Return concatenated error messages
|
||||
// // return errors.isNotEmpty ? errors.join("\n") : "";
|
||||
// // }
|
||||
// }
|
||||
|
||||
@@ -0,0 +1,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,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['success'] == true) {
|
||||
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/CommonWidget.dart';
|
||||
import 'package:regroup/Utils/Common/CommonAppbar.dart';
|
||||
import 'package:regroup/Utils/Common/CommonDropdown.dart';
|
||||
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
@@ -22,6 +23,19 @@ class _AddTimelineState extends State<AddTimeline> {
|
||||
TextEditingController dateController = TextEditingController();
|
||||
TextEditingController dateController2 = TextEditingController();
|
||||
|
||||
final List<String> _dropdownProductItems = [
|
||||
'Individual',
|
||||
'Business',
|
||||
];
|
||||
|
||||
String _selectedAccountType = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_selectedAccountType = value;
|
||||
});
|
||||
}
|
||||
|
||||
RxBool isChecked = false.obs;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -150,6 +164,18 @@ class _AddTimelineState extends State<AddTimeline> {
|
||||
)
|
||||
],
|
||||
),
|
||||
text16400white("Ability"),
|
||||
sizedBoxHeight(15.h),
|
||||
CustomDropDownWidgetSignup(
|
||||
header: 'Select ability',
|
||||
title: '',
|
||||
listData: _dropdownProductItems,
|
||||
onItemSelected: _onItemSelected,
|
||||
// leadingImage:
|
||||
// Image.asset(
|
||||
// 'assets/images/png/user.png',
|
||||
// ),
|
||||
),
|
||||
sizedBoxHeight(80.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
||||
|
||||
@@ -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,46 +50,48 @@ class _AnnouncementsState extends State<Announcements> {
|
||||
titleTxt: "Announcements",
|
||||
),
|
||||
body: Stack(children: [
|
||||
const CommonBlurLeftRed(),
|
||||
const CommonBlurRightRed(),
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
Positioned.fill(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.announcementrequest);
|
||||
},
|
||||
child: text16w700_FCFCFCUnderline(
|
||||
"View announcement requests"),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(announcement.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
announcementWidget(
|
||||
imagepath: announcement[index]["imagepath"],
|
||||
title: announcement[index]["title"],
|
||||
date: announcement[index]["date"],
|
||||
subtitle: announcement[index]["subtitle"]),
|
||||
sizedBoxHeight(16.h)
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
]))))
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.announcementrequest);
|
||||
},
|
||||
child: text16w700_FCFCFCUnderline(
|
||||
"View announcement requests"),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Column(
|
||||
children: List.generate(announcement.length, (index) {
|
||||
return Column(
|
||||
children: [
|
||||
announcementWidget(
|
||||
imagepath: announcement[index]["imagepath"],
|
||||
title: announcement[index]["title"],
|
||||
date: announcement[index]["date"],
|
||||
subtitle: announcement[index]["subtitle"]),
|
||||
sizedBoxHeight(16.h)
|
||||
],
|
||||
);
|
||||
}),
|
||||
)
|
||||
])),
|
||||
),
|
||||
]),
|
||||
floatingActionButton: Container(
|
||||
height: 55.h,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.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/dialogs.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:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
|
||||
@@ -27,9 +30,7 @@ class LoginScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _LoginScreenState extends State<LoginScreen> {
|
||||
String _accessToken = "";
|
||||
Map _userData = {};
|
||||
bool _checking = true;
|
||||
AccessToken? _accessToken;
|
||||
final TextEditingController _emailController = TextEditingController();
|
||||
RxBool isObscured = true.obs;
|
||||
final TextEditingController _passwordController = TextEditingController();
|
||||
@@ -46,13 +47,20 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
|
||||
_loginWithGoogle() {
|
||||
googleSigninController.handleGoogleSignIn().then((value) async {
|
||||
final resp = await LoginAPI().storeGoogleSignin(
|
||||
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
||||
if (value != 'Google Sign-In canceled') {
|
||||
final resp = await LoginAPI().storeGoogleSignin(
|
||||
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
||||
if (resp.message == "go-to-signin-via-oauth") {
|
||||
// Get.to(()=> );
|
||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
||||
logger.d("go to sign in");
|
||||
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||
arguments: {"email": resp.data});
|
||||
} else if (value == null) {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
resp.data["message"][0],
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
@@ -64,14 +72,13 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
logger.d("go to login");
|
||||
}
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
'Google Sign-In canceled',
|
||||
resp.data["message"][0],
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
@@ -80,54 +87,46 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
// _checkIfisLoggedIn() async {
|
||||
// //user token
|
||||
// final accessToken = await FacebookAuth.instance.accessToken;
|
||||
_checkIfisLoggedIn() async {
|
||||
await _logout();
|
||||
final accessToken = await FacebookAuth.instance.accessToken;
|
||||
if (accessToken != null) {
|
||||
print("/////////////////////////////////////////xcheck");
|
||||
|
||||
// setState(() {
|
||||
// _checking = false;
|
||||
// });
|
||||
final userData = await FacebookAuth.instance.getUserData();
|
||||
|
||||
// if (accessToken != null) {
|
||||
// print("/////////////////////////////////////////xcheck");
|
||||
// print("worked");
|
||||
// print(accessToken.toJson());
|
||||
// final userData = await FacebookAuth.instance.getUserData();
|
||||
// // _accessToken = accessToken;
|
||||
// setState(() {
|
||||
// _userData = userData;
|
||||
// });
|
||||
// } else {
|
||||
// print("/////////////////////////////////////////check");
|
||||
logger.i(accessToken.token);
|
||||
logger.i(userData.toString());
|
||||
} else {
|
||||
print("/////////////////////////////////////////check");
|
||||
_login();
|
||||
}
|
||||
}
|
||||
|
||||
// print("not worked");
|
||||
// _login();
|
||||
// }
|
||||
// }
|
||||
_login() async {
|
||||
final LoginResult result = await FacebookAuth.instance.login();
|
||||
|
||||
// _login() async {
|
||||
// final LoginResult result = await FacebookAuth.instance.login();
|
||||
if (result.status == LoginStatus.success) {
|
||||
_accessToken = result.accessToken;
|
||||
|
||||
// if (result.status == LoginStatus.success) {
|
||||
// _accessToken = result.accessToken;
|
||||
final userData = await FacebookAuth.instance.getUserData();
|
||||
logger.i(userData['email']);
|
||||
logger.i(userData['id']);
|
||||
|
||||
// final userData = await FacebookAuth.instance.getUserData();
|
||||
// _userData = userData;
|
||||
// } else {
|
||||
// print(result.status);
|
||||
// print(result.message);
|
||||
// }
|
||||
// setState(() {
|
||||
// _checking = false;
|
||||
// });
|
||||
// }
|
||||
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;
|
||||
// _userData = null;
|
||||
// setState(() {});
|
||||
// }
|
||||
_logout() async {
|
||||
await FacebookAuth.instance.logOut();
|
||||
_accessToken = null;
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
_logincheck() async {
|
||||
if (_emailController.text.isBlank! || _passwordController.text.isBlank!) {
|
||||
@@ -199,315 +198,310 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset:
|
||||
false, // Prevent resizing when the keyboard opens
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Choice screen.png"),
|
||||
fit: BoxFit.cover)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 150.h,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Container(
|
||||
width: 107.w,
|
||||
height: 70.h,
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/onboarding2.svg",
|
||||
fit: BoxFit.cover,
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset:
|
||||
false, // Prevent resizing when the keyboard opens
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Choice screen.png"),
|
||||
fit: BoxFit.cover)),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 150.h,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: Container(
|
||||
width: 107.w,
|
||||
height: 70.h,
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/onboarding2.svg",
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text22400FCFCFC("Find your community")),
|
||||
sizedBoxHeight(40.h),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white('Email address'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: _emailController,
|
||||
hintText: "Enter your email address",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
SizedBox(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
child: Image.asset(
|
||||
'assets/images/png/mail.png',
|
||||
sizedBoxHeight(20.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text22400FCFCFC("Find your community")),
|
||||
sizedBoxHeight(40.h),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white('Email address'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: _emailController,
|
||||
hintText: "Enter your email address",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
SizedBox(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
child: Image.asset(
|
||||
'assets/images/png/mail.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
// validationMessage: errormsg.value,
|
||||
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;
|
||||
},
|
||||
// onInput: (p0) {
|
||||
// if (p0!.isEmpty) {
|
||||
// errormsg.value = '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(p0!)) {
|
||||
// errormsg.value = 'Enter a valid e-mail address';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// validatorText: "Email Id",
|
||||
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Password'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
textEditingController: _passwordController,
|
||||
hintText: 'Enter your password',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
// validationMessage: errormsg.value,
|
||||
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;
|
||||
},
|
||||
// onInput: (p0) {
|
||||
// if (p0!.isEmpty) {
|
||||
// errormsg.value = '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(p0!)) {
|
||||
// errormsg.value = 'Enter a valid e-mail address';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// validatorText: "Email Id",
|
||||
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Password'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
textEditingController: _passwordController,
|
||||
hintText: 'Enter your password',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
// validationMessage: errormsgpass.value,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
if (!RegExp(
|
||||
r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$')
|
||||
.hasMatch(value)) {
|
||||
return 'Enter a valid password';
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
// onInput: (p0) {
|
||||
// if (p0 == null || p0.isEmpty) {
|
||||
// errormsgpass.value =
|
||||
// 'Please enter your password';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 6.w),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.forgotpass);
|
||||
},
|
||||
child: text14400white('Forgot password ?')),
|
||||
)),
|
||||
sizedBoxHeight(40.h),
|
||||
CustomButton(
|
||||
text: "Login",
|
||||
onPressed: () {
|
||||
_logincheck();
|
||||
}),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.signupscreen);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text14400white('Don’t have account ? '),
|
||||
sizedBoxWidth(5.w),
|
||||
text14700white('Sign up')
|
||||
// validationMessage: errormsgpass.value,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
if (!RegExp(
|
||||
r'^(?=.*?[A-Z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{8,}$')
|
||||
.hasMatch(value)) {
|
||||
return 'Enter a valid password';
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
// onInput: (p0) {
|
||||
// if (p0 == null || p0.isEmpty) {
|
||||
// errormsgpass.value =
|
||||
// 'Please enter your password';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 160,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF434A53),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
text14400white('Or'),
|
||||
sizedBoxWidth(6.w),
|
||||
Container(
|
||||
width: 160,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF434A53),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
width: 220.w,
|
||||
sizedBoxHeight(10.h),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 6.w),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.forgotpass);
|
||||
},
|
||||
child: text14400white('Forgot password ?')),
|
||||
)),
|
||||
sizedBoxHeight(40.h),
|
||||
CustomButton(
|
||||
text: "Login",
|
||||
onPressed: () {
|
||||
_logincheck();
|
||||
}),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.signupscreen);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithApple();
|
||||
Get.toNamed(
|
||||
RouteName.verifygoogleapplepage);
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login2.png'))),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithGoogle();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
/* FacebookAuth.instance.login(
|
||||
permissions: ['public_profile', 'email'],
|
||||
).then((value) {
|
||||
FacebookAuth.instance.getUserData().then((userData) {
|
||||
setState(() {
|
||||
/* _isLoggedIn = true;
|
||||
_userObj = userData; */
|
||||
});
|
||||
});
|
||||
}); */
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login4.png'))),
|
||||
),
|
||||
),
|
||||
text14400white('Don’t have account ? '),
|
||||
sizedBoxWidth(5.w),
|
||||
text14700white('Sign up')
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(100)
|
||||
],
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 160,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF434A53),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
text14400white('Or'),
|
||||
sizedBoxWidth(6.w),
|
||||
Container(
|
||||
width: 160,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF434A53),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
width: 220.w,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
if (Platform.isIOS)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithApple();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login2.png'))),
|
||||
),
|
||||
),
|
||||
// const Spacer(),
|
||||
if (Platform.isAndroid)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithGoogle();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
),
|
||||
),
|
||||
// const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
_checkIfisLoggedIn();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login4.png'))),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// sizedBoxHeight(100)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:regroup/Common/base_manager.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/CommonDropdown.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/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
|
||||
|
||||
class Verifygoogleandapple extends StatefulWidget {
|
||||
const Verifygoogleandapple({super.key});
|
||||
Verifygoogleandapple({
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
State<Verifygoogleandapple> createState() => _VerifygoogleandappleState();
|
||||
@@ -22,20 +29,53 @@ class Verifygoogleandapple extends StatefulWidget {
|
||||
class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
|
||||
TextEditingController emailidcontroller = TextEditingController();
|
||||
|
||||
final Map<String, int> _accountTypeMap = {
|
||||
'Individual': 1,
|
||||
'Business': 2,
|
||||
};
|
||||
|
||||
String _selectedAccountType = '';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
emailidcontroller.text = Get.arguments['email'];
|
||||
super.initState();
|
||||
}
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
_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
|
||||
Widget build(BuildContext context) {
|
||||
@@ -169,13 +209,11 @@ class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
|
||||
CustomButton(
|
||||
text: "Continue",
|
||||
onPressed: () {
|
||||
if (
|
||||
// isValid!
|
||||
emailidcontroller.text.isEmpty &&
|
||||
_selectedAccountType.isEmpty) {
|
||||
if (emailidcontroller.text.isEmpty &&
|
||||
_selectedAccountType.isEmpty) {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else {
|
||||
// Uploadata();
|
||||
_createAccountWithOAuth();
|
||||
}
|
||||
}),
|
||||
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/Global.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:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@@ -40,18 +41,20 @@ class LoginAPI {
|
||||
|
||||
if (accountype == "1") {
|
||||
print('tell us individyal');
|
||||
Get.toNamed(RouteName.tellusindividualscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusindividualscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
);
|
||||
} else if (accountype == "2") {
|
||||
print('tell us business');
|
||||
|
||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "mainscreen"
|
||||
// }
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -73,9 +76,52 @@ class LoginAPI {
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
await prefs.setString('access-token', response.data['data']['token']);
|
||||
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>(
|
||||
"go-to-signin-via-oauth", ResponseStatus.SUCCESS);
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
@@ -85,10 +131,12 @@ class LoginAPI {
|
||||
|
||||
Future<ResponseData> storeUserDetailsWhenComingFromGoogleAppleSignin(
|
||||
var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices()
|
||||
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: true);
|
||||
if (response.status == ResponseStatus.SUCCESS) {}
|
||||
.postApi(data, ApiUrls.storeDetailsOfOAuth, optionalpar: false);
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:regroup/Login/ViewModel/LoginApi.dart';
|
||||
import 'package:regroup/Utils/Common/googleOAuthService.dart';
|
||||
import 'package:sign_in_with_apple/sign_in_with_apple.dart';
|
||||
|
||||
@@ -14,7 +15,9 @@ class AppleOAuthService {
|
||||
logger.d("email is ${credential.email}");
|
||||
logger.d("fullname is ${credential.givenName}");
|
||||
logger.d("token is ${credential.userIdentifier}");
|
||||
|
||||
|
||||
await LoginAPI()
|
||||
.storeAppleSignin({"apple_auth_token": credential.userIdentifier}, emailReceived:credential.email );
|
||||
} catch (e) {
|
||||
print("Error occured");
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class CustomDropDownWidgetSignup extends StatefulWidget {
|
||||
required this.title,
|
||||
required this.listData,
|
||||
required this.onItemSelected,
|
||||
required this.leadingImage,
|
||||
this.leadingImage,
|
||||
}) : super(key: key);
|
||||
|
||||
final String header;
|
||||
@@ -73,7 +73,13 @@ class _CustomDropDownWidgetSignupState
|
||||
// 'assets/images/png/user.png',
|
||||
// ),
|
||||
|
||||
widget.leadingImage!,
|
||||
widget.leadingImage == null
|
||||
?
|
||||
SizedBox()
|
||||
:
|
||||
widget.leadingImage!
|
||||
,
|
||||
|
||||
SizedBox(width: 16.w),
|
||||
Text(
|
||||
selectedValue.value.isEmpty
|
||||
@@ -493,6 +499,7 @@ class _CustomDropDownTagState extends State<CustomDropDownTag> {
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
class CustomDropDownRadio extends StatefulWidget {
|
||||
const CustomDropDownRadio({
|
||||
Key? key,
|
||||
@@ -533,6 +540,7 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
selectedValue.value = item;
|
||||
_textController.clear();
|
||||
widget.onItemSelected(item);
|
||||
onDropTap.value = !onDropTap.value;
|
||||
},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
@@ -662,9 +670,11 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 50.h,
|
||||
height: 52.h,
|
||||
padding: EdgeInsets.only(
|
||||
top: 14.0, bottom: 14.0, right: 22.w, left: 12.w),
|
||||
right: 22.w,
|
||||
left: 12.w,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFFFFF).withOpacity(0.10),
|
||||
borderRadius: onDropTap.value
|
||||
@@ -682,29 +692,29 @@ class _CustomDropDownRadioState extends State<CustomDropDownRadio> {
|
||||
),
|
||||
border: Border.all(color: const Color(0xFF434A53)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
widget.leadingImage!,
|
||||
SizedBox(width: 16.w),
|
||||
Text(
|
||||
selectedValue.value.isEmpty
|
||||
? widget.header
|
||||
: selectedValue.value,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
onDropTap.value
|
||||
? Image.asset('assets/images/png/arrowup.png')
|
||||
: Image.asset('assets/images/png/arrowdown.png'),
|
||||
],
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
widget.leadingImage!,
|
||||
SizedBox(width: 12.w),
|
||||
Text(
|
||||
selectedValue.value.isEmpty
|
||||
? widget.header
|
||||
: selectedValue.value,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
Spacer(),
|
||||
onDropTap.value
|
||||
? Image.asset('assets/images/png/arrowup.png')
|
||||
: Image.asset('assets/images/png/arrowdown.png'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -129,7 +129,8 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
prefixIcon: widget.leadingIcon == null
|
||||
? null
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10.w, vertical: 13.h),
|
||||
child: widget.leadingIcon!,
|
||||
),
|
||||
suffixIcon: widget.isInputPassword
|
||||
@@ -164,7 +165,7 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
: widget.suffixIcon!,
|
||||
border: InputBorder.none,
|
||||
contentPadding:
|
||||
const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
EdgeInsets.symmetric(horizontal: 20.h, vertical: 13.w),
|
||||
),
|
||||
keyboardType: widget.texttype,
|
||||
inputFormatters: widget.inputFormatters,
|
||||
|
||||
@@ -53,7 +53,7 @@ class ImageUploadBottomSheet {
|
||||
.getImage(ImageSource.camera);
|
||||
onImagePicked(result);
|
||||
|
||||
Get.back();
|
||||
// Get.back();
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -116,7 +116,7 @@ class ImageUploadBottomSheet {
|
||||
onTap: () async {
|
||||
var result = await FilePickerMethod().pickFile();
|
||||
onImagePicked(result?.path ?? "");
|
||||
Get.back();
|
||||
// Get.back();
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -155,7 +155,7 @@ class ImageUploadBottomSheet {
|
||||
.getImage(ImageSource.camera);
|
||||
onImagePicked(result);
|
||||
|
||||
Get.back();
|
||||
// Get.back();
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -187,7 +187,7 @@ class ImageUploadBottomSheet {
|
||||
var result = await ImagePickerMethod()
|
||||
.getImage(ImageSource.gallery);
|
||||
onImagePicked(result);
|
||||
Get.back();
|
||||
// Get.back();
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
|
||||
@@ -32,16 +32,6 @@ class GoogleAuthService extends GetxController {
|
||||
}
|
||||
|
||||
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 {
|
||||
// Sign out the user if they are already signed in
|
||||
await _googleSignIn.signOut();
|
||||
@@ -88,7 +78,7 @@ class GoogleAuthService extends GetxController {
|
||||
} catch (error) {
|
||||
// Handle any errors that occurred during the sign-in process.
|
||||
print('Error during Google Sign-In: $error');
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,15 +15,13 @@ class utils {
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
child: WillPopScope(
|
||||
child: Container(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
color: Color(0xffc18948),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
color: Color(0xffc18948),
|
||||
),
|
||||
],
|
||||
),
|
||||
onWillPop: () async => false),
|
||||
),
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
@@ -45,10 +46,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// final Connectivity _connectivity = Connectivity();
|
||||
// late StreamSubscription<ConnectivityResult> _connectivitySubscription;
|
||||
|
||||
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
|
||||
List<ConnectivityResult> _connectionStatus = [ConnectivityResult.none];
|
||||
final Connectivity _connectivity = Connectivity();
|
||||
late StreamSubscription<List<ConnectivityResult>> _connectivitySubscription;
|
||||
|
||||
|
||||
// Future<void> checkInternet() async {
|
||||
// final connectivityResult = await (Connectivity().checkConnectivity());
|
||||
|
||||
@@ -97,25 +98,25 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// setState(() {
|
||||
// _connectionStatus = result;
|
||||
// });
|
||||
|
||||
if (result.contains(ConnectivityResult.wifi) || result.contains(ConnectivityResult.mobile)) {
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.back(result: true);
|
||||
|
||||
});
|
||||
if (result.contains(ConnectivityResult.wifi) ||
|
||||
result.contains(ConnectivityResult.mobile)) {
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.back(result: true);
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.toNamed(RouteName.nointernet);
|
||||
});
|
||||
setState(() {
|
||||
_connectionStatus = result;
|
||||
Get.toNamed(RouteName.nointernet);
|
||||
});
|
||||
// Get.toNamed(RouteName.nointernet);
|
||||
}
|
||||
// ignore: avoid_print
|
||||
print('Connectivity changed: $_connectionStatus');
|
||||
}
|
||||
|
||||
Future<void> _getStoragePermission() async {
|
||||
Future<void> _getStoragePermission() async {
|
||||
DeviceInfoPlugin plugin = DeviceInfoPlugin();
|
||||
AndroidDeviceInfo android = await plugin.androidInfo;
|
||||
if (android.version.sdkInt < 33) {
|
||||
@@ -155,13 +156,13 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
void initState() {
|
||||
initConnectivity();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
_connectivitySubscription =
|
||||
_connectivitySubscription =
|
||||
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||
|
||||
//do not remove this coomented code
|
||||
// if (Platform.isAndroid) {
|
||||
// _getStoragePermission();
|
||||
// }
|
||||
if (Platform.isAndroid) {
|
||||
_getStoragePermission();
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
||||
];
|
||||
|
||||
String _selectedbusinesstype = '';
|
||||
// String business_type = '';
|
||||
|
||||
void _onItemSelected(String value) {
|
||||
setState(() {
|
||||
@@ -46,8 +45,6 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
||||
});
|
||||
}
|
||||
|
||||
// String pagename = Get.arguments["pageroute"];
|
||||
|
||||
String getBusinessTypeId(String selectedBusinessType) {
|
||||
if (selectedBusinessType.contains("Retail")) {
|
||||
return '1';
|
||||
@@ -91,244 +88,172 @@ class _TellusaboutBusinessState extends State<TellusaboutBusiness> {
|
||||
};
|
||||
final data = await BusinessAPI().tellUsBusinessApi(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
// await global.setname();
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'success!',
|
||||
duration: Duration(seconds: 2),
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.green,
|
||||
margin: EdgeInsets.all(8),
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
|
||||
// if (pagename == "nextscreen") {
|
||||
Get.toNamed(RouteName.businessletusunderstandstep1);
|
||||
|
||||
// } else if (pagename == "mainscreen") {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
// }
|
||||
|
||||
Get.toNamed(RouteName.businessletusunderstandstep1);
|
||||
} else if (data.status == ResponseStatus.FAILED) {
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.message,
|
||||
duration: Duration(seconds: 2),
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
} else {
|
||||
// btnController.reset();
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
data.data['message'],
|
||||
duration: Duration(seconds: 2),
|
||||
duration: const Duration(seconds: 2),
|
||||
colorText: Colors.white,
|
||||
backgroundColor: Colors.red,
|
||||
margin: EdgeInsets.all(8),
|
||||
margin: const EdgeInsets.all(8),
|
||||
snackStyle: SnackStyle.FLOATING,
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
// _controller.isTextFieldEnabled.value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
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(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
|
||||
ListView(physics: ScrollPhysics(), children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// const Spacer(flex: 1),
|
||||
sizedBoxHeight(60.h),
|
||||
Center(child: text20400white('Tell us about your business')),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 154,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
text16400white('Business owner name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: businessownerController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your business owner name",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/user.png',
|
||||
),
|
||||
// validatorText: "Enter your business owner name",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your business owner name';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Business name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: businessNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your business name",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/briefcase.png',
|
||||
),
|
||||
// validatorText: "Enter your business name",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your business name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Business location'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: businesslocationController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your business location",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/location.png',
|
||||
),
|
||||
// validatorText: "Enter your business location",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your business location ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Type of business'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomDropDownWidgetSignup(
|
||||
header: 'Select type of business',
|
||||
title: '',
|
||||
listData: _businesslist,
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage:
|
||||
Image.asset('assets/images/png/briefcase.png'),
|
||||
),
|
||||
|
||||
sizedBoxHeight(50.h),
|
||||
CustomButton(
|
||||
text: "Continue",
|
||||
onPressed: () {
|
||||
_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),
|
||||
// const Spacer(
|
||||
// flex: 3,
|
||||
// )
|
||||
],
|
||||
),
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
])
|
||||
]));
|
||||
ListView(physics: const ScrollPhysics(), children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(60.h),
|
||||
Center(
|
||||
child: text20400white('Tell us about your business')),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 154,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
text16400white('Business owner name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: businessownerController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your business owner name",
|
||||
leadingIcon: Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/user.png',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your business owner name';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Business name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: businessNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your business name",
|
||||
leadingIcon: Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/briefcase.png',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your business name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Business location'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: businesslocationController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your business location",
|
||||
leadingIcon: Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/location.png',
|
||||
),
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your business location ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Type of business'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomDropDownRadio(
|
||||
header: 'Select type of business',
|
||||
title: '',
|
||||
listData: _businesslist,
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage:
|
||||
Image.asset('assets/images/png/briefcase.png'),
|
||||
),
|
||||
sizedBoxHeight(50.h),
|
||||
CustomButton(
|
||||
text: "Continue",
|
||||
onPressed: () {
|
||||
_tellUsBusinessDone();
|
||||
}),
|
||||
sizedBoxHeight(30.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
])
|
||||
])),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,17 +8,11 @@ class BusinessAPI {
|
||||
|
||||
Future<ResponseData<dynamic>> tellUsBusinessApi(var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.tellUsBusinessApi
|
||||
// "https://regroup.betadelivery.com/api/v1/tell-us-about-your-business",
|
||||
// optionalpar: true
|
||||
);
|
||||
final response =
|
||||
await NetworkApiServices().postApi(data, ApiUrls.tellUsBusinessApi);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||
if (response.data['status'] == 'success') {
|
||||
// LoginModel loginObj = LoginModel.fromJson(response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
@@ -27,16 +21,13 @@ class BusinessAPI {
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
|
||||
Future<ResponseData<dynamic>> letUsUnderstandApi(var data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.letUsUnderstandApi,
|
||||
// "https://regroup.betadelivery.com/api/v1/update-business-profile-step-1",
|
||||
);
|
||||
|
||||
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);
|
||||
|
||||
@@ -74,7 +74,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
|
||||
Color _getGradientColor(int id) {
|
||||
if (_selectedIndices.contains(id)) {
|
||||
return Color(0XFFD90B2E); // Selected color
|
||||
return const Color(0XFFD90B2E); // Selected color
|
||||
}
|
||||
return Colors.transparent; // Default color
|
||||
}
|
||||
@@ -108,7 +108,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
bottomNavigationBar: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10, left: 16, right: 16),
|
||||
child: CustomButton(
|
||||
@@ -129,67 +129,38 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
// RouteName.individualgroupstep3);
|
||||
}),
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: Getonboard().getIndividualactivity(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [Center(child: CircularProgressIndicator())],
|
||||
);
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: FutureBuilder(
|
||||
future: Getonboard().getIndividualactivity(),
|
||||
builder: (ctx, snapshot) {
|
||||
if (snapshot.data == null) {
|
||||
return const Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [Center(child: CircularProgressIndicator())],
|
||||
);
|
||||
}
|
||||
}
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${snapshot.error} occured',
|
||||
style: TextStyle(fontSize: 18.spMin),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
|
||||
Positioned(
|
||||
top: 450, right: -30, child: CommonBlurRightSecond()),
|
||||
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
|
||||
GlassmorphicContainer(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
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),
|
||||
],
|
||||
return Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
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(horizontal: 16.w, vertical: 0.h),
|
||||
child: SingleChildScrollView(
|
||||
@@ -224,7 +195,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
height: 25.h,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
@@ -238,7 +209,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
width: 120.w,
|
||||
height: 15.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
@@ -259,7 +230,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
@@ -296,7 +267,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
Center(
|
||||
child: Container(
|
||||
width: 154.w,
|
||||
decoration: ShapeDecoration(
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
@@ -310,7 +281,7 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
GridView.builder(
|
||||
physics: ScrollPhysics(),
|
||||
physics: const ScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
@@ -430,10 +401,10 @@ class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
//
|
||||
@@ -471,12 +442,12 @@ class ActivityContainer extends StatelessWidget {
|
||||
return GestureDetector(
|
||||
onTap: () => onTap(index),
|
||||
child: Container(
|
||||
width: 110.w,
|
||||
height: 120.h,
|
||||
// width: 110.w,
|
||||
// height: 120.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: isSelected
|
||||
? [
|
||||
gradientColor.withOpacity(0.80),
|
||||
@@ -490,12 +461,12 @@ class ActivityContainer extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||
side: const BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 10.h),
|
||||
padding: EdgeInsets.symmetric(horizontal: 0.w, vertical: 10.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
@@ -523,7 +494,7 @@ class ActivityContainer extends StatelessWidget {
|
||||
width: 50.w,
|
||||
height: 50.h,
|
||||
),
|
||||
Spacer(flex: 3),
|
||||
const Spacer(flex: 3),
|
||||
SizedBox(
|
||||
child: Text(
|
||||
titleString,
|
||||
|
||||
@@ -83,121 +83,85 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
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(
|
||||
children: [
|
||||
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
|
||||
Positioned(top: 400, right: -30, child: CommonBlurRightSecond()),
|
||||
Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()),
|
||||
SingleChildScrollView(
|
||||
child: 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),
|
||||
],
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 40.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.communitycommitscreen);
|
||||
},
|
||||
child: Text(
|
||||
'Skip',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
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: EdgeInsets.symmetric(
|
||||
horizontal: 16.w, vertical: 50.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.communitycommitscreen);
|
||||
},
|
||||
child: Text(
|
||||
'Skip',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text16400white('Step 2 of 3')),
|
||||
sizedBoxHeight(20.h),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 25.h,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.w, vertical: 2.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 216.w,
|
||||
height: 15.h,
|
||||
sizedBoxHeight(30.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text16400white('Step 2 of 3')),
|
||||
sizedBoxHeight(20.h),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 25.h,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.w, vertical: 2.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 216.w,
|
||||
height: 15.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Color(0xA5D90B2E),
|
||||
Color(0x42D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Color(0xA5D90B2E),
|
||||
Color(0x42D90B2E)
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x60D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -205,152 +169,142 @@ class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
|
||||
BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x60D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text20400white('Find your group'),
|
||||
sizedBoxWidth(5.w),
|
||||
Image.asset('assets/images/png/informationicon.png')
|
||||
],
|
||||
)),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 108.w,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text20400white('Find your group'),
|
||||
sizedBoxWidth(5.w),
|
||||
Image.asset(
|
||||
'assets/images/png/informationicon.png')
|
||||
],
|
||||
)),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 108.w,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
CustomTextFormField(
|
||||
// textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search groups",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
// SvgPicture.asset(
|
||||
// // width: 23.w,
|
||||
// // height: 23.h,
|
||||
// 'assets/images/svg/search.svg',
|
||||
// ),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// Onboard().postGroupsearch({"search": value},
|
||||
// streamController: searchcontroller);
|
||||
// searchGroups(value!);
|
||||
Getonboard().getGroupsearch(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
StreamBuilder<GrouplistModel>(
|
||||
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),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
CustomTextFormField(
|
||||
// textEditingController: searchcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search groups",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
// SvgPicture.asset(
|
||||
// // width: 23.w,
|
||||
// // height: 23.h,
|
||||
// 'assets/images/svg/search.svg',
|
||||
// ),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// Onboard().postGroupsearch({"search": value},
|
||||
// streamController: searchcontroller);
|
||||
// searchGroups(value!);
|
||||
Getonboard().getGroupsearch(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
StreamBuilder<GrouplistModel>(
|
||||
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 grouplistobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: Expanded(
|
||||
child: GridView.builder(
|
||||
physics: ScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 12.0,
|
||||
mainAxisSpacing: 12.0,
|
||||
),
|
||||
itemCount: grouplistobj!.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SizedBox(
|
||||
height:
|
||||
150.0, // Adjust this height according to your design
|
||||
child: GroupSelect(
|
||||
titleString: grouplistobj!
|
||||
.data![index].title!,
|
||||
image: grouplistobj
|
||||
?.data?[index]
|
||||
?.groupImage ??
|
||||
'',
|
||||
index: grouplistobj!
|
||||
.data![index].id!,
|
||||
isSelected: _selectedIndices
|
||||
.contains(grouplistobj!
|
||||
.data![index].id!),
|
||||
onTap: _onContainerTap,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return grouplistobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: Expanded(
|
||||
child: GridView.builder(
|
||||
physics: ScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 12.0,
|
||||
mainAxisSpacing: 12.0,
|
||||
),
|
||||
itemCount: grouplistobj!.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SizedBox(
|
||||
height:
|
||||
150.0, // Adjust this height according to your design
|
||||
child: GroupSelect(
|
||||
titleString:
|
||||
grouplistobj!.data![index].title!,
|
||||
image: grouplistobj
|
||||
?.data?[index]?.groupImage ??
|
||||
'',
|
||||
index: grouplistobj!.data![index].id!,
|
||||
isSelected: _selectedIndices.contains(
|
||||
grouplistobj!.data![index].id!),
|
||||
onTap: _onContainerTap,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
// 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,121 +84,86 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
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(
|
||||
children: [
|
||||
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
|
||||
Positioned(top: 400, right: -30, child: CommonBlurRightSecond()),
|
||||
Positioned(top: 630, left: -30, child: CommonBlurLeftBlue()),
|
||||
SingleChildScrollView(
|
||||
child: 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),
|
||||
],
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 40.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.communitycommitscreen);
|
||||
},
|
||||
child: Text(
|
||||
'Skip',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
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: EdgeInsets.symmetric(
|
||||
horizontal: 16.w, vertical: 50.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.communitycommitscreen);
|
||||
},
|
||||
child: Text(
|
||||
'Skip',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text16400white('Step 3 of 3')),
|
||||
sizedBoxHeight(20.h),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 25.h,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.w, vertical: 2.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
// width: 216.w,
|
||||
height: 15.h,
|
||||
sizedBoxHeight(30.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text16400white('Step 3 of 3')),
|
||||
sizedBoxHeight(20.h),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 25.h,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8.w, vertical: 2.h),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
// width: 216.w,
|
||||
height: 15.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Color(0xA5D90B2E),
|
||||
Color(0x42D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Color(0xA5D90B2E),
|
||||
Color(0x42D90B2E)
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x60D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -206,156 +171,145 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
|
||||
BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
width: 15,
|
||||
height: 15,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin:
|
||||
Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Color(0xFFD90B2E),
|
||||
Color(0x60D90B2E)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
30),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)))
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
)))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text20400white('Find your community'),
|
||||
sizedBoxWidth(5.w),
|
||||
Image.asset(
|
||||
'assets/images/png/informationicon.png',
|
||||
)
|
||||
],
|
||||
)),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 108.w,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(40.h),
|
||||
Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
text20400white('Find your community'),
|
||||
sizedBoxWidth(5.w),
|
||||
Image.asset(
|
||||
'assets/images/png/informationicon.png',
|
||||
)
|
||||
],
|
||||
)),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 108.w,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
CustomTextFormField(
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search community",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
// SvgPicture.asset(
|
||||
// // width: 23.w,
|
||||
// // height: 23.h,
|
||||
// 'assets/images/svg/search.svg',
|
||||
// ),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// Onboard().postGroupsearch({"search": value},
|
||||
// streamController: searchcontroller);
|
||||
// searchGroups(value!);
|
||||
Getonboard().getCommunitysearch(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
StreamBuilder<GetcommunitiesModel>(
|
||||
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),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
CustomTextFormField(
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Search community",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
// SvgPicture.asset(
|
||||
// // width: 23.w,
|
||||
// // height: 23.h,
|
||||
// 'assets/images/svg/search.svg',
|
||||
// ),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Icon(
|
||||
Icons.search,
|
||||
size: 35,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
],
|
||||
onInput: (value) {
|
||||
// Onboard().postGroupsearch({"search": value},
|
||||
// streamController: searchcontroller);
|
||||
// searchGroups(value!);
|
||||
Getonboard().getCommunitysearch(value,
|
||||
streamController: searchcontroller);
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
StreamBuilder<GetcommunitiesModel>(
|
||||
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 communitylistobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: Expanded(
|
||||
child: GridView.builder(
|
||||
physics: ScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 12.0,
|
||||
mainAxisSpacing: 12.0,
|
||||
),
|
||||
itemCount:
|
||||
communitylistobj!.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SizedBox(
|
||||
height:
|
||||
150.0, // Adjust this height according to your design
|
||||
child: CommunitySelect(
|
||||
titleString: communitylistobj!
|
||||
.data![index]
|
||||
.communityName!,
|
||||
image: communitylistobj
|
||||
?.data?[index]
|
||||
?.communityProfilePhoto ??
|
||||
'',
|
||||
index: communitylistobj!
|
||||
.data![index].id!,
|
||||
isSelected: _selectedIndices
|
||||
.contains(communitylistobj!
|
||||
.data![index].id!),
|
||||
onTap: _onContainerTap,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
// Data has been loaded, show actual UI
|
||||
return communitylistobj!.data!.isEmpty
|
||||
? _buildNoDataBody(context)
|
||||
: Expanded(
|
||||
child: GridView.builder(
|
||||
physics: ScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 12.0,
|
||||
mainAxisSpacing: 12.0,
|
||||
),
|
||||
itemCount: communitylistobj!.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
return SizedBox(
|
||||
height:
|
||||
150.0, // Adjust this height according to your design
|
||||
child: CommunitySelect(
|
||||
titleString: communitylistobj!
|
||||
.data![index].communityName!,
|
||||
image: communitylistobj?.data?[index]
|
||||
?.communityProfilePhoto ??
|
||||
'',
|
||||
index: communitylistobj!
|
||||
.data![index].id!,
|
||||
isSelected: _selectedIndices.contains(
|
||||
communitylistobj!
|
||||
.data![index].id!),
|
||||
onTap: _onContainerTap,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
// 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 locationcontroller = TextEditingController();
|
||||
|
||||
// String pagename = Get.arguments["pageroute"];
|
||||
|
||||
|
||||
DateTime? _selectedDate;
|
||||
final photographController = TextEditingController();
|
||||
|
||||
@@ -46,9 +43,24 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
Get.put(ProfileImageController());
|
||||
|
||||
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.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(
|
||||
context: context,
|
||||
initialDate: yesterday,
|
||||
@@ -56,68 +68,54 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
lastDate: DateTime(2026),
|
||||
builder: (BuildContext context, Widget? child) {
|
||||
return Theme(
|
||||
data: ThemeData.light().copyWith(
|
||||
colorScheme: ColorScheme.dark(
|
||||
primary:
|
||||
Color(0XFF222935).withOpacity(0.60), // Change primary color
|
||||
onPrimary:
|
||||
// Color(0XFF222935).withOpacity(0.60), // Change primary color
|
||||
Colors.white
|
||||
|
||||
// Colors.white, // Change text color
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.white, // Change button text color
|
||||
),
|
||||
),
|
||||
dialogBackgroundColor:
|
||||
// Color(0xFF434A53),
|
||||
Color(0XFF222935).withOpacity(0.60), // Change primary color
|
||||
|
||||
// // Change dialog background color
|
||||
),
|
||||
data: customTheme,
|
||||
// ThemeData.light().copyWith(
|
||||
// colorScheme: ColorScheme.dark(
|
||||
// primary: Color(0XFF222935).withOpacity(0.60),
|
||||
// onPrimary: Colors.white, // Change text color
|
||||
// ),
|
||||
// textButtonTheme: TextButtonThemeData(
|
||||
// style: TextButton.styleFrom(
|
||||
// foregroundColor: Colors.white, // Change button text color
|
||||
// ),
|
||||
// ),
|
||||
// dialogBackgroundColor: Color(0XFF222935)
|
||||
// .withOpacity(0.60), // Change dialog background color
|
||||
// ),
|
||||
child: child!,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
if (pickedDate != null) {
|
||||
// if (pickedDate.isBefore(eighteenYearsAgo)) {
|
||||
setState(() {
|
||||
// selectedDate.value = pickedDate;
|
||||
_selectedDate = pickedDate;
|
||||
datecontroller.text =
|
||||
"${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}";
|
||||
});
|
||||
// // } else {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return AlertDialog(
|
||||
// backgroundColor: Colors.black,
|
||||
// title: const Text(
|
||||
// "Age Restriction",
|
||||
// style: TextStyle(color: Colors.white),
|
||||
// ),
|
||||
// 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),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
if (pickedDate.isBefore(eighteenYearsAgo)) {
|
||||
setState(() {
|
||||
_selectedDate = pickedDate;
|
||||
datecontroller.text =
|
||||
"${_selectedDate!.year.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.day.toString().padLeft(2, '0')}";
|
||||
});
|
||||
} else {
|
||||
setState(() {
|
||||
_selectedDate = null;
|
||||
datecontroller.text = ''; // Clear the text field
|
||||
});
|
||||
|
||||
Get.snackbar(
|
||||
"Error!",
|
||||
'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+'),
|
||||
// ),
|
||||
// );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,36 +138,20 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
filename: path.basename(editProfileImage.profilePicPath.value),
|
||||
);
|
||||
}
|
||||
// else {
|
||||
// imageFile = await Helper.assetImageToMultipartFile(
|
||||
// "assets/images/png/camera.png", "profile");
|
||||
// }
|
||||
|
||||
FormData formData = FormData.fromMap({
|
||||
"full_name": fullNameController.text,
|
||||
"username": userNameController.text,
|
||||
"date_of_birth": datecontroller.text,
|
||||
"gender": _selectedgendertype,
|
||||
'profile_photo':
|
||||
// editProfileImage.profilePicPath.value.isNotEmpty ?
|
||||
imageFile,
|
||||
// : null,
|
||||
'profile_photo': imageFile,
|
||||
'location': locationcontroller.text,
|
||||
});
|
||||
|
||||
print("formData is $formData");
|
||||
log(formData.toString());
|
||||
final data = await Onboard().PosttellusIndividual(formData);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
utils.showToast("tell us done Successfully!");
|
||||
Get.back();
|
||||
// Get.toNamed(RouteName.individualprofilestep1);
|
||||
// if (pagename == "nextscreen") {
|
||||
Get.toNamed(RouteName.individualactivitystep2);
|
||||
|
||||
// } else if (pagename == "mainscreen") {
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
// }
|
||||
Get.toNamed(RouteName.individualactivitystep2);
|
||||
} else {
|
||||
Get.back();
|
||||
return utils.showToast(data.message);
|
||||
@@ -178,350 +160,288 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
SystemNavigator.pop();
|
||||
Navigator.pop(context);
|
||||
return true;
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned(top: 70, left: -30, child: CommonBlurLeftSecond()),
|
||||
Positioned(top: 310, right: -30, child: CommonBlurRightSecond()),
|
||||
Positioned(top: 510, 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),
|
||||
],
|
||||
),
|
||||
child: ListView(physics: ScrollPhysics(), children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// const Spacer(flex: 1),
|
||||
sizedBoxHeight(50.h),
|
||||
Center(
|
||||
child: text20400white('Tell us about yourself')),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 154,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
)),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
print("File path is $result");
|
||||
editProfileImage.profilePicPath.value =
|
||||
result;
|
||||
var filenameresult = extractFileName(result);
|
||||
print("File name is $filenameresult");
|
||||
photographController.text = filenameresult;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// Outer circle
|
||||
Container(
|
||||
width: 139.w,
|
||||
height: 139.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
// Middle circle
|
||||
Container(
|
||||
width: 119.w,
|
||||
height: 119.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
// Inner circle
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
child: Obx(() =>
|
||||
// editProfileImage
|
||||
// .profilePicPath.value !=
|
||||
// ''
|
||||
// ?
|
||||
editProfileImage.profilePicPath
|
||||
.value !=
|
||||
''
|
||||
? ClipOval(
|
||||
child:
|
||||
SizedBox.fromSize(
|
||||
size: Size.fromRadius(
|
||||
50.r),
|
||||
child: Image(
|
||||
image: FileImage(
|
||||
File(
|
||||
editProfileImage
|
||||
.profilePicPath
|
||||
.value,
|
||||
),
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
width: 200.w,
|
||||
height: 200.h,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/png/camera.png")
|
||||
// : Image.asset(
|
||||
// "assets/images/png/camera.png")
|
||||
)),
|
||||
// Main button
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 9),
|
||||
text16400white('Add profile picture')
|
||||
],
|
||||
)),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white('Full name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: fullNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your full name",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/user.png',
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
ListView(physics: const ScrollPhysics(), children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// const Spacer(flex: 1),
|
||||
sizedBoxHeight(50.h),
|
||||
Center(child: text20400white('Tell us about yourself')),
|
||||
sizedBoxHeight(10.w),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 154,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('User name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: userNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your user name",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/user.png',
|
||||
),
|
||||
// validatorText: "Enter your user name",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your user name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Date of birth'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: datecontroller,
|
||||
readonly: true,
|
||||
onTap: () {
|
||||
_selectDate(context);
|
||||
},
|
||||
// texttype: TextInputType.text,
|
||||
hintText: "Enter your date of birth",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/dateimage.png',
|
||||
),
|
||||
// validatorText: "Enter date of birth",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your date of birth';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Gender'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomDropDownWidgetSignup(
|
||||
header: 'Select gender',
|
||||
title: '',
|
||||
listData: _gender,
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage:
|
||||
Image.asset('assets/images/png/gendericon.png'),
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white('Location'),
|
||||
sizedBoxWidth(5.w),
|
||||
Image.asset(
|
||||
'assets/images/png/informationicon.png')
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: locationcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your location",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/location.png',
|
||||
),
|
||||
// validatorText: "Enter your location",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your location ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
text: "Continue",
|
||||
onPressed: () {
|
||||
if (
|
||||
// isValid!
|
||||
// fullNameController.text.isBlank! &&
|
||||
// userNameController.text.isBlank! &&
|
||||
// datecontroller.text.isBlank! &&
|
||||
// _selectedgendertype.isEmpty &&
|
||||
// locationcontroller.text.isBlank! &&
|
||||
// editProfileImage.profilePicPath.value ==
|
||||
// ''
|
||||
fullNameController.text.isBlank! ||
|
||||
userNameController.text.isBlank! ||
|
||||
datecontroller.text.isBlank! ||
|
||||
_selectedgendertype.isEmpty ||
|
||||
locationcontroller.text.isBlank! ||
|
||||
editProfileImage.profilePicPath.value ==
|
||||
'') {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else {
|
||||
TellusUploadData();
|
||||
}
|
||||
// if (_selectedgendertype.isNotEmpty) {
|
||||
// Get.toNamed(RouteName.individualprofilestep1);
|
||||
|
||||
// // Get.to(() => BusinessPage());
|
||||
// } else {
|
||||
// // Handle case where no selection is made
|
||||
// utils.showToast('Please select an gender type');
|
||||
// }
|
||||
}),
|
||||
sizedBoxHeight(30.h),
|
||||
// const Spacer(
|
||||
// flex: 3,
|
||||
// )
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
])),
|
||||
],
|
||||
)),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
print("File path is $result");
|
||||
editProfileImage.profilePicPath.value = result;
|
||||
var filenameresult = extractFileName(result);
|
||||
print("File name is $filenameresult");
|
||||
photographController.text = filenameresult;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
// Outer circle
|
||||
Container(
|
||||
width: 139.w,
|
||||
height: 139.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: const Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
// Middle circle
|
||||
Container(
|
||||
width: 119.w,
|
||||
height: 119.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: const Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
),
|
||||
// Inner circle
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
border: Border.all(
|
||||
color: const Color(0XFFD90B2E)
|
||||
.withOpacity(0.50),
|
||||
width: 2),
|
||||
),
|
||||
child: Obx(() => editProfileImage
|
||||
.profilePicPath.value !=
|
||||
''
|
||||
? ClipOval(
|
||||
child: SizedBox.fromSize(
|
||||
size: Size.fromRadius(50.r),
|
||||
child: Image(
|
||||
image: FileImage(
|
||||
File(
|
||||
editProfileImage
|
||||
.profilePicPath
|
||||
.value,
|
||||
),
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
width: 200.w,
|
||||
height: 200.h,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Image.asset(
|
||||
"assets/images/png/camera.png")
|
||||
// : Image.asset(
|
||||
// "assets/images/png/camera.png")
|
||||
)),
|
||||
// Main button
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 9),
|
||||
text16400white('Add profile picture')
|
||||
],
|
||||
)),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text16400white('Full name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: fullNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your full name",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/user.png',
|
||||
),
|
||||
// validatorText: "Enter your full name",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your full name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('User name'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: userNameController,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your user name",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/user.png',
|
||||
),
|
||||
// validatorText: "Enter your user name",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your user name ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Date of birth'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: datecontroller,
|
||||
readonly: true,
|
||||
onTap: () {
|
||||
_selectDate(context);
|
||||
},
|
||||
// texttype: TextInputType.text,
|
||||
hintText: "Enter your date of birth",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/dateimage.png',
|
||||
),
|
||||
// validatorText: "Enter date of birth",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your date of birth';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Gender'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomDropDownRadio(
|
||||
header: 'Select gender',
|
||||
title: '',
|
||||
listData: _gender,
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage:
|
||||
Image.asset('assets/images/png/gendericon.png'),
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
Row(
|
||||
children: [
|
||||
text16400white('Location'),
|
||||
sizedBoxWidth(5.w),
|
||||
Image.asset('assets/images/png/informationicon.png')
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: locationcontroller,
|
||||
texttype: TextInputType.text,
|
||||
hintText: "Enter your location",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
Image.asset(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
'assets/images/png/location.png',
|
||||
),
|
||||
// validatorText: "Enter your location",
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your location ';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
// LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter(),
|
||||
FilteringTextInputFormatter.allow(RegExp('[a-zA-Z ]'))
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
text: "Continue",
|
||||
onPressed: () {
|
||||
if (fullNameController.text.isBlank! ||
|
||||
userNameController.text.isBlank! ||
|
||||
datecontroller.text.isBlank! ||
|
||||
_selectedgendertype.isEmpty ||
|
||||
locationcontroller.text.isBlank! ||
|
||||
editProfileImage.profilePicPath.value == '') {
|
||||
utils.showToast('Please fill all fields');
|
||||
} else {
|
||||
TellusUploadData();
|
||||
}
|
||||
// if (_selectedgendertype.isNotEmpty) {
|
||||
// Get.toNamed(RouteName.individualprofilestep1);
|
||||
|
||||
// // Get.to(() => BusinessPage());
|
||||
// } else {
|
||||
// // Handle case where no selection is made
|
||||
// utils.showToast('Please select an gender type');
|
||||
// }
|
||||
}),
|
||||
sizedBoxHeight(30.h),
|
||||
// const Spacer(
|
||||
// flex: 3,
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
])
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,130 +23,95 @@ class _CommunitycommitmentState extends State<Communitycommitment> {
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
children: [
|
||||
// Positioned(top: 220, left: -30, child: CommonBlurLeftSecond()),
|
||||
Positioned(top: 230, right: -30, child: CommonBlurRightSecond()),
|
||||
// Positioned(top: 530, 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),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// SvgPicture.asset('assets/images/svg/redregroupicon.svg'),
|
||||
Image.asset('assets/images/png/redregroup.png'),
|
||||
sizedBoxHeight(30.h),
|
||||
Container(
|
||||
width: 358.w,
|
||||
height: 519.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.05999999865889549),
|
||||
Colors.white.withOpacity(0.07999999821186066)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.80, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16.w, vertical: 0.h),
|
||||
child: Scrollbar(
|
||||
thumbVisibility: true,
|
||||
radius: Radius.circular(20.r),
|
||||
// thickness: 6,
|
||||
controller: _scrollController,
|
||||
child: SingleChildScrollView(
|
||||
controller: _scrollController,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Our community commitment'),
|
||||
sizedBoxHeight(10.h),
|
||||
Container(
|
||||
width: 222.w,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign:
|
||||
BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// SvgPicture.asset('assets/images/svg/redregroupicon.svg'),
|
||||
Image.asset('assets/images/png/redregroup.png'),
|
||||
sizedBoxHeight(30.h),
|
||||
Container(
|
||||
width: 358.w,
|
||||
height: 519.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.05999999865889549),
|
||||
Colors.white.withOpacity(0.07999999821186066)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 0.80, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 0.h),
|
||||
child: Scrollbar(
|
||||
thumbVisibility: true,
|
||||
radius: Radius.circular(20.r),
|
||||
// thickness: 6,
|
||||
controller: _scrollController,
|
||||
child: SingleChildScrollView(
|
||||
controller: _scrollController,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
sizedBoxHeight(10.h),
|
||||
text16400white('Our community commitment'),
|
||||
sizedBoxHeight(10.h),
|
||||
Container(
|
||||
width: 222.w,
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF858585),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text20400white(
|
||||
'Regroup is a community where everyone ca belong'),
|
||||
sizedBoxHeight(15.h),
|
||||
text16400white(
|
||||
'''Lorem ipsum dolor sit amet, consectetur adipis elit. Ut et massa mi. Aliquam in hendrerit urna.\n\nPellentesque sit amet sapien fringilla, mattis ligula consectetur, ultrices mauris. Maecenas vitae mattis tellus. Nullam quis imperdiet augue. Vestibulum auctor ornare leo, non suscipit magna interdum eu. Curabitur pellentesque nibh nibh, at maximus ante fermentum sit amet. Pellentesque commodo lacus at sodales sodales. Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. '''),
|
||||
sizedBoxHeight(10.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
text20400white(
|
||||
'Regroup is a community where everyone ca belong'),
|
||||
sizedBoxHeight(15.h),
|
||||
text16400white(
|
||||
'''Lorem ipsum dolor sit amet, consectetur adipis elit. Ut et massa mi. Aliquam in hendrerit urna.\n\nPellentesque sit amet sapien fringilla, mattis ligula consectetur, ultrices mauris. Maecenas vitae mattis tellus. Nullam quis imperdiet augue. Vestibulum auctor ornare leo, non suscipit magna interdum eu. Curabitur pellentesque nibh nibh, at maximus ante fermentum sit amet. Pellentesque commodo lacus at sodales sodales. Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. In iaculis arcu eros, Quisque sagittis orci ut diam condimentum, vel euismod erat placerat. '''),
|
||||
sizedBoxHeight(10.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(
|
||||
flex: 2,
|
||||
),
|
||||
CustomButton(
|
||||
text: 'Agree & continue',
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.signupendpage);
|
||||
}),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton2(
|
||||
text: 'Decline',
|
||||
onPressed: () {
|
||||
Get.offAllNamed(RouteName.loginScreen);
|
||||
})
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
Spacer(
|
||||
flex: 2,
|
||||
),
|
||||
CustomButton(
|
||||
text: 'Agree & continue',
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.signupendpage);
|
||||
}),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton2(
|
||||
text: 'Decline',
|
||||
onPressed: () {
|
||||
Get.offAllNamed(RouteName.loginScreen);
|
||||
})
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@@ -23,97 +23,62 @@ class _SignupendPageState extends State<SignupendPage> {
|
||||
backgroundColor: Color.fromARGB(255, 18, 32, 47),
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned(top: 100, left: -30, child: CommonBlurLeftSecond()),
|
||||
Positioned(top: 300, right: -30, child: CommonBlurRightSecond()),
|
||||
Positioned(top: 530, left: -30, child: CommonBlurLeftBlue()),
|
||||
Positioned(top: 750, right: 40, child: CommonBlurRightSecond()),
|
||||
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),
|
||||
],
|
||||
),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 358.w,
|
||||
height: 519.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.05999999865889549),
|
||||
Colors.white.withOpacity(0.07999999821186066)
|
||||
],
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Center(
|
||||
child: Container(
|
||||
width: 358.w,
|
||||
height: 519.h,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment(0.98, -0.21),
|
||||
end: Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.05999999865889549),
|
||||
Colors.white.withOpacity(0.07999999821186066)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 0.80, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset('assets/images/png/regroupredtexticon.png'),
|
||||
sizedBoxHeight(30.h),
|
||||
text25700white('Welcome Edward '),
|
||||
sizedBoxHeight(20.h),
|
||||
// text16400white(
|
||||
// '''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.'''),
|
||||
Text(
|
||||
'''Congratulations, your account has been successfully created. Get ready to regroup with your community''',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCFCFCFC),
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side:
|
||||
BorderSide(width: 0.80, color: Color(0xFF434A53)),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.h),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/png/regroupredtexticon.png'),
|
||||
sizedBoxHeight(30.h),
|
||||
text25700white('Welcome Edward '),
|
||||
sizedBoxHeight(20.h),
|
||||
// text16400white(
|
||||
// '''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.'''),
|
||||
Text(
|
||||
'''Congratulations, your account has been successfully created. Get ready to regroup with your community''',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Color(0xCCFCFCFC),
|
||||
fontSize: 16.sp,
|
||||
fontFamily: 'Helvetica',
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
text: "Let's begin",
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
})
|
||||
],
|
||||
),
|
||||
)),
|
||||
)),
|
||||
sizedBoxHeight(20.h),
|
||||
CustomButton(
|
||||
text: "Let's begin",
|
||||
onPressed: () {
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
})
|
||||
],
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.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:get/get.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/CustomTextformfield.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/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
@@ -24,13 +31,10 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
TextEditingController emailidcontroller = TextEditingController();
|
||||
TextEditingController passwordController = TextEditingController();
|
||||
TextEditingController confirmpasscontroller = TextEditingController();
|
||||
AccessToken? _accessToken;
|
||||
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
List<String> _dropdownProductItems = [
|
||||
'Individual',
|
||||
'Business',
|
||||
];
|
||||
GoogleAuthService googleSigninController = Get.put(GoogleAuthService());
|
||||
|
||||
final Map<String, int> _accountTypeMap = {
|
||||
'Individual': 1,
|
||||
@@ -45,35 +49,93 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
// void _Signincheck() async {
|
||||
// if (emailidcontroller.text.isBlank! ||
|
||||
// passwordController.text.isBlank! ||
|
||||
// confirmpasscontroller.text.isBlank!) {
|
||||
// Get.snackbar(
|
||||
// 'Error',
|
||||
// 'Enter your credentials',
|
||||
// snackPosition: SnackPosition.BOTTOM,
|
||||
// backgroundColor: Colors.red,
|
||||
// colorText: Colors.white,
|
||||
// );
|
||||
// } else if (!emailidcontroller.text.isEmail) {
|
||||
// Get.snackbar(
|
||||
// 'Error',
|
||||
// 'Enter a valid e-mail address',
|
||||
// snackPosition: SnackPosition.BOTTOM,
|
||||
// backgroundColor: Colors.red,
|
||||
// colorText: Colors.white,
|
||||
// );
|
||||
// } else if (_selectedAccountType == 'Individual') {
|
||||
// print('individual selected');
|
||||
// Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
|
||||
// } else if (_selectedAccountType == 'Business') {
|
||||
// print('business selected');
|
||||
// Get.toNamed(RouteName.verifyusercreen, arguments: _selectedAccountType);
|
||||
// } else {
|
||||
// utils.showToast('Please select an account type');
|
||||
// }
|
||||
// }
|
||||
_loginWithApple() {
|
||||
AppleOAuthService().logIn();
|
||||
}
|
||||
|
||||
_loginWithGoogle() {
|
||||
googleSigninController.handleGoogleSignIn().then((value) async {
|
||||
final resp = await LoginAPI().storeGoogleSignin(
|
||||
{"google_access_token": value, "one_signal_player_id": "ABCD"});
|
||||
if (value != 'Google Sign-In canceled') {
|
||||
if (resp.message == "go-to-signin-via-oauth") {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage,
|
||||
arguments: {"email": resp.data});
|
||||
} else if (value == null) {
|
||||
Get.snackbar(
|
||||
'Error',
|
||||
resp.data["message"][0],
|
||||
duration: const Duration(seconds: 2),
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
backgroundColor: Colors.red,
|
||||
colorText: Colors.white,
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'Login successful!',
|
||||
duration: const Duration(seconds: 2),
|
||||
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 {
|
||||
utils.loader();
|
||||
@@ -90,42 +152,12 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
|
||||
String selectedCategory = _selectedAccountType;
|
||||
|
||||
Get.toNamed(RouteName.verifyusercreen,
|
||||
arguments:
|
||||
{
|
||||
"emailid" : emailidcontroller.text,
|
||||
"password" : passwordController.text,
|
||||
"accounttype" : selectedCategory,
|
||||
'accountypenumber' : accountTypeValue
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
// 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
|
||||
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
Get.toNamed(RouteName.verifyusercreen, arguments: {
|
||||
"emailid": emailidcontroller.text,
|
||||
"password": passwordController.text,
|
||||
"accounttype": selectedCategory,
|
||||
'accountypenumber': accountTypeValue
|
||||
});
|
||||
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
@@ -282,7 +314,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 320.w,
|
||||
height: 42.h,
|
||||
// height: 42.h,
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
@@ -402,19 +434,84 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
child: SizedBox(
|
||||
width: 220.w,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
if (Platform.isIOS)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithApple();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(
|
||||
0.71, -0.70),
|
||||
end: const Alignment(
|
||||
-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login2.png'))),
|
||||
),
|
||||
),
|
||||
if (Platform.isAndroid)
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
_loginWithGoogle();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(
|
||||
0.71, -0.70),
|
||||
end: const Alignment(
|
||||
-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
||||
onTap: () async {
|
||||
_checkIfisLoggedIn();
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin:
|
||||
const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
begin: const Alignment(
|
||||
0.71, -0.70),
|
||||
end:
|
||||
const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
@@ -429,65 +526,9 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login2.png'))),
|
||||
'assets/images/png/login4.png'))),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
||||
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin:
|
||||
const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin:
|
||||
const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login4.png'))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,27 +1,19 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:glassmorphism/glassmorphism.dart';
|
||||
import 'package:pin_code_fields/pin_code_fields.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/CustomNextButton.dart';
|
||||
import 'package:regroup/Utils/Common/blureffect.dart';
|
||||
import 'package:regroup/Utils/Common/sized_box.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/Utils/texts.dart';
|
||||
|
||||
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
|
||||
import 'package:regroup/resources/routes/route_name.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:timer_button/timer_button.dart';
|
||||
|
||||
|
||||
class VerifyuserScreenState extends StatefulWidget {
|
||||
const VerifyuserScreenState({super.key});
|
||||
|
||||
@@ -47,33 +39,52 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
"account_type": accounttypenumber,
|
||||
"otp": pincode.text
|
||||
};
|
||||
final data = await Onboard().Postverifyregisteration(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
// final data = res
|
||||
final res = await Onboard().Postverifyregisteration(updata);
|
||||
if (res.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("verification done");
|
||||
|
||||
if (accounttype == 'Individual') {
|
||||
print('individual selected');
|
||||
Get.toNamed(RouteName.tellusindividualscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "nextscreen"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusindividualscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "nextscreen"
|
||||
// }
|
||||
);
|
||||
} else if (accounttype == 'Business') {
|
||||
print('business selected');
|
||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "nextscreen"
|
||||
// }
|
||||
Get.toNamed(
|
||||
RouteName.tellusbusinessscreen,
|
||||
// arguments: {
|
||||
// 'pageroute' : "nextscreen"
|
||||
// }
|
||||
);
|
||||
}
|
||||
|
||||
return utils.showToast(data.message);
|
||||
return utils.showToast(res.message);
|
||||
} else {
|
||||
Get.back();
|
||||
print("verification not done");
|
||||
return utils.showToast(data.message);
|
||||
// btnController.error();
|
||||
// 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 {
|
||||
@@ -86,16 +97,46 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
final data = await Onboard().Postregisteration(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
Get.back();
|
||||
print("resend up done");
|
||||
return utils.showToast(data.message);
|
||||
} else {
|
||||
// print("resend up done");
|
||||
// return utils.showToast(data.message);
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'OTP has been sent to your email address!',
|
||||
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();
|
||||
print("resend not done");
|
||||
return utils.showToast(data.message);
|
||||
// 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
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -105,45 +146,13 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
// CommonBlurLeftSecond(),
|
||||
Positioned(top: 150, right: -30, child: CommonBlurRightSecond()),
|
||||
Positioned(top: 350, 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),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/png/Ellipse 1496.png"),
|
||||
fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -153,9 +162,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
text22400white('Check your email'),
|
||||
sizedBoxHeight(10.h),
|
||||
text14400white(
|
||||
|
||||
'Enter the verification code that we sent to $email'),
|
||||
|
||||
sizedBoxHeight(40.h),
|
||||
text16400white('Enter code'),
|
||||
sizedBoxHeight(20.h),
|
||||
@@ -241,7 +248,6 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
CustomButton(
|
||||
text: 'Continue',
|
||||
onPressed: () {
|
||||
|
||||
if (pincode.text.isEmpty) {
|
||||
utils.showToast('Pin field is empty');
|
||||
} else if (pincode.text.length < 4) {
|
||||
@@ -258,16 +264,15 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
// Get.toNamed(RouteName.tellusbusinessscreen);
|
||||
// }
|
||||
}
|
||||
|
||||
}),
|
||||
const Spacer(
|
||||
// flex: 2,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ 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/Global.dart';
|
||||
import 'package:regroup/Utils/dialogs.dart';
|
||||
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/tellusIndividual.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
@@ -16,6 +17,12 @@ class Onboard {
|
||||
.postApi(updata, ApiUrls.registeration, optionalpar: true);
|
||||
print("response is ${response.data}");
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -25,18 +32,34 @@ class Onboard {
|
||||
.postApi(updata, ApiUrls.verifyregisteration, optionalpar: true);
|
||||
print("response is ${response.data}");
|
||||
print("response message is ${response.message}");
|
||||
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
Map<String, dynamic> res = response.data;
|
||||
print("res is $res");
|
||||
await prefs.setString('access-token', res['data']['token']);
|
||||
// final SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
// Map<String, dynamic> res = response.data;
|
||||
// print("res is $res");
|
||||
// await prefs.setString('access-token', res['data']['token']);
|
||||
// await prefs.setInt('isprofileupdate', res['data']['is_profile_updated']);
|
||||
|
||||
token = res['data']['token'];
|
||||
// token = res['data']['token'];
|
||||
|
||||
print("token is $token");
|
||||
print("email is $emailid");
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -50,7 +73,8 @@ class Onboard {
|
||||
|
||||
if (response.status == ResponseStatus.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('username', tellusindiObj.data?.profile?.userName ?? "");
|
||||
// await prefs.setString('email', tellusindiObj.data?.profile?.emailAddress ?? "");
|
||||
@@ -60,7 +84,6 @@ class Onboard {
|
||||
// myusername = tellusindiObj.data?.profile?.userName;
|
||||
// fullname = tellusindiObj.data?.profile?.fullName;
|
||||
// phonenumber = tellusindiObj.data?.profile?.phoneNumber;
|
||||
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
|
||||
@@ -22,167 +22,39 @@ class SplashScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
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
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
initConnectivity();
|
||||
log(_connectionStatus.toString());
|
||||
|
||||
Future.delayed(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();
|
||||
Future.delayed(const Duration(seconds: 2), () async {
|
||||
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');
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
// 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);
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
}
|
||||
});
|
||||
}
|
||||
if (token == null || token!.isEmpty) {
|
||||
Get.toNamed(RouteName.onboarding1);
|
||||
} else {
|
||||
Timer(const Duration(seconds: 2), () async {
|
||||
print('this is second');
|
||||
await Getuserdetails().Getuser().then((value) {
|
||||
if (getuserobj?.data?.userData?.isProfileUpdated == 0) {
|
||||
String? accountype =
|
||||
getuserobj?.data?.userData?.principalTypeXid.toString();
|
||||
|
||||
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);
|
||||
if (accountype == "1") {
|
||||
Get.toNamed(RouteName.tellusindividualscreen,
|
||||
arguments: {'pageroute': "mainscreen"});
|
||||
} else if (accountype == "2") {
|
||||
Get.toNamed(RouteName.tellusbusinessscreen,
|
||||
arguments: {'pageroute': "mainscreen"});
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
});
|
||||
|
||||
// }
|
||||
// );
|
||||
Get.toNamed(RouteName.mainscreen);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Future.delayed(Duration(seconds: 2), () async {
|
||||
// Timer(const Duration(seconds: 1), () async {
|
||||
// Get.toNamed(RouteName.onboarding1);
|
||||
// });
|
||||
// });
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -197,11 +69,11 @@ class _SplashScreenState extends State<SplashScreen> {
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Color(0xff009DAB).withOpacity(0.25),
|
||||
Color(0xff35798C).withOpacity(0.44),
|
||||
Color(0xffD90B2E).withOpacity(0.33),
|
||||
Color(0xffD90B2E).withOpacity(0.52),
|
||||
Color(0xffD90B2E).withOpacity(0.59),
|
||||
const Color(0xff009DAB).withOpacity(0.25),
|
||||
const Color(0xff35798C).withOpacity(0.44),
|
||||
const Color(0xffD90B2E).withOpacity(0.33),
|
||||
const Color(0xffD90B2E).withOpacity(0.52),
|
||||
const Color(0xffD90B2E).withOpacity(0.59),
|
||||
],
|
||||
)),
|
||||
child: Column(
|
||||
|
||||
@@ -52,11 +52,9 @@ class _ForgotPassState extends State<ForgotPass> {
|
||||
snackPosition: SnackPosition.BOTTOM,
|
||||
);
|
||||
prefs.setString('email', emailController.text);
|
||||
prefs.setInt(
|
||||
'principal_xid', resp.data['data']['iam_principal_xid']);
|
||||
prefs.setInt('principal_xid', resp.data['data']['iam_principal_xid']);
|
||||
Future.delayed(Duration(seconds: 1), () {
|
||||
Get.toNamed(RouteName.forgotOtp,
|
||||
arguments: emailController.text);
|
||||
Get.toNamed(RouteName.forgotOtp, arguments: emailController.text);
|
||||
});
|
||||
// print('success');
|
||||
} 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) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your e-mail address';
|
||||
|
||||
@@ -19,7 +19,8 @@ class ForgotPassAPI {
|
||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||
if (response.data['status'] == "success") {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.SUCCESS,data: response.data);
|
||||
response.data['message'], ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
@@ -50,4 +51,3 @@ class ForgotPassAPI {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/ContactUs
|
||||
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/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/ReportABug.dart';
|
||||
import 'package:regroup/Feed%20Module/Main_Screens/ProfileTab/Settings/Settings.dart';
|
||||
@@ -495,7 +495,7 @@ class AppRoutes {
|
||||
),
|
||||
GetPage(
|
||||
name: RouteName.verifygoogleapplepage,
|
||||
page: () => const Verifygoogleandapple(),
|
||||
page: () => Verifygoogleandapple(),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
32
pubspec.lock
32
pubspec.lock
@@ -105,6 +105,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
csslib:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: csslib
|
||||
sha256: "831883fb353c8bdc1d71979e5b342c7d88acfbc643113c14ae51e2442ea0f20f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.17.3"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -310,6 +318,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -528,6 +544,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.4+1"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: html
|
||||
sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.15.4"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -688,6 +712,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
||||
@@ -75,6 +75,7 @@ dependencies:
|
||||
logger: ^2.3.0
|
||||
sign_in_with_apple: any
|
||||
timer_button: ^2.1.1
|
||||
flutter_html: ^3.0.0-beta.2
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user