8 Commits

47 changed files with 2302 additions and 4439 deletions

View File

@@ -35,21 +35,10 @@ PODS:
- DKPhotoGallery/Resource (0.0.19):
- SDWebImage
- SwiftyGif
- FBAEMKit (16.3.1):
- FBSDKCoreKit_Basics (= 16.3.1)
- FBSDKCoreKit (16.3.1):
- FBAEMKit (= 16.3.1)
- FBSDKCoreKit_Basics (= 16.3.1)
- FBSDKCoreKit_Basics (16.3.1)
- FBSDKLoginKit (16.3.1):
- FBSDKCoreKit (= 16.3.1)
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
- Flutter (1.0.0)
- flutter_facebook_auth (6.0.4):
- FBSDKLoginKit (~> 16.3.1)
- Flutter
- fluttertoast (0.0.2):
- Flutter
- Toast
@@ -90,7 +79,6 @@ DEPENDENCIES:
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
- Flutter (from `Flutter`)
- flutter_facebook_auth (from `.symlinks/plugins/flutter_facebook_auth/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
@@ -105,10 +93,6 @@ SPEC REPOS:
trunk:
- DKImagePickerController
- DKPhotoGallery
- FBAEMKit
- FBSDKCoreKit
- FBSDKCoreKit_Basics
- FBSDKLoginKit
- GoogleMaps
- SDWebImage
- SwiftyGif
@@ -124,8 +108,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/file_picker/ios"
Flutter:
:path: Flutter
flutter_facebook_auth:
:path: ".symlinks/plugins/flutter_facebook_auth/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
geolocator_apple:
@@ -150,13 +132,8 @@ SPEC CHECKSUMS:
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c
DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60
FBAEMKit: 6c7b5eb77c96861bb59e040842c6e55bf39512ce
FBSDKCoreKit: 5e4dd478947ab1bcc887e8cfadeae0727af1a942
FBSDKCoreKit_Basics: cd7b5f5d1e8868c26706917919d058999ca672c3
FBSDKLoginKit: 572cca0bc6c90067ef197187697cb3b584310c52
file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_facebook_auth: c8700ab1770f3d8e5e7456220e4f3bbcdb831454
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
geolocator_apple: 6cbaf322953988e009e5ecb481f07efece75c450
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458

View File

@@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1510;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@@ -11,7 +11,7 @@ GlassContainer bottomnavigationbar(MainController _mainController) {
width: double.infinity,
height: 100,
borderRadius: BorderRadius.circular(2),
blur: 2,
blur: 6,
opacity: 0.2,
gradient: LinearGradient(
begin: Alignment.topLeft,
@@ -202,7 +202,7 @@ GlassContainer bottomnavigationbar(MainController _mainController) {
))
],
),
label: 'Calendar',
label: 'Calender',
),
BottomNavigationBarItem(
icon: Image.asset(

View File

@@ -85,7 +85,7 @@ Widget commonGlassUIBlue({
required double height,
required Widget customWidget,
// required double border,
double mainOpacity = 1,
double mainOpacity = 0.05,
Color borderColor = const Color(0xff434A53),
required BorderRadius? borderRadius,
}) {
@@ -127,7 +127,7 @@ Widget commonGlassUI({
width: width,
height: height,
borderRadius: borderRadius,
blur: 2,
blur: 6,
opacity: mainOpacity,
gradient: LinearGradient(
begin: Alignment.topLeft,
@@ -144,38 +144,3 @@ Widget commonGlassUI({
border: Border.all(color: borderColor, width: borderwidth),
child: customWidget);
}
Widget commonContainer({
required double width,
required double height,
// required double border,
// double mainOpacity = 1,
double opacity1 = 0.04,
double opacity2 = 0.05,
Color borderColor = const Color(0xff434A53),
double borderwidth = 1.0,
BorderRadius? borderRadius,
required Widget customWidget,
BoxShape boxShape = BoxShape.rectangle,
}) {
return Container(
width: width,
height: height,
decoration: BoxDecoration(
borderRadius: borderRadius,
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFFFFFFFF).withOpacity(opacity1),
const Color(0xFFFFFFFF).withOpacity(opacity2),
],
stops: const [
0.1,
1,
],
),
shape: boxShape,
border: Border.all(color: borderColor, width: borderwidth)),
child: customWidget);
}

View File

@@ -312,25 +312,15 @@ Widget stackReaction({
return Positioned(
top: 6.h,
left: index * 23.w,
child: Container(
child: commonGlassUI(
width: 30.w,
height: 30.h,
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFFFFFFFF).withOpacity(0.1),
const Color(0xFFFFFFFF).withOpacity(0.06),
],
stops: const [
0.1,
1,
],
),
border: Border.all(color: Color(0xFF1E3A46), width: 1.71)),
child: Center(
mainOpacity: 1,
opacity1: 0.05,
opacity2: 0.06,
borderRadius: BorderRadius.circular(100),
customWidget: Center(
child: Image.asset(
containerImages[index],
height: 18.h,

View File

@@ -1,35 +0,0 @@
class ApiUrls {
static const baseUrl = "https://regroup.betadelivery.com/api/v1/";
static const getlogin = "${baseUrl}login";
static const registeration = "${baseUrl}send_otp";
static const verifyregisteration = "${baseUrl}verify_otp";
static const tellusIndividual = "${baseUrl}add_profile";
static const getIndividualactivity = "${baseUrl}fetch-interests";
static const postindividualactivity = "${baseUrl}select-interests";
static const getgroups = "${baseUrl}fetch-groups";
static const postgroups = "${baseUrl}select-groups";
static const getcommunities = "${baseUrl}fetch-communities";
static const postcommunities = "${baseUrl}select-communities";
}

View File

@@ -1,4 +0,0 @@
abstract class BaseApiServices {
Future<dynamic> getApi(String url);
Future<dynamic> postApi(var data, String url);
}

View File

@@ -5,70 +5,35 @@ import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:get/get.dart' hide Response;
import 'package:regroup/Global.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Utils/base_manager.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:http/http.dart' as http;
import '../../entry_point_controller.dart';
import 'entry_point_controller.dart';
class NetworkApiServices {
class NetworkApi {
Dio dio = Dio();
final controllerEntryPoint = Get.put(EntryPointController());
String basicAuth = 'Basic ' +
base64.encode(
utf8.encode('RegroupUserName:71%@L%es^bUX94`J9XT*@bh,._WWM{\$%^^&&'));
Future<ResponseData> getApi(String url, {bool optionalpar = false}) async {
Future<ResponseData> getApi(String url) async {
if (kDebugMode) {
print("api url is >>> $url");
}
Response response;
SharedPreferences prefs = await SharedPreferences.getInstance();
token = prefs.getString('token');
print("url is $url");
log(token.toString());
try {
response = await dio.get(
url,
options:
// Options(headers: {
// "authorization": "Bearer $token",
// 'content-Type': 'application/json',
// })
optionalpar
? Options(
headers: {
"authorization": basicAuth,
},
)
: Options(
headers: {
'authorization': basicAuth,
'access-token': token
},
),
);
} on Exception catch (e) {
log(e.toString());
response = await dio.get(url,
options: Options(headers: {
"authorization": "Bearer $token",
'content-Type': 'application/json',
}));
} on Exception catch (_) {
return ResponseData<dynamic>(
'Oops something Went Wrong', ResponseStatus.FAILED);
}
// on Exception catch (e) {
// if (e is DioException) {
// if (e.response!.statusCode == 403) {
// return ResponseData<dynamic>(
// e.response!.data['message'][0]!, ResponseStatus.FAILED,
// data: e.response!.data);
// }
// }
// return ResponseData<dynamic>(
// 'Oops something Went Wrong',
// ResponseStatus.FAILED,
// );
// }
if (response.statusCode == 200) {
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
data: response.data);
@@ -86,149 +51,45 @@ class NetworkApiServices {
}
}
// Future<ResponseData> postApi(
// data,
// String url,
// {bool optionalpar = false}
// ) async {
// if (kDebugMode) {
// print("data >>> $data");
// print("api url is >>> $url");
// }
// Response response;
// SharedPreferences prefs = await SharedPreferences.getInstance();
// // ignore: unused_local_variable
// String? token = prefs.getString('token').toString();
// print("token is $token");
// log(token.toString());
// try {
// response = await dio.post(url,
// data: data,
// options: optionalpar
// ?
// Options(
// headers: {
// "authorization": basicAuth,
// },
// )
// :
// Options(
// headers: {'authorization': basicAuth, 'access-token': token},
// ),
// );
// log(response.toString());
// } on Exception catch (e) {
// if (e is DioException) {
// log(e.response.toString());
// }
// return ResponseData<dynamic>(
// 'Opps something went wrong', ResponseStatus.FAILED);
// }
// // if (kDebugMode) {
// // print(response);
// // }
// // print("response in post $response");
// if (response.statusCode == 200) {
// // print(response.data);
// return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
// data: response.data);
// } else {
// try {
// return ResponseData<dynamic>(
// response.data['message'].toString(), ResponseStatus.FAILED);
// } catch (_) {
// return ResponseData<dynamic>(
// response.statusMessage!, ResponseStatus.FAILED);
// }
// }
// }
//New post api
@override
Future<ResponseData> postApi(data, String url,
{bool optionalpar = false}) async {
Future<ResponseData> postApi({data, required String url}) async {
if (kDebugMode) {
print("data >>> $data");
print("api url is >>> $url");
}
Response response;
SharedPreferences prefs = await SharedPreferences.getInstance();
String? token = prefs.getString('token');
log(token.toString());
log(basicAuth);
// ignore: unused_local_variable
String? token = prefs.getString('token').toString();
print("token is $token");
try {
response = await dio.post(
url,
data: data,
options: optionalpar
? Options(
headers: {
"authorization": basicAuth,
},
)
: Options(
headers: {
'authorization': basicAuth,
// 'access-token': token
},
),
);
log(response.toString());
response = await dio.post(url,
data: data,
options: Options(
headers: {
"authorization": "Bearer $token",
'content-Type': 'application/json',
"Accept": 'application/json'
},
));
} on Exception catch (e) {
if (e is DioException) {
log(e.response.toString());
if (e.response == null) {
return ResponseData<dynamic>(
'Oops something Went Wrong, Please try again!',
ResponseStatus.FAILED,
);
}
if (e.response!.statusCode == 401) {
prefs.remove('token');
prefs.remove('refreshToken');
// Get.toNamed(RouteName.login);
return ResponseData<dynamic>(
'Oops something Went Wrong, Please try again!',
ResponseStatus.FAILED,
);
}
if (e.response!.statusCode == 403) {
if (e.response!.data['message'] is List) {
return ResponseData<dynamic>(
e.response!.data['message'][0]!, ResponseStatus.FAILED,
data: e.response!.data);
} else {
return ResponseData<dynamic>(
e.response!.data['message'], ResponseStatus.FAILED,
data: e.response!.data);
}
}
}
return ResponseData<dynamic>(
'Oops something Went Wrong',
ResponseStatus.FAILED,
);
'Opps something went wrong', ResponseStatus.FAILED);
}
if (response.statusCode == 200 || response.statusCode == 201) {
// if (kDebugMode) {
// print(response);
// }
// print("response in post $response");
if (response.statusCode == 200) {
// print(response.data);
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
data: response.data);
} else if (response.statusCode == 203) {
print(response.data);
return ResponseData<dynamic>("success", ResponseStatus.PRIVATE,
data: response.data);
} else {
try {
return ResponseData<dynamic>(
@@ -335,18 +196,17 @@ class NetworkApiServices {
var resp = await response.stream.bytesToString();
var jsonResp = jsonDecode(resp);
print(jsonResp);
var errorMessage = jsonResp["errors"]["email2"].join(", ") +
"\n" +
jsonResp["errors"]["contact_number2"].join(", ");
var errorMessage = jsonResp["errors"]["email2"].join(", ") + "\n" +
jsonResp["errors"]["contact_number2"].join(", ");
// return ResponseData<dynamic>(
// jsonResp["errors"][0]["email2"] +
// jsonResp["errors"][0]["contact_number2"],
// ResponseStatus.PRIVATE,
// );
return ResponseData<String>(
errorMessage,
ResponseStatus.PRIVATE,
);
return ResponseData<String>(
errorMessage,
ResponseStatus.PRIVATE,
);
} else if (response.statusCode == 500) {
var resp = await response.stream.bytesToString();
var jsonResp = jsonDecode(resp);

View File

@@ -1,6 +1,5 @@
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
LatLng? latlong;
@@ -26,16 +25,3 @@ getLocation() async {
print('done');
}
setname() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String? token = prefs.getString('token');
if (token != null) {
// await ProfileAPI().getApi();
// prefs.setString('email', getProfileObj!.data!.email!);
// prefs.setString('profile_img', getProfileObj!.data!.profilePhoto!);
// prefs.setString('firstName', getProfileObj!.data!.firstName!);
// prefs.setString('phoneNo', getProfileObj!.data!.phoneNo ?? "");
// prefs.setInt('complete', getProfileObj!.data!.profileComplete ?? 0);
}
}

View File

@@ -58,9 +58,9 @@ class _CalenderTabState extends State<CalenderTab> {
List<Appointment>? _appointments;
// final List<String> _nameCollection = <String>[];
// final List<String> _userImages = <String>[];
// DateTime? _startDate;
// DateTime? _endDate;
// bool _isRangeSelection = false;
DateTime? _startDate;
DateTime? _endDate;
bool _isRangeSelection = false;
@override
void initState() {
super.initState();
@@ -257,7 +257,7 @@ class _CalenderTabState extends State<CalenderTab> {
appointmentTextStyle: TextStyle(color: Colors.white),
headerStyle: CalendarHeaderStyle(
textStyle: TextStyle(
color: Color(0xFFD90B2E),
color: Colors.blue,
)),
// blackoutDatesTextStyle: TextStyle(color: Colors.white),
@@ -282,6 +282,7 @@ class _CalenderTabState extends State<CalenderTab> {
allowViewNavigation: true,
allowDragAndDrop: true,
showDatePickerButton: true,
monthViewSettings: MonthViewSettings(
navigationDirection: MonthNavigationDirection.horizontal,
),
@@ -359,25 +360,20 @@ class _CalenderTabState extends State<CalenderTab> {
),
Positioned(
top: 6.h,
left: 100.w,
left: 190.w,
child: InkWell(
onTap: () {
Get.toNamed(RouteName.availability);
},
child: Container(
height: 25.h,
width: 50.w,
decoration: BoxDecoration(
border: Border.all(
color: Color(0xFFD90B2E),
color: Colors.blue,
),
borderRadius: BorderRadius.circular(15.r)),
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 10.w,
),
child:
Center(child: text10400white("view availability")),
),
child: Center(child: text10400white("view")),
)
// Image.asset(
@@ -559,7 +555,7 @@ class _CalenderTabState extends State<CalenderTab> {
appointmentTextStyle: TextStyle(color: Colors.white),
headerStyle: CalendarHeaderStyle(
textStyle: TextStyle(
color: Color(0xFFD90B2E),
color: Colors.blue,
)),
// blackoutDatesTextStyle: TextStyle(color: Colors.white),
@@ -583,7 +579,7 @@ class _CalenderTabState extends State<CalenderTab> {
showNavigationArrow: true,
allowViewNavigation: true,
allowDragAndDrop: true,
showDatePickerButton: true,
// showDatePickerButton: true,
monthViewSettings: MonthViewSettings(
navigationDirection: MonthNavigationDirection.horizontal,
),
@@ -650,6 +646,20 @@ class _CalenderTabState extends State<CalenderTab> {
);
}),
),
Positioned(
top: 8.h,
right: 110.w,
child: InkWell(
onTap: () {
Get.toNamed(RouteName.availability);
},
child: Image.asset(
"assets/images/png/calender.png",
color: Colors.blue,
height: 18.h,
width: 18.w,
),
))
]),
// SfCalendar(

File diff suppressed because it is too large Load Diff

View File

@@ -315,35 +315,33 @@ class _GroupDetailState extends State<GroupDetail> {
sizedBoxHeight(16.h),
Row(
children: [
commonContainer(
width: 35.w,
height: 35.h,
boxShape: BoxShape.circle,
opacity1: 0.24,
opacity2: 0.24,
borderwidth: 0.5,
customWidget: Center(
child: Image.asset(
"assets/images/png/community 1 (traced).png",
height: 20.h,
width: 20.w),
),
),
commonGlassContainer(
width: 35.w,
height: 35.h,
borderradius: 100,
opacity1: 0.24,
opacity2: 0.24,
customWidget: Center(
child: Image.asset(
"assets/images/png/community 1 (traced).png",
height: 20.h,
width: 20.w),
),
border: 0.5),
sizedBoxWidth(7.w),
text16w400_FCFCFCblur("The athlectic town"),
sizedBoxWidth(20.w),
commonContainer(
width: 35.w,
height: 35.h,
boxShape: BoxShape.circle,
opacity1: 0.24,
opacity2: 0.24,
borderwidth: 0.5,
customWidget: Center(
child: Image.asset("assets/images/png/img12.png",
height: 20.h, width: 20.w),
),
),
commonGlassContainer(
width: 35.w,
height: 35.h,
opacity1: 0.24,
opacity2: 0.24,
borderradius: 100,
customWidget: Center(
child: Image.asset("assets/images/png/img12.png",
height: 20.h, width: 20.w),
),
border: 0.5),
sizedBoxWidth(7.w),
text16w400_FCFCFCblur("Public"),
],
@@ -351,20 +349,19 @@ class _GroupDetailState extends State<GroupDetail> {
sizedBoxHeight(25.h),
Row(
children: [
commonContainer(
width: 35.w,
height: 35.h,
boxShape: BoxShape.circle,
opacity1: 0.24,
opacity2: 0.24,
borderwidth: 0.5,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector (4).png",
height: 20.h,
width: 20.w),
),
),
commonGlassContainer(
width: 35.w,
height: 35.h,
opacity1: 0.24,
opacity2: 0.24,
borderradius: 100,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector (4).png",
height: 20.h,
width: 20.w),
),
border: 0.5),
sizedBoxWidth(7.w),
text16w400_FCFCFCblur("Rowing, Football, Swimming"),
],
@@ -597,10 +594,11 @@ class _GroupDetailState extends State<GroupDetail> {
}
// MediaQuery.of(context).size.height
return commonGlassUIBlue(
return commonGlassContainerblue(
width: double.infinity,
height: 610.h,
borderRadius: BorderRadius.circular(1),
border: 0,
borderradius: 1,
customWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -792,13 +790,13 @@ class _GroupDetailState extends State<GroupDetail> {
]),
),
Spacer(),
commonContainer(
commonGlassContainer(
border: 0.43,
width: 30.w,
height: 30.h,
opacity1: 0.24,
opacity2: 0.24,
boxShape: BoxShape.circle,
borderwidth: 0.43,
opacity1: 0.05,
opacity2: 0.06,
borderradius: 100,
customWidget: Center(
child: Image.asset(
'assets/images/png/Frame 1000004088.png',
@@ -810,13 +808,13 @@ class _GroupDetailState extends State<GroupDetail> {
sizedBoxWidth(12.w),
text14w400_FCFCFC('20'),
sizedBoxWidth(20.w),
commonContainer(
commonGlassContainer(
border: 0.43,
width: 30.w,
height: 30.h,
opacity1: 0.24,
opacity2: 0.24,
boxShape: BoxShape.circle,
borderwidth: 0.43,
borderradius: 100,
opacity1: 0.05,
opacity2: 0.06,
customWidget: Center(
child: Image.asset(
'assets/images/png/Vector (1).png',
@@ -952,11 +950,11 @@ class _GroupDetailState extends State<GroupDetail> {
}
Widget containertile({required String text}) {
return commonContainer(
return commonGlassContainer(
border: 1,
width: 100.w,
height: 30.h,
borderRadius: BorderRadius.circular(30.r),
borderwidth: 1,
borderradius: 30.r,
borderColor: Color(0xFFD90B2E),
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
@@ -968,16 +966,17 @@ class _GroupDetailState extends State<GroupDetail> {
return Column(
children: [
sizedBoxHeight(40.h),
commonGlassUI(
commonGlassContainer(
width: double.infinity,
height: 500.h,
borderRadius: BorderRadius.circular(1),
borderradius: 1,
border: 0,
customWidget: SfCalendar(
view: CalendarView.day,
appointmentTextStyle: TextStyle(color: Colors.white),
headerStyle: CalendarHeaderStyle(
textStyle: TextStyle(
color: Color(0xFFD90B2E),
color: Colors.blue,
)),
// blackoutDatesTextStyle: TextStyle(color: Colors.white),

View File

@@ -168,11 +168,11 @@ class _GroupTabState extends State<GroupTab> {
padding: EdgeInsets.only(bottom: 25.h),
child: GestureDetector(
onTap: ontap,
child: commonGlassUI(
child: commonGlassContainer(
border: 0.9,
width: double.infinity,
height: 162.h,
borderwidth: 0.9,
borderRadius: BorderRadius.circular(10.r),
borderradius: 10.r,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child: Column(

View File

@@ -152,7 +152,7 @@ class _NewPostState extends State<NewPost> {
sizedBoxHeight(20.h),
text16w400_FCFCFC("Tags"),
sizedBoxHeight(18.h),
CustomDropDownTag1(
CustomDropDownTag(
header: "Enter tags",
title: "Enter tags",
listData: [

View File

@@ -46,28 +46,23 @@ class _RequestedGroupsState extends State<RequestedGroups> {
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
image: AssetImage("assets/images/png/Ellipse 1496.png"), fit: BoxFit.fill)),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
sizedBoxHeight(20.h),
ListView.builder(
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemCount: groupData.length,
itemBuilder: (context, index) {
return groupCard(
ontap: () {},
imagepath: groupData[index]['imagePath'],
title: groupData[index]['text'],
members: groupData[index]['members']);
},
)
]),
)
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
sizedBoxHeight(20.h),
ListView.builder(
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemCount: groupData.length,
itemBuilder: (context, index) {
return groupCard(
ontap: () {},
imagepath: groupData[index]['imagePath'],
title: groupData[index]['text'],
members: groupData[index]['members']);
},
)
])
]));
}
@@ -81,11 +76,11 @@ class _RequestedGroupsState extends State<RequestedGroups> {
padding: EdgeInsets.only(bottom: 25.h),
child: GestureDetector(
onTap: ontap,
child: commonGlassUI(
child: commonGlassContainer(
border: 0.9,
width: double.infinity,
height: 162.h,
borderwidth: 0.9,
borderRadius: BorderRadius.circular(10.r),
borderradius: 10.r,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child: Column(

View File

@@ -257,20 +257,20 @@ class _ProfileTabState extends State<ProfileTab> {
sizedBoxHeight(25.h),
Row(
children: [
commonContainer(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/Group 58645.png",
height: 12.h,
width: 12.w,
)),
),
commonGlassUI(
width: 25.w,
height: 25.h,
opacity1: 0.24,
opacity2: 0.24,
mainOpacity: 1,
borderRadius: BorderRadius.circular(100),
customWidget: Center(
child: Image.asset(
"assets/images/png/Group 58645.png",
height: 12.h,
width: 12.w,
)),
borderwidth: 0.5),
sizedBoxWidth(12.w),
text14400whiteblur(
"Elm street london, United Kingdom"),
@@ -279,13 +279,14 @@ class _ProfileTabState extends State<ProfileTab> {
sizedBoxHeight(20.h),
Row(
children: [
commonContainer(
commonGlassUI(
width: 25.w,
height: 25.h,
opacity1: 0.26,
opacity2: 0.26,
opacity1: 0.24,
opacity2: 0.24,
mainOpacity: 1,
borderRadius: BorderRadius.circular(100),
borderwidth: 0.5,
boxShape: BoxShape.circle,
customWidget: Center(
child: Image.asset(
"assets/images/png/Vector (4).png",
@@ -433,19 +434,34 @@ class _ProfileTabState extends State<ProfileTab> {
children: [
sizedBoxHeight(20.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
commonGlassUI(
width: 40.w,
height: 40.h,
opacity1: 0.5,
opacity2: 0.4,
borderwidth: 0.5,
borderRadius: BorderRadius.circular(100.r),
customWidget: Center(
child: Image.asset(
'assets/images/png/ph_arrow-up-thin.png',
height: 25.h,
width: 25.w,
)),
),
Spacer(),
InkWell(
onTap: () {
Get.toNamed(RouteName.settings);
},
child: commonContainer(
child: commonGlassContainer(
border: 0.5,
width: 40.w,
height: 40.h,
borderwidth: 0.5,
boxShape: BoxShape.circle,
borderradius: 100,
opacity1: 0.5,
opacity2: 0.6,
opacity2: 0.4,
customWidget: Center(
child: Image.asset(
'assets/images/png/setting2.png',
@@ -733,13 +749,13 @@ class _ProfileTabState extends State<ProfileTab> {
'assets/images/png/party-popper 2.png'
]),
Spacer(),
commonContainer(
commonGlassUI(
width: 30.w,
height: 30.h,
opacity1: 0.2,
opacity2: 0.2,
opacity1: 0.05,
opacity2: 0.06,
borderwidth: 0.43,
boxShape: BoxShape.circle,
borderRadius: BorderRadius.circular(100),
customWidget: Center(
child: Image.asset(
'assets/images/png/Frame 1000004088.png',
@@ -751,13 +767,13 @@ class _ProfileTabState extends State<ProfileTab> {
sizedBoxWidth(12.w),
text14w400_FCFCFC('20'),
sizedBoxWidth(20.w),
commonContainer(
commonGlassUI(
width: 30.w,
height: 30.h,
opacity1: 0.2,
opacity2: 0.2,
opacity1: 0.05,
opacity2: 0.06,
borderwidth: 0.43,
boxShape: BoxShape.circle,
borderRadius: BorderRadius.circular(100),
customWidget: Center(
child: Image.asset(
'assets/images/png/Vector (1).png',
@@ -888,12 +904,12 @@ class _ProfileTabState extends State<ProfileTab> {
}
Widget containertile({required String text}) {
return commonContainer(
return commonGlassUI(
width: 100.w,
height: 30.h,
borderRadius: BorderRadius.circular(30.r),
borderColor: Color(0xFFD90B2E),
borderwidth: 0.9,
borderRadius: BorderRadius.circular(30.r),
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Center(child: text14w400_FCFCFC(text)),

View File

@@ -102,50 +102,51 @@ class _MyCommunityState extends State<MyCommunity> {
),
),
body: Stack(children: [
Container(
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: [
text18w700_FCFCFC("Joined communities"),
sizedBoxHeight(15.h),
Column(
children:
List.generate(JoinedcommunityData.length, (index) {
return communityCard(
ontap: () {
Get.toNamed(RouteName.communityDetails);
},
imagepath: JoinedcommunityData[index]
['imagePath'],
title: JoinedcommunityData[index]['text'],
members: JoinedcommunityData[index]['members'],
index: JoinedcommunityData[index]['index']);
}),
),
text18w700_FCFCFC("Requested communities"),
sizedBoxHeight(20.h),
Column(
children:
List.generate(RequestcommunityData.length, (index) {
return communityCard(
ontap: () {},
imagepath: RequestcommunityData[index]
['imagePath'],
title: RequestcommunityData[index]['text'],
members: RequestcommunityData[index]['members'],
index: RequestcommunityData[index]['index']);
}),
)
]),
))
), Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text18w700_FCFCFC("Joined communities"),
sizedBoxHeight(15.h),
Column(
children: List.generate(JoinedcommunityData.length,
(index) {
return communityCard(
ontap: () {
Get.toNamed(RouteName.communityDetails);
},
imagepath: JoinedcommunityData[index]
['imagePath'],
title: JoinedcommunityData[index]['text'],
members: JoinedcommunityData[index]
['members'],
index: JoinedcommunityData[index]['index']);
}),
),
text18w700_FCFCFC("Requested communities"),
sizedBoxHeight(20.h),
Column(
children: List.generate(RequestcommunityData.length,
(index) {
return communityCard(
ontap: () {},
imagepath: RequestcommunityData[index]
['imagePath'],
title: RequestcommunityData[index]['text'],
members: RequestcommunityData[index]
['members'],
index: RequestcommunityData[index]['index']);
}),
)
]),
))
]));
}
@@ -160,11 +161,11 @@ class _MyCommunityState extends State<MyCommunity> {
padding: EdgeInsets.only(bottom: 25.h),
child: GestureDetector(
onTap: ontap,
child: commonGlassUI(
child: commonGlassContainer(
border: 0.9,
width: double.infinity,
height: 162.h,
borderwidth: 0.9,
borderRadius: BorderRadius.circular(10.r),
borderradius: 10.r,
customWidget: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
child: Column(

View File

@@ -1,12 +1,13 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
import 'package:regroup/Common/CommonGlassmorphism.dart';
import 'package:regroup/Common/CommonWidget.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 SideMenu extends StatefulWidget {
const SideMenu({super.key});
@@ -77,75 +78,75 @@ class _SideMenuState extends State<SideMenu> {
child: ListView(children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: commonGlassUI(
width: double.infinity,
height: 330.h,
borderRadius: BorderRadius.circular(10.r),
customWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 12.h),
child: Row(
children: [
text16w400_FCFCFC("Pinned"),
Spacer(),
Icon(
Icons.arrow_drop_up,
color: Colors.white,
size: 25,
)
],
child: commonGlassContainer(
width: double.infinity,
height: 330.h,
borderradius: 10,
customWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 12.h),
child: Row(
children: [
text16w400_FCFCFC("Pinned"),
Spacer(),
Icon(
Icons.arrow_drop_up,
color: Colors.white,
size: 25,
)
],
),
),
),
commonDivider(),
sizedBoxHeight(10.h),
firstRowTile(
text: "Row bridge",
leadingimage:
"assets/images/png/sidemenu/rowing 1 (traced).png",
index: 1),
firstRowTile(
text: "Advice",
leadingimage:
"assets/images/png/sidemenu/solar_cloud-outline.png",
index: 2),
firstRowTile(
text: "Crush",
leadingimage:
"assets/images/png/sidemenu/Vector (4).png",
index: 3),
ListTile(
leading: CircleAvatar(
radius: 15.r,
foregroundImage: AssetImage(
"assets/images/png/sidemenu/Ellipse 52.png"),
commonDivider(),
sizedBoxHeight(10.h),
firstRowTile(
text: "Row bridge",
leadingimage:
"assets/images/png/sidemenu/rowing 1 (traced).png",
index: 1),
firstRowTile(
text: "Advice",
leadingimage:
"assets/images/png/sidemenu/solar_cloud-outline.png",
index: 2),
firstRowTile(
text: "Crush",
leadingimage:
"assets/images/png/sidemenu/Vector (4).png",
index: 3),
ListTile(
leading: CircleAvatar(
radius: 15.r,
foregroundImage: AssetImage(
"assets/images/png/sidemenu/Ellipse 52.png"),
),
title: text14w400_FCFCFC("Ryan Dorwart"),
trailing: Image.asset(
"assets/images/png/sidemenu/f7_pin-fill (1).png",
width: 19.w,
height: 19.h,
),
onTap: () {},
),
title: text14w400_FCFCFC("Ryan Dorwart"),
trailing: Image.asset(
"assets/images/png/sidemenu/f7_pin-fill (1).png",
width: 19.w,
height: 19.h,
ListTile(
leading: CircleAvatar(
radius: 15.r,
foregroundImage: AssetImage(
"assets/images/png/sidemenu/Ellipse 53.png"),
),
title: text14w400_FCFCFC("Ahmad Rhiel Madsen"),
trailing: Image.asset(
"assets/images/png/sidemenu/f7_pin-fill (1).png",
width: 19.w,
height: 19.h,
),
onTap: () {},
),
onTap: () {},
),
ListTile(
leading: CircleAvatar(
radius: 15.r,
foregroundImage: AssetImage(
"assets/images/png/sidemenu/Ellipse 53.png"),
),
title: text14w400_FCFCFC("Ahmad Rhiel Madsen"),
trailing: Image.asset(
"assets/images/png/sidemenu/f7_pin-fill (1).png",
width: 19.w,
height: 19.h,
),
onTap: () {},
),
]),
),
]),
border: 1),
),
sizedBoxHeight(18.h),
Padding(
@@ -365,11 +366,11 @@ class _SideMenuState extends State<SideMenu> {
required int index,
}) {
return ListTile(
leading: commonContainer(
leading: commonGlassContainer(
border: 0.9,
width: 29.w,
height: 29.h,
borderwidth: 0.9,
boxShape: BoxShape.circle,
borderradius: 100,
customWidget: Center(
child: Image.asset(
leadingimage,

View File

@@ -4,8 +4,6 @@ import 'package:get/get.dart';
String? myusername;
String? token;
String? emailid;
int? isprofileupdated;
String? phonenumber;
bool pindialog = false;
bool storagedialog = false;

View File

@@ -1,45 +0,0 @@
class LoginModel {
String? status;
int? statusCode;
String? message;
Data? data;
LoginModel({this.status, this.statusCode, this.message, this.data});
LoginModel.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 {
String? accessToken;
int? id;
Data({this.accessToken, this.id});
Data.fromJson(Map<String, dynamic> json) {
accessToken = json['access-token'];
id = json['id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['access-token'] = this.accessToken;
data['id'] = this.id;
return data;
}
}

View File

@@ -1,19 +1,19 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Login/ViewModel/LoginApi.dart';
import 'package:glassmorphism/glassmorphism.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/texts.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
import 'package:show_fps/show_fps.dart';
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
import 'package:regroup/Common/global.dart' as global;
// import 'package:regroup/Common/global.dart' as global;
class LoginScreen extends StatefulWidget {
const LoginScreen({super.key});
@@ -26,13 +26,11 @@ class _LoginScreenState extends State<LoginScreen> {
Map<String, dynamic>? _userData;
AccessToken? _accessToken;
bool _checking = true;
final TextEditingController _emailController = TextEditingController();
final TextEditingController _email = TextEditingController();
RxBool isObscured = true.obs;
final TextEditingController _passwordController = TextEditingController();
final TextEditingController _password = TextEditingController();
// final GlobalKey<FormState> _form = GlobalKey<FormState>();
// RxString errormsg = ''.obs;
// RxString errormsgpass = ''.obs;
@override
void initState() {
// TODO: implement initState
@@ -40,8 +38,8 @@ class _LoginScreenState extends State<LoginScreen> {
super.initState();
}
_checkIfisLoggedIn() async {
//user token
_checkIfisLoggedIn() async {
//user token
final accessToken = await FacebookAuth.instance.accessToken;
setState(() {
@@ -58,14 +56,13 @@ class _LoginScreenState extends State<LoginScreen> {
_userData = userData;
});
} else {
print("/////////////////////////////////////////check");
print("/////////////////////////////////////////check");
print("not worked");
_login();
}
}
_login() async {
_login() async {
final LoginResult result = await FacebookAuth.instance.login();
if (result.status == LoginStatus.success) {
@@ -89,75 +86,6 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() {});
}
_logincheck() async {
if (_emailController.text.isBlank! || _passwordController.text.isBlank!) {
Get.snackbar(
'Error',
'Enter your credentials',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else if (!_emailController.text.isEmail) {
Get.snackbar(
'Error',
'Enter a valid e-mail address',
snackPosition: SnackPosition.BOTTOM,
backgroundColor: Colors.red,
colorText: Colors.white,
);
} else {
Map<String, String> updata = {
"email_address": _emailController.text,
"password": _passwordController.text,
// "access-token" : ""
//
// "player_id": global.player_id!,
};
final data = await LoginAPI().loginApi(updata);
if (data.status == ResponseStatus.SUCCESS) {
// await global.setname();
Get.snackbar(
"Success!",
'Login successful!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
Get.toNamed(RouteName.mainscreen);
} else if (data.status == ResponseStatus.FAILED) {
Get.snackbar(
"Error!",
data.message,
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// _controller.isTextFieldEnabled.value = true;
} else {
// btnController.reset();
Get.snackbar(
"Error!",
data.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
// _controller.isTextFieldEnabled.value = true;
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -173,300 +101,253 @@ class _LoginScreenState extends State<LoginScreen> {
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,
),
),
Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 150.h,
),
),
sizedBoxHeight(20.h),
Align(
alignment: Alignment.center,
child: text22400FCFCFC("Find your community")),
sizedBoxHeight(40.h),
Expanded(
child: Padding(
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(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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),
text16400white('Email address'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: _email,
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,
child: Image.asset(
'assets/images/png/mail.png',
width: 22.w,
height: 17.h,
),
),
// validatorText: "Email Id",
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(30),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(10.h),
text16400white('Password'),
sizedBoxHeight(10.h),
CustomTextFormField(
isInputPassword: true,
textEditingController: _password,
hintText: 'Enter your password',
leadingIcon: Image.asset(
'assets/images/png/lock.png',
width: 22.w,
height: 17.h,
),
validator: (val) {
if (val == null || val.isEmpty) {
return '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: text14400white('Forgot password ?'),
)),
sizedBoxHeight(40.h),
CustomButton(
text: "Login",
onPressed: () {
Get.toNamed(RouteName.mainscreen);
}),
sizedBoxHeight(20.h),
GestureDetector(
onTap: () {
Get.toNamed(RouteName.signupscreen);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14400white('Dont have account ? '),
sizedBoxWidth(5.w),
text14700white('Sign up')
],
),
),
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),
),
),
),
),
// 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,
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),
),
),
),
),
// 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);
},
],
),
sizedBoxHeight(20.h),
Center(
child: SizedBox(
width: 220.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text14400white('Dont have account ? '),
sizedBoxWidth(5.w),
text14700white('Sign up')
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(),
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();
/* 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'))),
),
),
],
),
),
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(
children: [
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/login2.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(),
GestureDetector(
onTap: () async {
_checkIfisLoggedIn();
/* 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'))),
),
),
],
),
),
),
sizedBoxHeight(100)
],
),
)
],
),
),
),
],
)
],
),
),
],
),

View File

@@ -1,192 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:regroup/Common/controller/CommonTextFormField.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/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 Verifygoogleandapple extends StatefulWidget {
const Verifygoogleandapple({super.key});
@override
State<Verifygoogleandapple> createState() => _VerifygoogleandappleState();
}
class _VerifygoogleandappleState extends State<Verifygoogleandapple> {
TextEditingController emailidcontroller = TextEditingController();
final Map<String, int> _accountTypeMap = {
'Individual': 1,
'Business': 2,
};
String _selectedAccountType = '';
void _onItemSelected(String value) {
setState(() {
_selectedAccountType = value;
});
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
appBar: CommonAppbar(
titleTxt: '',
),
backgroundColor: Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
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: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(20.h),
text22400white('One more step to verify'),
sizedBoxHeight(10.h),
Container(
width: 154,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
)),
sizedBoxHeight(20.h),
text14400white(
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.'),
sizedBoxHeight(30.h),
text16400white('Full name'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: emailidcontroller,
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,
),
),
// validatorText: "Email Id",
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()
],
),
sizedBoxHeight(10.h),
Row(
children: [
text16400white('Account type'),
sizedBoxWidth(5.w),
Image.asset('assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomDropDownRadio(
header: '',
title: '',
listData: [
'Individual',
'Business',
],
onItemSelected: _onItemSelected,
leadingImage: Image.asset(
'assets/images/png/user.png',
),
),
Spacer(
flex: 3,
),
CustomButton(
text: "Continue",
onPressed: () {
if (
// isValid!
emailidcontroller.text.isEmpty &&
_selectedAccountType.isEmpty) {
utils.showToast('Please fill all fields');
} else {
// Uploadata();
}
}),
Spacer(
)
],
),
),
)
],
),
),
);
}
}

View File

@@ -1,33 +0,0 @@
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/data/network/network_api.dart';
import 'package:regroup/Login/Model/LoginModel.dart';
import 'package:shared_preferences/shared_preferences.dart';
class LoginAPI {
LoginAPI();
Future<ResponseData> loginApi(var data) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
final response = await NetworkApiServices().postApi(
data, 'https://regroup.betadelivery.com/api/v1/login',
optionalpar: true
// "auth/login/",
);
if (response.status == ResponseStatus.SUCCESS) {
//Map<String, dynamic> responseData = jsonDecode(response.data);
if (response.data['status'] == 'success') {
LoginModel loginObj = LoginModel.fromJson(response.data);
await prefs.setString('access-token', loginObj.data!.accessToken!);
// await prefs.setString('refreshToken', loginObj.data!.refresh!);
print("token is ${loginObj.data!.accessToken!}");
// print("refresh-token is ${loginObj.data!.refresh!}");
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -33,7 +33,7 @@ class CustomTextFormField extends StatefulWidget {
this.opacity2 = 0.05,
}) : super(key: key);
dynamic validator;
final String? Function(String?)? validator;
final TextEditingController? textEditingController;
final String? hintText;
final Widget? leadingIcon;
@@ -46,7 +46,7 @@ class CustomTextFormField extends StatefulWidget {
final TextInputType? texttype;
final List<TextInputFormatter>? inputFormatters;
final Color outlineColor;
final String? Function(String?)? onInput;
final Function(String)? onInput;
final VoidCallback? onTap;
final Widget? suffixIcon;
final double opacity1;
@@ -159,7 +159,6 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
],
),
)
: widget.suffixIcon == null
? null
: widget.suffixIcon!,
@@ -169,7 +168,6 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
),
keyboardType: widget.texttype,
inputFormatters: widget.inputFormatters,
// validator: widget.validator,
onChanged: (value) {
widget.onInput?.call(value);
validateField(value);

View File

@@ -0,0 +1,6 @@
class ApiUrls {
static const baseUrl = "";
static const getfaq = "${baseUrl}faq-tags";
}

View File

@@ -530,16 +530,6 @@ Widget text12w400_FCFCFC(String text) {
fontWeight: FontWeight.w400),
);
}
Widget text12w400_8E8E8E(String text) {
return Text(
text,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF8E8E8E),
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400),
);
}
Widget text12w700_FCFCFC(String text) {
return Text(

View File

@@ -16,20 +16,20 @@ import 'package:statsfl/statsfl.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setPreferredOrientations([
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]).then((value) =>
// runApp(MyApp())
runApp(const MyApp())
// StatsFl(
// align: Alignment.center,
// width: 200,
// height: 100,
// child: const MyApp())),
);
]).then(
(value) =>
// runApp(MyApp())
runApp(StatsFl(
align: Alignment.center,
width: 200,
height: 100,
child: const MyApp())),
);
}
class MyApp extends StatefulWidget {
const MyApp({super.key});

View File

@@ -1,61 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:regroup/Common/CommonButton.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/texts.dart';
class NewPassword extends StatefulWidget {
const NewPassword({super.key});
@override
State<NewPassword> createState() => _NewPasswordState();
}
class _NewPasswordState extends State<NewPassword> {
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "",
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(30.h),
text22400white("Create password"),
sizedBoxHeight(15.h),
Container(
height: 1.h,
width: 250.w,
color: Color(0xFF858585),
),
sizedBoxHeight(35.h),
text16w400_FCFCFC("Create new password"),
sizedBoxHeight(15.h),
CustomTextFormField(),
sizedBoxHeight(20.h),
text16w400_FCFCFC("Confirm password"),
sizedBoxHeight(15.h),
CustomTextFormField(),
sizedBoxHeight(90.h),
CommonBtn(text: 'Continue'),
])))
]));
}
}

View File

@@ -1,76 +0,0 @@
class GetcommunitiesModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
GetcommunitiesModel({this.status, this.statusCode, this.message, this.data});
GetcommunitiesModel.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? communityProfilePhoto;
String? communityBannerImage;
String? communityName;
String? communityLocation;
String? communityDescription;
int? communityTypeXid;
int? activityXid;
Data(
{this.id,
this.communityProfilePhoto,
this.communityBannerImage,
this.communityName,
this.communityLocation,
this.communityDescription,
this.communityTypeXid,
this.activityXid});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
communityProfilePhoto = json['community_profile_photo'];
communityBannerImage = json['community_banner_image'];
communityName = json['community_name'];
communityLocation = json['community_location'];
communityDescription = json['community_description'];
communityTypeXid = json['community_type_xid'];
activityXid = json['activity_xid'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['community_profile_photo'] = this.communityProfilePhoto;
data['community_banner_image'] = this.communityBannerImage;
data['community_name'] = this.communityName;
data['community_location'] = this.communityLocation;
data['community_description'] = this.communityDescription;
data['community_type_xid'] = this.communityTypeXid;
data['activity_xid'] = this.activityXid;
return data;
}
}

View File

@@ -1,72 +0,0 @@
class GrouplistModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
GrouplistModel({this.status, this.statusCode, this.message, this.data});
GrouplistModel.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? title;
String? backgroundImage;
String? groupImage;
String? location;
String? link;
String? description;
Data(
{this.id,
this.title,
this.backgroundImage,
this.groupImage,
this.location,
this.link,
this.description});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
backgroundImage = json['background_image'];
groupImage = json['group_image'];
location = json['location'];
link = json['link'];
description = json['description'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['background_image'] = this.backgroundImage;
data['group_image'] = this.groupImage;
data['location'] = this.location;
data['link'] = this.link;
data['description'] = this.description;
return data;
}
}

View File

@@ -1,54 +0,0 @@
class GetIndividualactivityModel {
String? status;
int? statusCode;
String? message;
List<Data>? data;
GetIndividualactivityModel(
{this.status, this.statusCode, this.message, this.data});
GetIndividualactivityModel.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? name;
String? image;
Data({this.id, this.name, this.image});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
image = json['image'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['image'] = this.image;
return data;
}
}

View File

@@ -1,22 +1,15 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:regroup/Common/CommonDropDown.dart';
import 'package:regroup/Common/base_manager.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:regroup/onboarding/Signup/view_model/getmethod.dart';
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
class SelectIndividualActivity extends StatefulWidget {
const SelectIndividualActivity({super.key});
@@ -28,431 +21,351 @@ class SelectIndividualActivity extends StatefulWidget {
class _SelectIndividualActivityState extends State<SelectIndividualActivity> {
final List<int> _selectedIndices = [];
TextEditingController otheractivitycontroller = TextEditingController();
// to select only two containers
// void _onContainerTap(int index) {
// setState(() {
// if (_selectedIndices.contains(index)) {
// _selectedIndices.remove(index);
// } else {
// if (_selectedIndices.length < 2) {
// _selectedIndices.add(index);
// } else {
// _selectedIndices[1] = index;
// }
// }
// });
// }
void _onContainerTap(int id) {
void _onContainerTap(int index) {
setState(() {
if (_selectedIndices.contains(id)) {
_selectedIndices.remove(id);
if (_selectedIndices.contains(index)) {
_selectedIndices.remove(index);
} else {
_selectedIndices.add(id);
if (_selectedIndices.length < 2) {
_selectedIndices.add(index);
} else {
_selectedIndices[1] = index;
}
}
});
}
// to give two different colors for selectedd two containers
// Color _getGradientColor(int index) {
// if (_selectedIndices.isEmpty) {
// return Colors.transparent;
// } else if (_selectedIndices.length == 1 &&
// _selectedIndices.contains(index)) {
// return Color(0XFFD90B2E);
// } else if (_selectedIndices.length == 2) {
// if (_selectedIndices[0] == index) {
// return Color(0XFFD90B2E);
// } else if (_selectedIndices[1] == index) {
// return Color(0xFF009DAB);
// }
// }
// return Colors.transparent;
// }
Color _getGradientColor(int id) {
if (_selectedIndices.contains(id)) {
return Color(0XFFD90B2E); // Selected color
}
return Colors.transparent; // Default color
}
Uploadata() async {
utils.loader();
String selectedIndicesString = '[${_selectedIndices.join(',')}]';
print('Selected Indices: $selectedIndicesString');
Map<String, dynamic> updata = {
"manage_interest_xid": selectedIndicesString,
"other_interest": otheractivitycontroller.text,
};
print('Payload: $updata');
final data = await Onboard().PostIndividualActivity(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("Activities selected");
Get.toNamed(RouteName.individualgroupstep3);
return utils.showToast(data.message);
} else {
Get.back();
print("Not done");
return utils.showToast(data.message);
Color _getGradientColor(int index) {
if (_selectedIndices.isEmpty) {
return Colors.transparent;
} else if (_selectedIndices.length == 1 &&
_selectedIndices.contains(index)) {
return Color(0XFFD90B2E);
} else if (_selectedIndices.length == 2) {
if (_selectedIndices[0] == index) {
return Color(0XFFD90B2E);
} else if (_selectedIndices[1] == index) {
return Color(0xFF009DAB);
}
}
return Colors.transparent;
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
return 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: () {
if (_selectedIndices.isEmpty &&
otheractivitycontroller.text.isEmpty) {
utils.showToast('Please select activity');
} else {
print(_selectedIndices.toString());
// String selectedIndicesString =
// _selectedIndices.join(',');
// print(
// 'Selected Indices: [$selectedIndicesString]');
Uploadata();
}
// Get.toNamed(
// 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: 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),
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),
],
),
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.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: 0.h),
child: SingleChildScrollView(
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),
),
Color(0XFF222935).withOpacity(0.60),
],
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
child: Expanded(
child: SingleChildScrollView(
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 1 of 3')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
height: 25.h,
),
sizedBoxHeight(30.h),
Align(
alignment: Alignment.center,
child: text16400white('Step 2 of 4')),
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: 120.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(0xFFD90B2E),
Color(0x60D90B2E)
],
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(30),
),
),
)
],
))
],
),
),
),
sizedBoxHeight(40.h),
Center(
child: _selectedIndices.isEmpty
? text20400white('What is your main activity ?')
: text20400white('What else do you do?')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154.w,
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: 120.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(0xFFD90B2E),
Color(0x60D90B2E)
],
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(30),
),
),
)
],
))
],
width: 1,
strokeAlign: BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
sizedBoxHeight(40.h),
indiactivityobj!.data == null ||
indiactivityobj!.data!.isEmpty
? _buildNoDataBody(context)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Center(
child: _selectedIndices.isEmpty
? text20400white(
'What is your main activity ?')
: text20400white(
'What else do you do?')),
sizedBoxHeight(10.w),
Center(
child: Container(
width: 154.w,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
width: 1,
strokeAlign:
BorderSide.strokeAlignCenter,
color: Color(0xFF858585),
),
),
),
),
),
sizedBoxHeight(30.h),
GridView.builder(
physics: ScrollPhysics(),
shrinkWrap: true,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount:
3, // Number of items in each row
crossAxisSpacing: 12
.w, // Horizontal spacing between items
mainAxisSpacing: 12
.h, // Vertical spacing between items
),
itemCount: indiactivityobj!.data!.length,
itemBuilder: (context, index) {
return ActivityContainer(
index:
indiactivityobj!.data![index].id!,
titleString: indiactivityobj!
.data![index].name!,
image: indiactivityobj!
.data![index].image,
// 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices.contains(
indiactivityobj!
.data![index].id!),
gradientColor: _getGradientColor(
indiactivityobj!
.data![index].id!),
onTap: _onContainerTap,
);
},
),
sizedBoxHeight(30.h),
text20400FCFCFC("Add other activity"),
sizedBoxHeight(25.h),
CustomTextFormField(
textEditingController:
otheractivitycontroller,
texttype: TextInputType.text,
hintText: "Enter other activity",
// 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 ]'))
],
),
// CustomDropDownRadio(
// header: "",
// title: "",
// listData: [
// "American football",
// "Archery",
// "Athletics",
// "Baseball",
// "Basketball",
// "Boxing",
// "Canoeing",
// "Clay pigeon shooting",
// "Climbing",
// "Combat sports",
// "Cricket",
// "Dodgeball",
// "Equestrian",
// "Fencing",
// "Gaelic football",
// "Golf",
// "Gymnastics",
// "Handball",
// "Hockey",
// "Lacrosse",
// "Modern biathlon and pentathlon",
// "Netball",
// "Orienteering",
// "Pool and snooker",
// "Powerlifting",
// "Rifle",
// "Rugby league",
// "Rugby union",
// "Sailing",
// "Snowsports",
// "Squash",
// "Surfing",
// "Swimming",
// "Softball",
// "Table tennis",
// "Tennis",
// "Touch rugby",
// "Trampoline",
// "Triathlon",
// "Ultimate frisbee",
// "Volleyball",
// "Water polo",
// "Windsurfing"
// ],
// onItemSelected: (p0) {},
// leadingImage: SizedBox()),
// // Spacer(flex: 1),
sizedBoxHeight(35.h),
],
)
],
),
),
sizedBoxHeight(30.h),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ActivityContainer(
index: 0,
titleString: 'Rowing',
image: 'assets/images/svg/individualact1.svg',
isSelected: _selectedIndices.contains(0),
gradientColor: _getGradientColor(0),
onTap: _onContainerTap,
),
ActivityContainer(
index: 1,
titleString: 'Badminton',
image: 'assets/images/svg/badminton.svg',
isSelected: _selectedIndices.contains(1),
gradientColor: _getGradientColor(1),
onTap: _onContainerTap,
),
ActivityContainer(
index: 2,
titleString: 'Cycling',
image: 'assets/images/svg/individualact2.svg',
isSelected: _selectedIndices.contains(2),
gradientColor: _getGradientColor(2),
onTap: _onContainerTap,
),
],
),
SizedBox(height: 20.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ActivityContainer(
index: 3,
titleString: 'Football',
image: 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices.contains(3),
gradientColor: _getGradientColor(3),
onTap: _onContainerTap,
),
ActivityContainer(
index: 4,
titleString: 'Weightlifting',
image: 'assets/images/svg/weightlifting.svg',
isSelected: _selectedIndices.contains(4),
gradientColor: _getGradientColor(4),
onTap: _onContainerTap,
),
ActivityContainer(
index: 5,
titleString: 'Running',
image: 'assets/images/svg/individualact3.svg',
isSelected: _selectedIndices.contains(5),
gradientColor: _getGradientColor(5),
onTap: _onContainerTap,
),
],
),
SizedBox(height: 20.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ActivityContainer(
index: 6,
titleString: 'Social',
image: 'assets/images/svg/individualact7.svg',
isSelected: _selectedIndices.contains(6),
gradientColor: _getGradientColor(6),
onTap: _onContainerTap,
),
SizedBox(width: 20.w),
ActivityContainer(
index: 7,
titleString: 'Special Interest (Societies)',
image:
'assets/images/svg/special interest.svg',
isSelected: _selectedIndices.contains(7),
gradientColor: _getGradientColor(7),
onTap: _onContainerTap,
),
],
),
],
),
sizedBoxHeight(30.h),
text20400FCFCFC("Select other activity"),
sizedBoxHeight(25.h),
CustomDropDownRadio(
header: "",
title: "",
listData: [
"American football",
"Archery",
"Athletics",
"Baseball",
"Basketball",
"Boxing",
"Canoeing",
"Clay pigeon shooting",
"Climbing",
"Combat sports",
"Cricket",
"Dodgeball",
"Equestrian",
"Fencing",
"Gaelic football",
"Golf",
"Gymnastics",
"Handball",
"Hockey",
"Lacrosse",
"Modern biathlon and pentathlon",
"Netball",
"Orienteering",
"Pool and snooker",
"Powerlifting",
"Rifle",
"Rugby league",
"Rugby union",
"Sailing",
"Snowsports",
"Squash",
"Surfing",
"Swimming",
"Softball",
"Table tennis",
"Tennis",
"Touch rugby",
"Trampoline",
"Triathlon",
"Ultimate frisbee",
"Volleyball",
"Water polo",
"Windsurfing"
],
onItemSelected: (p0) {},
leadingImage: SizedBox()),
// Spacer(flex: 1),
sizedBoxHeight(35.h),
CustomButton(
text: "Continue",
onPressed: () {
Get.toNamed(RouteName.individualgroupstep3);
})
],
),
),
)
],
);
},
),
//
),
);
}
Widget _buildNoDataBody(context) {
return const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [Text("No Data Found")],
);
),
),
)
],
));
}
}
class ActivityContainer extends StatelessWidget {
final int index;
final String titleString;
final String? image;
final String image;
final bool isSelected;
final Color gradientColor;
final Function(int) onTap;
@@ -499,31 +412,12 @@ class ActivityContainer extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// image.isEmpty
// ? SvgPicture.asset(
// "assets/images/svg/individualact7.svg",
// width: 50.w,
// height: 50.h,
// )
// : Image.network(image),
image == null || image!.isEmpty
? Image.asset(
'assets/images/png/redregroup.png',
color: Colors.white,
width: 50.w,
height: 50.h,
)
// SvgPicture.asset(
// "assets/images/svg/individualact7.svg",
// width: 50.w,
// height: 50.h,
// )
: Image.network(
image!,
width: 50.w,
height: 50.h,
),
Spacer(flex: 3),
SvgPicture.asset(
image,
width: 50.w,
height: 50.h,
),
SizedBox(height: 10.h),
SizedBox(
child: Text(
titleString,

View File

@@ -1,20 +1,14 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:regroup/Common/base_manager.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:regroup/onboarding/Signup/Model/Onboarding/Individual/GroupModel.dart';
import 'package:regroup/onboarding/Signup/view_model/getmethod.dart';
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
@@ -26,371 +20,250 @@ class SelectIndividualGroup extends StatefulWidget {
}
class _SelectIndividualGroupState extends State<SelectIndividualGroup> {
StreamController<GrouplistModel> searchcontroller = StreamController();
@override
void initState() {
var updata = "";
Getonboard().getGroupsearch(updata, streamController: searchcontroller);
super.initState();
}
@override
void dispose() {
searchcontroller.close();
super.dispose();
}
final List<int> _selectedIndices = [];
void _onContainerTap(int id) {
setState(() {
if (_selectedIndices.contains(id)) {
_selectedIndices.remove(id);
} else {
_selectedIndices.add(id);
}
});
}
Uploadata() async {
utils.loader();
String selectedIndicesString = '[${_selectedIndices.join(',')}]';
print('Selected Indices: $selectedIndicesString');
Map<String, dynamic> updata = {
"manage_group_xid": selectedIndicesString,
};
print('Payload: $updata');
final data = await Onboard().postGroups(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("groups selected");
Get.toNamed(RouteName.individualcommunitystep4);
return utils.showToast(data.message);
} else {
Get.back();
print("Not done");
return utils.showToast(data.message);
}
}
TextEditingController searchcontroller = TextEditingController();
// StreamController<BlogsModel> blogsController = StreamController();
@override
Widget build(BuildContext context) {
return GestureDetector(
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),
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
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),
],
),
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.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: [
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),
),
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,
),
sizedBoxHeight(30.h),
Align(
alignment: Alignment.center,
child: text16400white('Step 3 of 4')),
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: 240.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(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, 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(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),
),
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,
),
),
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,
),
);
},
),
);
}
},
),
],
),
)),
),
],
)),
);
}
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),
)
],
),
);
// validatorText: "Enter your full name",
inputFormatters: [
// LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter(),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GroupSelect(
titleString: 'Cambridge university Boat ..',
image: 'assets/images/png/groupindividual.png'),
GroupSelect(
titleString: 'Liverpool FC',
image:
'assets/images/png/groupindividual2.png'),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GroupSelect(
titleString: 'Cambridge rugby Club',
image:
'assets/images/png/groupindividual3.png'),
GroupSelect(
titleString: 'Cambridge university Boat ..',
image: 'assets/images/png/groupindividual.png'),
],
),
Spacer(flex: 1),
CustomButton(
text: "Continue",
onPressed: () {
Get.toNamed(RouteName.individualcommunitystep4);
})
],
),
)),
),
],
));
}
}
class GroupSelect extends StatelessWidget {
class GroupSelect extends StatefulWidget {
final String titleString;
final String? image;
final int index;
final Function(int) onTap;
final bool isSelected;
final String image;
GroupSelect({
Key? key,
required this.titleString,
required this.image,
required this.index,
required this.onTap,
required this.isSelected,
}) : super(key: key);
@override
State<GroupSelect> createState() => _GroupSelectState();
}
class _GroupSelectState extends State<GroupSelect> {
bool _text = false;
@override
Widget build(BuildContext context) {
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
@@ -398,29 +271,24 @@ class GroupSelect extends StatelessWidget {
width: 169,
height: 74,
decoration: ShapeDecoration(
image: image == null || image!.isEmpty
? DecorationImage(
image: AssetImage("assets/images/png/groupindividual3.png"),
fit: BoxFit.fill,
)
: DecorationImage(
image: NetworkImage(image!),
fit: BoxFit.fill,
),
image: DecorationImage(
image: AssetImage(
// "https://via.placeholder.com/169x74"
widget.image),
fit: BoxFit.fill,
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
),
),
SizedBox(height: 15.0),
Text(
titleString,
style: TextStyle(
color: Colors.white,
fontSize: 12.0,
overflow: TextOverflow.ellipsis),
),
SizedBox(height: 15.0),
sizedBoxHeight(15.h),
text12400white(widget.titleString),
sizedBoxHeight(15.h),
GestureDetector(
onTap: () => onTap(index),
onTap: () {
setState(() {
_text = !_text;
});
},
child: Container(
width: 169,
height: 23,
@@ -433,11 +301,7 @@ class GroupSelect extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
isSelected
? Text('Regrouping',
style: TextStyle(color: Colors.white, fontSize: 10.0))
: Text('Join',
style: TextStyle(color: Colors.white, fontSize: 10.0))
_text ? text10400white('Regrouping') : text10400white('Join')
],
),
),

View File

@@ -1,20 +1,13 @@
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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/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:regroup/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart';
import 'package:regroup/onboarding/Signup/view_model/getmethod.dart';
import 'package:regroup/onboarding/Signup/view_model/postmethod.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
@@ -27,126 +20,58 @@ class SelectIndividualCommunity extends StatefulWidget {
}
class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
StreamController<GetcommunitiesModel> searchcontroller = StreamController();
@override
void initState() {
var updata = "";
Getonboard().getCommunitysearch(updata, streamController: searchcontroller);
super.initState();
}
@override
void dispose() {
searchcontroller.close();
super.dispose();
}
final List<int> _selectedIndices = [];
void _onContainerTap(int id) {
setState(() {
if (_selectedIndices.contains(id)) {
_selectedIndices.remove(id);
} else {
_selectedIndices.add(id);
}
});
}
Uploadata() async {
utils.loader();
String selectedIndicesString = '[${_selectedIndices.join(',')}]';
print('Selected Indices: $selectedIndicesString');
Map<String, dynamic> updata = {
"manage_community_xid": selectedIndicesString,
};
print('Payload: $updata');
final data = await Onboard().postCommunities(updata);
if (data.status == ResponseStatus.SUCCESS) {
// Get.back();
print("groups selected");
Get.toNamed(RouteName.communitycommitscreen);
return utils.showToast(data.message);
} else {
Get.back();
print("Not done");
return utils.showToast(data.message);
}
}
TextEditingController searchcontroller = TextEditingController();
// StreamController<BlogsModel> blogsController = StreamController();
@override
Widget build(BuildContext context) {
return GestureDetector(
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),
return Scaffold(
backgroundColor: Color.fromARGB(255, 18, 32, 47),
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),
],
),
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.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),
Color(0XFF222935).withOpacity(0.60),
],
),
child: Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 50.h),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -171,7 +96,7 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
sizedBoxHeight(30.h),
Align(
alignment: Alignment.center,
child: text16400white('Step 3 of 3')),
child: text16400white('Step 4 of 4')),
sizedBoxHeight(20.h),
Container(
width: double.infinity,
@@ -189,8 +114,9 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
child: Row(
children: [
Expanded(
child: Container(
width: double.infinity,
child: Container(
// width: 216.w,
height: 15.h,
decoration: ShapeDecoration(
gradient: LinearGradient(
@@ -231,7 +157,9 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
),
)
],
)))
)),
),
)
],
),
),
@@ -265,6 +193,7 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
),
sizedBoxHeight(30.h),
CustomTextFormField(
textEditingController: searchcontroller,
texttype: TextInputType.text,
hintText: "Search community",
leadingIcon:
@@ -287,116 +216,75 @@ class _SelectIndividualCommunityState extends State<SelectIndividualCommunity> {
// 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,
),
);
},
),
);
}
},
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CommunitySelect(
titleString: 'Liverpool FC ',
image:
'assets/images/png/groupindividual2.png'),
CommunitySelect(
titleString: 'Cambridge rugby Club',
image: 'assets/images/png/community2.png'),
CommunitySelect(
titleString: 'Cambridge rugby Club',
image: 'assets/images/png/community2.png'),
],
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CommunitySelect(
titleString: 'The athletic town',
image:
'assets/images/png/groupindividual3.png'),
CommunitySelect(
titleString: 'Football Fever',
image:
'assets/images/png/groupindividual2.png'),
CommunitySelect(
titleString: 'Football Fever',
image:
'assets/images/png/groupindividual2.png'),
],
),
// Spacer(flex: 1),
sizedBoxHeight(40.h),
CustomButton(
text: "Continue",
onPressed: () {
Get.toNamed(RouteName.communitycommitscreen);
})
],
),
)),
),
],
)),
);
}
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),
)
],
),
);
),
)),
),
],
));
}
}
class CommunitySelect extends StatelessWidget {
class CommunitySelect extends StatefulWidget {
final String titleString;
final String? image;
final int index;
final Function(int) onTap;
final bool isSelected;
final String image;
CommunitySelect({
Key? key,
required this.titleString,
required this.image,
required this.index,
required this.onTap,
required this.isSelected,
}) : super(key: key);
@override
State<CommunitySelect> createState() => _CommunitySelectState();
}
class _CommunitySelectState extends State<CommunitySelect> {
bool _text = false;
@override
Widget build(BuildContext context) {
return Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
@@ -404,34 +292,29 @@ class CommunitySelect extends StatelessWidget {
width: 73.w,
height: 73.h,
decoration: ShapeDecoration(
image: image == null || image!.isEmpty
? DecorationImage(
image: AssetImage("assets/images/png/groupindividual2.png"),
fit: BoxFit.fill,
)
: DecorationImage(
image: NetworkImage(image!),
fit: BoxFit.fill,
),
image: DecorationImage(
image: AssetImage(
// "https://via.placeholder.com/169x74"
widget.image),
fit: BoxFit.fill,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100),
),
),
),
sizedBoxHeight(15.h),
Text(
titleString,
style: TextStyle(
color: Colors.white,
fontSize: 12.0,
overflow: TextOverflow.ellipsis),
),
SizedBox(width: 94.w, child: text12400white(widget.titleString)),
sizedBoxHeight(15.h),
GestureDetector(
onTap: () => onTap(index),
onTap: () {
setState(() {
_text = !_text;
});
},
child: Container(
width: 169,
height: 23,
width: 100.w,
height: 23.h,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(width: 1, color: Color(0xFFFF002B)),
@@ -441,11 +324,7 @@ class CommunitySelect extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
isSelected
? Text('Regrouping',
style: TextStyle(color: Colors.white, fontSize: 10.0))
: Text('Join',
style: TextStyle(color: Colors.white, fontSize: 10.0))
_text ? text10400white('Regrouping') : text10400white('Join')
],
),
),

View File

@@ -1,14 +1,11 @@
import 'dart:developer';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart' hide MultipartFile, FormData;
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:regroup/Common/CommonWidget.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/profileimagecontroller.dart';
import 'package:regroup/Utils/Common/CommonDropdown.dart';
import 'package:regroup/Utils/Common/CustomNextButton.dart';
@@ -18,10 +15,8 @@ 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:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
import 'package:path/path.dart' as path;
class TellusaboutIndividual extends StatefulWidget {
const TellusaboutIndividual({super.key});
@@ -34,8 +29,6 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
TextEditingController fullNameController = TextEditingController();
TextEditingController userNameController = TextEditingController();
TextEditingController datecontroller = TextEditingController();
TextEditingController locationcontroller = TextEditingController();
DateTime? _selectedDate;
final photographController = TextEditingController();
@@ -80,35 +73,27 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
);
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')}";
"${_selectedDate!.day.toString().padLeft(2, '0')}-${_selectedDate!.month.toString().padLeft(2, '0')}-${_selectedDate!.year.toString().padLeft(2, '0')}";
});
// // } else {
// }
// 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),
// ),
// title: const Text("Age Restriction"),
// content: const Text("Sorry, you must be above 18 years age"),
// actions: [
// TextButton(
// onPressed: () {
// Navigator.of(context).pop();
// },
// child: const Text(
// "OK",
// style: TextStyle(color: Colors.white),
// ),
// child: const Text("OK"),
// ),
// ],
// );
@@ -128,142 +113,122 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
});
}
void TellusUploadData() async {
utils.loader();
var imageFile;
if (editProfileImage.profilePicPath.value.isNotEmpty) {
imageFile = await MultipartFile.fromFile(
editProfileImage.profilePicPath.value,
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,
'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);
Get.toNamed(RouteName.individualactivitystep2);
} else {
Get.back();
return utils.showToast(data.message);
}
}
@override
Widget build(BuildContext context) {
return 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),
return 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.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),
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),
),
),
)),
),
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,
// 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,
@@ -272,241 +237,194 @@ class _TellusaboutIndividualState extends State<TellusaboutIndividual> {
.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,
),
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,
),
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 ]'))
),
)
: 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(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),
)),
),
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(
'assets/images/png/informationicon.png')
],
width: 22.w,
height: 17.h,
'assets/images/png/user.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 ]'))
],
// 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(0.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',
),
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);
// 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(0.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(0.h),
text16400white('Gender'),
sizedBoxHeight(10.h),
CustomDropDownWidgetSignup(
header: 'Select gender',
title: '',
listData: _gender,
onItemSelected: _onItemSelected,
leadingImage:
Image.asset('assets/images/png/gendericon.png'),
),
sizedBoxHeight(20.h),
Row(
children: [
text16400white('Location'),
sizedBoxWidth(5.w),
Image.asset('assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: userNameController,
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 (_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,
// )
],
),
// 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,
// )
],
),
])),
],
)),
);
),
])),
],
));
}
}

View File

@@ -2,14 +2,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:regroup/Common/base_manager.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/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:remove_emoji_input_formatter/remove_emoji_input_formatter.dart';
@@ -22,21 +20,14 @@ class SignupScreen extends StatefulWidget {
class _SignupScreenState extends State<SignupScreen> {
TextEditingController emailidcontroller = TextEditingController();
TextEditingController passwordController = TextEditingController();
TextEditingController _password = TextEditingController();
TextEditingController confirmpasscontroller = TextEditingController();
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
List<String> _dropdownProductItems = [
'Individual',
'Business',
];
final Map<String, int> _accountTypeMap = {
'Individual': 1,
'Business': 2,
};
String _selectedAccountType = '';
void _onItemSelected(String value) {
@@ -45,464 +36,348 @@ 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');
// }
// }
Uploadata() async {
utils.loader();
int accountTypeValue = _accountTypeMap[_selectedAccountType] ?? 0;
Map<String, dynamic> updata = {
"email_address": emailidcontroller.text,
"password": passwordController.text,
"account_type": accountTypeValue,
};
final data = await Onboard().Postregisteration(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("Sign up done");
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
// }
// );
// }
return utils.showToast(data.message);
} else {
Get.back();
print("registration not done");
return utils.showToast(data.message);
}
}
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image:
AssetImage("assets/images/png/Choice screen.png"),
fit: BoxFit.fill)),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 150.h),
child: Center(child: text22400white('Create account')),
),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 30.h),
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
return Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: const Color.fromARGB(255, 18, 32, 47),
body: Stack(
children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Choice screen.png"),
fit: BoxFit.fill)),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 150.h),
child: Center(child: text22400white('Create account')),
),
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 16.w, vertical: 30.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
text16400white('Email address'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: emailidcontroller,
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,
),
),
// validatorText: "Email Id",
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(20),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(10.h),
text16400white('Password'),
sizedBoxHeight(10.h),
CustomTextFormField(
isInputPassword: true,
textEditingController: _password,
hintText: 'Enter your password',
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(10.h),
text16400white('Confirm password'),
sizedBoxHeight(10.h),
CustomTextFormField(
isInputPassword: true,
textEditingController: confirmpasscontroller,
hintText: "Enter your password",
leadingIcon: Image.asset(
'assets/images/png/lock.png',
width: 22.w,
height: 17.h,
),
// const Icon(Icons.lock_outline),
// validatorText: "Enter your password",
validator: (val) {
if (val == null || val.isEmpty) {
return 'Please enter your password';
}
if (val != _password.text) {
return 'Password does not match';
}
return null;
},
inputFormatters: [
LengthLimitingTextInputFormatter(20),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(10.h),
Row(
children: [
text16400white('Email address'),
sizedBoxHeight(10.h),
CustomTextFormField(
textEditingController: emailidcontroller,
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,
),
),
// validatorText: "Email Id",
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()
],
),
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,
),
// 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(10.h),
text16400white('Confirm password'),
sizedBoxHeight(10.h),
CustomTextFormField(
isInputPassword: true,
textEditingController: confirmpasscontroller,
hintText: "Enter your password",
leadingIcon: Image.asset(
'assets/images/png/lock.png',
width: 22.w,
height: 17.h,
),
// const Icon(Icons.lock_outline),
// validatorText: "Enter your password",
validator: (val) {
if (val == null || val.isEmpty) {
return 'Please enter your password';
}
if (val != passwordController.text) {
return 'Password does not match';
}
return null;
},
inputFormatters: [
LengthLimitingTextInputFormatter(50),
RemoveEmojiInputFormatter()
],
),
sizedBoxHeight(10.h),
Row(
children: [
text16400white('Account type'),
sizedBoxWidth(5.w),
Image.asset(
'assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomDropDownRadio(
header: 'Select account type',
title: '',
listData: [
'Individual',
'Business',
],
onItemSelected: _onItemSelected,
leadingImage: Image.asset(
'assets/images/png/user.png',
),
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 320.w,
height: 42.h,
child: Text.rich(
TextSpan(
children: [
TextSpan(
text:
'By signing up to ReGroup you agree to our ',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
),
),
TextSpan(
text: 'Terms and Conditions',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w700,
decoration:
TextDecoration.underline,
decorationColor:
const Color(0xffFCFCFC)
.withOpacity(0.80),
),
),
TextSpan(
text: ' and ',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
),
),
TextSpan(
text: 'Privacy Policy',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w700,
decoration:
TextDecoration.underline,
decorationColor:
const Color(0xffFCFCFC)
.withOpacity(0.80),
),
),
],
),
textAlign: TextAlign.center,
),
),
],
),
sizedBoxHeight(20.h),
CustomButton(
text: "Continue",
onPressed: () {
// _Signincheck();
final isValid =
_formKey.currentState?.validate();
if (
// isValid!
emailidcontroller.text.isBlank! &&
passwordController.text.isBlank! &&
confirmpasscontroller
.text.isBlank! &&
_selectedAccountType.isEmpty) {
print(emailidcontroller.text);
print(passwordController.text);
print(_selectedAccountType.toString());
utils.showToast('Please fill all fields');
} else {
Uploadata();
}
}),
sizedBoxHeight(20.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(
text16400white('Account type'),
sizedBoxWidth(5.w),
Image.asset(
'assets/images/png/informationicon.png')
],
),
sizedBoxHeight(10.h),
CustomDropDownRadio(
header: 'Select account type',
title: '',
listData: [
'Individual',
'Business',
],
onItemSelected: (p0) {},
leadingImage: Image.asset(
'assets/images/png/user.png',
),
),
sizedBoxHeight(30.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 320.w,
height: 42.h,
child: Text.rich(
TextSpan(
children: [
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/login2.png'))),
TextSpan(
text:
'By signing up to ReGroup you agree to our ',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
),
),
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'))),
TextSpan(
text: 'Terms and Conditions',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w700,
decoration: TextDecoration.underline,
decorationColor:
const Color(0xffFCFCFC)
.withOpacity(0.80),
),
),
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'))),
TextSpan(
text: ' and ',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w400,
),
),
TextSpan(
text: 'Privacy Policy',
style: TextStyle(
color: const Color(0xCCFCFCFC),
fontSize: 14.sp,
fontFamily: 'Helvetica',
fontWeight: FontWeight.w700,
decoration: TextDecoration.underline,
decorationColor:
const Color(0xffFCFCFC)
.withOpacity(0.80),
),
),
],
),
textAlign: TextAlign.center,
),
),
sizedBoxHeight(20.h),
],
),
),
sizedBoxHeight(20.h),
CustomButton(
text: "Continue",
onPressed: () {
if (_selectedAccountType == 'Individual') {
// Get.to(() => IndividualPage());
print('individual selected');
Get.toNamed(RouteName.verifyusercreen,
arguments: _selectedAccountType);
} else if (_selectedAccountType == 'Business') {
print('business selected');
Get.toNamed(RouteName.verifyusercreen,
arguments: _selectedAccountType);
// Get.to(() => BusinessPage());
} else {
// Handle case where no selection is made
utils.showToast(
'Please select an account type');
}
}),
sizedBoxHeight(20.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(
children: [
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(),
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'))),
),
],
),
),
),
sizedBoxHeight(20.h),
],
),
),
)
],
),
],
)),
);
),
)
],
),
],
));
}
}

View File

@@ -4,22 +4,13 @@ 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});
@@ -29,63 +20,8 @@ class VerifyuserScreenState extends StatefulWidget {
}
class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
// String accounttype = Get.arguments;
TextEditingController pincode = TextEditingController();
String email = Get.arguments['emailid'];
String userpassword = Get.arguments['password'];
String accounttype = Get.arguments['accounttype'];
int accounttypenumber = Get.arguments["accountypenumber"];
Uploadata() async {
utils.loader();
Map<String, dynamic> updata = {
"email_address": email,
"password": userpassword,
"account_type": accounttypenumber,
"otp": pincode.text
};
final data = await Onboard().Postverifyregisteration(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("verification done");
if (accounttype == 'Individual') {
print('individual selected');
Get.toNamed(RouteName.tellusindividualscreen);
} else if (accounttype == 'Business') {
print('business selected');
Get.toNamed(RouteName.tellusbusinessscreen);
}
return utils.showToast(data.message);
} else {
Get.back();
print("verification not done");
return utils.showToast(data.message);
}
}
Uploadataresendotp() async {
utils.loader();
Map<String, dynamic> updata = {
"email_address": email,
"password": userpassword,
"account_type": accounttypenumber,
};
final data = await Onboard().Postregisteration(updata);
if (data.status == ResponseStatus.SUCCESS) {
Get.back();
print("resend up done");
return utils.showToast(data.message);
} else {
Get.back();
print("resend not done");
return utils.showToast(data.message);
}
}
String accounttype = Get.arguments;
TextEditingController? pincode = TextEditingController();
@override
Widget build(BuildContext context) {
@@ -144,9 +80,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
text22400white('Check your email'),
sizedBoxHeight(10.h),
text14400white(
'Enter the verification code that we sent to $email'),
'Enter the verification code that we sent to loremipsum@gmail.com'),
sizedBoxHeight(40.h),
text16400white('Enter code'),
sizedBoxHeight(20.h),
@@ -207,49 +141,23 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
},
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: 120,
//mobile.text.isEmpty ? 1 : 60,
onPressed: () {
setState(() {
Uploadataresendotp();
});
},
// disabledColor: Colors.white,
color: Color(0XFF222935).withOpacity(0.10),
),
),
const Spacer(
flex: 3,
),
CustomButton(
text: 'Continue',
onPressed: () {
if (pincode.text.isEmpty) {
if (pincode!.text.isEmpty) {
utils.showToast('Pin field is empty');
} else if (pincode.text.length < 4) {
utils.showToast(
'Pin field must be at least 4 characters long');
} else {
Uploadata();
// if (accounttype == 'Individual') {
// print('individual selected');
// Get.toNamed(RouteName.tellusindividualscreen);
// } else if (accounttype == 'Business') {
// print('business selected');
// Get.toNamed(RouteName.tellusbusinessscreen);
// }
if (accounttype == 'Individual') {
print('individual selected');
Get.toNamed(RouteName.tellusindividualscreen);
} else if (accounttype == 'Business') {
print('business selected');
Get.toNamed(RouteName.tellusbusinessscreen);
}
}
}),
const Spacer(
// flex: 2,
@@ -261,4 +169,4 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
),
);
}
}
}

View File

@@ -1,65 +0,0 @@
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/onboarding/Signup/Model/Onboarding/Individual/CommunitiesModel.dart';
import 'package:regroup/onboarding/Signup/Model/Onboarding/Individual/GroupModel.dart';
import 'package:regroup/onboarding/Signup/Model/Onboarding/IndividualModel.dart';
GetIndividualactivityModel? indiactivityobj;
GrouplistModel? grouplistobj;
GetcommunitiesModel? communitylistobj;
class Getonboard {
Future<ResponseData<dynamic>> getIndividualactivity() async {
final response = await NetworkApiServices()
.getApi(
ApiUrls.getIndividualactivity,
// optionalpar: false
);
if (response.status == ResponseStatus.SUCCESS) {
indiactivityobj = GetIndividualactivityModel.fromJson(response.data);
log(indiactivityobj!.data.toString());
}
return response;
}
Future<ResponseData<dynamic>> getGroupsearch(updata,
{required StreamController<GrouplistModel> streamController}) async {
final response =
await NetworkApiServices().getApi(
"${ApiUrls.getgroups}?search_data=$updata",
);
if (response.status == ResponseStatus.SUCCESS) {
grouplistobj = GrouplistModel.fromJson(response.data);
if (!streamController.isClosed) streamController.sink.add(grouplistobj!);
}
return response;
}
Future<ResponseData<dynamic>> getCommunitysearch(updata,
{required StreamController<GetcommunitiesModel> streamController}) async {
final response =
await NetworkApiServices().getApi(
"${ApiUrls.getcommunities}?search_data=$updata",
);
if (response.status == ResponseStatus.SUCCESS) {
communitylistobj = GetcommunitiesModel.fromJson(response.data);
if (!streamController.isClosed) streamController.sink.add(communitylistobj!);
}
return response;
}
}

View File

@@ -1,85 +0,0 @@
import 'dart:async';
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:shared_preferences/shared_preferences.dart';
class Onboard {
Onboard();
Future<ResponseData<dynamic>> Postregisteration(updata) async {
print("updata is $updata");
final response = await NetworkApiServices()
.postApi(updata, ApiUrls.registeration, optionalpar: true);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
Future<ResponseData<dynamic>> Postverifyregisteration(updata) async {
print("updata is $updata");
final response = await NetworkApiServices()
.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('token', res['data']['token']);
await prefs.setString('email', res['data']['email']);
await prefs.setInt('isprofileupdate', res['data']['is_profile_updated']);
token = res['data']['token'];
emailid = res['data']['email'];
isprofileupdated = res['data']['is_profile_updated'];
print("token is $token");
print("email is $emailid");
print("profile update value is $isprofileupdated");
return response;
}
Future<ResponseData> PosttellusIndividual(updata) async {
print("updata is $updata");
final response =
await NetworkApiServices().postApi(updata, ApiUrls.tellusIndividual);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
Future<ResponseData<dynamic>> PostIndividualActivity(updata) async {
print("updata is $updata");
final response = await NetworkApiServices()
.postApi(updata, ApiUrls.postindividualactivity,);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
Future<ResponseData<dynamic>> postGroups(updata) async {
print("updata is $updata");
final response = await NetworkApiServices()
.postApi(updata, ApiUrls.postgroups,);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
Future<ResponseData<dynamic>> postCommunities(updata) async {
print("updata is $updata");
final response = await NetworkApiServices()
.postApi(updata, ApiUrls.postcommunities,);
print("response is ${response.data}");
print("response message is ${response.message}");
return response;
}
}

View File

@@ -1,161 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Utils/Common/CommonAppbar.dart';
import 'package:regroup/Utils/Common/CustomNextButton.dart';
import 'package:regroup/Utils/Common/CustomTextformfield.dart';
import 'package:regroup/Utils/Common/sized_box.dart';
import 'package:regroup/Utils/dialogs.dart';
import 'package:regroup/Utils/texts.dart';
import 'package:regroup/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart';
import 'package:regroup/resources/routes/route_name.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ForgotPass extends StatefulWidget {
const ForgotPass({super.key});
@override
State<ForgotPass> createState() => _ForgotPassState();
}
class _ForgotPassState extends State<ForgotPass> {
TextEditingController emailController = TextEditingController();
// final _formKey = GlobalKey<FormState>();
checkValidation() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
if (emailController.text.isEmpty) {
utils.showToast('Enter a email address');
} else if (!emailController.text.isEmail) {
utils.showToast('Enter a valid email address');
} else {
// Get.toNamed(RouteName.verifyusercreen,
// arguments: {
// "emailAddress": emailController.text
// });
Map<String, String> updata = {
"email_address": emailController.text,
};
final resp = await ForgotPassAPI().requestotp(updata);
if (resp.status == ResponseStatus.SUCCESS) {
Get.snackbar(
"Success!",
'OTP sent successfully!',
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.green,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
prefs.setString('email', emailController.text);
prefs.setString('principal_xid', resp.data['data']['iam_principal_xid']);
Future.delayed(Duration(seconds: 1), () {
Get.toNamed(RouteName.verifyusercreen,
arguments: emailController.text);
});
// print('success');
} else if (resp.status == ResponseStatus.FAILED) {
Get.snackbar(
"Error!",
resp.message,
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
} else {
// btnController.error();
// btnController.reset();
Get.snackbar(
"Error!",
resp.data['message'],
duration: Duration(seconds: 2),
colorText: Colors.white,
backgroundColor: Colors.red,
margin: EdgeInsets.all(8),
snackStyle: SnackStyle.FLOATING,
snackPosition: SnackPosition.BOTTOM,
);
}
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
// key: _scaffoldKey1,
backgroundColor: Color(0xFF222935),
extendBody: true,
resizeToAvoidBottomInset: false,
appBar: CommonAppbar(
titleTxt: "",
),
body: Stack(children: [
Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/png/Ellipse 1496.png"),
fit: BoxFit.fill)),
),
SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
sizedBoxHeight(30.h),
text22400white("Forgot password"),
sizedBoxHeight(15.h),
Container(
height: 1.h,
width: 250.w,
color: Color(0xFF858585),
),
sizedBoxHeight(35.h),
text16w400_FCFCFC("Email address"),
sizedBoxHeight(15.h),
CustomTextFormField(
textEditingController: emailController,
leadingIcon: Container(
height: 18.h,
width: 23.w,
child: Center(
child: Image.asset(
"assets/images/png/Frame 12 (1).png",
height: 18.h,
width: 23.w,
),
),
),
hintText: "loremipsum@gmail.comess",
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;
},
),
sizedBoxHeight(8.h),
text12w400_8E8E8E(
"Well send four digit code to the registered email"),
sizedBoxHeight(90.h),
CustomButton(
text: 'Continue',
onPressed: () {
checkValidation();
}),
])))
]));
}
}

View File

@@ -1,50 +0,0 @@
import 'package:regroup/Common/base_manager.dart';
import 'package:regroup/Common/controller/data/network/network_api.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ForgotPassAPI {
ForgotPassAPI();
// class otpAPI {
// otpAPI(this.data);
// var data;
Future<ResponseData<dynamic>> requestotp(var data) async {
final response = await NetworkApiServices().postApi(
data,
"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>> verifyotp(var data) async {
final response = await NetworkApiServices().postApi(
data,
"https://regroup.betadelivery.com/api/v1/forgot-password/verify-otp",
);
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);
} else {
return ResponseData<dynamic>(
response.data['message'], ResponseStatus.FAILED);
}
}
return response;
}
}

View File

@@ -8,7 +8,6 @@ class RouteName {
static const String verifyusercreen = '/verifyuser';
static const String tellusindividualscreen = '/tellusindividualscreen';
static const String tellusbusinessscreen = '/tellusbusinessscreen';
static const String forgotpass = '/forgotpass';
static const String individualprofilestep1 = '/individualprofilestep1';
static const String individualactivitystep2 = '/individualactivitystep2';
@@ -80,10 +79,9 @@ class RouteName {
static const String changepassword = '/changepassword';
static const String addtimeline = '/addtimeline';
static const String verifycode = '/verifycode';
static const String newpassword = '/newpassword';
static const String availability = '/availability';
//Group Tab
static const String grouptab = '/grouptab';
@@ -98,6 +96,8 @@ class RouteName {
static const String certificate = '/certificate';
static const String sessions = '/sessions';
//subgroup
static const String subgroups = '/subgroups';
static const String subgroupinfo = '/subgroupinfo';
@@ -110,8 +110,7 @@ class RouteName {
static const String searchgroup = '/searchgroup';
static const String detailexplore = '/detailexplore';
static const String notificaationpage = '/notificationpage';
static const String verifygoogleapplepage = '/verifygoogleapplepage';
}

View File

@@ -81,10 +81,8 @@ import 'package:regroup/Feed%20Module/sidemenu/Community/MyCommunity/View/Commun
import 'package:regroup/Feed%20Module/sidemenu/Community/MyCommunity/View/MyCommunity.dart';
import 'package:regroup/Feed%20Module/sidemenu/SavedPosts/SavedPosts.dart';
import 'package:regroup/Feed%20Module/sidemenu/sidemenu.dart';
import 'package:regroup/Login/View/verifygoogleapple.dart';
import 'package:regroup/Utils/Common/NoInternet.dart';
import 'package:regroup/onboarding/NewPass/View/NewPass.dart';
import 'package:regroup/onboarding/Signup/View/Business/step1Letusunderstandbetter.dart';
import 'package:regroup/onboarding/Signup/View/Business/step2Selectgroup.dart';
import 'package:regroup/onboarding/Signup/View/Business/step3SelectCommunity.dart';
@@ -98,7 +96,6 @@ import 'package:regroup/onboarding/Signup/View/communitycommitment.dart';
import 'package:regroup/onboarding/Signup/View/signupendpage.dart';
import 'package:regroup/onboarding/Signup/View/signupscreen.dart';
import 'package:regroup/onboarding/Signup/View/verifyuser.dart';
import 'package:regroup/onboarding/forgotPass/View/ForgotPass.dart';
import 'package:regroup/onboarding/onboarding1.dart';
import 'package:regroup/onboarding/splashscreen.dart';
import 'package:regroup/resources/routes/route_name.dart';
@@ -479,19 +476,5 @@ class AppRoutes {
name: RouteName.sessions,
page: () => const Sessions(),
),
GetPage(
name: RouteName.forgotpass,
page: () => const ForgotPass(),
),
GetPage(
name: RouteName.newpassword,
page: () => const NewPassword(),
),
GetPage(
name: RouteName.verifygoogleapplepage,
page: () => const Verifygoogleandapple(),
),
];
}

View File

@@ -941,14 +941,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.1"
timer_button:
dependency: "direct main"
description:
name: timer_button
sha256: "448a67cc29a07e2696f8bd025f0ebd859cf156c35b4eeeee0121a728dceba7c9"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
timezone:
dependency: transitive
description:

View File

@@ -69,7 +69,6 @@ dependencies:
statsfl: ^2.3.0
glass_kit: ^4.0.1
flutter_facebook_auth: ^6.0.4
timer_button: ^2.1.1