feat:login page done

This commit is contained in:
jahongireshonqulov
2025-10-29 12:00:33 +05:00
parent d3ad5b8ddd
commit 2ed2c430c0
27 changed files with 524 additions and 178 deletions

View File

@@ -2,6 +2,7 @@ abstract class AppLocaleKeys {
///Storage keys
static const String language = 'language';
static const String browseSearchHistory = 'browse-search-history';
static const String token = 'token';
static const String fontBold = "fontBold";
static const String fontMedium = "fontMedium";

View File

@@ -71,7 +71,10 @@ extension GetItInjectableX on _i174.GetIt {
() => _i241.LoginUseCase(gh<_i884.AuthRepository>()),
);
gh.factory<_i1065.LoginBloc>(
() => _i1065.LoginBloc(gh<_i241.LoginUseCase>()),
() => _i1065.LoginBloc(
gh<_i241.LoginUseCase>(),
gh<_i321.StorageService>(),
),
);
return this;
}

View File

@@ -63,8 +63,7 @@ import 'app_localizations_uz.dart';
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
AppLocalizations(String locale)
: localeName = intl.Intl.canonicalizedLocale(locale.toString());
AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());
final String localeName;
@@ -72,8 +71,7 @@ abstract class AppLocalizations {
return Localizations.of<AppLocalizations>(context, AppLocalizations);
}
static const LocalizationsDelegate<AppLocalizations> delegate =
_AppLocalizationsDelegate();
static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();
/// A list of this localizations delegate along with the default localizations
/// delegates.
@@ -85,19 +83,18 @@ abstract class AppLocalizations {
/// Additional delegates can be added by appending to this list in
/// MaterialApp. This list does not have to be used at all if a custom list
/// of delegates is preferred or required.
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates =
<LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];
static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
delegate,
GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
];
/// A list of this localizations delegate's supported locales.
static const List<Locale> supportedLocales = <Locale>[
Locale('en'),
Locale('ru'),
Locale('uz'),
Locale('uz')
];
/// No description provided for @useYourTAxiAccount.
@@ -753,10 +750,63 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Language'**
String get language;
/// No description provided for @login.
///
/// In en, this message translates to:
/// **'Login'**
String get login;
/// No description provided for @phone_number.
///
/// In en, this message translates to:
/// **'Phone number'**
String get phone_number;
/// No description provided for @enter_phone_number.
///
/// In en, this message translates to:
/// **'Enter phone number'**
String get enter_phone_number;
/// No description provided for @password.
///
/// In en, this message translates to:
/// **'Password'**
String get password;
/// No description provided for @enter_password.
///
/// In en, this message translates to:
/// **'Enter password'**
String get enter_password;
/// No description provided for @forgot_password.
///
/// In en, this message translates to:
/// **'Forgot password'**
String get forgot_password;
/// No description provided for @continue.
///
/// In en, this message translates to:
/// **'Continue'**
String get Continue;
/// No description provided for @dont_have_account.
///
/// In en, this message translates to:
/// **'Don\'t have an account?'**
String get dont_have_account;
/// No description provided for @sign_up.
///
/// In en, this message translates to:
/// **'SignUp'**
String get sign_up;
}
class _AppLocalizationsDelegate
extends LocalizationsDelegate<AppLocalizations> {
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
const _AppLocalizationsDelegate();
@override
@@ -765,28 +815,26 @@ class _AppLocalizationsDelegate
}
@override
bool isSupported(Locale locale) =>
<String>['en', 'ru', 'uz'].contains(locale.languageCode);
bool isSupported(Locale locale) => <String>['en', 'ru', 'uz'].contains(locale.languageCode);
@override
bool shouldReload(_AppLocalizationsDelegate old) => false;
}
AppLocalizations lookupAppLocalizations(Locale locale) {
// Lookup logic when only language code is specified.
switch (locale.languageCode) {
case 'en':
return AppLocalizationsEn();
case 'ru':
return AppLocalizationsRu();
case 'uz':
return AppLocalizationsUz();
case 'en': return AppLocalizationsEn();
case 'ru': return AppLocalizationsRu();
case 'uz': return AppLocalizationsUz();
}
throw FlutterError(
'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
'an issue with the localizations generation tool. Please file an issue '
'on GitHub with a reproducible sample app and the gen-l10n configuration '
'that was used.',
'that was used.'
);
}

