diff --git a/assets/images/bc_Intro.svg b/assets/images/bc_Intro.svg new file mode 100644 index 0000000..deb4ffa --- /dev/null +++ b/assets/images/bc_Intro.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/bn_Intro.png b/assets/images/bn_Intro.png new file mode 100644 index 0000000..8c342d2 Binary files /dev/null and b/assets/images/bn_Intro.png differ diff --git a/assets/images/bn_car.jpeg b/assets/images/bn_car.jpeg new file mode 100644 index 0000000..5a6bd85 Binary files /dev/null and b/assets/images/bn_car.jpeg differ diff --git a/assets/images/ic_engine.png b/assets/images/ic_engine.png new file mode 100644 index 0000000..0256ff0 Binary files /dev/null and b/assets/images/ic_engine.png differ diff --git a/assets/images/ic_logo_white.png b/assets/images/ic_logo_white.png new file mode 100644 index 0000000..779fda4 Binary files /dev/null and b/assets/images/ic_logo_white.png differ diff --git a/lib/pages/dashboard/dashboard_page.dart b/lib/pages/dashboard/dashboard_page.dart index ab2b9a4..734436b 100644 --- a/lib/pages/dashboard/dashboard_page.dart +++ b/lib/pages/dashboard/dashboard_page.dart @@ -75,7 +75,9 @@ class _DashboardPageState extends State { width: double.infinity, height: 200, color: MyColors.darkPrimaryColor.withOpacity(0.01), - child: Image.network(ApiConsts.baseUrlServices + AppState().getUser.data!.userInfo!.userImageUrl.toString()), + child: Image.network( + ApiConsts.baseUrlServices + AppState().getUser.data!.userInfo!.userImageUrl.toString(), + ), ), Positioned( top: 10, @@ -215,8 +217,8 @@ class _DashboardPageState extends State { showDialog( context: context, builder: (context) => AlertDialog(content: Text("Choose image source"), actions: [ - FlatButton(child: Text("Camera"), onPressed: () => cameraImage()), - FlatButton(child: Text("Gallery"), onPressed: () => gallaryImage()), + TextButton(child: Text("Camera"), onPressed: () => cameraImage()), + TextButton(child: Text("Gallery"), onPressed: () => gallaryImage()), ]), // .then((ImageSource source) async { // if (source != null) { diff --git a/lib/pages/user/edit_account_page.dart b/lib/pages/user/edit_account_page.dart index a64cc73..d2eac6e 100644 --- a/lib/pages/user/edit_account_page.dart +++ b/lib/pages/user/edit_account_page.dart @@ -52,7 +52,12 @@ class _EditAccountPageState extends State { ), 20.width, Expanded(child: LocaleKeys.changePassword.tr().toText12(isBold: true)), - RaisedButton( + ElevatedButton( + style: ElevatedButton.styleFrom( + textStyle: const TextStyle(color: Colors.white), + backgroundColor: MyColors.darkPrimaryColor, + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + ), onPressed: () { navigateWithName(context, AppRoutes.changePassword); }, @@ -63,9 +68,6 @@ class _EditAccountPageState extends State { fontWeight: FontWeight.w600, ), ), - color: MyColors.darkPrimaryColor, - textColor: Colors.white, - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), ), ], ), @@ -83,7 +85,12 @@ class _EditAccountPageState extends State { Expanded(child: LocaleKeys.changeMobile.tr().toText12(isBold: true)), LocaleKeys.verify.tr().toText12(color: Colors.green), 20.width, - RaisedButton( + ElevatedButton( + style: ElevatedButton.styleFrom( + textStyle: const TextStyle(color: Colors.white), + backgroundColor: MyColors.darkPrimaryColor, + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + ), onPressed: () { navigateWithName(context, AppRoutes.changeMobilePage); }, @@ -94,9 +101,6 @@ class _EditAccountPageState extends State { fontWeight: FontWeight.w600, ), ), - textColor: Colors.white, - color: MyColors.darkPrimaryColor, - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), ) ], ), @@ -121,20 +125,23 @@ class _EditAccountPageState extends State { }, ), 20.width, - RaisedButton( - onPressed: () { - navigateWithName(context, AppRoutes.changeEmailPage); - }, - child: Text( - LocaleKeys.change.tr(), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - ), + ElevatedButton( + style: ElevatedButton.styleFrom( + textStyle: const TextStyle(color: Colors.white), + backgroundColor: MyColors.darkPrimaryColor, + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8), + ), + onPressed: () { + navigateWithName(context, AppRoutes.changeEmailPage); + }, + child: Text( + LocaleKeys.change.tr(), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, ), - textColor: Colors.white, - color: MyColors.darkPrimaryColor, - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8)) + ), + ), ], ) diff --git a/lib/pages/user/forget_password_page.dart b/lib/pages/user/forget_password_page.dart index d5ddf79..f7900dc 100644 --- a/lib/pages/user/forget_password_page.dart +++ b/lib/pages/user/forget_password_page.dart @@ -41,7 +41,7 @@ class _ForgetPasswordPageState extends State { int otpType = 1; String userName = ""; - ClassType type = ClassType.NUMBER; + ClassType type = ClassType.EMAIL; Country? _country; String countryCode = ""; diff --git a/lib/pages/user/login_with_password_page.dart b/lib/pages/user/login_with_password_page.dart index 709a61b..da2f09d 100644 --- a/lib/pages/user/login_with_password_page.dart +++ b/lib/pages/user/login_with_password_page.dart @@ -38,7 +38,7 @@ class LoginWithPassword extends StatefulWidget { class _LoginWithPasswordState extends State { int otpType = 1; - ClassType type = ClassType.NUMBER; + ClassType type = ClassType.EMAIL; String phoneNum = "", password = ""; String email = ""; String countryCode = ""; @@ -68,11 +68,11 @@ class _LoginWithPasswordState extends State { children: [ 12.height, LocaleKeys.login.tr().toText20(), - 20.height, - (type == ClassType.NUMBER ? LocaleKeys.enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr()).toText14( - color: MyColors.lightTextColor, - textAlign: TextAlign.center, - ), + // 20.height, + // (type == ClassType.NUMBER ? LocaleKeys.enterPhoneNumber.tr() : LocaleKeys.enterEmail.tr()).toText14( + // color: MyColors.lightTextColor, + // textAlign: TextAlign.center, + // ), 30.height, LoginEmailTab( onSelection: (ClassType type) { @@ -107,12 +107,14 @@ class _LoginWithPasswordState extends State { ), ], ), - 10.height, + 20.height, + LocaleKeys.forgetPasswordQ.tr().toText14(color: MyColors.textColor), ShowFillButton( - title: LocaleKeys.forgetPasswordRecover.tr(), + title: LocaleKeys.recover.tr(), isFlatButton: true, isBold: false, fontSize: 14, + maxHeight: 24, txtColor: MyColors.darkPrimaryColor, onPressed: () { navigateWithName(context, AppRoutes.forgetPassword); @@ -163,5 +165,4 @@ class _LoginWithPasswordState extends State { Utils.showToast(user.message ?? ""); } } - } diff --git a/lib/pages/user/register_page.dart b/lib/pages/user/register_page.dart index a0e94fe..e2ea98c 100644 --- a/lib/pages/user/register_page.dart +++ b/lib/pages/user/register_page.dart @@ -25,10 +25,18 @@ import 'package:flutter/material.dart'; import '../../classes/colors.dart'; -class RegisterPage extends StatelessWidget { +class RegisterPage extends StatefulWidget { + @override + State createState() => _RegisterPageState(); +} + +class _RegisterPageState extends State { String phoneNum = "", countryCode = ""; + int role = 4, countryId = -1; + TextEditingController emailController = TextEditingController(); + @override Widget build(BuildContext context) { return Scaffold( @@ -46,9 +54,9 @@ class RegisterPage extends StatelessWidget { LocaleKeys.signUp.tr().toText20(), 20.height, LocaleKeys.enterPhoneNumber.tr().toText14( - color: MyColors.lightTextColor, - textAlign: TextAlign.center, - ), + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), 30.height, FutureBuilder( future: UserApiClent().getAllCountries(), @@ -66,14 +74,20 @@ class RegisterPage extends StatelessWidget { return Column( children: [ LocaleKeys.selectYourCountry.tr().toText14( - color: MyColors.lightTextColor, - textAlign: TextAlign.center, - ), + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), 10.height, - DropdownField((DropValue value) { - countryCode = value.subValue; - countryId = value.id; - }, list: dropList, hint: LocaleKeys.chooseCountry.tr()), + DropdownField( + (DropValue value) { + setState(() { + countryCode = value.subValue; + countryId = value.id; + }); + }, + list: dropList, + hint: LocaleKeys.chooseCountry.tr(), + ), ], ); } else { @@ -83,17 +97,60 @@ class RegisterPage extends StatelessWidget { ), 18.height, LocaleKeys.enterPhoneForVerfication.tr().toText14( - color: MyColors.lightTextColor, - textAlign: TextAlign.center, - ), + color: MyColors.lightTextColor, + textAlign: TextAlign.center, + ), 10.height, - TxtField( - hint: "5********", - value: phoneNum, - onChanged: (v) { - phoneNum = v; - }, + Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + mExp(1), + Expanded( + flex: 3, + child: Row( + children: [ + Text( + (countryCode.isEmpty ? "+00" : "+" + countryCode), + style: const TextStyle( + fontSize: 20, + color: MyColors.black, + fontWeight: FontWeight.bold, + ), + ), + const Text( + " | ", + style: TextStyle( + fontSize: 20, + color: MyColors.black, + fontWeight: FontWeight.bold, + ), + ), + Flexible( + child: TextField( + controller: emailController, + onChanged: (v){ + phoneNum=v; + }, + style: const TextStyle( + fontSize: 20, + color: MyColors.black, + ), + decoration: const InputDecoration( + hintStyle: TextStyle(color: MyColors.lightTextColor, fontSize: 20), + hintText: "546758594", + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + ), + ), + ), + ], + ), + ), + mExp(1), + ], ), + 40.height, ShowFillButton( title: LocaleKeys.continu.tr(), @@ -138,15 +195,15 @@ class RegisterPage extends StatelessWidget { bool isValid = true; if (role == -1) { Utils.showToast(LocaleKeys.selectProviderRole.tr()); - //("Please select Provider Role"); + //("Please select Provider Role"); isValid = false; } else if (countryCode.isEmpty) { Utils.showToast(LocaleKeys.selectCountryCode.tr()); - //("Please select Country Code"); + //("Please select Country Code"); isValid = false; } else if (phoneNum.isEmpty) { Utils.showToast(LocaleKeys.addPhoneNo.tr()); - //("Please add Phone No"); + //("Please add Phone No"); isValid = false; } return isValid; diff --git a/lib/pages/user/register_selection_page.dart b/lib/pages/user/register_selection_page.dart index b4d04f3..db3d46b 100644 --- a/lib/pages/user/register_selection_page.dart +++ b/lib/pages/user/register_selection_page.dart @@ -21,14 +21,20 @@ class RegisterSelectionPage extends StatelessWidget { body: Container( width: double.infinity, height: double.infinity, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/bn_Intro.png"), + fit: BoxFit.cover, + ), + ), child: Column( children: [ - mFlex(4), + mFlex(6), SvgPicture.asset("assets/images/logo.svg"), - mFlex(3), + mFlex(4), LocaleKeys.welcomeMessage.tr().toText20(), LocaleKeys.welcomeDes.tr().toText14(color: MyColors.lightTextColor), - mFlex(4), + mFlex(1), ShowFillButton( title: LocaleKeys.login.tr(), maxWidth: double.infinity, @@ -58,11 +64,19 @@ class RegisterSelectionPage extends StatelessWidget { // navigateWithName(context, AppRoutes.forgetPassword); // }, // ), - mFlex(2), - SvgPicture.asset( - "assets/images/bn_logo.svg", - fit: BoxFit.cover, - ) + mFlex(3), + TextButton( + onPressed: () {}, + child: const Text( + "Continue as Guest", + style: TextStyle( + color: MyColors.darkPrimaryColor, + fontWeight: FontWeight.bold, + decoration: TextDecoration.underline, + ), + ), + ), + mFlex(3), ], ), ), diff --git a/lib/widgets/tab/login_email_tab.dart b/lib/widgets/tab/login_email_tab.dart index ad435fc..498c5ce 100644 --- a/lib/widgets/tab/login_email_tab.dart +++ b/lib/widgets/tab/login_email_tab.dart @@ -17,7 +17,7 @@ class LoginEmailTab extends StatefulWidget { } class _LoginEmailTabState extends State { - ClassType type = ClassType.NUMBER; + ClassType type = ClassType.EMAIL; @override Widget build(BuildContext context) { @@ -28,22 +28,22 @@ class _LoginEmailTabState extends State { Expanded( child: InkWell( onTap: () { - type = ClassType.NUMBER; - widget.onSelection(ClassType.NUMBER); + type = ClassType.EMAIL; + widget.onSelection(ClassType.EMAIL); }, child: Container( width: double.infinity, height: 45, decoration: BoxDecoration( - color: type == ClassType.NUMBER ? MyColors.darkPrimaryColor : Colors.grey[200], + 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.number.tr(), + LocaleKeys.email.tr(), style: TextStyle( - color: type == ClassType.NUMBER ? MyColors.white : Colors.black, + color: type == ClassType.EMAIL ? MyColors.white : Colors.black, ), ), ), @@ -54,28 +54,29 @@ class _LoginEmailTabState extends State { Expanded( child: InkWell( onTap: () { - type = ClassType.EMAIL; - widget.onSelection(ClassType.EMAIL); + type = ClassType.NUMBER; + widget.onSelection(ClassType.NUMBER); }, child: Container( width: double.infinity, height: 45, decoration: BoxDecoration( - color: type == ClassType.EMAIL ? MyColors.darkPrimaryColor : Colors.grey[200], + 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.email.tr(), + LocaleKeys.phoneNumber.tr(), style: TextStyle( - color: type == ClassType.EMAIL ? MyColors.white : Colors.black, + color: type == ClassType.NUMBER ? MyColors.white : Colors.black, ), ), ), ), ), ), + ], ), ); diff --git a/resources/langs/ar-SA.json b/resources/langs/ar-SA.json index 1f20fa6..4d542b6 100644 --- a/resources/langs/ar-SA.json +++ b/resources/langs/ar-SA.json @@ -116,6 +116,9 @@ "welcomeDes": "أنت مكان واحد لكل ما تحتاجه سيارتك", "log_in": "تسجيل الدخول", "send": "إرسال", + "phoneNumber": "رقم الهاتف", + "forgetPasswordQ": "نسيت كلمة المرور؟", + "recover": "استعادة", "retrivePassword": "استرجع كلمة المرور بإحدى الطرق التالية", "retriveOnPhone": "سوف نرسل الاختيار إلى رقم هاتفك المحمول المسجل", "retriveOnEmail": "سوف نرسل الاختيار إلى عنوان بريدك الإلكتروني المسجل", diff --git a/resources/langs/en-US.json b/resources/langs/en-US.json index defb8ef..ae3143e 100644 --- a/resources/langs/en-US.json +++ b/resources/langs/en-US.json @@ -116,6 +116,9 @@ "welcomeDes": "You one stop place all your car needs", "log_in": "Log In", "send": "Send", + "phoneNumber": "Phone Number", + "forgetPasswordQ": "Forget Password?", + "recover": "Recover", "retrivePassword": "Retrive password by one of following method", "retriveOnPhone": "We will send the opt to your registered mobile number", "retriveOnEmail": "We will send the opt to your registered email address",