Compare commits
7 Commits
signuponbo
...
verifygoog
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ee76bca98 | ||
|
|
7ed2830e3b | ||
|
|
54283a2a4c | ||
|
|
d56f25864e | ||
|
|
47641d5f7b | ||
|
|
3614bbb43d | ||
|
|
f8246d33ed |
@@ -149,7 +149,9 @@ class NetworkApiServices {
|
||||
|
||||
//New post api
|
||||
|
||||
|
||||
@override
|
||||
|
||||
Future<ResponseData> postApi(data, String url,
|
||||
{bool optionalpar = false}) async {
|
||||
if (kDebugMode) {
|
||||
@@ -159,8 +161,11 @@ class NetworkApiServices {
|
||||
Response response;
|
||||
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
|
||||
String? token = prefs.getString('token');
|
||||
|
||||
log(token.toString());
|
||||
log(basicAuth);
|
||||
try {
|
||||
response = await dio.post(
|
||||
url,
|
||||
@@ -172,13 +177,33 @@ class NetworkApiServices {
|
||||
},
|
||||
)
|
||||
: Options(
|
||||
headers: {'authorization': basicAuth, 'access-token': token},
|
||||
headers: {
|
||||
'authorization': basicAuth,
|
||||
// 'access-token': token
|
||||
},
|
||||
),
|
||||
);
|
||||
log(response.toString());
|
||||
} 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,
|
||||
@@ -188,6 +213,7 @@ class NetworkApiServices {
|
||||
e.response!.data['message'], ResponseStatus.FAILED,
|
||||
data: e.response!.data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return ResponseData<dynamic>(
|
||||
@@ -196,21 +222,13 @@ class NetworkApiServices {
|
||||
);
|
||||
}
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return ResponseData<dynamic>("success", ResponseStatus.SUCCESS,
|
||||
data: response.data);
|
||||
} else if (response.statusCode == 201) {
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
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 if (response.statusCode == 403) {
|
||||
print(response.data);
|
||||
return ResponseData<dynamic>(
|
||||
response.statusMessage!, ResponseStatus.ERROR,
|
||||
data: response.data);
|
||||
} else {
|
||||
try {
|
||||
return ResponseData<dynamic>(
|
||||
|
||||
@@ -108,7 +108,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
);
|
||||
} else {
|
||||
Map<String, String> updata = {
|
||||
"email": _emailController.text,
|
||||
"email_address": _emailController.text,
|
||||
"password": _passwordController.text,
|
||||
// "access-token" : ""
|
||||
//
|
||||
@@ -116,7 +116,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
};
|
||||
final data = await LoginAPI().loginApi(updata);
|
||||
if (data.status == ResponseStatus.SUCCESS) {
|
||||
await global.setname();
|
||||
// await global.setname();
|
||||
Get.snackbar(
|
||||
"Success!",
|
||||
'Login successful!',
|
||||
@@ -268,6 +268,11 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
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;
|
||||
},
|
||||
@@ -288,7 +293,11 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
alignment: Alignment.centerRight,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 6.w),
|
||||
child: text14400white('Forgot password ?'),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.forgotpass);
|
||||
},
|
||||
child: text14400white('Forgot password ?')),
|
||||
)),
|
||||
sizedBoxHeight(40.h),
|
||||
CustomButton(
|
||||
@@ -350,52 +359,62 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
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'))),
|
||||
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(),
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white
|
||||
.withOpacity(0.07999999821186066),
|
||||
Colors.white
|
||||
.withOpacity(0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
||||
},
|
||||
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(
|
||||
|
||||
192
lib/Login/View/verifygoogleapple.dart
Normal file
192
lib/Login/View/verifygoogleapple.dart
Normal file
@@ -0,0 +1,192 @@
|
||||
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(
|
||||
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,19 +5,18 @@ import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class LoginAPI {
|
||||
LoginAPI();
|
||||
Future<ResponseData<dynamic>> loginApi(var data) async {
|
||||
Future<ResponseData> loginApi(var data) async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
final response = await NetworkApiServices().postApi(
|
||||
'https://regroup.betadelivery.com/api/v1/login',
|
||||
data,
|
||||
optionalpar: true
|
||||
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['success'] == true) {
|
||||
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!);
|
||||
|
||||
@@ -530,6 +530,16 @@ 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(
|
||||
|
||||
61
lib/onboarding/NewPass/View/NewPass.dart
Normal file
61
lib/onboarding/NewPass/View/NewPass.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
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'),
|
||||
])))
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -403,54 +403,65 @@ class _SignupScreenState extends State<SignupScreen> {
|
||||
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'))),
|
||||
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(),
|
||||
Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin:
|
||||
const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(RouteName.verifygoogleapplepage);
|
||||
|
||||
},
|
||||
child: Container(
|
||||
width: 55,
|
||||
height: 55,
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin:
|
||||
const Alignment(0.71, -0.70),
|
||||
end: const Alignment(-0.71, 0.7),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.07999999821186066),
|
||||
Colors.white.withOpacity(
|
||||
0.12999999523162842)
|
||||
],
|
||||
),
|
||||
shape: const OvalBorder(
|
||||
side: BorderSide(
|
||||
width: 0.50,
|
||||
color: Color(0xFF434A53)),
|
||||
),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage(
|
||||
'assets/images/png/login3.png'))),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
|
||||
@@ -5,18 +5,22 @@ 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});
|
||||
|
||||
@@ -26,6 +30,7 @@ class VerifyuserScreenState extends StatefulWidget {
|
||||
|
||||
class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
// String accounttype = Get.arguments;
|
||||
|
||||
TextEditingController pincode = TextEditingController();
|
||||
|
||||
String email = Get.arguments['emailid'];
|
||||
@@ -81,6 +86,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -138,7 +144,9 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
text22400white('Check your email'),
|
||||
sizedBoxHeight(10.h),
|
||||
text14400white(
|
||||
|
||||
'Enter the verification code that we sent to $email'),
|
||||
|
||||
sizedBoxHeight(40.h),
|
||||
text16400white('Enter code'),
|
||||
sizedBoxHeight(20.h),
|
||||
@@ -224,6 +232,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
CustomButton(
|
||||
text: 'Continue',
|
||||
onPressed: () {
|
||||
|
||||
if (pincode.text.isEmpty) {
|
||||
utils.showToast('Pin field is empty');
|
||||
} else if (pincode.text.length < 4) {
|
||||
@@ -240,6 +249,7 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
// Get.toNamed(RouteName.tellusbusinessscreen);
|
||||
// }
|
||||
}
|
||||
|
||||
}),
|
||||
const Spacer(
|
||||
// flex: 2,
|
||||
@@ -251,4 +261,4 @@ class _VerifyuserScreenStateState extends State<VerifyuserScreenState> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
161
lib/onboarding/forgotPass/View/ForgotPass.dart
Normal file
161
lib/onboarding/forgotPass/View/ForgotPass.dart
Normal file
@@ -0,0 +1,161 @@
|
||||
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(
|
||||
"We’ll send four digit code to the registered email"),
|
||||
sizedBoxHeight(90.h),
|
||||
CustomButton(
|
||||
text: 'Continue',
|
||||
onPressed: () {
|
||||
checkValidation();
|
||||
}),
|
||||
])))
|
||||
]));
|
||||
}
|
||||
}
|
||||
50
lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart
Normal file
50
lib/onboarding/forgotPass/ViewModel/ForgotPassAPI.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ 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';
|
||||
@@ -79,8 +80,9 @@ class RouteName {
|
||||
static const String changepassword = '/changepassword';
|
||||
static const String addtimeline = '/addtimeline';
|
||||
static const String verifycode = '/verifycode';
|
||||
static const String availability = '/availability';
|
||||
static const String newpassword = '/newpassword';
|
||||
|
||||
static const String availability = '/availability';
|
||||
|
||||
//Group Tab
|
||||
|
||||
@@ -96,8 +98,6 @@ class RouteName {
|
||||
static const String certificate = '/certificate';
|
||||
static const String sessions = '/sessions';
|
||||
|
||||
|
||||
|
||||
//subgroup
|
||||
static const String subgroups = '/subgroups';
|
||||
static const String subgroupinfo = '/subgroupinfo';
|
||||
@@ -110,7 +110,8 @@ class RouteName {
|
||||
static const String searchgroup = '/searchgroup';
|
||||
static const String detailexplore = '/detailexplore';
|
||||
|
||||
|
||||
|
||||
static const String notificaationpage = '/notificationpage';
|
||||
|
||||
static const String verifygoogleapplepage = '/verifygoogleapplepage';
|
||||
|
||||
}
|
||||
|
||||
@@ -81,8 +81,10 @@ 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';
|
||||
@@ -96,6 +98,7 @@ 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';
|
||||
@@ -476,5 +479,19 @@ 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(),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user