View File

@@ -21,8 +21,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get next => 'Next';
@override
String get contestToGetCallAndSms =>
'By proceeding, you consent to get calls, Whatsapp or SMS messages, including by automated means, from uber and its affiliates to the number provided.';
String get contestToGetCallAndSms => 'By proceeding, you consent to get calls, Whatsapp or SMS messages, including by automated means, from uber and its affiliates to the number provided.';
@override
String get continueWithGoogle => 'Continue with google';
@@ -239,8 +238,7 @@ class AppLocalizationsEn extends AppLocalizations {
String get addItemsStartBasket => 'Add items to start a basket';
@override
String get basketHint =>
'Once you add items from a restaurant or store, your basket will appear here.';
String get basketHint => 'Once you add items from a restaurant or store, your basket will appear here.';
@override
String get startShopping => 'Start Shopping';
@@ -346,4 +344,31 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get language => 'Language';
@override
String get login => 'Login';
@override
String get phone_number => 'Phone number';
@override
String get enter_phone_number => 'Enter phone number';
@override
String get password => 'Password';
@override
String get enter_password => 'Enter password';
@override
String get forgot_password => 'Forgot password';
@override
String get Continue => 'Continue';
@override
String get dont_have_account => 'Don\'t have an account?';
@override
String get sign_up => 'SignUp';
}

View File

