Merge branch 'main' of https://github.com/WDI-Ideas/Regroup_flutter
This commit is contained in:
@@ -202,7 +202,7 @@ GlassContainer bottomnavigationbar(MainController _mainController) {
|
||||
))
|
||||
],
|
||||
),
|
||||
label: 'Calender',
|
||||
label: 'Calendar',
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
icon: Image.asset(
|
||||
|
||||
@@ -85,7 +85,7 @@ Widget commonGlassUIBlue({
|
||||
required double height,
|
||||
required Widget customWidget,
|
||||
// required double border,
|
||||
double mainOpacity = 0.05,
|
||||
double mainOpacity = 1,
|
||||
Color borderColor = const Color(0xff434A53),
|
||||
required BorderRadius? borderRadius,
|
||||
}) {
|
||||
|
||||
6
lib/Common/api_urls.dart
Normal file
6
lib/Common/api_urls.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
class ApiUrls {
|
||||
static const baseUrl = "https://regroup.betadelivery.com/api/v1/";
|
||||
|
||||
static const getlogin = "${baseUrl}login";
|
||||
|
||||
}
|
||||
4
lib/Common/controller/data/network/BaseApiServices.dart
Normal file
4
lib/Common/controller/data/network/BaseApiServices.dart
Normal file
@@ -0,0 +1,4 @@
|
||||
abstract class BaseApiServices {
|
||||
Future<dynamic> getApi(String url);
|
||||
Future<dynamic> postApi(var data, String url);
|
||||
}
|
||||
@@ -5,14 +5,14 @@ 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/Utils/base_manager.dart';
|
||||
import 'package:regroup/Common/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 NetworkApi {
|
||||
class NetworkApiServices {
|
||||
Dio dio = Dio();
|
||||
final controllerEntryPoint = Get.put(EntryPointController());
|
||||
|
||||
@@ -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: Colors.blue,
|
||||
color: Color(0xFFD90B2E),
|
||||
)),
|
||||
// blackoutDatesTextStyle: TextStyle(color: Colors.white),
|
||||
|
||||
@@ -282,7 +282,6 @@ class _CalenderTabState extends State<CalenderTab> {
|
||||
allowViewNavigation: true,
|
||||
allowDragAndDrop: true,
|
||||
showDatePickerButton: true,
|
||||
|
||||
monthViewSettings: MonthViewSettings(
|
||||
navigationDirection: MonthNavigationDirection.horizontal,
|
||||
),
|
||||
@@ -360,20 +359,25 @@ class _CalenderTabState extends State<CalenderTab> {
|
||||
),
|
||||
Positioned(
|
||||
top: 6.h,
|
||||
left: 190.w,
|
||||
left: 100.w,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.availability);
|
||||
},
|
||||
child: Container(
|
||||
height: 25.h,
|
||||
width: 50.w,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: Colors.blue,
|
||||
color: Color(0xFFD90B2E),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(15.r)),
|
||||
child: Center(child: text10400white("view")),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10.w,
|
||||
),
|
||||
child:
|
||||
Center(child: text10400white("view availability")),
|
||||
),
|
||||
)
|
||||
|
||||
// Image.asset(
|
||||
@@ -555,7 +559,7 @@ class _CalenderTabState extends State<CalenderTab> {
|
||||
appointmentTextStyle: TextStyle(color: Colors.white),
|
||||
headerStyle: CalendarHeaderStyle(
|
||||
textStyle: TextStyle(
|
||||
color: Colors.blue,
|
||||
color: Color(0xFFD90B2E),
|
||||
)),
|
||||
// blackoutDatesTextStyle: TextStyle(color: Colors.white),
|
||||
|
||||
@@ -579,7 +583,7 @@ class _CalenderTabState extends State<CalenderTab> {
|
||||
showNavigationArrow: true,
|
||||
allowViewNavigation: true,
|
||||
allowDragAndDrop: true,
|
||||
// showDatePickerButton: true,
|
||||
showDatePickerButton: true,
|
||||
monthViewSettings: MonthViewSettings(
|
||||
navigationDirection: MonthNavigationDirection.horizontal,
|
||||
),
|
||||
@@ -646,20 +650,6 @@ 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(
|
||||
|
||||
@@ -174,7 +174,7 @@ Widget feedTab() {
|
||||
"containerTitle": ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events'],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -186,7 +186,7 @@ Widget feedTab() {
|
||||
],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -198,7 +198,7 @@ Widget feedTab() {
|
||||
],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -989,7 +989,6 @@ Widget announcecardtile({
|
||||
commonGlassUIBlue(
|
||||
width: double.infinity,
|
||||
height: 610.h,
|
||||
mainOpacity: 1,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
customWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -1386,7 +1385,7 @@ Widget popularTab() {
|
||||
"containerTitle": ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events'],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -1398,7 +1397,7 @@ Widget popularTab() {
|
||||
],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -1410,7 +1409,7 @@ Widget popularTab() {
|
||||
],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -1457,7 +1456,7 @@ Widget latestTab() {
|
||||
"containerTitle": ['Cycle', 'Marathon', 'Events', 'Marathon', 'Events'],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -1469,7 +1468,7 @@ Widget latestTab() {
|
||||
],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
@@ -1481,7 +1480,7 @@ Widget latestTab() {
|
||||
],
|
||||
},
|
||||
{
|
||||
"profileImg": "'assets/images/png/Ellipse 52.png'",
|
||||
"profileImg": "assets/images/png/Ellipse 52.png",
|
||||
"title": "Ryan Dorwat",
|
||||
"mainImg": "assets/images/png/Rectangle 25.png",
|
||||
"containerTitle": [
|
||||
|
||||
@@ -315,33 +315,35 @@ class _GroupDetailState extends State<GroupDetail> {
|
||||
sizedBoxHeight(16.h),
|
||||
Row(
|
||||
children: [
|
||||
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),
|
||||
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),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(7.w),
|
||||
text16w400_FCFCFCblur("The athlectic town"),
|
||||
sizedBoxWidth(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),
|
||||
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),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(7.w),
|
||||
text16w400_FCFCFCblur("Public"),
|
||||
],
|
||||
@@ -349,19 +351,20 @@ class _GroupDetailState extends State<GroupDetail> {
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
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),
|
||||
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),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(7.w),
|
||||
text16w400_FCFCFCblur("Rowing, Football, Swimming"),
|
||||
],
|
||||
@@ -594,11 +597,10 @@ class _GroupDetailState extends State<GroupDetail> {
|
||||
}
|
||||
|
||||
// MediaQuery.of(context).size.height
|
||||
return commonGlassContainerblue(
|
||||
return commonGlassUIBlue(
|
||||
width: double.infinity,
|
||||
height: 610.h,
|
||||
border: 0,
|
||||
borderradius: 1,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
customWidget: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -790,13 +792,13 @@ class _GroupDetailState extends State<GroupDetail> {
|
||||
]),
|
||||
),
|
||||
Spacer(),
|
||||
commonGlassContainer(
|
||||
border: 0.43,
|
||||
commonContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
borderradius: 100,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
boxShape: BoxShape.circle,
|
||||
borderwidth: 0.43,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/Frame 1000004088.png',
|
||||
@@ -808,13 +810,13 @@ class _GroupDetailState extends State<GroupDetail> {
|
||||
sizedBoxWidth(12.w),
|
||||
text14w400_FCFCFC('20'),
|
||||
sizedBoxWidth(20.w),
|
||||
commonGlassContainer(
|
||||
border: 0.43,
|
||||
commonContainer(
|
||||
width: 30.w,
|
||||
height: 30.h,
|
||||
borderradius: 100,
|
||||
opacity1: 0.05,
|
||||
opacity2: 0.06,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
boxShape: BoxShape.circle,
|
||||
borderwidth: 0.43,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/Vector (1).png',
|
||||
@@ -950,11 +952,11 @@ class _GroupDetailState extends State<GroupDetail> {
|
||||
}
|
||||
|
||||
Widget containertile({required String text}) {
|
||||
return commonGlassContainer(
|
||||
border: 1,
|
||||
return commonContainer(
|
||||
width: 100.w,
|
||||
height: 30.h,
|
||||
borderradius: 30.r,
|
||||
borderRadius: BorderRadius.circular(30.r),
|
||||
borderwidth: 1,
|
||||
borderColor: Color(0xFFD90B2E),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
@@ -966,17 +968,16 @@ class _GroupDetailState extends State<GroupDetail> {
|
||||
return Column(
|
||||
children: [
|
||||
sizedBoxHeight(40.h),
|
||||
commonGlassContainer(
|
||||
commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 500.h,
|
||||
borderradius: 1,
|
||||
border: 0,
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
customWidget: SfCalendar(
|
||||
view: CalendarView.day,
|
||||
appointmentTextStyle: TextStyle(color: Colors.white),
|
||||
headerStyle: CalendarHeaderStyle(
|
||||
textStyle: TextStyle(
|
||||
color: Colors.blue,
|
||||
color: Color(0xFFD90B2E),
|
||||
)),
|
||||
// blackoutDatesTextStyle: TextStyle(color: Colors.white),
|
||||
|
||||
|
||||
@@ -168,11 +168,11 @@ class _GroupTabState extends State<GroupTab> {
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassContainer(
|
||||
border: 0.9,
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 162.h,
|
||||
borderradius: 10.r,
|
||||
borderwidth: 0.9,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
|
||||
@@ -152,7 +152,7 @@ class _NewPostState extends State<NewPost> {
|
||||
sizedBoxHeight(20.h),
|
||||
text16w400_FCFCFC("Tags"),
|
||||
sizedBoxHeight(18.h),
|
||||
CustomDropDownTag(
|
||||
CustomDropDownTag1(
|
||||
header: "Enter tags",
|
||||
title: "Enter tags",
|
||||
listData: [
|
||||
|
||||
@@ -46,23 +46,28 @@ 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)),
|
||||
),
|
||||
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']);
|
||||
},
|
||||
)
|
||||
])
|
||||
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']);
|
||||
},
|
||||
)
|
||||
]),
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -76,11 +81,11 @@ class _RequestedGroupsState extends State<RequestedGroups> {
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassContainer(
|
||||
border: 0.9,
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 162.h,
|
||||
borderradius: 10.r,
|
||||
borderwidth: 0.9,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
|
||||
@@ -257,20 +257,20 @@ class _ProfileTabState extends State<ProfileTab> {
|
||||
sizedBoxHeight(25.h),
|
||||
Row(
|
||||
children: [
|
||||
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),
|
||||
commonContainer(
|
||||
width: 25.w,
|
||||
height: 25.h,
|
||||
opacity1: 0.26,
|
||||
opacity2: 0.26,
|
||||
borderwidth: 0.5,
|
||||
boxShape: BoxShape.circle,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Group 58645.png",
|
||||
height: 12.h,
|
||||
width: 12.w,
|
||||
)),
|
||||
),
|
||||
sizedBoxWidth(12.w),
|
||||
text14400whiteblur(
|
||||
"Elm street london, United Kingdom"),
|
||||
@@ -279,14 +279,13 @@ class _ProfileTabState extends State<ProfileTab> {
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
children: [
|
||||
commonGlassUI(
|
||||
commonContainer(
|
||||
width: 25.w,
|
||||
height: 25.h,
|
||||
opacity1: 0.24,
|
||||
opacity2: 0.24,
|
||||
mainOpacity: 1,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
opacity1: 0.26,
|
||||
opacity2: 0.26,
|
||||
borderwidth: 0.5,
|
||||
boxShape: BoxShape.circle,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
"assets/images/png/Vector (4).png",
|
||||
@@ -434,34 +433,19 @@ 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: commonGlassContainer(
|
||||
border: 0.5,
|
||||
child: commonContainer(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
borderradius: 100,
|
||||
borderwidth: 0.5,
|
||||
boxShape: BoxShape.circle,
|
||||
opacity1: 0.5,
|
||||
opacity2: 0.4,
|
||||
opacity2: 0.6,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
'assets/images/png/setting2.png',
|
||||
|
||||
@@ -102,51 +102,50 @@ 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']);
|
||||
}),
|
||||
)
|
||||
]),
|
||||
))
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -161,11 +160,11 @@ class _MyCommunityState extends State<MyCommunity> {
|
||||
padding: EdgeInsets.only(bottom: 25.h),
|
||||
child: GestureDetector(
|
||||
onTap: ontap,
|
||||
child: commonGlassContainer(
|
||||
border: 0.9,
|
||||
child: commonGlassUI(
|
||||
width: double.infinity,
|
||||
height: 162.h,
|
||||
borderradius: 10.r,
|
||||
borderwidth: 0.9,
|
||||
borderRadius: BorderRadius.circular(10.r),
|
||||
customWidget: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 16.h),
|
||||
child: Column(
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
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});
|
||||
@@ -78,75 +77,75 @@ class _SideMenuState extends State<SideMenu> {
|
||||
child: ListView(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
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,
|
||||
)
|
||||
],
|
||||
),
|
||||
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,
|
||||
)
|
||||
],
|
||||
),
|
||||
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: () {},
|
||||
),
|
||||
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"),
|
||||
),
|
||||
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: () {},
|
||||
title: text14w400_FCFCFC("Ryan Dorwart"),
|
||||
trailing: Image.asset(
|
||||
"assets/images/png/sidemenu/f7_pin-fill (1).png",
|
||||
width: 19.w,
|
||||
height: 19.h,
|
||||
),
|
||||
]),
|
||||
border: 1),
|
||||
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: () {},
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(18.h),
|
||||
Padding(
|
||||
@@ -366,11 +365,11 @@ class _SideMenuState extends State<SideMenu> {
|
||||
required int index,
|
||||
}) {
|
||||
return ListTile(
|
||||
leading: commonGlassContainer(
|
||||
border: 0.9,
|
||||
leading: commonContainer(
|
||||
width: 29.w,
|
||||
height: 29.h,
|
||||
borderradius: 100,
|
||||
borderwidth: 0.9,
|
||||
boxShape: BoxShape.circle,
|
||||
customWidget: Center(
|
||||
child: Image.asset(
|
||||
leadingimage,
|
||||
|
||||
45
lib/Login/Model/LoginModel.dart
Normal file
45
lib/Login/Model/LoginModel.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,16 @@
|
||||
|
||||
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/base_manager.dart';
|
||||
import 'package:regroup/Login/ViewModel/LoginApi.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';
|
||||
|
||||
class LoginScreen extends StatefulWidget {
|
||||
@@ -26,11 +24,13 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
Map<String, dynamic>? _userData;
|
||||
AccessToken? _accessToken;
|
||||
bool _checking = true;
|
||||
final TextEditingController _email = TextEditingController();
|
||||
final TextEditingController _emailController = TextEditingController();
|
||||
RxBool isObscured = true.obs;
|
||||
final TextEditingController _password = TextEditingController();
|
||||
final TextEditingController _passwordController = TextEditingController();
|
||||
// final GlobalKey<FormState> _form = GlobalKey<FormState>();
|
||||
|
||||
// RxString errormsg = ''.obs;
|
||||
// RxString errormsgpass = ''.obs;
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
@@ -38,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(() {
|
||||
@@ -56,13 +56,14 @@ 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) {
|
||||
@@ -86,6 +87,74 @@ 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": _emailController.text,
|
||||
"password": _passwordController.text,
|
||||
"access-token":
|
||||
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3JlZ3JvdXAuYmV0YWRlbGl2ZXJ5LmNvbS9hcGkvdjEvbG9naW4iLCJpYXQiOjE3MjA1MDgwNzcsIm5iZiI6MTcyMDUwODA3NywianRpIjoiNlFsbU1hSzB1cGJ2MDN5WSIsInN1YiI6IjIzIiwicHJ2IjoiNDBiYzNmZGUzNDYyNTdhODUwOTUwMmZlNjQyMzU1OWExMTE2NGJkMyJ9.3rmDa3ZXoAPFlxAVx-Rms78tZ-VHaVDYn1YG3eYYQp0",
|
||||
// "player_id": global.player_id!,
|
||||
};
|
||||
final data = await LoginAPI().loginApi(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
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(
|
||||
@@ -101,221 +170,184 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
image: AssetImage("assets/images/png/Choice screen.png"),
|
||||
fit: BoxFit.cover)),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 150.h,
|
||||
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: text22400FCFCFC("Find your community")),
|
||||
sizedBoxHeight(40.h),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16.w),
|
||||
child: 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,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
text16400white('Email address'),
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
textEditingController: _emailController,
|
||||
hintText: "Enter your email address",
|
||||
leadingIcon:
|
||||
// const Icon(Icons.mail_outline),
|
||||
SizedBox(
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
child: Image.asset(
|
||||
'assets/images/png/mail.png',
|
||||
width: 22.w,
|
||||
height: 17.h,
|
||||
),
|
||||
),
|
||||
// validationMessage: errormsg.value,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Enter your e-mail address';
|
||||
}
|
||||
if (!RegExp(
|
||||
r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
|
||||
.hasMatch(value)) {
|
||||
return 'Enter a valid e-mail address';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
// onInput: (p0) {
|
||||
// if (p0!.isEmpty) {
|
||||
// errormsg.value = 'Enter your e-mail address';
|
||||
// }
|
||||
// if (!RegExp(
|
||||
// r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
|
||||
// .hasMatch(p0!)) {
|
||||
// errormsg.value = 'Enter a valid e-mail address';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
// validatorText: "Email Id",
|
||||
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(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',
|
||||
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,
|
||||
),
|
||||
),
|
||||
// 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('Don’t have account ? '),
|
||||
sizedBoxWidth(5.w),
|
||||
text14700white('Sign up')
|
||||
// validationMessage: errormsgpass.value,
|
||||
validator: (value) {
|
||||
if (value!.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
// onInput: (p0) {
|
||||
// if (p0 == null || p0.isEmpty) {
|
||||
// errormsgpass.value =
|
||||
// 'Please enter your password';
|
||||
// }
|
||||
// return null;
|
||||
// },
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
RemoveEmojiInputFormatter()
|
||||
],
|
||||
),
|
||||
),
|
||||
sizedBoxHeight(30.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: 160,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF434A53),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
sizedBoxWidth(6.w),
|
||||
text14400white('Or'),
|
||||
sizedBoxWidth(6.w),
|
||||
Container(
|
||||
width: 160,
|
||||
decoration: const ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
strokeAlign: BorderSide.strokeAlignCenter,
|
||||
color: Color(0xFF434A53),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
width: 220.w,
|
||||
sizedBoxHeight(10.h),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 6.w),
|
||||
child: text14400white('Forgot password ?'),
|
||||
)),
|
||||
sizedBoxHeight(40.h),
|
||||
CustomButton(
|
||||
text: "Login",
|
||||
onPressed: () {
|
||||
_logincheck();
|
||||
}),
|
||||
sizedBoxHeight(20.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.signupscreen);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
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'))),
|
||||
text14400white('Don’t 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),
|
||||
),
|
||||
),
|
||||
),
|
||||
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'))),
|
||||
),
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
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(
|
||||
),
|
||||
],
|
||||
),
|
||||
sizedBoxHeight(20.h),
|
||||
Center(
|
||||
child: SizedBox(
|
||||
width: 220.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
@@ -336,18 +368,83 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login4.png'))),
|
||||
'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(100)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
30
lib/Login/ViewModel/LoginApi.dart
Normal file
30
lib/Login/ViewModel/LoginApi.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:regroup/Common/base_manager.dart';
|
||||
import 'package:regroup/Common/controller/data/network/network_api.dart';
|
||||
import 'package:regroup/Login/Model/LoginModel.dart';
|
||||
|
||||
class LoginAPI {
|
||||
LoginAPI();
|
||||
Future<ResponseData<dynamic>> loginApi(var data) async {
|
||||
// SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices().postApi(url: 'https://regroup.betadelivery.com/api/v1/login', data: data
|
||||
|
||||
// "auth/login/",
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
//Map<String, dynamic> responseData = jsonDecode(response.data);
|
||||
if (response.data['success'] == true) {
|
||||
LoginModel loginObj = LoginModel.fromJson(response.data);
|
||||
// await prefs.setString('token', loginObj.data!.access!);
|
||||
// await prefs.setString('refreshToken', loginObj.data!.refresh!);
|
||||
// print("token is ${loginObj.data!.access!}");
|
||||
// print("refresh-token is ${loginObj.data!.refresh!}");
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
response.data['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class CustomTextFormField extends StatefulWidget {
|
||||
this.opacity2 = 0.05,
|
||||
}) : super(key: key);
|
||||
|
||||
final String? Function(String?)? validator;
|
||||
dynamic 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 Function(String)? onInput;
|
||||
final String? Function(String?)? onInput;
|
||||
final VoidCallback? onTap;
|
||||
final Widget? suffixIcon;
|
||||
final double opacity1;
|
||||
@@ -159,6 +159,7 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
: widget.suffixIcon == null
|
||||
? null
|
||||
: widget.suffixIcon!,
|
||||
@@ -168,6 +169,7 @@ class _CustomTextFormFieldState extends State<CustomTextFormField> {
|
||||
),
|
||||
keyboardType: widget.texttype,
|
||||
inputFormatters: widget.inputFormatters,
|
||||
// validator: widget.validator,
|
||||
onChanged: (value) {
|
||||
widget.onInput?.call(value);
|
||||
validateField(value);
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
class ApiUrls {
|
||||
static const baseUrl = "";
|
||||
|
||||
static const getfaq = "${baseUrl}faq-tags";
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class SignupScreen extends StatefulWidget {
|
||||
|
||||
class _SignupScreenState extends State<SignupScreen> {
|
||||
TextEditingController emailidcontroller = TextEditingController();
|
||||
TextEditingController _password = TextEditingController();
|
||||
TextEditingController passwordController = TextEditingController();
|
||||
TextEditingController confirmpasscontroller = TextEditingController();
|
||||
|
||||
List<String> _dropdownProductItems = [
|
||||
@@ -36,6 +36,36 @@ 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');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -102,7 +132,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
sizedBoxHeight(10.h),
|
||||
CustomTextFormField(
|
||||
isInputPassword: true,
|
||||
textEditingController: _password,
|
||||
textEditingController: passwordController,
|
||||
hintText: 'Enter your password',
|
||||
leadingIcon: Image.asset(
|
||||
'assets/images/png/lock.png',
|
||||
@@ -140,7 +170,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
if (val == null || val.isEmpty) {
|
||||
return 'Please enter your password';
|
||||
}
|
||||
if (val != _password.text) {
|
||||
if (val != passwordController.text) {
|
||||
return 'Password does not match';
|
||||
}
|
||||
return null;
|
||||
@@ -167,7 +197,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
'Individual',
|
||||
'Business',
|
||||
],
|
||||
onItemSelected: (p0) {},
|
||||
onItemSelected: _onItemSelected,
|
||||
leadingImage: Image.asset(
|
||||
'assets/images/png/user.png',
|
||||
),
|
||||
@@ -238,22 +268,7 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
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');
|
||||
}
|
||||
_Signincheck();
|
||||
}),
|
||||
sizedBoxHeight(20.h),
|
||||
Row(
|
||||
|
||||
Reference in New Issue
Block a user