diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 7753291..eaf1789 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -1,5 +1,8 @@
plugins {
id("com.android.application")
+ // START: FlutterFire Configuration
+ id("com.google.gms.google-services")
+ // END: FlutterFire Configuration
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
@@ -24,7 +27,7 @@ android {
applicationId = "com.example.proxibuy"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
- minSdk = flutter.minSdkVersion
+ minSdk = 23
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
diff --git a/android/app/google-services.json b/android/app/google-services.json
new file mode 100644
index 0000000..9f23e46
--- /dev/null
+++ b/android/app/google-services.json
@@ -0,0 +1,48 @@
+{
+ "project_info": {
+ "project_number": "800272350428",
+ "project_id": "proxibuy-3b5e0",
+ "storage_bucket": "proxibuy-3b5e0.firebasestorage.app"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:800272350428:android:d6af1e013bae09d9c78819",
+ "android_client_info": {
+ "package_name": "com.example.business_panel"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [
+ {
+ "current_key": "AIzaSyCMGweIbZBsFNXabKRJJJcVLPwcmqhuSwg"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": []
+ }
+ }
+ },
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:800272350428:android:6cbc063052753bc9c78819",
+ "android_client_info": {
+ "package_name": "com.example.proxibuy"
+ }
+ },
+ "oauth_client": [],
+ "api_key": [
+ {
+ "current_key": "AIzaSyCMGweIbZBsFNXabKRJJJcVLPwcmqhuSwg"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": []
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 987642b..01490dd 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -3,6 +3,7 @@
+
> getNearbyOffers();
- Future getOfferById(String id); // <<<<<<< جدید
+ Future getOfferById(String id);
}
class MockOfferDataSource implements OfferDataSource {
@@ -71,7 +71,7 @@ class MockOfferDataSource implements OfferDataSource {
name: "رفیقبازی",
description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیقتو بیار و تخفیفتو ببر. دوستای بیشتر، تخفیف بیشتر.",
),
- comments: [ // <-- بخش نظرات اضافه شد
+ comments: [
CommentModel(
id: 'c1',
userName: 'سارا رضایی',
@@ -154,7 +154,7 @@ class MockOfferDataSource implements OfferDataSource {
name: "رفیقبازی",
description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیقتو بیار و تخفیفتو ببر. دوستای بیشتر، تخفیف بیشتر.",
),
- comments: [ // <-- بخش نظرات اضافه شد
+ comments: [
CommentModel(
id: 'c1',
userName: 'سارا رضایی',
@@ -218,7 +218,7 @@ class MockOfferDataSource implements OfferDataSource {
Shift(openAt: '۵ عصر', closeAt: '۱۱ شب'),
],
),
- WorkingHours(day: 'جمعه', shifts: []), // تعطیل
+ WorkingHours(day: 'جمعه', shifts: []),
],
discountType: 'رفیقبازی',
isOpen: true,
@@ -237,7 +237,7 @@ class MockOfferDataSource implements OfferDataSource {
name: "رفیقبازی",
description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیقتو بیار و تخفیفتو ببر. دوستای بیشتر، تخفیف بیشتر.",
),
- comments: [ // <-- بخش نظرات اضافه شد
+ comments: [
CommentModel(
id: 'c1',
userName: 'سارا رضایی',
@@ -320,7 +320,7 @@ class MockOfferDataSource implements OfferDataSource {
name: "رفیقبازی",
description: "یه مهمونی دو نفره، یه تخفیف دوتایی؛ پس رفیقتو بیار و تخفیفتو ببر. دوستای بیشتر، تخفیف بیشتر.",
),
- comments: [ // <-- بخش نظرات اضافه شد
+ comments: [
CommentModel(
id: 'c1',
userName: 'سارا رضایی',
diff --git a/lib/data/repositories/offer_repository.dart b/lib/data/repositories/offer_repository.dart
index 165b18f..7b2557d 100644
--- a/lib/data/repositories/offer_repository.dart
+++ b/lib/data/repositories/offer_repository.dart
@@ -21,7 +21,6 @@ class OfferRepository {
return filteredOffers;
}
Future fetchOfferById(String id) async {
- // در آینده این متد میتواند یک درخواست API برای گرفتن اطلاعات یک محصول خاص ارسال کند
return _offerDataSource.getOfferById(id);
}
}
\ No newline at end of file
diff --git a/lib/domain/entities/category_entity.dart b/lib/domain/entities/category_entity.dart
index 3f3a050..cca25ac 100644
--- a/lib/domain/entities/category_entity.dart
+++ b/lib/domain/entities/category_entity.dart
@@ -1,7 +1,7 @@
import 'package:proxibuy/core/gen/assets.gen.dart';
class CategoryEntity {
- final int id;
+ final String id;
final String name;
final SvgGenImage icon;
diff --git a/lib/domain/entities/onboarding_entity.dart b/lib/domain/entities/onboarding_entity.dart
index 8e50291..8f44575 100644
--- a/lib/domain/entities/onboarding_entity.dart
+++ b/lib/domain/entities/onboarding_entity.dart
@@ -1,4 +1,3 @@
-// lib/domain/entities/onboarding_entity.dart
class OnboardingEntity {
final String imagePath;
final String title;
diff --git a/lib/features/add_photo/cubit/add_photo_cubit.dart b/lib/features/add_photo/cubit/add_photo_cubit.dart
index c23f7ec..3773e3f 100644
--- a/lib/features/add_photo/cubit/add_photo_cubit.dart
+++ b/lib/features/add_photo/cubit/add_photo_cubit.dart
@@ -28,7 +28,6 @@ class AddPhotoCubit extends Cubit {
}
}
- // ✅ متد را طوری تغییر دادیم که منبع عکس را به عنوان ورودی بگیرد
Future pickImage(ImageSource source) async {
final currentState = state;
if (currentState is AddPhotoLoaded) {
diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart
new file mode 100644
index 0000000..402b9ac
--- /dev/null
+++ b/lib/firebase_options.dart
@@ -0,0 +1,62 @@
+// File generated by FlutterFire CLI.
+// ignore_for_file: type=lint
+import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
+import 'package:flutter/foundation.dart'
+ show defaultTargetPlatform, kIsWeb, TargetPlatform;
+
+/// Default [FirebaseOptions] for use with your Firebase apps.
+///
+/// Example:
+/// ```dart
+/// import 'firebase_options.dart';
+/// // ...
+/// await Firebase.initializeApp(
+/// options: DefaultFirebaseOptions.currentPlatform,
+/// );
+/// ```
+class DefaultFirebaseOptions {
+ static FirebaseOptions get currentPlatform {
+ if (kIsWeb) {
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for web - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ }
+ switch (defaultTargetPlatform) {
+ case TargetPlatform.android:
+ return android;
+ case TargetPlatform.iOS:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for ios - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ case TargetPlatform.macOS:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for macos - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ case TargetPlatform.windows:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for windows - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ case TargetPlatform.linux:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions have not been configured for linux - '
+ 'you can reconfigure this by running the FlutterFire CLI again.',
+ );
+ default:
+ throw UnsupportedError(
+ 'DefaultFirebaseOptions are not supported for this platform.',
+ );
+ }
+ }
+
+ static const FirebaseOptions android = FirebaseOptions(
+ apiKey: 'AIzaSyCMGweIbZBsFNXabKRJJJcVLPwcmqhuSwg',
+ appId: '1:800272350428:android:6cbc063052753bc9c78819',
+ messagingSenderId: '800272350428',
+ projectId: 'proxibuy-3b5e0',
+ storageBucket: 'proxibuy-3b5e0.firebasestorage.app',
+ );
+}
diff --git a/lib/main.dart b/lib/main.dart
index bada8f1..3ca6bde 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -1,3 +1,4 @@
+import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -5,17 +6,23 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:proxibuy/data/models/datasources/offer_data_source.dart';
import 'package:proxibuy/data/repositories/offer_repository.dart';
+import 'package:proxibuy/firebase_options.dart';
import 'package:proxibuy/presentation/auth/bloc/auth_bloc.dart';
import 'package:proxibuy/presentation/notification_preferences/bloc/notification_preferences_bloc.dart';
-import 'package:proxibuy/presentation/notification_preferences/bloc/notification_preferences_event.dart';
import 'package:proxibuy/presentation/offer/bloc/offer_bloc.dart';
+import 'package:proxibuy/presentation/pages/offers_page.dart';
+import 'package:proxibuy/presentation/pages/otp_page.dart';
+import 'package:proxibuy/presentation/pages/user_info_page.dart';
import 'package:proxibuy/presentation/reservation/cubit/reservation_cubit.dart';
+// import 'package:proxibuy/services/mqtt_service.dart';
import 'core/config/app_colors.dart';
import 'presentation/pages/onboarding_page.dart';
+import 'package:proxibuy/presentation/pages/splash_screen.dart'; // <--- ایمپورت جدید
-void main() {
+void main() async {
+ WidgetsFlutterBinding.ensureInitialized();
+ await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
Animate.restartOnHotReload = true;
-
runApp(const MyApp());
}
@@ -24,118 +31,136 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return MultiRepositoryProvider(
+ return MultiBlocProvider(
providers: [
+ BlocProvider(
+ create: (context) => AuthBloc()..add(CheckAuthStatusEvent()),
+ ),
RepositoryProvider(
- create:
- (context) =>
- OfferRepository(offerDataSource: MockOfferDataSource()),
+ create: (context) =>
+ OfferRepository(offerDataSource: MockOfferDataSource()),
+ ),
+ BlocProvider(
+ create: (context) => ReservationCubit(),
+ ),
+ BlocProvider(
+ create: (context) => OffersBloc(
+ offerRepository: context.read(),
+ ),
+ ),
+ BlocProvider(
+ create: (context) => NotificationPreferencesBloc(),
),
],
- child: MultiBlocProvider(
- providers: [
- BlocProvider(create: (context) => AuthBloc()),
- BlocProvider(
- create:
- (context) =>
- NotificationPreferencesBloc()..add(LoadCategories()),
- ),
- BlocProvider(
- create:
- (context) => OffersBloc(
- offerRepository: context.read(),
- ),
- ),
- BlocProvider(
- create: (context) => ReservationCubit(),
- ),
+ child: MaterialApp(
+ title: 'Proxibuy',
+ debugShowCheckedModeBanner: false,
+ home: const SplashScreen(), // <--- استفاده از صفحه اسپلش
+ localizationsDelegates: const [
+ GlobalMaterialLocalizations.delegate,
+ GlobalWidgetsLocalizations.delegate,
+ GlobalCupertinoLocalizations.delegate,
],
- child: MaterialApp(
- title: 'Proxibuy',
- debugShowCheckedModeBanner: false,
-
- localizationsDelegates: const [
- GlobalMaterialLocalizations.delegate,
- GlobalWidgetsLocalizations.delegate,
- GlobalCupertinoLocalizations.delegate,
- ],
- supportedLocales: const [Locale('fa')],
- locale: const Locale('fa'),
-
- theme: ThemeData(
- fontFamily: 'Dana',
- scaffoldBackgroundColor: Colors.white,
- colorScheme: ColorScheme.fromSeed(
- seedColor: AppColors.primary,
- primary: AppColors.primary,
- surface: Colors.white,
+ supportedLocales: const [Locale('fa')],
+ locale: const Locale('fa'),
+ theme: ThemeData(
+ fontFamily: 'Dana',
+ scaffoldBackgroundColor: Colors.white,
+ colorScheme: ColorScheme.fromSeed(
+ seedColor: AppColors.primary,
+ primary: AppColors.primary,
+ surface: Colors.white,
+ ),
+ inputDecorationTheme: InputDecorationTheme(
+ filled: true,
+ fillColor: Colors.white,
+ floatingLabelBehavior: FloatingLabelBehavior.always,
+ contentPadding: const EdgeInsets.symmetric(
+ vertical: 18,
+ horizontal: 20,
),
- appBarTheme: const AppBarTheme(
- backgroundColor: AppColors.primary,
- foregroundColor: Colors.white,
- elevation: 0,
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(10),
+ borderSide: const BorderSide(color: AppColors.border),
),
- inputDecorationTheme: InputDecorationTheme(
- filled: true,
- fillColor: Colors.white,
- floatingLabelBehavior: FloatingLabelBehavior.always,
- contentPadding: const EdgeInsets.symmetric(
- vertical: 18,
- horizontal: 20,
- ),
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(10),
- borderSide: const BorderSide(color: AppColors.border),
- ),
- enabledBorder: OutlineInputBorder(
- borderRadius: BorderRadius.circular(10),
- borderSide: const BorderSide(color: AppColors.border),
- ),
- focusedBorder: OutlineInputBorder(
- borderRadius: BorderRadius.circular(10),
- borderSide: const BorderSide(
- color: AppColors.primary,
- width: 2,
- ),
- ),
- labelStyle: const TextStyle(color: Colors.black),
- // ignore: deprecated_member_use
- hintStyle: TextStyle(color: Colors.black.withOpacity(0.8)),
+ enabledBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(10),
+ borderSide: const BorderSide(color: AppColors.border),
),
- outlinedButtonTheme: OutlinedButtonThemeData(
- style: OutlinedButton.styleFrom(
- foregroundColor: Colors.black, // رنگ متن دکمه Outlined
- padding: const EdgeInsets.symmetric(vertical: 16),
- side: const BorderSide(color: Colors.grey),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(50),
- ),
- textStyle: const TextStyle(
- fontFamily: 'Dana',
- fontSize: 16,
- color: Colors.black,
- ),
- ),
+ focusedBorder: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(10),
+ borderSide: const BorderSide(color: AppColors.primary, width: 2),
),
- elevatedButtonTheme: ElevatedButtonThemeData(
- style: ElevatedButton.styleFrom(
- backgroundColor: AppColors.button,
- foregroundColor: Colors.white,
- padding: const EdgeInsets.symmetric(vertical: 16),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(50),
- ),
- textStyle: const TextStyle(
- fontFamily: 'Dana',
- fontSize: 16,
- fontWeight: FontWeight.bold,
- ),
+ labelStyle: const TextStyle(color: Colors.black),
+ // ignore: deprecated_member_use
+ hintStyle: TextStyle(color: Colors.black.withOpacity(0.8)),
+ ),
+ outlinedButtonTheme: OutlinedButtonThemeData(
+ style: OutlinedButton.styleFrom(
+ foregroundColor: Colors.black,
+ padding: const EdgeInsets.symmetric(vertical: 16),
+ side: const BorderSide(color: Colors.grey),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(50),
+ ),
+ textStyle: const TextStyle(
+ fontFamily: 'Dana',
+ fontSize: 16,
+ color: Colors.black,
+ ),
+ ),
+ ),
+ elevatedButtonTheme: ElevatedButtonThemeData(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: AppColors.button,
+ foregroundColor: Colors.white,
+ padding: const EdgeInsets.symmetric(vertical: 16),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(50),
+ ),
+ textStyle: const TextStyle(
+ fontFamily: 'Dana',
+ fontSize: 16,
+ fontWeight: FontWeight.bold,
),
),
),
- home: const OnboardingPage(),
),
),
);
}
}
+
+class AppRouter extends StatelessWidget {
+ const AppRouter({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final authState = context.select((AuthBloc bloc) => bloc.state);
+
+ if (authState is AuthCodeSentSuccess) {
+ return OtpPage(
+ phoneNumber: "+${authState.countryCode}${authState.phone}",
+ phone: authState.phone,
+ countryCode: authState.countryCode,
+ );
+ }
+
+ if (authState is AuthLoading) {
+ final currentState = context.read().state;
+ if (currentState is! AuthCodeSentSuccess) {
+ return const Scaffold(body: Center(child: CircularProgressIndicator()));
+ }
+ }
+
+ if (authState is AuthSuccess) {
+ return const OffersPage();
+ }
+
+ if (authState is AuthNeedsInfo) {
+ return const UserInfoPage();
+ }
+
+ return const OnboardingPage();
+ }
+}
diff --git a/lib/presentation/auth/bloc/auth_bloc.dart b/lib/presentation/auth/bloc/auth_bloc.dart
index 7518fd0..c74894e 100644
--- a/lib/presentation/auth/bloc/auth_bloc.dart
+++ b/lib/presentation/auth/bloc/auth_bloc.dart
@@ -1,43 +1,116 @@
-// ignore: depend_on_referenced_packages
import 'package:bloc/bloc.dart';
-// ignore: depend_on_referenced_packages
+import 'package:dio/dio.dart';
+import 'package:equatable/equatable.dart';
+import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:meta/meta.dart';
-import 'dart:async';
+import 'package:proxibuy/core/config/api_config.dart';
part 'auth_event.dart';
part 'auth_state.dart';
class AuthBloc extends Bloc {
+ late final Dio _dio;
+ final _storage = const FlutterSecureStorage();
+
AuthBloc() : super(AuthInitial()) {
- on((event, emit) async {
- emit(AuthLoading());
- await Future.delayed(const Duration(seconds: 1));
- if (event.phoneNumber.isNotEmpty) {
- emit(AuthCodeSentSuccess());
- } else {
- emit(AuthFailure('شماره موبایل معتبر نیست.'));
- }
- });
+ _dio = Dio();
+ _dio.interceptors.add(
+ LogInterceptor(
+ requestHeader: true,
+ requestBody: true,
+ responseBody: true,
+ error: true,
+ ),
+ );
- on((event, emit) async {
- emit(AuthLoading());
- await Future.delayed(const Duration(seconds: 1));
- if (event.otp == '12345') {
- emit(AuthVerified());
- } else {
- emit(AuthFailure('کد تایید صحیح نمیباشد.'));
- }
- });
-
- on((event, emit) async {
- emit(AuthLoading());
- await Future.delayed(const Duration(milliseconds: 500));
-
- if (event.name.trim().isEmpty) {
- emit(AuthFailure('لطفاً نام خود را وارد کنید.'));
- } else {
- emit(UserInfoSaved());
- }
- });
+ on(_onCheckAuthStatus);
+ on(_onSendOTP);
+ on(_onVerifyOTP);
+ on(_onUpdateUserInfo);
+ on(_onLogout);
}
-}
+
+ Future _onCheckAuthStatus(
+ CheckAuthStatusEvent event, Emitter emit) async {
+ final token = await _storage.read(key: 'accessToken');
+ if (token != null && token.isNotEmpty) {
+ emit(AuthSuccess());
+ } else {
+ emit(AuthInitial());
+ }
+ }
+
+ Future _onSendOTP(SendOTPEvent event, Emitter emit) async {
+ emit(AuthLoading());
+ try {
+ final response = await _dio.post(
+ ApiConfig.baseUrl + ApiConfig.sendCode,
+ data: {'Phone': event.phoneNumber, 'Code': event.countryCode},
+ );
+ if (response.statusCode == 200) {
+ emit(AuthCodeSentSuccess(
+ phone: event.phoneNumber,
+ countryCode: event.countryCode,
+ ));
+ } else {
+ emit(AuthFailure(response.data['message'] ?? 'خطایی رخ داد'));
+ }
+ } on DioException catch (e) {
+ emit(AuthFailure(e.response?.data['message'] ?? 'خطا در ارتباط با سرور'));
+ }
+ }
+
+ Future _onVerifyOTP(VerifyOTPEvent event, Emitter emit) async {
+ emit(AuthLoading());
+ try {
+ final response = await _dio.post(
+ ApiConfig.baseUrl + ApiConfig.verifyCode,
+ data: {
+ 'Phone': event.phoneNumber,
+ 'Code': event.countryCode,
+ 'OTP': event.otp,
+ },
+ );
+ if (response.statusCode == 200) {
+ final accessToken = response.data['data']['accessToken'];
+ final refreshToken = response.data['data']['refreshToken'];
+ await _storage.write(key: 'accessToken', value: accessToken);
+ await _storage.write(key: 'refreshToken', value: refreshToken);
+ emit(AuthNeedsInfo());
+ } else {
+ emit(AuthFailure(response.data['message'] ?? 'کد صحیح نیست'));
+ }
+ } on DioException catch (e) {
+ emit(AuthFailure(e.response?.data['message'] ?? 'خطایی در سرور رخ داد'));
+ }
+ }
+
+ Future _onUpdateUserInfo(
+ UpdateUserInfoEvent event, Emitter emit) async {
+ emit(AuthLoading());
+ try {
+ final token = await _storage.read(key: 'accessToken');
+ if (token == null) {
+ emit(const AuthFailure("شما وارد نشدهاید."));
+ return;
+ }
+ final response = await _dio.post(
+ ApiConfig.baseUrl + ApiConfig.updateUser,
+ data: {'Name': event.name, 'Gender': event.gender},
+ options: Options(headers: {'Authorization': 'Bearer $token'}),
+ );
+ if (response.statusCode == 200) {
+ emit(AuthSuccess());
+ } else {
+ emit(AuthFailure(response.data['message'] ?? 'خطا در ثبت اطلاعات'));
+ }
+ } on DioException catch (e) {
+ emit(AuthFailure(e.response?.data['message'] ?? 'خطا در ارتباط با سرور'));
+ }
+ }
+
+ Future _onLogout(LogoutEvent event, Emitter emit) async {
+ await _storage.deleteAll();
+ emit(AuthInitial());
+ }
+}
\ No newline at end of file
diff --git a/lib/presentation/auth/bloc/auth_event.dart b/lib/presentation/auth/bloc/auth_event.dart
index ae15595..e7ca537 100644
--- a/lib/presentation/auth/bloc/auth_event.dart
+++ b/lib/presentation/auth/bloc/auth_event.dart
@@ -1,4 +1,3 @@
-
part of 'auth_bloc.dart';
@immutable
@@ -6,19 +5,24 @@ abstract class AuthEvent {}
class SendOTPEvent extends AuthEvent {
final String phoneNumber;
-
- SendOTPEvent({required this.phoneNumber});
+ final String countryCode;
+ SendOTPEvent({required this.phoneNumber, required this.countryCode});
}
class VerifyOTPEvent extends AuthEvent {
+ final String phoneNumber;
+ final String countryCode;
final String otp;
-
- VerifyOTPEvent({required this.otp});
+ VerifyOTPEvent({required this.phoneNumber, required this.countryCode, required this.otp});
}
-class SaveUserInfoEvent extends AuthEvent {
+class CheckAuthStatusEvent extends AuthEvent {}
+
+class LogoutEvent extends AuthEvent {}
+
+class UpdateUserInfoEvent extends AuthEvent {
final String name;
final String gender;
- SaveUserInfoEvent({required this.name, required this.gender});
-}
+ UpdateUserInfoEvent({required this.name, required this.gender});
+}
\ No newline at end of file
diff --git a/lib/presentation/auth/bloc/auth_state.dart b/lib/presentation/auth/bloc/auth_state.dart
index 497c253..5eff7bc 100644
--- a/lib/presentation/auth/bloc/auth_state.dart
+++ b/lib/presentation/auth/bloc/auth_state.dart
@@ -1,21 +1,34 @@
-
part of 'auth_bloc.dart';
@immutable
-abstract class AuthState {}
+abstract class AuthState extends Equatable {
+ const AuthState();
+ @override
+ List