@@ -9,8 +9,7 @@ class AppLocalizationsRu extends AppLocalizations {
AppLocalizationsRu([String locale = 'ru']) : super(locale);
@override
String get useYourTAxiAccount =>
'Используйте свой аккаунт Uber, чтобы начать';
String get useYourTAxiAccount => 'Используйте свой аккаунт Uber, чтобы начать';
@override
String get enterYourMobileNumber => 'Введите свой номер телефона';
@@ -22,8 +21,7 @@ class AppLocalizationsRu extends AppLocalizations {
String get next => 'Далее';
@override
String get contestToGetCallAndSms =>
'Продолжая, вы соглашаетесь получать звонки, сообщения WhatsApp или SMS, включая автоматические, от Uber и его партнеров на указанный номер.';
String get contestToGetCallAndSms => 'Продолжая, вы соглашаетесь получать звонки, сообщения WhatsApp или SMS, включая автоматические, от Uber и его партнеров на указанный номер.';
@override
String get continueWithGoogle => 'Продолжить через Google';
@@ -240,8 +238,7 @@ class AppLocalizationsRu extends AppLocalizations {
String get addItemsStartBasket => 'Добавьте товары, чтобы создать корзину';
@override
String get basketHint =>
'Когда вы добавите товары из ресторана или магазина, ваша корзина появится здесь.';
String get basketHint => 'Когда вы добавите товары из ресторана или магазина, ваша корзина появится здесь.';
@override
String get startShopping => 'Начать покупки';
@@ -347,4 +344,31 @@ class AppLocalizationsRu extends AppLocalizations {
@override
String get language => 'Язык';
@override
String get login => 'Login';
@override
String get phone_number => 'Phone number';
@override
String get enter_phone_number => 'Enter phone number';
@override
String get password => 'Password';
@override
String get enter_password => 'Enter password';
@override
String get forgot_password => 'Forgot password';
@override
String get Continue => 'Continue';
@override
String get dont_have_account => 'Don\'t have an account?';
@override
String get sign_up => 'SignUp';
}

View File

@@ -9,8 +9,7 @@ class AppLocalizationsUz extends AppLocalizations {
AppLocalizationsUz([String locale = 'uz']) : super(locale);
@override
String get useYourTAxiAccount =>
'Boshlash uchun Uber hisobingizdan foydalaning';
String get useYourTAxiAccount => 'Boshlash uchun Uber hisobingizdan foydalaning';
@override
String get enterYourMobileNumber => 'Telefon raqamingizni kiriting';
@@ -22,8 +21,7 @@ class AppLocalizationsUz extends AppLocalizations {
String get next => 'Keyingi';
@override
String get contestToGetCallAndSms =>
'Davom etish orqali siz Uber va uning hamkorlaridan avtomatlashtirilgan qongiroqlar, WhatsApp yoki SMS xabarlarini olishga rozilik bildirasiz.';
String get contestToGetCallAndSms => 'Davom etish orqali siz Uber va uning hamkorlaridan avtomatlashtirilgan qongiroqlar, WhatsApp yoki SMS xabarlarini olishga rozilik bildirasiz.';
@override
String get continueWithGoogle => 'Google orqali davom etish';
@@ -240,8 +238,7 @@ class AppLocalizationsUz extends AppLocalizations {
String get addItemsStartBasket => 'Savatni boshlash uchun mahsulot qoshing';
@override
String get basketHint =>
'Restorandan yoki do\'kondan mahsulot qoshsangiz, savatingiz shu yerda paydo boladi.';
String get basketHint => 'Restorandan yoki do\'kondan mahsulot qoshsangiz, savatingiz shu yerda paydo boladi.';
@override
String get startShopping => 'Xaridni boshlash';
@@ -347,4 +344,31 @@ class AppLocalizationsUz extends AppLocalizations {
@override
String get language => 'Til';
@override
String get login => 'Login';
@override
String get phone_number => 'Phone number';
@override
String get enter_phone_number => 'Enter phone number';
@override
String get password => 'Password';
@override
String get enter_password => 'Enter password';
@override
String get forgot_password => 'Forgot password';
@override
String get Continue => 'Continue';
@override
String get dont_have_account => 'Don\'t have an account?';
@override
String get sign_up => 'SignUp';
}

View File

@@ -1,5 +1,4 @@
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:food_delivery_client/core/network/header_interceptors.dart';
import 'package:food_delivery_client/food_delivery_client.dart';
import 'error_handler_interceptor.dart';

View File

@@ -1,5 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:food_delivery_client/feature/auth/presentation/pages/forgot_password_page/forgot_password_page.dart';
import 'package:food_delivery_client/feature/auth/presentation/pages/login_page/login_page.dart';
import 'package:food_delivery_client/feature/auth/presentation/pages/register_page/register_page.dart';
import 'package:food_delivery_client/feature/home/presentation/pages/restaurants_by_category_page/restaurants_by_category_page.dart';
import '../../food_delivery_client.dart';
@@ -18,6 +20,16 @@ class AppRoutes {
pageBuilder: (context, state) => CupertinoPage(child: LoginPage()),
),
GoRoute(
path: Routes.register,
pageBuilder: (context, state) => CupertinoPage(child: RegisterPage()),
),
GoRoute(
path: Routes.forgotPassword,
pageBuilder: (context, state) =>
CupertinoPage(child: ForgotPasswordPage()),
),
GoRoute(
path: Routes.main,
pageBuilder: (context, state) => CupertinoPage(child: MainPage()),

View File

@@ -5,6 +5,7 @@ abstract class Routes {
static const String main = '/main';
static const String categories = '/categories';
static const String filters = '/filters';
static const String browse = '/browse';
static const String browse = '/browse';
static const String forgotPassword = "/forgot-password";
static const String restaurantsByCategory = '/restaurants-by-category';
}

View File

@@ -48,6 +48,7 @@ abstract class AppIcons {
static const String icWallet = "$baseUrl/ic_wallet.svg";
static const String icOrdersSvg = "$baseUrl/ic_orders_svg.svg";
static const String icLanguage = "$baseUrl/ic_language.svg";
static const String icArrowRightLight = "$baseUrl/ic_arrow_right_light.svg";
///.png icons
static const String icBestOverall = "$baseUrl/ic_best.png";

View File

@@ -23,4 +23,5 @@ abstract class AppImages {
static const String imgDesert = "$baseUrl/img_desert.png";
static const String imgPickUp = "$baseUrl/img_pick_up.png";
static const String imgAvatar = "$baseUrl/img_avatar.jpg";
static const String imgBurger2 = "$baseUrl/img_burger2.png";
}

View File

@@ -83,6 +83,19 @@ abstract class AppTextStyles {
fontFamily: _fontMedium,
fontWeight: FontWeight.w500,
);
static const TextStyle size14Bold= TextStyle(
color: _defaultColor,
fontSize: SizesCons.size_14,
fontFamily: _fontBold,
fontWeight: FontWeight.w700,
);
static const TextStyle size15Bold= TextStyle(
color: _defaultColor,
fontSize: SizesCons.size_15,
fontFamily: _fontBold,
fontWeight: FontWeight.w700,
);
static const TextStyle size16Bold= TextStyle(
color: _defaultColor,