New UI Implemented Fix 1.2

mirza_dev
devmirza121 3 years ago
parent 3c257868eb
commit a2d12db77d

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

@ -51,7 +51,7 @@ class MyColors {
darkPrimaryColor,
primaryColor,
]),
borderRadius: BorderRadius.circular(6),
borderRadius: BorderRadius.circular(0),
boxShadow: [
new BoxShadow(
color: primaryColor.withOpacity(0.2),

@ -76,7 +76,7 @@ class AppRoutes {
forgetPassword: (context) => ForgetPasswordPage(),
loginVerification: (context) => LoginVerificationPage(),
loginWithPassword: (context) => LoginWithPassword(),
loginMethodSelection: (context) => LoginMethodSelectionPage(ModalRoute.of(context)!.settings.arguments as String),
loginMethodSelection: (context) => LoginMethodSelectionPage(),
completeProfile: (context) => CompleteProfilePage(ModalRoute.of(context)!.settings.arguments as RegisterUser),
profile1: (context) => Profile1Page(),
profile2: (context) => Profile2Page(),

@ -32,6 +32,7 @@ abstract class LocaleKeys {
static const createPass = 'createPass';
static const newPassword = 'newPassword';
static const forgetPassword = 'forgetPassword';
static const forgetPasswordRecover = 'forgetPasswordRecover';
static const editAccount = 'editAccount';
static const change = 'change';
static const verifyAccount = 'verifyAccount';
@ -132,9 +133,11 @@ abstract class LocaleKeys {
static const gender = 'gender';
static const reset_locale = 'reset_locale';
static const insert_otp_code = 'insert_otp_code';
static const type_code = 'type_code';
static const resend_code = 'resend_code';
static const check_code = 'check_code';
static const time_will_expire = 'time_will_expire';
static const sec = 'sec';
static const no_city_available = 'no_city_available';
static const branch_created = 'branch_created';
static const branch_updated = 'branch_updated';

@ -44,7 +44,7 @@ class _DefineLicensePageState extends State<DefineLicensePage> {
return Scaffold(
appBar: appBar(
context,
title: "",
title: LocaleKeys.defineLicences.tr(),
),
body: Container(
width: double.infinity,
@ -57,9 +57,9 @@ class _DefineLicensePageState extends State<DefineLicensePage> {
padding: const EdgeInsets.all(20.0),
child: Column(
children: [
LocaleKeys.defineLicences.tr().toText20(isBold: true),
12.height,
LocaleKeys.defineLicenese.tr().toText14(color: MyColors.lightTextColor),
// LocaleKeys.defineLicences.tr().toText20(isBold: true),
// 12.height,
// LocaleKeys.defineLicenese.tr().toText14(color: MyColors.lightTextColor),
20.height,
showWidget(),
],
@ -70,7 +70,7 @@ class _DefineLicensePageState extends State<DefineLicensePage> {
Padding(
padding: const EdgeInsets.all(12.0),
child: ShowFillButton(
title: LocaleKeys.update.tr(),
title: LocaleKeys.continu.tr(),
maxWidth: double.infinity,
onPressed: () {
if (AppState().getUser.data!.userInfo!.roleId == 5) {
@ -135,6 +135,7 @@ class _DefineLicensePageState extends State<DefineLicensePage> {
TxtField(
hint: LocaleKeys.description.tr(),
maxLines: 3,
isBackgroundEnabled: true,
),
if (((document?.data![index].documentUrl ?? "").toString().isNotEmpty))
Column(
@ -155,8 +156,8 @@ class _DefineLicensePageState extends State<DefineLicensePage> {
height: 45,
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(color: MyColors.darkPrimaryColor, width: 2),
borderRadius: BorderRadius.all(Radius.circular(8)),
border: Border.all(color: MyColors.greyACColor, width: 2),
borderRadius: BorderRadius.all(Radius.circular(0)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,

@ -26,12 +26,15 @@ import 'package:flutter/material.dart';
import 'package:http/http.dart';
class LoginMethodSelectionPage extends StatelessWidget {
String userToken;
LoginMethodSelectionPage(this.userToken);
String? userToken, userName;
@override
Widget build(BuildContext context) {
if (userToken == null && userName == null) {
Map<String, dynamic> map = ModalRoute.of(context)!.settings.arguments as Map<String, dynamic>;
userToken = map["userToke"];
userName = map["userName"];
}
return Scaffold(
appBar: appBar(context, title: LocaleKeys.log_in.tr()),
body: Container(
@ -102,36 +105,38 @@ class LoginMethodSelectionPage extends StatelessWidget {
Future<void> performBasicOtp(BuildContext context) async {
Utils.showLoading(context);
Response response = await UserApiClent().login_V2_OTP(userToken, "1");
Response response = await UserApiClent().login_V2_OTP(userToken ?? "", "1");
Utils.hideLoading(context);
LoginPassword user = LoginPassword.fromJson(jsonDecode(response.body));
if (user.messageStatus == 1) {
showMDialog(context, child: OtpDialog(
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
Response response2 = await UserApiClent().login_V2_OTPVerify(user.data!.userToken ?? "", code);
Utils.hideLoading(context);
RegisterUser verifiedUser = RegisterUser.fromJson(jsonDecode(response2.body));
showMDialog(context,
child: OtpDialog(
userName: userName,
onClick: (String code) async {
pop(context);
Utils.showLoading(context);
Response response2 = await UserApiClent().login_V2_OTPVerify(user.data!.userToken ?? "", code);
Utils.hideLoading(context);
RegisterUser verifiedUser = RegisterUser.fromJson(jsonDecode(response2.body));
if (verifiedUser.messageStatus == 1) {
User user = User.fromJson(jsonDecode(response2.body));
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6) {
AppState().setUser = user;
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(user.data!.refreshToken ?? "");
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
// pop(context);
navigateReplaceWithNameTillLast(context, AppRoutes.dashboard);
} else {
Utils.showToast("Sorry, Only Provider's can log in this app");
}
} else {
Utils.showToast(verifiedUser.message ?? "");
}
},
));
if (verifiedUser.messageStatus == 1) {
User user = User.fromJson(jsonDecode(response2.body));
if (user.data!.userInfo!.roleId == 5 || user.data!.userInfo!.roleId == 6) {
AppState().setUser = user;
SharedPrefManager.setUserToken(user.data!.accessToken ?? "");
SharedPrefManager.setUserId(user.data!.userInfo!.userId ?? "");
SharedPrefManager.setRefreshToken(user.data!.refreshToken ?? "");
SharedPrefManager.setData(jsonEncode(user.data!.userInfo!.toJson()));
// pop(context);
navigateReplaceWithNameTillLast(context, AppRoutes.dashboard);
} else {
Utils.showToast("Sorry, Only Provider's can log in this app");
}
} else {
Utils.showToast(verifiedUser.message ?? "");
}
},
));
} else {
Utils.showToast(user.message ?? "");
}

@ -68,7 +68,7 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
child: Column(
children: [
12.height,
LocaleKeys.log_in.tr().toText20(),
LocaleKeys.login.tr().toText20(),
20.height,
(type == ClassType.NUMBER ? LocaleKeys.enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr()).toText14(
color: MyColors.lightTextColor,
@ -110,7 +110,7 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
),
10.height,
ShowFillButton(
title: LocaleKeys.forgetPassword.tr(),
title: LocaleKeys.forgetPasswordRecover.tr(),
isFlatButton: true,
isBold: false,
fontSize: 14,
@ -121,7 +121,7 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
),
30.height,
ShowFillButton(
title: LocaleKeys.login.tr(),
title: LocaleKeys.continu.tr(),
maxWidth: double.infinity,
onPressed: () {
performBasicOtp(context);
@ -171,7 +171,7 @@ class _LoginWithPasswordState extends State<LoginWithPassword> {
if (user.messageStatus == 1) {
SharedPrefManager.setPhoneOrEmail(type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum);
SharedPrefManager.setUserPassword(password);
navigateReplaceWithName(context, AppRoutes.loginMethodSelection, arguments: user.data!.userToken);
navigateReplaceWithName(context, AppRoutes.loginMethodSelection, arguments: {"userToke": user.data!.userToken, "userName": type == ClassType.NUMBER ? countryCode + phoneNum : phoneNum});
} else {
Utils.showToast(user.message ?? "");
}

@ -22,7 +22,7 @@ class RegisterSelectionPage extends StatelessWidget {
height: double.infinity,
child: Column(
children: [
mFlex(2),
mFlex(4),
SvgPicture.asset("assets/images/logo.svg"),
mFlex(3),
LocaleKeys.welcomeMessage.tr().toText20(),
@ -30,7 +30,6 @@ class RegisterSelectionPage extends StatelessWidget {
mFlex(4),
ShowFillButton(
title: LocaleKeys.login.tr(),
// title: "Log In With Password",
maxWidth: double.infinity,
horizontalMargin: 20,
onPressed: () {
@ -48,16 +47,16 @@ class RegisterSelectionPage extends StatelessWidget {
},
),
10.height,
ShowFillButton(
title: LocaleKeys.forgetPassword.tr(),
maxWidth: double.infinity,
isFlatButton: true,
isBold: false,
txtColor: MyColors.darkPrimaryColor,
onPressed: () {
navigateWithName(context, AppRoutes.forgetPassword);
},
),
// ShowFillButton(
// title: LocaleKeys.forgetPassword.tr(),
// maxWidth: double.infinity,
// isFlatButton: true,
// isBold: false,
// txtColor: MyColors.darkPrimaryColor,
// onPressed: () {
// navigateWithName(context, AppRoutes.forgetPassword);
// },
// ),
mFlex(2),
SvgPicture.asset(
"assets/images/bn_logo.svg",

@ -14,12 +14,29 @@ class SplashPage extends StatelessWidget {
body: Container(
width: double.infinity,
height: double.infinity,
decoration: MyColors.gradient,
color: Colors.black,
child: Column(
children: [
mExp(1),
Expanded(
child: SvgPicture.asset("assets/images/splash_logo.svg"),
child: Image.asset(
"assets/images/ic_logo_white.png",
),
),
Expanded(
flex: 10,
child: Image.asset(
"assets/images/bn_car.jpeg",
fit: BoxFit.cover,
width: double.infinity,
height: 00,
),
),
Expanded(
flex: 3,
child: Image.asset(
"assets/images/ic_engine.png",
),
),
mExp(1),
],

@ -15,8 +15,8 @@ class ShowFillButton extends StatelessWidget {
required this.title,
required this.onPressed,
this.txtColor = Colors.white,
this.elevation = 4,
this.radius = 8,
this.elevation = 0,
this.radius = 0,
this.maxWidth = 88,
this.maxHeight = 45,
this.fontSize = 16,
@ -32,7 +32,7 @@ class ShowFillButton extends StatelessWidget {
return isFlatButton
? Container(
child: showButton(),
height: 30,
height: maxHeight,
padding: const EdgeInsets.only(
left: 20,
right: 20,
@ -51,7 +51,8 @@ class ShowFillButton extends StatelessWidget {
Widget showButton() {
return Container(
decoration: isFlatButton ? null : MyColors.gradientButton,
// decoration: isFlatButton ? null : MyColors.gradientButton,
color:isFlatButton ? null : MyColors.darkPrimaryColor,
margin: EdgeInsets.symmetric(horizontal: horizontalMargin, vertical: verticalMargin),
child: MaterialButton(
onPressed: onPressed,

@ -13,9 +13,10 @@ import '../count_down_timer.dart';
import '../otp_widget.dart';
class OtpDialog extends StatefulWidget {
String? userName;
Function(String) onClick;
OtpDialog({required this.onClick});
OtpDialog({required this.onClick, this.userName});
@override
State<OtpDialog> createState() => _OtpDialogState();
@ -35,9 +36,13 @@ class _OtpDialogState extends State<OtpDialog> {
width: double.infinity,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
LocaleKeys.insert_otp_code.tr().toText24(),
8.height,
LocaleKeys.type_code.tr().toText12(color: MyColors.textColor),
if (widget.userName != null) (widget.userName ?? "").toText12(color: MyColors.darkPrimaryColor),
20.height,
Center(
child: OTPWidget(
@ -48,59 +53,32 @@ class _OtpDialogState extends State<OtpDialog> {
onTextChanged: (text) {},
pinBoxColor: Colors.white,
onDone: (code) => _onOtpCallBack(code, null),
textBorderColor: const Color(0xffD8D8D8),
textBorderColor: MyColors.darkPrimaryColor,
pinBoxWidth: 48,
pinBoxHeight: 48,
pinTextStyle: const TextStyle(fontSize: 24.0, color: MyColors.darkTextColor),
pinTextAnimatedSwitcherTransition: ProvidedPinBoxTextAnimation.scalingTransition,
pinTextAnimatedSwitcherDuration: const Duration(milliseconds: 300),
pinBoxRadius: 8,
pinBoxRadius: 0,
keyboardType: TextInputType.number,
),
),
// Row(
// children: [
// Expanded(
// child: Container(
// width: double.infinity,
// height: 60,
// color: accentColor.withOpacity(0.3),
// ),
// ),
// 12.width,
// Expanded(
// child: Container(
// width: double.infinity,
// height: 60,
// color: accentColor.withOpacity(0.3),
// ),
// ),
// 12.width,
// Expanded(
// child: Container(
// width: double.infinity,
// height: 60,
// color: accentColor.withOpacity(0.3),
// ),
// ),
// 12.width,
// Expanded(
// child: Container(
// width: double.infinity,
// height: 60,
// color: accentColor.withOpacity(0.3),
// ),
// ),
// ],
// ),
40.height,
ShowFillButton(
title: LocaleKeys.check_code.tr(),
maxWidth: double.infinity,
onPressed: () {
widget.onClick(code);
},
),
if (!hasTimerStopped)
Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: Text(LocaleKeys.time_will_expire.tr()),
),
Text(LocaleKeys.time_will_expire.tr() + " "),
CountDownTimer(
secondsRemaining: 60,
whenTimeExpires: () {
@ -110,43 +88,33 @@ class _OtpDialogState extends State<OtpDialog> {
},
countDownTimerStyle: TextStyle(
color: Colors.blue,
fontSize: 17.0,
height: 1.2,
),
),
Text(" " + LocaleKeys.sec.tr()),
],
),
),
if (hasTimerStopped)
Align(
alignment: Alignment.topRight,
child: InkWell(
onTap: () {
setState(() {
hasTimerStopped = false;
});
},
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
LocaleKeys.resend_code.tr(),
style: TextStyle(
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.blue,
),
InkWell(
onTap: () {
setState(() {
hasTimerStopped = false;
});
},
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
LocaleKeys.resend_code.tr(),
style: TextStyle(
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold,
color: Colors.blue,
),
),
),
),
40.height,
ShowFillButton(
title: LocaleKeys.check_code.tr(),
maxWidth: double.infinity,
onPressed: () {
widget.onClick(code);
},
)
],
),
);

@ -43,10 +43,10 @@ class _DropdownFieldState extends State<DropdownField> {
Widget build(BuildContext context) {
return Container(
decoration: containerColorRadiusBorderWidth(
MyColors.textFieldColor,
8,
MyColors.textFieldColor,
MyColors.white,
0,
MyColors.darkPrimaryColor,
2,
),
margin: EdgeInsets.all(0),
padding: EdgeInsets.only(left: 8, right: 8),

@ -1,5 +1,7 @@
import 'package:car_provider_app/extensions/int_extensions.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:sizer/sizer.dart';
import '../../classes/colors.dart';
import '../../generated/locale_keys.g.dart';
@ -34,21 +36,22 @@ class _LoginEmailTabState extends State<LoginEmailTab> {
width: double.infinity,
height: 45,
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(color: type == ClassType.NUMBER ? MyColors.darkPrimaryColor : Colors.transparent, width: 2),
borderRadius: BorderRadius.all(Radius.circular(8)),
color: type == ClassType.NUMBER ? MyColors.darkPrimaryColor : Colors.grey[200],
// border: Border.all(color: type == ClassType.NUMBER ? MyColors.darkPrimaryColor : Colors.transparent, width: 2),
borderRadius: BorderRadius.all(Radius.circular(0)),
),
child: Center(
child: Text(
LocaleKeys.number.tr(),
style: TextStyle(
color: Colors.black,
color: type == ClassType.NUMBER ? MyColors.white : Colors.black,
),
),
),
),
),
),
12.width,
Expanded(
child: InkWell(
onTap: () {
@ -59,15 +62,15 @@ class _LoginEmailTabState extends State<LoginEmailTab> {
width: double.infinity,
height: 45,
decoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(color: type == ClassType.EMAIL ? MyColors.darkPrimaryColor : Colors.transparent, width: 2),
borderRadius: BorderRadius.all(Radius.circular(8)),
color: type == ClassType.EMAIL ? MyColors.darkPrimaryColor : Colors.grey[200],
// border: Border.all(color: type == ClassType.NUMBER ? MyColors.darkPrimaryColor : Colors.transparent, width: 2),
borderRadius: BorderRadius.all(Radius.circular(0)),
),
child: Center(
child: Text(
LocaleKeys.email.tr(),
style: TextStyle(
color: Colors.black,
color: type == ClassType.EMAIL ? MyColors.white : Colors.black,
),
),
),

@ -26,6 +26,7 @@ class TxtField extends StatelessWidget {
bool? isPasswordEnabled;
Function(String)? onChanged;
TextInputType? keyboardType;
bool isBackgroundEnabled=false;
TxtField({
this.value,
@ -45,6 +46,7 @@ class TxtField extends StatelessWidget {
this.onChanged,
this.isPasswordEnabled,
this.keyboardType,
this.isBackgroundEnabled=false,
});
@override
@ -63,8 +65,8 @@ class TxtField extends StatelessWidget {
Expanded(
child: Container(
decoration: BoxDecoration(
color: MyColors.textFieldColor,
borderRadius: BorderRadius.all(Radius.circular(8)),
color: isBackgroundEnabled?MyColors.textFieldColor:Colors.white,
borderRadius: BorderRadius.all(Radius.circular(0)),
),
child: TextField(
keyboardType: keyboardType,
@ -80,16 +82,18 @@ class TxtField extends StatelessWidget {
alignLabelWithHint: true,
fillColor: Colors.white,
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyColors.darkPrimaryColor, width: isNeedBorder ? 1.0 : 0),
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(color: MyColors.darkPrimaryColor, width: isNeedBorder ? 2.0 : 0),
borderRadius: BorderRadius.circular(0.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyColors.textFieldColor, width: isNeedBorder ? 1.0 : 0),
borderRadius: BorderRadius.circular(8.0),
// borderSide: BorderSide(color: MyColors.textFieldColor, width: isNeedBorder ? 1.0 : 0),
borderSide: BorderSide(color: MyColors.darkPrimaryColor, width: isNeedBorder ? 2.0 : 0),
borderRadius: BorderRadius.circular(0.0),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: MyColors.textFieldColor, width: isNeedBorder ? 1.0 : 0),
borderRadius: BorderRadius.circular(8.0),
// borderSide: BorderSide(color: MyColors.textFieldColor, width: isNeedBorder ? 1.0 : 0),
borderSide: BorderSide(color: MyColors.darkPrimaryColor, width: isNeedBorder ? 2.0 : 0),
borderRadius: BorderRadius.circular(0.0),
),
prefixIcon: prefixData != null
? Icon(

@ -30,6 +30,7 @@
"createPass": "انشاء كلمة مرور جديده *",
"newPassword": " كلمة مرور جديده",
"forgetPassword": "نسيت كلمة المرور",
"forgetPasswordRecover": "نسيت كلمة المرور؟ استعادة",
"editAccount": "تعديل الحساب",
"change": "تغيير",
"verifyAccount": "التحقق من الحساب",
@ -151,10 +152,12 @@
}
},
"reset_locale": "Reset Language",
"insert_otp_code": "الرجاء إدخال رمز OTP",
"insert_otp_code": "ادخل الرمز",
"type_code": "الرجاء كتابة الرمز الذي أرسلناه إلى",
"resend_code": "أعد إرسال الرمز",
"check_code": "التحقق من الشفرة",
"time_will_expire": "سينتهي الوقت في",
"time_will_expire": "إعادة إرسال الرمز بتنسيق",
"sec" : "ثانية",
"no_city_available": "لا توجد مدينة متاحة لهذا البلد",
"branch_created": "تم إنشاء الفرع بنجاح",
"branch_updated": "تم تحديث الفرع بنجاح",

@ -1,10 +1,10 @@
{
"firstTimeLogIn": "First Time Log In",
"signUp": "Sign Up",
"signUp": "Register",
"changeMobile": "Change Mobile",
"notifications": "Notifications",
"general": "General",
"defineLicences": "Define Licences",
"defineLicences": "Register Licences",
"dealershipSettings": "Dealership Settings",
"changePassword": "Change Password",
"retrievePassword": "Retrieve Password",
@ -20,7 +20,7 @@
"confirm": "Confirm",
"completeProfile": "Complete Profile",
"enterNewPhoneNumber": "Enter New Phone Number",
"enterPhoneNumber": "Enter Phone Number",
"enterPhoneNumber": "Enter the login credentials",
"continu": "Continue",
"confirmPassword": "Confirm Password",
"createPassword": "Create Password",
@ -31,6 +31,7 @@
"createPass": "Create Password *",
"newPassword": "New Password",
"forgetPassword": "Forget Password",
"forgetPasswordRecover": "Forget Password? Recover",
"editAccount": "Edit Account",
"change": "Change",
"verifyAccount": "Verify Account",
@ -151,10 +152,12 @@
}
},
"reset_locale": "Reset Language",
"insert_otp_code": "Please insert OTP Code",
"insert_otp_code": "Enter the code",
"type_code": "Please type the code we sent to",
"resend_code": "Resend Code",
"check_code": "Check Code",
"time_will_expire": "Time will Expire in",
"time_will_expire": "Resend code in",
"sec" : "sec",
"no_city_available": "No City Available for this country",
"branch_created": "Branch is successfully created",
"branch_updated": "Branch is successfully Updated",

Loading…
Cancel
Save