diff --git a/assets/images/auth_screen/svg/hide_password.svg b/assets/images/auth_screen/svg/hide_password.svg
new file mode 100644
index 0000000..0313ac2
--- /dev/null
+++ b/assets/images/auth_screen/svg/hide_password.svg
@@ -0,0 +1,7 @@
+
diff --git a/assets/images/auth_screen/svg/show_password.svg b/assets/images/auth_screen/svg/show_password.svg
new file mode 100644
index 0000000..932a449
--- /dev/null
+++ b/assets/images/auth_screen/svg/show_password.svg
@@ -0,0 +1,4 @@
+
diff --git a/assets/images/country_flag/svg/bahrain_flag.svg b/assets/images/country_flag/svg/bahrain_flag.svg
new file mode 100644
index 0000000..25d8620
--- /dev/null
+++ b/assets/images/country_flag/svg/bahrain_flag.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/images/country_flag/svg/kuwait_flag.svg b/assets/images/country_flag/svg/kuwait_flag.svg
new file mode 100644
index 0000000..bbc8958
--- /dev/null
+++ b/assets/images/country_flag/svg/kuwait_flag.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/images/country_flag/svg/oman_flag.svg b/assets/images/country_flag/svg/oman_flag.svg
new file mode 100644
index 0000000..1636dff
--- /dev/null
+++ b/assets/images/country_flag/svg/oman_flag.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/images/country_flag/svg/qatar_flag.svg b/assets/images/country_flag/svg/qatar_flag.svg
new file mode 100644
index 0000000..68b2a67
--- /dev/null
+++ b/assets/images/country_flag/svg/qatar_flag.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/images/country_flag/svg/saudi_arabia_flag.svg b/assets/images/country_flag/svg/saudi_arabia_flag.svg
new file mode 100644
index 0000000..de0b22e
--- /dev/null
+++ b/assets/images/country_flag/svg/saudi_arabia_flag.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/images/country_flag/svg/united_arab_emirates_flag.svg b/assets/images/country_flag/svg/united_arab_emirates_flag.svg
new file mode 100644
index 0000000..56291aa
--- /dev/null
+++ b/assets/images/country_flag/svg/united_arab_emirates_flag.svg
@@ -0,0 +1,9 @@
+
diff --git a/lib/core/styles/app_color.dart b/lib/core/styles/app_color.dart
index 0de7396..b9b6a59 100644
--- a/lib/core/styles/app_color.dart
+++ b/lib/core/styles/app_color.dart
@@ -4,8 +4,6 @@ class AppColor {
//Primary Color
static const Color primaryColor = Color(0xFF002F0F);
- //Secondary Color
-
//Welcome Color
static const Color indicatorActiveColor = Color(0xFF002F0F);
static const Color indicatorInactiveColor = Color(0xFFb8c1bb);
@@ -13,4 +11,21 @@ class AppColor {
//Common Color
static const Color plainWhite = Color(0xFFFFFFFF);
static const Color darkGreyColor = Color(0xFF343434);
+
+ //Auth Color
+ static const Color charcoalColor = Color(0xFF272727);
+ static const Color smokeGrayColor = Color(0xFF787878);
+ static const Color textLabelColor = Color(0xFF363636);
+ static const Color forgotPassButtonColor = Color(0xFF888888);
+
+ //Text Form Field Color
+ static const Color txtBorderColor = Color(0xFFE3E3E3);
+ static const Color txtBorderShadowColor = Color(0xFFE9E9E9);
+ static const Color hintTextColor = Color(0xFF8D8D8D);
+ static const Color txtErrorBorderColor = Color(0xFFF1B9B9);
+ static const Color txtErrorColor = Color(0xFFD21C1C);
+
+ //Button Color
+ static const Color inactiveBtnColor = Color(0xFFD8D8D8);
+ static const Color inactiveBtnTxtColor = Color(0xFF8D8D8D);
}
diff --git a/lib/core/styles/app_images.dart b/lib/core/styles/app_images.dart
index 9627984..f1e8ea6 100644
--- a/lib/core/styles/app_images.dart
+++ b/lib/core/styles/app_images.dart
@@ -10,10 +10,29 @@ class AppImages {
"assets/images/welcome_screen/svg/Tanami_Capital_Logo.svg";
static const String firstWelcome =
"assets/images/welcome_screen/png/First_Onboarding.png";
-
static const String secondWelcome =
"assets/images/welcome_screen/png/Second_Onboarding.png";
-
static const String thirdWelcome =
"assets/images/welcome_screen/png/Third_Onboarding.png";
+
+ //Auth
+ static const String forwardArrow =
+ "assets/images/auth_screen/svg/right_arrow.svg";
+ static const String hidePassword =
+ "assets/images/auth_screen/svg/hide_password.svg";
+ static const String showPassword =
+ "assets/images/auth_screen/svg/show_password.svg";
+
+ //Country Flag
+ static const String bahrainFlag =
+ "assets/images/country_flag/svg/bahrain_flag.svg";
+ static const String kuwaitFlag =
+ "assets/images/auth_screen/svg/kuwait_flag.svg";
+ static const String omanFlag = "assets/images/auth_screen/svg/oman_flag.svg";
+ static const String qatarFlag =
+ "assets/images/country_flag/svg/qatar_flag.svg";
+ static const String saudiArabiaflag =
+ "assets/images/auth_screen/svg/saudi_arabia_flag.svg";
+ static const String unitedArabEmiratesFlag =
+ "assets/images/auth_screen/svg/united_arab_emirates_flag.svg";
}
diff --git a/lib/core/styles/app_text.dart b/lib/core/styles/app_text.dart
index 033f058..c9387f3 100644
--- a/lib/core/styles/app_text.dart
+++ b/lib/core/styles/app_text.dart
@@ -12,6 +12,20 @@ class AppText {
static const String weclomeDescription2Text =
"experienced investment experts with a long-standing track record";
static const String weclomeDescription3Text = "with only SAR 1,000";
- static const String loginText = "Login In";
+ static const String loginText = "Log In";
static const String signUpText = "Sign Up";
+
+ //Login
+ static const String welcomeText = "Welcome back!";
+ static const String pleaseEnterLoginDetails =
+ "Please enter your login details to get started";
+ static const String countryOfResidence = "Country of residence";
+ static const String chooseCountry = "Choose country";
+ static const String phoneNumber = "Phone Number";
+ static const String password = "Password";
+ static const String enterPassword = "Enter password";
+ static const String invalidPhoneNo = "Invalid Phone Number";
+ static const String enterPhoneNo = "Enter phone number";
+ static const String invalidPassword = "Invalid Password";
+ static const String forgorPassword = "Forgot Password";
}
diff --git a/lib/features/countrySelection/presentation/pages/choose_country_screen.dart b/lib/features/countrySelection/presentation/pages/choose_country_screen.dart
new file mode 100644
index 0000000..e69de29
diff --git a/lib/features/login/presentation/bloc/login_bloc.dart b/lib/features/login/presentation/bloc/login_bloc.dart
new file mode 100644
index 0000000..e6ade5b
--- /dev/null
+++ b/lib/features/login/presentation/bloc/login_bloc.dart
@@ -0,0 +1,76 @@
+import 'dart:developer';
+
+import 'package:bloc/bloc.dart';
+import 'package:flutter/material.dart';
+import 'login_event.dart';
+import 'login_state.dart';
+
+class LoginBloc extends Bloc {
+ final GlobalKey formKey = GlobalKey();
+ final TextEditingController countrySelectionTextField =
+ TextEditingController();
+ final TextEditingController phoneNumberTextField = TextEditingController();
+ final TextEditingController passwordTextField = TextEditingController();
+
+ GlobalKey getFormKey() {
+ return formKey;
+ }
+
+ LoginBloc() : super(LoginInitial()) {
+ phoneNumberTextField.addListener(_onFormFieldChanged);
+ passwordTextField.addListener(_onFormFieldChanged);
+ countrySelectionTextField.addListener(_onFormFieldChanged);
+ on((event, emit) async {
+ if (!formKey.currentState!.validate()) {
+ return;
+ }
+ emit(LoginLoading());
+ try {
+ // Simulate API call
+ await Future.delayed(const Duration(seconds: 2));
+ // Replace the next line with actual API call
+ final isSuccess = await _mockLoginApi(
+ event.phoneNumber, event.password, event.countryResidence);
+ if (isSuccess) {
+ emit(LoginSuccess());
+ } else {
+ emit(const LoginFailure(
+ "Login failed. Please check your credentials."));
+ }
+ } catch (e) {
+ emit(LoginFailure(e.toString()));
+ }
+ });
+ }
+ void _onFormFieldChanged() {
+ add(LoginFormChanged());
+ }
+
+ bool areFieldsFilled() {
+ return phoneNumberTextField.text.isNotEmpty &&
+ passwordTextField.text.isNotEmpty &&
+ countrySelectionTextField.text.isNotEmpty;
+ }
+
+ Stream mapEventToState(LoginEvent event) async* {
+ if (event is LoginFormChanged) {
+ yield LoginFieldsState(areFieldsFilled());
+ }
+ }
+
+ // Mock API function, replace with actual API call
+ Future _mockLoginApi(
+ String email,
+ String password,
+ String countryResidence,
+ ) async {
+ return email == "1234567891" && password == "123456";
+ }
+
+ @override
+ Future close() {
+ phoneNumberTextField.dispose();
+ passwordTextField.dispose();
+ return super.close();
+ }
+}
diff --git a/lib/features/login/presentation/bloc/login_event.dart b/lib/features/login/presentation/bloc/login_event.dart
new file mode 100644
index 0000000..aa0ac58
--- /dev/null
+++ b/lib/features/login/presentation/bloc/login_event.dart
@@ -0,0 +1,25 @@
+import 'package:equatable/equatable.dart';
+
+abstract class LoginEvent extends Equatable {
+ const LoginEvent();
+
+ @override
+ List