diff --git a/client-mobile/.gitignore b/client-mobile/.gitignore
new file mode 100644
index 0000000..24476c5
--- /dev/null
+++ b/client-mobile/.gitignore
@@ -0,0 +1,44 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
+.DS_Store
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
+
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
+
+# Flutter/Dart/Pub related
+**/doc/api/
+**/ios/Flutter/.last_build_id
+.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+.packages
+.pub-cache/
+.pub/
+/build/
+
+# Symbolication related
+app.*.symbols
+
+# Obfuscation related
+app.*.map.json
+
+# Android Studio will place build artifacts here
+/android/app/debug
+/android/app/profile
+/android/app/release
diff --git a/client-mobile/.metadata b/client-mobile/.metadata
new file mode 100644
index 0000000..0b450df
--- /dev/null
+++ b/client-mobile/.metadata
@@ -0,0 +1,20 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: 5f120583730cedfc49a0e0872e3e1ac7a0a3c8eb
+ channel: stable
+
+project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: 5f120583730cedfc49a0e0872e3e1ac7a0a3c8eb
+ base_revision: 5f120583730cedfc49a0e0872e3e1ac7a0a3c8eb
+ - platform: android
+ create_revision: 5f120583730cedfc49a0e0872e3e1ac7a0a3c8eb
+ base_revision: 5f120583730cedfc49a0e0872e3e1ac7a0a3c8eb
diff --git a/client-mobile/GETTING_STARTED.md b/client-mobile/GETTING_STARTED.md
new file mode 100644
index 0000000..995429f
--- /dev/null
+++ b/client-mobile/GETTING_STARTED.md
@@ -0,0 +1,125 @@
+# Инструкция по запуску проекта
+
+## Предварительные требования
+
+1. **Flutter SDK** (версия 3.0.0 или выше)
+ - Установите Flutter: https://docs.flutter.dev/get-started/install
+ - Проверьте установку: `flutter doctor`
+
+2. **Android Studio** или **VS Code** с Flutter плагином
+
+3. **Android SDK** (для сборки под Android)
+ - MinSDK: 21
+ - TargetSDK: 34
+ - CompileSDK: 34
+
+## Установка зависимостей
+
+```bash
+cd client-mobile
+flutter pub get
+```
+
+## Генерация кода
+
+Проект использует code generation для:
+- Freezed (immutable модели)
+- AutoRoute (навигация)
+- Isar (база данных)
+
+```bash
+dart run build_runner build --delete-conflicting-outputs
+```
+
+Для автоматической генерации при изменениях:
+```bash
+dart run build_runner watch --delete-conflicting-outputs
+```
+
+## Запуск приложения
+
+### Android
+```bash
+flutter run
+```
+
+### Сборка релиза
+```bash
+flutter build apk --release
+```
+
+## Структура проекта
+
+```
+lib/
+├── core/ # Общие компоненты
+│ ├── constants/ # Константы приложения
+│ ├── errors/ # Обработка ошибок
+│ ├── network/ # Сетевой клиент (Dio)
+│ └── theme/ # Темы оформления
+├── features/ # Функциональные модули
+│ ├── auth/ # Аутентификация
+│ │ ├── data/ # Data layer
+│ │ ├── domain/ # Domain layer
+│ │ └── presentation/ # UI layer (BLoC, страницы)
+│ ├── chat/ # Чаты
+│ ├── profile/ # Профиль
+│ └── settings/ # Настройки
+└── internal/ # Внутренняя конфигурация
+ ├── di/ # Dependency Injection (GetIt)
+ └── router/ # Навигация
+```
+
+## Архитектура
+
+Проект следует принципам **Clean Architecture**:
+
+- **Domain Layer**: Бизнес-логика, entities, use cases, repository interfaces
+- **Data Layer**: Реализации репозиториев, datasources, модели
+- **Presentation Layer**: UI, BLoC, страницы, виджеты
+
+## State Management
+
+Используется **flutter_bloc** для управления состоянием:
+- Каждый feature имеет свой BLoC
+- События и состояния генерируются через Freezed
+- DI через GetIt
+
+## Навигация
+
+Используется **auto_route** для декларативной навигации.
+
+## База данных
+
+Используется **Isar** - быстрая NoSQL база данных для Flutter.
+
+## Сетевые запросы
+
+- **Dio** для REST API запросов
+- **SignalR** для real-time обновлений
+
+## Тестирование
+
+```bash
+flutter test
+```
+
+## Полезные команды
+
+```bash
+# Анализ кода
+flutter analyze
+
+# Форматирование
+dart format .
+
+# Очистка
+flutter clean
+
+# Проверка зависимостей
+flutter pub outdated
+```
+
+## Контакты
+
+Для вопросов и предложений обращайтесь к команде разработки.
diff --git a/client-mobile/README.md b/client-mobile/README.md
new file mode 100644
index 0000000..711e161
--- /dev/null
+++ b/client-mobile/README.md
@@ -0,0 +1,51 @@
+# Messenger App
+
+A Telegram-like mobile messenger application built with Flutter using Clean Architecture.
+
+## Architecture
+
+This project follows Clean Architecture principles with the following structure:
+
+```
+lib/
+├── core/ # Core utilities, network, errors, theme
+├── features/ # Feature modules (auth, chat, profile, settings)
+│ └── [feature]/
+│ ├── data/ # Data layer (repositories, datasources)
+│ ├── domain/ # Domain layer (entities, usecases, repository interfaces)
+│ └── presentation/ # UI layer (bloc, pages, widgets)
+└── internal/ # App configuration, DI, routing
+```
+
+## Dependencies
+
+- **State Management**: flutter_bloc, bloc
+- **Architecture & DI**: get_it, injectable, freezed_annotation
+- **Network & Real-time**: dio, signalr_netcore
+- **Navigation**: auto_route
+- **Database**: isar, isar_flutter_libs
+
+## Setup
+
+1. Install Flutter dependencies:
+ ```bash
+ flutter pub get
+ ```
+
+2. Generate code:
+ ```bash
+ dart run build_runner build --delete-conflicting-outputs
+ ```
+
+3. Run the app:
+ ```bash
+ flutter run
+ ```
+
+## Features
+
+- Authentication (Login/Register)
+- Real-time Chat
+- Contacts
+- Profile Management
+- Settings
diff --git a/client-mobile/analysis_options.yaml b/client-mobile/analysis_options.yaml
new file mode 100644
index 0000000..30e5539
--- /dev/null
+++ b/client-mobile/analysis_options.yaml
@@ -0,0 +1,8 @@
+include: package:flutter_lints/flutter.yaml
+
+linter:
+ rules:
+ prefer_const_constructors: true
+ prefer_const_declarations: true
+ avoid_print: false
+ prefer_single_quotes: true
diff --git a/client-mobile/android/.gitignore b/client-mobile/android/.gitignore
new file mode 100644
index 0000000..bc2100d
--- /dev/null
+++ b/client-mobile/android/.gitignore
@@ -0,0 +1,7 @@
+gradle-wrapper.jar
+/.gradle
+/captures/
+/gradlew
+/gradlew.bat
+/local.properties
+GeneratedPluginRegistrant.java
diff --git a/client-mobile/android/app/build.gradle b/client-mobile/android/app/build.gradle
new file mode 100644
index 0000000..ce1ce77
--- /dev/null
+++ b/client-mobile/android/app/build.gradle
@@ -0,0 +1,69 @@
+plugins {
+ id "com.android.application"
+ id "kotlin-android"
+ id "dev.flutter.flutter-gradle-plugin"
+}
+
+def localProperties = new Properties()
+def localPropertiesFile = rootProject.file('local.properties')
+if (localPropertiesFile.exists()) {
+ localPropertiesFile.withReader('UTF-8') { reader ->
+ localProperties.load(reader)
+ }
+}
+
+def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
+if (flutterVersionCode == null) {
+ flutterVersionCode = '1'
+}
+
+def flutterVersionName = localProperties.getProperty('flutter.versionName')
+if (flutterVersionName == null) {
+ flutterVersionName = '1.0'
+}
+
+android {
+ namespace "com.example.messenger_app"
+ compileSdkVersion 35
+ ndkVersion flutter.ndkVersion
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
+ }
+
+ kotlinOptions {
+ jvmTarget = '17'
+ }
+
+ sourceSets {
+ main.java.srcDirs += 'src/main/kotlin'
+ }
+
+ defaultConfig {
+ applicationId "com.example.messenger_app"
+ minSdkVersion flutter.minSdkVersion
+ targetSdkVersion 35
+ versionCode flutterVersionCode.toInteger()
+ versionName flutterVersionName
+ multiDexEnabled true
+ }
+
+ packagingOptions {
+ resources {
+ excludes += '/META-INF/{AL2.0,LGPL2.1}'
+ }
+ }
+
+ buildTypes {
+ release {
+ signingConfig signingConfigs.debug
+ }
+ }
+}
+
+flutter {
+ source '../..'
+}
+
+dependencies {}
diff --git a/client-mobile/android/app/src/main/AndroidManifest.xml b/client-mobile/android/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..7aa4ea5
--- /dev/null
+++ b/client-mobile/android/app/src/main/AndroidManifest.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/client-mobile/android/app/src/main/kotlin/com/example/messenger_app/MainActivity.kt b/client-mobile/android/app/src/main/kotlin/com/example/messenger_app/MainActivity.kt
new file mode 100644
index 0000000..cacc070
--- /dev/null
+++ b/client-mobile/android/app/src/main/kotlin/com/example/messenger_app/MainActivity.kt
@@ -0,0 +1,5 @@
+package com.example.messenger_app
+
+import io.flutter.embedding.android.FlutterActivity
+
+class MainActivity: FlutterActivity()
diff --git a/client-mobile/android/app/src/main/res/drawable/launch_background.xml b/client-mobile/android/app/src/main/res/drawable/launch_background.xml
new file mode 100644
index 0000000..5782842
--- /dev/null
+++ b/client-mobile/android/app/src/main/res/drawable/launch_background.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/client-mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.xml b/client-mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.xml
new file mode 100644
index 0000000..a917906
--- /dev/null
+++ b/client-mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/client-mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.xml b/client-mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.xml
new file mode 100644
index 0000000..a917906
--- /dev/null
+++ b/client-mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/client-mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.xml b/client-mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.xml
new file mode 100644
index 0000000..a917906
--- /dev/null
+++ b/client-mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/client-mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.xml b/client-mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.xml
new file mode 100644
index 0000000..a917906
--- /dev/null
+++ b/client-mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/client-mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml b/client-mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml
new file mode 100644
index 0000000..a917906
--- /dev/null
+++ b/client-mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
diff --git a/client-mobile/android/app/src/main/res/values/styles.xml b/client-mobile/android/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..ff81bae
--- /dev/null
+++ b/client-mobile/android/app/src/main/res/values/styles.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/client-mobile/android/build.gradle b/client-mobile/android/build.gradle
new file mode 100644
index 0000000..619f1e0
--- /dev/null
+++ b/client-mobile/android/build.gradle
@@ -0,0 +1,25 @@
+allprojects {
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.buildDir = '../build'
+
+subprojects {
+ project.buildDir = "${rootProject.buildDir}/${project.name}"
+ afterEvaluate { project ->
+ if (project.hasProperty("android")) {
+ project.android {
+ if (namespace == null) {
+ namespace project.group
+ }
+ }
+ }
+ }
+}
+
+tasks.register("clean", Delete) {
+ delete rootProject.buildDir
+}
diff --git a/client-mobile/android/gradle.properties b/client-mobile/android/gradle.properties
new file mode 100644
index 0000000..2597170
--- /dev/null
+++ b/client-mobile/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/client-mobile/android/gradle/wrapper/gradle-wrapper.properties b/client-mobile/android/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..3c85cfe
--- /dev/null
+++ b/client-mobile/android/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
diff --git a/client-mobile/android/settings.gradle b/client-mobile/android/settings.gradle
new file mode 100644
index 0000000..4f52071
--- /dev/null
+++ b/client-mobile/android/settings.gradle
@@ -0,0 +1,25 @@
+pluginManagement {
+ def flutterSdkPath = {
+ def properties = new Properties()
+ file("local.properties").withInputStream { properties.load(it) }
+ def flutterSdkPath = properties.getProperty("flutter.sdk")
+ assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
+ return flutterSdkPath
+ }()
+
+ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
+
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+
+plugins {
+ id "dev.flutter.flutter-plugin-loader" version "1.0.0"
+ id "com.android.application" version "8.6.0" apply false
+ id "org.jetbrains.kotlin.android" version "2.1.0" apply false
+}
+
+include ":app"
diff --git a/client-mobile/ios/Flutter/Generated.xcconfig b/client-mobile/ios/Flutter/Generated.xcconfig
new file mode 100644
index 0000000..e2bb368
--- /dev/null
+++ b/client-mobile/ios/Flutter/Generated.xcconfig
@@ -0,0 +1,14 @@
+// This is a generated file; do not edit or check into version control.
+FLUTTER_ROOT=C:\src\flutter
+FLUTTER_APPLICATION_PATH=E:\GIT\forkmessager\client-mobile
+COCOAPODS_PARALLEL_CODE_SIGN=true
+FLUTTER_TARGET=lib\main.dart
+FLUTTER_BUILD_DIR=build
+FLUTTER_BUILD_NAME=1.0.0
+FLUTTER_BUILD_NUMBER=1
+EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
+EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
+DART_OBFUSCATION=false
+TRACK_WIDGET_CREATION=true
+TREE_SHAKE_ICONS=false
+PACKAGE_CONFIG=.dart_tool/package_config.json
diff --git a/client-mobile/ios/Flutter/ephemeral/flutter_lldb_helper.py b/client-mobile/ios/Flutter/ephemeral/flutter_lldb_helper.py
new file mode 100644
index 0000000..a88caf9
--- /dev/null
+++ b/client-mobile/ios/Flutter/ephemeral/flutter_lldb_helper.py
@@ -0,0 +1,32 @@
+#
+# Generated file, do not edit.
+#
+
+import lldb
+
+def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
+ """Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
+ base = frame.register["x0"].GetValueAsAddress()
+ page_len = frame.register["x1"].GetValueAsUnsigned()
+
+ # Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
+ # first page to see if handled it correctly. This makes diagnosing
+ # misconfiguration (e.g. missing breakpoint) easier.
+ data = bytearray(page_len)
+ data[0:8] = b'IHELPED!'
+
+ error = lldb.SBError()
+ frame.GetThread().GetProcess().WriteMemory(base, data, error)
+ if not error.Success():
+ print(f'Failed to write into {base}[+{page_len}]', error)
+ return
+
+def __lldb_init_module(debugger: lldb.SBDebugger, _):
+ target = debugger.GetDummyTarget()
+ # Caveat: must use BreakpointCreateByRegEx here and not
+ # BreakpointCreateByName. For some reasons callback function does not
+ # get carried over from dummy target for the later.
+ bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
+ bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
+ bp.SetAutoContinue(True)
+ print("-- LLDB integration loaded --")
diff --git a/client-mobile/ios/Flutter/ephemeral/flutter_lldbinit b/client-mobile/ios/Flutter/ephemeral/flutter_lldbinit
new file mode 100644
index 0000000..e3ba6fb
--- /dev/null
+++ b/client-mobile/ios/Flutter/ephemeral/flutter_lldbinit
@@ -0,0 +1,5 @@
+#
+# Generated file, do not edit.
+#
+
+command script import --relative-to-command-file flutter_lldb_helper.py
diff --git a/client-mobile/ios/Flutter/flutter_export_environment.sh b/client-mobile/ios/Flutter/flutter_export_environment.sh
new file mode 100644
index 0000000..be71c03
--- /dev/null
+++ b/client-mobile/ios/Flutter/flutter_export_environment.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# This is a generated file; do not edit or check into version control.
+export "FLUTTER_ROOT=C:\src\flutter"
+export "FLUTTER_APPLICATION_PATH=E:\GIT\forkmessager\client-mobile"
+export "COCOAPODS_PARALLEL_CODE_SIGN=true"
+export "FLUTTER_TARGET=lib\main.dart"
+export "FLUTTER_BUILD_DIR=build"
+export "FLUTTER_BUILD_NAME=1.0.0"
+export "FLUTTER_BUILD_NUMBER=1"
+export "DART_OBFUSCATION=false"
+export "TRACK_WIDGET_CREATION=true"
+export "TREE_SHAKE_ICONS=false"
+export "PACKAGE_CONFIG=.dart_tool/package_config.json"
diff --git a/client-mobile/ios/Runner/AppDelegate.swift b/client-mobile/ios/Runner/AppDelegate.swift
new file mode 100644
index 0000000..70693e4
--- /dev/null
+++ b/client-mobile/ios/Runner/AppDelegate.swift
@@ -0,0 +1,13 @@
+import UIKit
+import Flutter
+
+@UIApplicationMain
+@objc class AppDelegate: FlutterAppDelegate {
+ override func application(
+ _ application: UIApplication,
+ didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
+ ) -> Bool {
+ GeneratedPluginRegistrant.register(with: self)
+ return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+ }
+}
diff --git a/client-mobile/ios/Runner/GeneratedPluginRegistrant.h b/client-mobile/ios/Runner/GeneratedPluginRegistrant.h
new file mode 100644
index 0000000..7a89092
--- /dev/null
+++ b/client-mobile/ios/Runner/GeneratedPluginRegistrant.h
@@ -0,0 +1,19 @@
+//
+// Generated file. Do not edit.
+//
+
+// clang-format off
+
+#ifndef GeneratedPluginRegistrant_h
+#define GeneratedPluginRegistrant_h
+
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface GeneratedPluginRegistrant : NSObject
++ (void)registerWithRegistry:(NSObject*)registry;
+@end
+
+NS_ASSUME_NONNULL_END
+#endif /* GeneratedPluginRegistrant_h */
diff --git a/client-mobile/ios/Runner/GeneratedPluginRegistrant.m b/client-mobile/ios/Runner/GeneratedPluginRegistrant.m
new file mode 100644
index 0000000..35361ae
--- /dev/null
+++ b/client-mobile/ios/Runner/GeneratedPluginRegistrant.m
@@ -0,0 +1,28 @@
+//
+// Generated file. Do not edit.
+//
+
+// clang-format off
+
+#import "GeneratedPluginRegistrant.h"
+
+#if __has_include()
+#import
+#else
+@import isar_flutter_libs;
+#endif
+
+#if __has_include()
+#import
+#else
+@import shared_preferences_foundation;
+#endif
+
+@implementation GeneratedPluginRegistrant
+
++ (void)registerWithRegistry:(NSObject*)registry {
+ [IsarFlutterLibsPlugin registerWithRegistrar:[registry registrarForPlugin:@"IsarFlutterLibsPlugin"]];
+ [SharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"SharedPreferencesPlugin"]];
+}
+
+@end
diff --git a/client-mobile/l10n.yaml b/client-mobile/l10n.yaml
new file mode 100644
index 0000000..3a803ff
--- /dev/null
+++ b/client-mobile/l10n.yaml
@@ -0,0 +1,4 @@
+arb-dir: l10n
+template-arb-file: app_ru.arb
+output-localization-file: app_localizations.dart
+output-class: AppLocalizations
diff --git a/client-mobile/l10n/app_en.arb b/client-mobile/l10n/app_en.arb
new file mode 100644
index 0000000..ae47019
--- /dev/null
+++ b/client-mobile/l10n/app_en.arb
@@ -0,0 +1,51 @@
+{
+ "@@locale": "en",
+ "appTitle": "Messenger",
+ "chats": "Chats",
+ "contacts": "Contacts",
+ "settings": "Settings",
+ "login": "Login",
+ "email": "Email",
+ "password": "Password",
+ "name": "Name",
+ "loginButton": "Sign In",
+ "register": "Register",
+ "noAccount": "No account? Sign up",
+ "logout": "Sign Out",
+ "serverSettings": "Server Settings",
+ "apiUrl": "API URL",
+ "apiUrlHint": "https://api.example.com",
+ "save": "Save",
+ "serverConfig": "Server Configuration",
+ "system": "System",
+ "stories": "Stories",
+ "chatsModule": "Chats",
+ "messages": "Messages",
+ "calls": "Calls",
+ "klipy": "Klipy",
+ "import": "Import",
+ "federation": "Federation",
+ "domainUrl": "Domain",
+ "enableRegistration": "Registration Enabled",
+ "enabled": "Enabled",
+ "disabled": "Disabled",
+ "language": "Language",
+ "russian": "Русский",
+ "english": "English",
+ "notifications": "Notifications",
+ "privacy": "Privacy",
+ "soundsAndVibration": "Sounds & Vibration",
+ "dataAndStorage": "Data & Storage",
+ "aboutApp": "About App",
+ "help": "Help",
+ "version": "Version",
+ "loading": "Loading...",
+ "error": "Error",
+ "retry": "Retry",
+ "noChats": "No chats yet",
+ "inDevelopment": "In development",
+ "user": "User",
+ "edit": "Edit",
+ "serverConnectionError": "Server connection error",
+ "settingsSaved": "Settings saved"
+}
diff --git a/client-mobile/l10n/app_localizations.dart b/client-mobile/l10n/app_localizations.dart
new file mode 100644
index 0000000..044ad11
--- /dev/null
+++ b/client-mobile/l10n/app_localizations.dart
@@ -0,0 +1,421 @@
+import 'dart:async';
+
+import 'package:flutter/foundation.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_localizations/flutter_localizations.dart';
+import 'package:intl/intl.dart' as intl;
+
+import 'app_localizations_en.dart';
+import 'app_localizations_ru.dart';
+
+// ignore_for_file: type=lint
+
+/// Callers can lookup localized strings with an instance of AppLocalizations
+/// returned by `AppLocalizations.of(context)`.
+///
+/// Applications need to include `AppLocalizations.delegate()` in their app's
+/// `localizationDelegates` list, and the locales they support in the app's
+/// `supportedLocales` list. For example:
+///
+/// ```dart
+/// import 'l10n/app_localizations.dart';
+///
+/// return MaterialApp(
+/// localizationsDelegates: AppLocalizations.localizationsDelegates,
+/// supportedLocales: AppLocalizations.supportedLocales,
+/// home: MyApplicationHome(),
+/// );
+/// ```
+///
+/// ## Update pubspec.yaml
+///
+/// Please make sure to update your pubspec.yaml to include the following
+/// packages:
+///
+/// ```yaml
+/// dependencies:
+/// # Internationalization support.
+/// flutter_localizations:
+/// sdk: flutter
+/// intl: any # Use the pinned version from flutter_localizations
+///
+/// # Rest of dependencies
+/// ```
+///
+/// ## iOS Applications
+///
+/// iOS applications define key application metadata, including supported
+/// locales, in an Info.plist file that is built into the application bundle.
+/// To configure the locales supported by your app, you’ll need to edit this
+/// file.
+///
+/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
+/// Then, in the Project Navigator, open the Info.plist file under the Runner
+/// project’s Runner folder.
+///
+/// Next, select the Information Property List item, select Add Item from the
+/// Editor menu, then select Localizations from the pop-up menu.
+///
+/// Select and expand the newly-created Localizations item then, for each
+/// locale your application supports, add a new item and select the locale
+/// you wish to add from the pop-up menu in the Value field. This list should
+/// be consistent with the languages listed in the AppLocalizations.supportedLocales
+/// property.
+abstract class AppLocalizations {
+ AppLocalizations(String locale)
+ : localeName = intl.Intl.canonicalizedLocale(locale.toString());
+
+ final String localeName;
+
+ static AppLocalizations? of(BuildContext context) {
+ return Localizations.of(context, AppLocalizations);
+ }
+
+ static const LocalizationsDelegate delegate =
+ _AppLocalizationsDelegate();
+
+ /// A list of this localizations delegate along with the default localizations
+ /// delegates.
+ ///
+ /// Returns a list of localizations delegates containing this delegate along with
+ /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
+ /// and GlobalWidgetsLocalizations.delegate.
+ ///
+ /// 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> localizationsDelegates =
+ >[
+ delegate,
+ GlobalMaterialLocalizations.delegate,
+ GlobalCupertinoLocalizations.delegate,
+ GlobalWidgetsLocalizations.delegate,
+ ];
+
+ /// A list of this localizations delegate's supported locales.
+ static const List supportedLocales = [
+ Locale('en'),
+ Locale('ru')
+ ];
+
+ /// No description provided for @appTitle.
+ ///
+ /// In ru, this message translates to:
+ /// **'Мессенджер'**
+ String get appTitle;
+
+ /// No description provided for @chats.
+ ///
+ /// In ru, this message translates to:
+ /// **'Чаты'**
+ String get chats;
+
+ /// No description provided for @contacts.
+ ///
+ /// In ru, this message translates to:
+ /// **'Контакты'**
+ String get contacts;
+
+ /// No description provided for @settings.
+ ///
+ /// In ru, this message translates to:
+ /// **'Настройки'**
+ String get settings;
+
+ /// No description provided for @login.
+ ///
+ /// In ru, this message translates to:
+ /// **'Вход'**
+ String get login;
+
+ /// No description provided for @email.
+ ///
+ /// In ru, this message translates to:
+ /// **'Email'**
+ String get email;
+
+ /// No description provided for @password.
+ ///
+ /// In ru, this message translates to:
+ /// **'Пароль'**
+ String get password;
+
+ /// No description provided for @name.
+ ///
+ /// In ru, this message translates to:
+ /// **'Имя'**
+ String get name;
+
+ /// No description provided for @loginButton.
+ ///
+ /// In ru, this message translates to:
+ /// **'Войти'**
+ String get loginButton;
+
+ /// No description provided for @register.
+ ///
+ /// In ru, this message translates to:
+ /// **'Зарегистрироваться'**
+ String get register;
+
+ /// No description provided for @noAccount.
+ ///
+ /// In ru, this message translates to:
+ /// **'Нет аккаунта? Зарегистрироваться'**
+ String get noAccount;
+
+ /// No description provided for @logout.
+ ///
+ /// In ru, this message translates to:
+ /// **'Выйти из аккаунта'**
+ String get logout;
+
+ /// No description provided for @serverSettings.
+ ///
+ /// In ru, this message translates to:
+ /// **'Настройки сервера'**
+ String get serverSettings;
+
+ /// No description provided for @apiUrl.
+ ///
+ /// In ru, this message translates to:
+ /// **'Адрес API'**
+ String get apiUrl;
+
+ /// No description provided for @apiUrlHint.
+ ///
+ /// In ru, this message translates to:
+ /// **'https://api.example.com'**
+ String get apiUrlHint;
+
+ /// No description provided for @save.
+ ///
+ /// In ru, this message translates to:
+ /// **'Сохранить'**
+ String get save;
+
+ /// No description provided for @serverConfig.
+ ///
+ /// In ru, this message translates to:
+ /// **'Конфигурация сервера'**
+ String get serverConfig;
+
+ /// No description provided for @system.
+ ///
+ /// In ru, this message translates to:
+ /// **'Система'**
+ String get system;
+
+ /// No description provided for @stories.
+ ///
+ /// In ru, this message translates to:
+ /// **'Истории'**
+ String get stories;
+
+ /// No description provided for @chatsModule.
+ ///
+ /// In ru, this message translates to:
+ /// **'Чаты'**
+ String get chatsModule;
+
+ /// No description provided for @messages.
+ ///
+ /// In ru, this message translates to:
+ /// **'Сообщения'**
+ String get messages;
+
+ /// No description provided for @calls.
+ ///
+ /// In ru, this message translates to:
+ /// **'Звонки'**
+ String get calls;
+
+ /// No description provided for @klipy.
+ ///
+ /// In ru, this message translates to:
+ /// **'Клипы'**
+ String get klipy;
+
+ /// No description provided for @import.
+ ///
+ /// In ru, this message translates to:
+ /// **'Импорт'**
+ String get import;
+
+ /// No description provided for @federation.
+ ///
+ /// In ru, this message translates to:
+ /// **'Федерация'**
+ String get federation;
+
+ /// No description provided for @domainUrl.
+ ///
+ /// In ru, this message translates to:
+ /// **'Домен'**
+ String get domainUrl;
+
+ /// No description provided for @enableRegistration.
+ ///
+ /// In ru, this message translates to:
+ /// **'Регистрация включена'**
+ String get enableRegistration;
+
+ /// No description provided for @enabled.
+ ///
+ /// In ru, this message translates to:
+ /// **'Включено'**
+ String get enabled;
+
+ /// No description provided for @disabled.
+ ///
+ /// In ru, this message translates to:
+ /// **'Отключено'**
+ String get disabled;
+
+ /// No description provided for @language.
+ ///
+ /// In ru, this message translates to:
+ /// **'Язык'**
+ String get language;
+
+ /// No description provided for @russian.
+ ///
+ /// In ru, this message translates to:
+ /// **'Русский'**
+ String get russian;
+
+ /// No description provided for @english.
+ ///
+ /// In ru, this message translates to:
+ /// **'English'**
+ String get english;
+
+ /// No description provided for @notifications.
+ ///
+ /// In ru, this message translates to:
+ /// **'Уведомления'**
+ String get notifications;
+
+ /// No description provided for @privacy.
+ ///
+ /// In ru, this message translates to:
+ /// **'Конфиденциальность'**
+ String get privacy;
+
+ /// No description provided for @soundsAndVibration.
+ ///
+ /// In ru, this message translates to:
+ /// **'Звуки и вибрация'**
+ String get soundsAndVibration;
+
+ /// No description provided for @dataAndStorage.
+ ///
+ /// In ru, this message translates to:
+ /// **'Данные и память'**
+ String get dataAndStorage;
+
+ /// No description provided for @aboutApp.
+ ///
+ /// In ru, this message translates to:
+ /// **'О приложении'**
+ String get aboutApp;
+
+ /// No description provided for @help.
+ ///
+ /// In ru, this message translates to:
+ /// **'Помощь'**
+ String get help;
+
+ /// No description provided for @version.
+ ///
+ /// In ru, this message translates to:
+ /// **'Версия'**
+ String get version;
+
+ /// No description provided for @loading.
+ ///
+ /// In ru, this message translates to:
+ /// **'Загрузка...'**
+ String get loading;
+
+ /// No description provided for @error.
+ ///
+ /// In ru, this message translates to:
+ /// **'Ошибка'**
+ String get error;
+
+ /// No description provided for @retry.
+ ///
+ /// In ru, this message translates to:
+ /// **'Повторить'**
+ String get retry;
+
+ /// No description provided for @noChats.
+ ///
+ /// In ru, this message translates to:
+ /// **'У вас пока нет чатов'**
+ String get noChats;
+
+ /// No description provided for @inDevelopment.
+ ///
+ /// In ru, this message translates to:
+ /// **'Функция в разработке'**
+ String get inDevelopment;
+
+ /// No description provided for @user.
+ ///
+ /// In ru, this message translates to:
+ /// **'Пользователь'**
+ String get user;
+
+ /// No description provided for @edit.
+ ///
+ /// In ru, this message translates to:
+ /// **'Редактировать'**
+ String get edit;
+
+ /// No description provided for @serverConnectionError.
+ ///
+ /// In ru, this message translates to:
+ /// **'Ошибка подключения к серверу'**
+ String get serverConnectionError;
+
+ /// No description provided for @settingsSaved.
+ ///
+ /// In ru, this message translates to:
+ /// **'Настройки сохранены'**
+ String get settingsSaved;
+}
+
+class _AppLocalizationsDelegate
+ extends LocalizationsDelegate {
+ const _AppLocalizationsDelegate();
+
+ @override
+ Future load(Locale locale) {
+ return SynchronousFuture(lookupAppLocalizations(locale));
+ }
+
+ @override
+ bool isSupported(Locale locale) =>
+ ['en', 'ru'].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();
+ }
+
+ 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.');
+}
diff --git a/client-mobile/l10n/app_localizations_en.dart b/client-mobile/l10n/app_localizations_en.dart
new file mode 100644
index 0000000..25720e4
--- /dev/null
+++ b/client-mobile/l10n/app_localizations_en.dart
@@ -0,0 +1,154 @@
+// ignore: unused_import
+import 'package:intl/intl.dart' as intl;
+import 'app_localizations.dart';
+
+// ignore_for_file: type=lint
+
+/// The translations for English (`en`).
+class AppLocalizationsEn extends AppLocalizations {
+ AppLocalizationsEn([String locale = 'en']) : super(locale);
+
+ @override
+ String get appTitle => 'Messenger';
+
+ @override
+ String get chats => 'Chats';
+
+ @override
+ String get contacts => 'Contacts';
+
+ @override
+ String get settings => 'Settings';
+
+ @override
+ String get login => 'Login';
+
+ @override
+ String get email => 'Email';
+
+ @override
+ String get password => 'Password';
+
+ @override
+ String get name => 'Name';
+
+ @override
+ String get loginButton => 'Sign In';
+
+ @override
+ String get register => 'Register';
+
+ @override
+ String get noAccount => 'No account? Sign up';
+
+ @override
+ String get logout => 'Sign Out';
+
+ @override
+ String get serverSettings => 'Server Settings';
+
+ @override
+ String get apiUrl => 'API URL';
+
+ @override
+ String get apiUrlHint => 'https://api.example.com';
+
+ @override
+ String get save => 'Save';
+
+ @override
+ String get serverConfig => 'Server Configuration';
+
+ @override
+ String get system => 'System';
+
+ @override
+ String get stories => 'Stories';
+
+ @override
+ String get chatsModule => 'Chats';
+
+ @override
+ String get messages => 'Messages';
+
+ @override
+ String get calls => 'Calls';
+
+ @override
+ String get klipy => 'Klipy';
+
+ @override
+ String get import => 'Import';
+
+ @override
+ String get federation => 'Federation';
+
+ @override
+ String get domainUrl => 'Domain';
+
+ @override
+ String get enableRegistration => 'Registration Enabled';
+
+ @override
+ String get enabled => 'Enabled';
+
+ @override
+ String get disabled => 'Disabled';
+
+ @override
+ String get language => 'Language';
+
+ @override
+ String get russian => 'Русский';
+
+ @override
+ String get english => 'English';
+
+ @override
+ String get notifications => 'Notifications';
+
+ @override
+ String get privacy => 'Privacy';
+
+ @override
+ String get soundsAndVibration => 'Sounds & Vibration';
+
+ @override
+ String get dataAndStorage => 'Data & Storage';
+
+ @override
+ String get aboutApp => 'About App';
+
+ @override
+ String get help => 'Help';
+
+ @override
+ String get version => 'Version';
+
+ @override
+ String get loading => 'Loading...';
+
+ @override
+ String get error => 'Error';
+
+ @override
+ String get retry => 'Retry';
+
+ @override
+ String get noChats => 'No chats yet';
+
+ @override
+ String get inDevelopment => 'In development';
+
+ @override
+ String get user => 'User';
+
+ @override
+ String get edit => 'Edit';
+
+ @override
+ String get serverConnectionError => 'Server connection error';
+
+ @override
+ String get settingsSaved => 'Settings saved';
+}
diff --git a/client-mobile/l10n/app_localizations_ru.dart b/client-mobile/l10n/app_localizations_ru.dart
new file mode 100644
index 0000000..d3fab57
--- /dev/null
+++ b/client-mobile/l10n/app_localizations_ru.dart
@@ -0,0 +1,154 @@
+// ignore: unused_import
+import 'package:intl/intl.dart' as intl;
+import 'app_localizations.dart';
+
+// ignore_for_file: type=lint
+
+/// The translations for Russian (`ru`).
+class AppLocalizationsRu extends AppLocalizations {
+ AppLocalizationsRu([String locale = 'ru']) : super(locale);
+
+ @override
+ String get appTitle => 'Мессенджер';
+
+ @override
+ String get chats => 'Чаты';
+
+ @override
+ String get contacts => 'Контакты';
+
+ @override
+ String get settings => 'Настройки';
+
+ @override
+ String get login => 'Вход';
+
+ @override
+ String get email => 'Email';
+
+ @override
+ String get password => 'Пароль';
+
+ @override
+ String get name => 'Имя';
+
+ @override
+ String get loginButton => 'Войти';
+
+ @override
+ String get register => 'Зарегистрироваться';
+
+ @override
+ String get noAccount => 'Нет аккаунта? Зарегистрироваться';
+
+ @override
+ String get logout => 'Выйти из аккаунта';
+
+ @override
+ String get serverSettings => 'Настройки сервера';
+
+ @override
+ String get apiUrl => 'Адрес API';
+
+ @override
+ String get apiUrlHint => 'https://api.example.com';
+
+ @override
+ String get save => 'Сохранить';
+
+ @override
+ String get serverConfig => 'Конфигурация сервера';
+
+ @override
+ String get system => 'Система';
+
+ @override
+ String get stories => 'Истории';
+
+ @override
+ String get chatsModule => 'Чаты';
+
+ @override
+ String get messages => 'Сообщения';
+
+ @override
+ String get calls => 'Звонки';
+
+ @override
+ String get klipy => 'Клипы';
+
+ @override
+ String get import => 'Импорт';
+
+ @override
+ String get federation => 'Федерация';
+
+ @override
+ String get domainUrl => 'Домен';
+
+ @override
+ String get enableRegistration => 'Регистрация включена';
+
+ @override
+ String get enabled => 'Включено';
+
+ @override
+ String get disabled => 'Отключено';
+
+ @override
+ String get language => 'Язык';
+
+ @override
+ String get russian => 'Русский';
+
+ @override
+ String get english => 'English';
+
+ @override
+ String get notifications => 'Уведомления';
+
+ @override
+ String get privacy => 'Конфиденциальность';
+
+ @override
+ String get soundsAndVibration => 'Звуки и вибрация';
+
+ @override
+ String get dataAndStorage => 'Данные и память';
+
+ @override
+ String get aboutApp => 'О приложении';
+
+ @override
+ String get help => 'Помощь';
+
+ @override
+ String get version => 'Версия';
+
+ @override
+ String get loading => 'Загрузка...';
+
+ @override
+ String get error => 'Ошибка';
+
+ @override
+ String get retry => 'Повторить';
+
+ @override
+ String get noChats => 'У вас пока нет чатов';
+
+ @override
+ String get inDevelopment => 'Функция в разработке';
+
+ @override
+ String get user => 'Пользователь';
+
+ @override
+ String get edit => 'Редактировать';
+
+ @override
+ String get serverConnectionError => 'Ошибка подключения к серверу';
+
+ @override
+ String get settingsSaved => 'Настройки сохранены';
+}
diff --git a/client-mobile/l10n/app_ru.arb b/client-mobile/l10n/app_ru.arb
new file mode 100644
index 0000000..af3143b
--- /dev/null
+++ b/client-mobile/l10n/app_ru.arb
@@ -0,0 +1,51 @@
+{
+ "@@locale": "ru",
+ "appTitle": "Мессенджер",
+ "chats": "Чаты",
+ "contacts": "Контакты",
+ "settings": "Настройки",
+ "login": "Вход",
+ "email": "Email",
+ "password": "Пароль",
+ "name": "Имя",
+ "loginButton": "Войти",
+ "register": "Зарегистрироваться",
+ "noAccount": "Нет аккаунта? Зарегистрироваться",
+ "logout": "Выйти из аккаунта",
+ "serverSettings": "Настройки сервера",
+ "apiUrl": "Адрес API",
+ "apiUrlHint": "https://api.example.com",
+ "save": "Сохранить",
+ "serverConfig": "Конфигурация сервера",
+ "system": "Система",
+ "stories": "Истории",
+ "chatsModule": "Чаты",
+ "messages": "Сообщения",
+ "calls": "Звонки",
+ "klipy": "Клипы",
+ "import": "Импорт",
+ "federation": "Федерация",
+ "domainUrl": "Домен",
+ "enableRegistration": "Регистрация включена",
+ "enabled": "Включено",
+ "disabled": "Отключено",
+ "language": "Язык",
+ "russian": "Русский",
+ "english": "English",
+ "notifications": "Уведомления",
+ "privacy": "Конфиденциальность",
+ "soundsAndVibration": "Звуки и вибрация",
+ "dataAndStorage": "Данные и память",
+ "aboutApp": "О приложении",
+ "help": "Помощь",
+ "version": "Версия",
+ "loading": "Загрузка...",
+ "error": "Ошибка",
+ "retry": "Повторить",
+ "noChats": "У вас пока нет чатов",
+ "inDevelopment": "Функция в разработке",
+ "user": "Пользователь",
+ "edit": "Редактировать",
+ "serverConnectionError": "Ошибка подключения к серверу",
+ "settingsSaved": "Настройки сохранены"
+}
diff --git a/client-mobile/lib/app.dart b/client-mobile/lib/app.dart
new file mode 100644
index 0000000..9cf15ca
--- /dev/null
+++ b/client-mobile/lib/app.dart
@@ -0,0 +1,56 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'core/theme/app_theme.dart';
+import 'features/auth/presentation/bloc/auth_bloc.dart';
+import 'features/auth/presentation/bloc/auth_event.dart';
+import 'features/chat/presentation/bloc/chat_bloc.dart';
+import 'features/chat/presentation/bloc/chat_event.dart';
+import 'features/settings/presentation/bloc/settings_bloc.dart';
+import 'features/settings/presentation/bloc/settings_event.dart';
+import 'features/settings/presentation/bloc/settings_state.dart';
+import 'features/settings/presentation/l10n/app_localizations.dart';
+import 'internal/di/injection_container.dart' as di;
+import 'internal/router/main_screen.dart';
+
+class MessengerApp extends StatelessWidget {
+ const MessengerApp({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return MultiBlocProvider(
+ providers: [
+ BlocProvider(
+ create: (_) => di.sl()..add(const SettingsEvent.started()),
+ ),
+ BlocProvider(
+ create: (_) => di.sl()..add(const AuthEvent.authChecked()),
+ ),
+ BlocProvider(
+ create: (_) => di.sl()..add(const ChatEvent.started()),
+ ),
+ ],
+ child: BlocBuilder(
+ builder: (context, settingsState) {
+ final languageCode = settingsState is SettingsLoaded
+ ? settingsState.languageCode
+ : 'ru';
+
+ return MaterialApp(
+ title: 'Messenger',
+ debugShowCheckedModeBanner: false,
+ theme: AppTheme.lightTheme,
+ darkTheme: AppTheme.darkTheme,
+ themeMode: ThemeMode.system,
+ locale: Locale(languageCode),
+ supportedLocales: const [
+ Locale('ru'),
+ Locale('en'),
+ ],
+ localizationsDelegates: AppLocalizations.localizationsDelegates,
+ home: const MainScreen(),
+ );
+ },
+ ),
+ );
+ }
+}
diff --git a/client-mobile/lib/core/constants/app_constants.dart b/client-mobile/lib/core/constants/app_constants.dart
new file mode 100644
index 0000000..042673e
--- /dev/null
+++ b/client-mobile/lib/core/constants/app_constants.dart
@@ -0,0 +1,25 @@
+class AppConstants {
+ AppConstants._();
+
+ // API
+ static const String apiBaseUrl = 'https://api.messenger.app';
+ static const int apiTimeout = 30;
+
+ // Storage
+ static const String sharedPrefsName = 'messenger_prefs';
+ static const String tokenKey = 'auth_token';
+ static const String refreshTokenKey = 'refresh_token';
+ static const String userIdKey = 'user_id';
+
+ // Pagination
+ static const int pageSize = 20;
+ static const int defaultPageSize = 50;
+
+ // Chat
+ static const int maxMessageLength = 4096;
+ static const int typingIndicatorTimeout = 3000;
+
+ // Media
+ static const int maxImageSize = 10 * 1024 * 1024; // 10MB
+ static const int maxVideoSize = 100 * 1024 * 1024; // 100MB
+}
diff --git a/client-mobile/lib/core/constants/storage_keys.dart b/client-mobile/lib/core/constants/storage_keys.dart
new file mode 100644
index 0000000..bac0c4b
--- /dev/null
+++ b/client-mobile/lib/core/constants/storage_keys.dart
@@ -0,0 +1,9 @@
+class StorageKeys {
+ StorageKeys._();
+
+ static const String apiUrl = 'api_url';
+ static const String languageCode = 'language_code';
+ static const String serverConfig = 'server_config';
+ static const String authToken = 'auth_token';
+ static const String refreshToken = 'refresh_token';
+}
diff --git a/client-mobile/lib/core/errors/errors.dart b/client-mobile/lib/core/errors/errors.dart
new file mode 100644
index 0000000..642547a
--- /dev/null
+++ b/client-mobile/lib/core/errors/errors.dart
@@ -0,0 +1,15 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'errors.freezed.dart';
+
+@freezed
+class AppError with _$AppError {
+ const factory AppError.unknown({String? message}) = UnknownError;
+ const factory AppError.network({String? message}) = NetworkError;
+ const factory AppError.unauthorized({String? message}) = UnauthorizedError;
+ const factory AppError.forbidden({String? message}) = ForbiddenError;
+ const factory AppError.notFound({String? message}) = NotFoundError;
+ const factory AppError.server({int? statusCode, String? message}) = ServerError;
+ const factory AppError.database({String? message}) = DatabaseError;
+ const factory AppError.validation({Map? fieldErrors}) = ValidationError;
+}
diff --git a/client-mobile/lib/core/errors/errors.freezed.dart b/client-mobile/lib/core/errors/errors.freezed.dart
new file mode 100644
index 0000000..cfa537d
--- /dev/null
+++ b/client-mobile/lib/core/errors/errors.freezed.dart
@@ -0,0 +1,1488 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of 'errors.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
+
+/// @nodoc
+mixin _$AppError {
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $AppErrorCopyWith<$Res> {
+ factory $AppErrorCopyWith(AppError value, $Res Function(AppError) then) =
+ _$AppErrorCopyWithImpl<$Res, AppError>;
+}
+
+/// @nodoc
+class _$AppErrorCopyWithImpl<$Res, $Val extends AppError>
+ implements $AppErrorCopyWith<$Res> {
+ _$AppErrorCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+}
+
+/// @nodoc
+abstract class _$$UnknownErrorImplCopyWith<$Res> {
+ factory _$$UnknownErrorImplCopyWith(
+ _$UnknownErrorImpl value, $Res Function(_$UnknownErrorImpl) then) =
+ __$$UnknownErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String? message});
+}
+
+/// @nodoc
+class __$$UnknownErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$UnknownErrorImpl>
+ implements _$$UnknownErrorImplCopyWith<$Res> {
+ __$$UnknownErrorImplCopyWithImpl(
+ _$UnknownErrorImpl _value, $Res Function(_$UnknownErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? message = freezed,
+ }) {
+ return _then(_$UnknownErrorImpl(
+ message: freezed == message
+ ? _value.message
+ : message // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$UnknownErrorImpl implements UnknownError {
+ const _$UnknownErrorImpl({this.message});
+
+ @override
+ final String? message;
+
+ @override
+ String toString() {
+ return 'AppError.unknown(message: $message)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$UnknownErrorImpl &&
+ (identical(other.message, message) || other.message == message));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, message);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$UnknownErrorImplCopyWith<_$UnknownErrorImpl> get copyWith =>
+ __$$UnknownErrorImplCopyWithImpl<_$UnknownErrorImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return unknown(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return unknown?.call(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (unknown != null) {
+ return unknown(message);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return unknown(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return unknown?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (unknown != null) {
+ return unknown(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class UnknownError implements AppError {
+ const factory UnknownError({final String? message}) = _$UnknownErrorImpl;
+
+ String? get message;
+ @JsonKey(ignore: true)
+ _$$UnknownErrorImplCopyWith<_$UnknownErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$NetworkErrorImplCopyWith<$Res> {
+ factory _$$NetworkErrorImplCopyWith(
+ _$NetworkErrorImpl value, $Res Function(_$NetworkErrorImpl) then) =
+ __$$NetworkErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String? message});
+}
+
+/// @nodoc
+class __$$NetworkErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$NetworkErrorImpl>
+ implements _$$NetworkErrorImplCopyWith<$Res> {
+ __$$NetworkErrorImplCopyWithImpl(
+ _$NetworkErrorImpl _value, $Res Function(_$NetworkErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? message = freezed,
+ }) {
+ return _then(_$NetworkErrorImpl(
+ message: freezed == message
+ ? _value.message
+ : message // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$NetworkErrorImpl implements NetworkError {
+ const _$NetworkErrorImpl({this.message});
+
+ @override
+ final String? message;
+
+ @override
+ String toString() {
+ return 'AppError.network(message: $message)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$NetworkErrorImpl &&
+ (identical(other.message, message) || other.message == message));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, message);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$NetworkErrorImplCopyWith<_$NetworkErrorImpl> get copyWith =>
+ __$$NetworkErrorImplCopyWithImpl<_$NetworkErrorImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return network(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return network?.call(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (network != null) {
+ return network(message);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return network(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return network?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (network != null) {
+ return network(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class NetworkError implements AppError {
+ const factory NetworkError({final String? message}) = _$NetworkErrorImpl;
+
+ String? get message;
+ @JsonKey(ignore: true)
+ _$$NetworkErrorImplCopyWith<_$NetworkErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$UnauthorizedErrorImplCopyWith<$Res> {
+ factory _$$UnauthorizedErrorImplCopyWith(_$UnauthorizedErrorImpl value,
+ $Res Function(_$UnauthorizedErrorImpl) then) =
+ __$$UnauthorizedErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String? message});
+}
+
+/// @nodoc
+class __$$UnauthorizedErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$UnauthorizedErrorImpl>
+ implements _$$UnauthorizedErrorImplCopyWith<$Res> {
+ __$$UnauthorizedErrorImplCopyWithImpl(_$UnauthorizedErrorImpl _value,
+ $Res Function(_$UnauthorizedErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? message = freezed,
+ }) {
+ return _then(_$UnauthorizedErrorImpl(
+ message: freezed == message
+ ? _value.message
+ : message // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$UnauthorizedErrorImpl implements UnauthorizedError {
+ const _$UnauthorizedErrorImpl({this.message});
+
+ @override
+ final String? message;
+
+ @override
+ String toString() {
+ return 'AppError.unauthorized(message: $message)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$UnauthorizedErrorImpl &&
+ (identical(other.message, message) || other.message == message));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, message);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$UnauthorizedErrorImplCopyWith<_$UnauthorizedErrorImpl> get copyWith =>
+ __$$UnauthorizedErrorImplCopyWithImpl<_$UnauthorizedErrorImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return unauthorized(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return unauthorized?.call(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (unauthorized != null) {
+ return unauthorized(message);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return unauthorized(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return unauthorized?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (unauthorized != null) {
+ return unauthorized(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class UnauthorizedError implements AppError {
+ const factory UnauthorizedError({final String? message}) =
+ _$UnauthorizedErrorImpl;
+
+ String? get message;
+ @JsonKey(ignore: true)
+ _$$UnauthorizedErrorImplCopyWith<_$UnauthorizedErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$ForbiddenErrorImplCopyWith<$Res> {
+ factory _$$ForbiddenErrorImplCopyWith(_$ForbiddenErrorImpl value,
+ $Res Function(_$ForbiddenErrorImpl) then) =
+ __$$ForbiddenErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String? message});
+}
+
+/// @nodoc
+class __$$ForbiddenErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$ForbiddenErrorImpl>
+ implements _$$ForbiddenErrorImplCopyWith<$Res> {
+ __$$ForbiddenErrorImplCopyWithImpl(
+ _$ForbiddenErrorImpl _value, $Res Function(_$ForbiddenErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? message = freezed,
+ }) {
+ return _then(_$ForbiddenErrorImpl(
+ message: freezed == message
+ ? _value.message
+ : message // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$ForbiddenErrorImpl implements ForbiddenError {
+ const _$ForbiddenErrorImpl({this.message});
+
+ @override
+ final String? message;
+
+ @override
+ String toString() {
+ return 'AppError.forbidden(message: $message)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$ForbiddenErrorImpl &&
+ (identical(other.message, message) || other.message == message));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, message);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$ForbiddenErrorImplCopyWith<_$ForbiddenErrorImpl> get copyWith =>
+ __$$ForbiddenErrorImplCopyWithImpl<_$ForbiddenErrorImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return forbidden(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return forbidden?.call(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (forbidden != null) {
+ return forbidden(message);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return forbidden(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return forbidden?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (forbidden != null) {
+ return forbidden(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class ForbiddenError implements AppError {
+ const factory ForbiddenError({final String? message}) = _$ForbiddenErrorImpl;
+
+ String? get message;
+ @JsonKey(ignore: true)
+ _$$ForbiddenErrorImplCopyWith<_$ForbiddenErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$NotFoundErrorImplCopyWith<$Res> {
+ factory _$$NotFoundErrorImplCopyWith(
+ _$NotFoundErrorImpl value, $Res Function(_$NotFoundErrorImpl) then) =
+ __$$NotFoundErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String? message});
+}
+
+/// @nodoc
+class __$$NotFoundErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$NotFoundErrorImpl>
+ implements _$$NotFoundErrorImplCopyWith<$Res> {
+ __$$NotFoundErrorImplCopyWithImpl(
+ _$NotFoundErrorImpl _value, $Res Function(_$NotFoundErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? message = freezed,
+ }) {
+ return _then(_$NotFoundErrorImpl(
+ message: freezed == message
+ ? _value.message
+ : message // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$NotFoundErrorImpl implements NotFoundError {
+ const _$NotFoundErrorImpl({this.message});
+
+ @override
+ final String? message;
+
+ @override
+ String toString() {
+ return 'AppError.notFound(message: $message)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$NotFoundErrorImpl &&
+ (identical(other.message, message) || other.message == message));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, message);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$NotFoundErrorImplCopyWith<_$NotFoundErrorImpl> get copyWith =>
+ __$$NotFoundErrorImplCopyWithImpl<_$NotFoundErrorImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return notFound(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return notFound?.call(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (notFound != null) {
+ return notFound(message);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return notFound(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return notFound?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (notFound != null) {
+ return notFound(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class NotFoundError implements AppError {
+ const factory NotFoundError({final String? message}) = _$NotFoundErrorImpl;
+
+ String? get message;
+ @JsonKey(ignore: true)
+ _$$NotFoundErrorImplCopyWith<_$NotFoundErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$ServerErrorImplCopyWith<$Res> {
+ factory _$$ServerErrorImplCopyWith(
+ _$ServerErrorImpl value, $Res Function(_$ServerErrorImpl) then) =
+ __$$ServerErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({int? statusCode, String? message});
+}
+
+/// @nodoc
+class __$$ServerErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$ServerErrorImpl>
+ implements _$$ServerErrorImplCopyWith<$Res> {
+ __$$ServerErrorImplCopyWithImpl(
+ _$ServerErrorImpl _value, $Res Function(_$ServerErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? statusCode = freezed,
+ Object? message = freezed,
+ }) {
+ return _then(_$ServerErrorImpl(
+ statusCode: freezed == statusCode
+ ? _value.statusCode
+ : statusCode // ignore: cast_nullable_to_non_nullable
+ as int?,
+ message: freezed == message
+ ? _value.message
+ : message // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$ServerErrorImpl implements ServerError {
+ const _$ServerErrorImpl({this.statusCode, this.message});
+
+ @override
+ final int? statusCode;
+ @override
+ final String? message;
+
+ @override
+ String toString() {
+ return 'AppError.server(statusCode: $statusCode, message: $message)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$ServerErrorImpl &&
+ (identical(other.statusCode, statusCode) ||
+ other.statusCode == statusCode) &&
+ (identical(other.message, message) || other.message == message));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, statusCode, message);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith =>
+ __$$ServerErrorImplCopyWithImpl<_$ServerErrorImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return server(statusCode, message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return server?.call(statusCode, message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (server != null) {
+ return server(statusCode, message);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return server(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return server?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (server != null) {
+ return server(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class ServerError implements AppError {
+ const factory ServerError({final int? statusCode, final String? message}) =
+ _$ServerErrorImpl;
+
+ int? get statusCode;
+ String? get message;
+ @JsonKey(ignore: true)
+ _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$DatabaseErrorImplCopyWith<$Res> {
+ factory _$$DatabaseErrorImplCopyWith(
+ _$DatabaseErrorImpl value, $Res Function(_$DatabaseErrorImpl) then) =
+ __$$DatabaseErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String? message});
+}
+
+/// @nodoc
+class __$$DatabaseErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$DatabaseErrorImpl>
+ implements _$$DatabaseErrorImplCopyWith<$Res> {
+ __$$DatabaseErrorImplCopyWithImpl(
+ _$DatabaseErrorImpl _value, $Res Function(_$DatabaseErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? message = freezed,
+ }) {
+ return _then(_$DatabaseErrorImpl(
+ message: freezed == message
+ ? _value.message
+ : message // ignore: cast_nullable_to_non_nullable
+ as String?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$DatabaseErrorImpl implements DatabaseError {
+ const _$DatabaseErrorImpl({this.message});
+
+ @override
+ final String? message;
+
+ @override
+ String toString() {
+ return 'AppError.database(message: $message)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$DatabaseErrorImpl &&
+ (identical(other.message, message) || other.message == message));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, message);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$DatabaseErrorImplCopyWith<_$DatabaseErrorImpl> get copyWith =>
+ __$$DatabaseErrorImplCopyWithImpl<_$DatabaseErrorImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return database(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return database?.call(message);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (database != null) {
+ return database(message);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return database(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return database?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (database != null) {
+ return database(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class DatabaseError implements AppError {
+ const factory DatabaseError({final String? message}) = _$DatabaseErrorImpl;
+
+ String? get message;
+ @JsonKey(ignore: true)
+ _$$DatabaseErrorImplCopyWith<_$DatabaseErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$ValidationErrorImplCopyWith<$Res> {
+ factory _$$ValidationErrorImplCopyWith(_$ValidationErrorImpl value,
+ $Res Function(_$ValidationErrorImpl) then) =
+ __$$ValidationErrorImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({Map? fieldErrors});
+}
+
+/// @nodoc
+class __$$ValidationErrorImplCopyWithImpl<$Res>
+ extends _$AppErrorCopyWithImpl<$Res, _$ValidationErrorImpl>
+ implements _$$ValidationErrorImplCopyWith<$Res> {
+ __$$ValidationErrorImplCopyWithImpl(
+ _$ValidationErrorImpl _value, $Res Function(_$ValidationErrorImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? fieldErrors = freezed,
+ }) {
+ return _then(_$ValidationErrorImpl(
+ fieldErrors: freezed == fieldErrors
+ ? _value._fieldErrors
+ : fieldErrors // ignore: cast_nullable_to_non_nullable
+ as Map?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$ValidationErrorImpl implements ValidationError {
+ const _$ValidationErrorImpl({final Map? fieldErrors})
+ : _fieldErrors = fieldErrors;
+
+ final Map? _fieldErrors;
+ @override
+ Map? get fieldErrors {
+ final value = _fieldErrors;
+ if (value == null) return null;
+ if (_fieldErrors is EqualUnmodifiableMapView) return _fieldErrors;
+ // ignore: implicit_dynamic_type
+ return EqualUnmodifiableMapView(value);
+ }
+
+ @override
+ String toString() {
+ return 'AppError.validation(fieldErrors: $fieldErrors)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$ValidationErrorImpl &&
+ const DeepCollectionEquality()
+ .equals(other._fieldErrors, _fieldErrors));
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ runtimeType, const DeepCollectionEquality().hash(_fieldErrors));
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$ValidationErrorImplCopyWith<_$ValidationErrorImpl> get copyWith =>
+ __$$ValidationErrorImplCopyWithImpl<_$ValidationErrorImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function(String? message) unknown,
+ required TResult Function(String? message) network,
+ required TResult Function(String? message) unauthorized,
+ required TResult Function(String? message) forbidden,
+ required TResult Function(String? message) notFound,
+ required TResult Function(int? statusCode, String? message) server,
+ required TResult Function(String? message) database,
+ required TResult Function(Map? fieldErrors) validation,
+ }) {
+ return validation(fieldErrors);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function(String? message)? unknown,
+ TResult? Function(String? message)? network,
+ TResult? Function(String? message)? unauthorized,
+ TResult? Function(String? message)? forbidden,
+ TResult? Function(String? message)? notFound,
+ TResult? Function(int? statusCode, String? message)? server,
+ TResult? Function(String? message)? database,
+ TResult? Function(Map? fieldErrors)? validation,
+ }) {
+ return validation?.call(fieldErrors);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function(String? message)? unknown,
+ TResult Function(String? message)? network,
+ TResult Function(String? message)? unauthorized,
+ TResult Function(String? message)? forbidden,
+ TResult Function(String? message)? notFound,
+ TResult Function(int? statusCode, String? message)? server,
+ TResult Function(String? message)? database,
+ TResult Function(Map? fieldErrors)? validation,
+ required TResult orElse(),
+ }) {
+ if (validation != null) {
+ return validation(fieldErrors);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(UnknownError value) unknown,
+ required TResult Function(NetworkError value) network,
+ required TResult Function(UnauthorizedError value) unauthorized,
+ required TResult Function(ForbiddenError value) forbidden,
+ required TResult Function(NotFoundError value) notFound,
+ required TResult Function(ServerError value) server,
+ required TResult Function(DatabaseError value) database,
+ required TResult Function(ValidationError value) validation,
+ }) {
+ return validation(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(UnknownError value)? unknown,
+ TResult? Function(NetworkError value)? network,
+ TResult? Function(UnauthorizedError value)? unauthorized,
+ TResult? Function(ForbiddenError value)? forbidden,
+ TResult? Function(NotFoundError value)? notFound,
+ TResult? Function(ServerError value)? server,
+ TResult? Function(DatabaseError value)? database,
+ TResult? Function(ValidationError value)? validation,
+ }) {
+ return validation?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(UnknownError value)? unknown,
+ TResult Function(NetworkError value)? network,
+ TResult Function(UnauthorizedError value)? unauthorized,
+ TResult Function(ForbiddenError value)? forbidden,
+ TResult Function(NotFoundError value)? notFound,
+ TResult Function(ServerError value)? server,
+ TResult Function(DatabaseError value)? database,
+ TResult Function(ValidationError value)? validation,
+ required TResult orElse(),
+ }) {
+ if (validation != null) {
+ return validation(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class ValidationError implements AppError {
+ const factory ValidationError({final Map? fieldErrors}) =
+ _$ValidationErrorImpl;
+
+ Map? get fieldErrors;
+ @JsonKey(ignore: true)
+ _$$ValidationErrorImplCopyWith<_$ValidationErrorImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
diff --git a/client-mobile/lib/core/errors/result.dart b/client-mobile/lib/core/errors/result.dart
new file mode 100644
index 0000000..b214d68
--- /dev/null
+++ b/client-mobile/lib/core/errors/result.dart
@@ -0,0 +1,30 @@
+import 'errors.dart';
+
+/// A generic class for handling success/failure results
+class Result {
+ final T? data;
+ final AppError? error;
+
+ const Result.success(this.data) : error = null;
+ const Result.failure(this.error) : data = null;
+
+ bool get isSuccess => error == null;
+ bool get isFailure => error != null;
+
+ R when({
+ required R Function(T data) onSuccess,
+ required R Function(AppError error) onFailure,
+ }) {
+ if (isSuccess) {
+ return onSuccess(data as T);
+ }
+ return onFailure(error!);
+ }
+
+ T getOrThrow() {
+ if (isFailure) {
+ throw error!;
+ }
+ return data as T;
+ }
+}
diff --git a/client-mobile/lib/core/network/api_client.dart b/client-mobile/lib/core/network/api_client.dart
new file mode 100644
index 0000000..ccb100d
--- /dev/null
+++ b/client-mobile/lib/core/network/api_client.dart
@@ -0,0 +1,135 @@
+import 'package:dio/dio.dart';
+import '../errors/errors.dart';
+import '../errors/result.dart';
+
+class ApiClient {
+ final Dio _dio;
+
+ ApiClient(this._dio);
+
+ Future> get(
+ String path, {
+ Map? queryParameters,
+ Options? options,
+ }) async {
+ try {
+ final response = await _dio.get(
+ path,
+ queryParameters: queryParameters,
+ options: options,
+ );
+ return Result.success(response.data as T);
+ } on DioException catch (e) {
+ return Result.failure(_handleDioError(e));
+ } catch (e) {
+ return Result.failure(const AppError.unknown(message: 'Unknown error occurred'));
+ }
+ }
+
+ Future> post(
+ String path, {
+ dynamic data,
+ Map? queryParameters,
+ Options? options,
+ }) async {
+ try {
+ final response = await _dio.post(
+ path,
+ data: data,
+ queryParameters: queryParameters,
+ options: options,
+ );
+ return Result.success(response.data as T);
+ } on DioException catch (e) {
+ return Result.failure(_handleDioError(e));
+ } catch (e) {
+ return Result.failure(const AppError.unknown(message: 'Unknown error occurred'));
+ }
+ }
+
+ Future> put(
+ String path, {
+ dynamic data,
+ Map? queryParameters,
+ Options? options,
+ }) async {
+ try {
+ final response = await _dio.put(
+ path,
+ data: data,
+ queryParameters: queryParameters,
+ options: options,
+ );
+ return Result.success(response.data as T);
+ } on DioException catch (e) {
+ return Result.failure(_handleDioError(e));
+ } catch (e) {
+ return Result.failure(const AppError.unknown(message: 'Unknown error occurred'));
+ }
+ }
+
+ Future> delete(
+ String path, {
+ dynamic data,
+ Map? queryParameters,
+ Options? options,
+ }) async {
+ try {
+ final response = await _dio.delete(
+ path,
+ data: data,
+ queryParameters: queryParameters,
+ options: options,
+ );
+ return Result.success(response.data as T);
+ } on DioException catch (e) {
+ return Result.failure(_handleDioError(e));
+ } catch (e) {
+ return Result.failure(const AppError.unknown(message: 'Unknown error occurred'));
+ }
+ }
+
+ AppError _handleDioError(DioException error) {
+ switch (error.type) {
+ case DioExceptionType.connectionTimeout:
+ case DioExceptionType.sendTimeout:
+ case DioExceptionType.receiveTimeout:
+ return const AppError.network(message: 'Connection timeout');
+ case DioExceptionType.connectionError:
+ return const AppError.network(message: 'No internet connection');
+ case DioExceptionType.badResponse:
+ final statusCode = error.response?.statusCode;
+ switch (statusCode) {
+ case 401:
+ return const AppError.unauthorized();
+ case 403:
+ return const AppError.forbidden();
+ case 404:
+ return const AppError.notFound();
+ case 422:
+ return AppError.validation(fieldErrors: _extractValidationErrors(error.response?.data));
+ case int s when s >= 500:
+ return AppError.server(statusCode: statusCode, message: 'Server error');
+ default:
+ return AppError.server(statusCode: statusCode, message: 'Request failed');
+ }
+ case DioExceptionType.cancel:
+ return const AppError.unknown(message: 'Request cancelled');
+ default:
+ return const AppError.unknown();
+ }
+ }
+
+ Map? _extractValidationErrors(dynamic data) {
+ if (data is Map && data.containsKey('errors')) {
+ final errors = data['errors'] as Map;
+ return errors.map((key, value) {
+ if (value is List && value.isNotEmpty) {
+ return MapEntry(key, value.first.toString());
+ }
+ return MapEntry(key, 'Invalid');
+ });
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff --git a/client-mobile/lib/core/theme/app_theme.dart b/client-mobile/lib/core/theme/app_theme.dart
new file mode 100644
index 0000000..69186d3
--- /dev/null
+++ b/client-mobile/lib/core/theme/app_theme.dart
@@ -0,0 +1,134 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+
+class AppTheme {
+ AppTheme._();
+
+ static const _primaryColor = Color(0xFF2481CC);
+ static const _primaryContainerColor = Color(0xFFD3E4FD);
+ static const _secondaryColor = Color(0xFF5F6AC4);
+ static const _tertiaryColor = Color(0xFFFFD700);
+
+ static const _lightSurfaceColor = Color(0xFFFFFBFE);
+ static const _darkSurfaceColor = Color(0xFF1C1B1F);
+
+ static ThemeData get lightTheme {
+ return ThemeData(
+ useMaterial3: true,
+ brightness: Brightness.light,
+ colorScheme: const ColorScheme.light(
+ primary: _primaryColor,
+ primaryContainer: _primaryContainerColor,
+ secondary: _secondaryColor,
+ tertiary: _tertiaryColor,
+ surface: _lightSurfaceColor,
+ onPrimary: Colors.white,
+ onSecondary: Colors.white,
+ onSurface: Colors.black87,
+ error: Color(0xFFBA1A1A),
+ ),
+ appBarTheme: const AppBarTheme(
+ centerTitle: true,
+ elevation: 0,
+ backgroundColor: _primaryColor,
+ foregroundColor: Colors.white,
+ systemOverlayStyle: SystemUiOverlayStyle.light,
+ ),
+ bottomNavigationBarTheme: const BottomNavigationBarThemeData(
+ type: BottomNavigationBarType.fixed,
+ backgroundColor: Colors.white,
+ selectedItemColor: _primaryColor,
+ unselectedItemColor: Colors.grey,
+ elevation: 8,
+ ),
+ cardTheme: CardThemeData(
+ elevation: 2,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ ),
+ inputDecorationTheme: InputDecorationTheme(
+ filled: true,
+ fillColor: Colors.grey[100],
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(12),
+ borderSide: BorderSide.none,
+ ),
+ contentPadding: const EdgeInsets.symmetric(
+ horizontal: 16,
+ vertical: 12,
+ ),
+ ),
+ elevatedButtonTheme: ElevatedButtonThemeData(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: _primaryColor,
+ foregroundColor: Colors.white,
+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ ),
+ ),
+ );
+ }
+
+ static ThemeData get darkTheme {
+ return ThemeData(
+ useMaterial3: true,
+ brightness: Brightness.dark,
+ colorScheme: const ColorScheme.dark(
+ primary: _primaryColor,
+ primaryContainer: _primaryContainerColor,
+ secondary: _secondaryColor,
+ tertiary: _tertiaryColor,
+ surface: _darkSurfaceColor,
+ onPrimary: Colors.white,
+ onSecondary: Colors.white,
+ onSurface: const Color(0xFFE6E1E5),
+ error: Color(0xFFFFB4AB),
+ ),
+ appBarTheme: const AppBarTheme(
+ centerTitle: true,
+ elevation: 0,
+ backgroundColor: Color(0xFF1F1F1F),
+ foregroundColor: Colors.white,
+ systemOverlayStyle: SystemUiOverlayStyle.light,
+ ),
+ bottomNavigationBarTheme: const BottomNavigationBarThemeData(
+ type: BottomNavigationBarType.fixed,
+ backgroundColor: Color(0xFF1F1F1F),
+ selectedItemColor: _primaryColor,
+ unselectedItemColor: Colors.grey,
+ elevation: 8,
+ ),
+ cardTheme: CardThemeData(
+ elevation: 2,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ ),
+ inputDecorationTheme: InputDecorationTheme(
+ filled: true,
+ fillColor: const Color(0xFF2D2D2D),
+ border: OutlineInputBorder(
+ borderRadius: BorderRadius.circular(12),
+ borderSide: BorderSide.none,
+ ),
+ contentPadding: const EdgeInsets.symmetric(
+ horizontal: 16,
+ vertical: 12,
+ ),
+ ),
+ elevatedButtonTheme: ElevatedButtonThemeData(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: _primaryColor,
+ foregroundColor: Colors.white,
+ padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(12),
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/client-mobile/lib/features/auth/data/datasources/auth_local_datasource.dart b/client-mobile/lib/features/auth/data/datasources/auth_local_datasource.dart
new file mode 100644
index 0000000..02af6d7
--- /dev/null
+++ b/client-mobile/lib/features/auth/data/datasources/auth_local_datasource.dart
@@ -0,0 +1,8 @@
+abstract class AuthLocalDataSource {
+ Future getToken();
+ Future saveToken(String token);
+ Future removeToken();
+ Future getUserId();
+ Future saveUserId(String userId);
+ Future removeUserId();
+}
diff --git a/client-mobile/lib/features/auth/data/datasources/auth_remote_datasource.dart b/client-mobile/lib/features/auth/data/datasources/auth_remote_datasource.dart
new file mode 100644
index 0000000..707bc63
--- /dev/null
+++ b/client-mobile/lib/features/auth/data/datasources/auth_remote_datasource.dart
@@ -0,0 +1,10 @@
+import '../../../../core/errors/result.dart';
+import '../../domain/entities/user.dart';
+
+abstract class AuthRemoteDataSource {
+ Future> login(String email, String password);
+ Future> register(String email, String password, String name);
+ Future> logout();
+ Future> getCurrentUser();
+ Future> refreshToken();
+}
diff --git a/client-mobile/lib/features/auth/data/repositories/auth_repository_impl.dart b/client-mobile/lib/features/auth/data/repositories/auth_repository_impl.dart
new file mode 100644
index 0000000..683576f
--- /dev/null
+++ b/client-mobile/lib/features/auth/data/repositories/auth_repository_impl.dart
@@ -0,0 +1,47 @@
+import '../../../../core/errors/errors.dart';
+import '../../../../core/errors/result.dart';
+import '../../domain/entities/user.dart';
+import '../../domain/repositories/auth_repository.dart';
+
+class AuthRepositoryImpl implements AuthRepository {
+ @override
+ bool get isLoggedIn => false;
+
+ @override
+ Future> getCurrentUser() async {
+ return const Result.failure(AppError.unauthorized(message: 'Not logged in'));
+ }
+
+ @override
+ Future> login(String email, String password) async {
+ // TODO: Implement real login
+ return Result.success(
+ User(
+ id: '1',
+ email: email,
+ name: 'Test User',
+ ),
+ );
+ }
+
+ @override
+ Future> logout() async {
+ return const Result.success(null);
+ }
+
+ @override
+ Future> register(String email, String password, String name) async {
+ return Result.success(
+ User(
+ id: '1',
+ email: email,
+ name: name,
+ ),
+ );
+ }
+
+ @override
+ Future> refreshToken() async {
+ return const Result.success(null);
+ }
+}
diff --git a/client-mobile/lib/features/auth/domain/entities/user.dart b/client-mobile/lib/features/auth/domain/entities/user.dart
new file mode 100644
index 0000000..4b41608
--- /dev/null
+++ b/client-mobile/lib/features/auth/domain/entities/user.dart
@@ -0,0 +1,19 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'user.freezed.dart';
+// part 'user.g.dart';
+
+@freezed
+class User with _$User {
+ const factory User({
+ required String id,
+ required String email,
+ required String name,
+ String? avatarUrl,
+ String? phoneNumber,
+ DateTime? lastSeen,
+ bool? isOnline,
+ }) = _User;
+
+ // factory User.fromJson(Map json) => _$UserFromJson(json);
+}
diff --git a/client-mobile/lib/features/auth/domain/entities/user.freezed.dart b/client-mobile/lib/features/auth/domain/entities/user.freezed.dart
new file mode 100644
index 0000000..d81a2ee
--- /dev/null
+++ b/client-mobile/lib/features/auth/domain/entities/user.freezed.dart
@@ -0,0 +1,257 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of 'user.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
+
+/// @nodoc
+mixin _$User {
+ String get id => throw _privateConstructorUsedError;
+ String get email => throw _privateConstructorUsedError;
+ String get name => throw _privateConstructorUsedError;
+ String? get avatarUrl => throw _privateConstructorUsedError;
+ String? get phoneNumber => throw _privateConstructorUsedError;
+ DateTime? get lastSeen => throw _privateConstructorUsedError;
+ bool? get isOnline => throw _privateConstructorUsedError;
+
+ @JsonKey(ignore: true)
+ $UserCopyWith get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $UserCopyWith<$Res> {
+ factory $UserCopyWith(User value, $Res Function(User) then) =
+ _$UserCopyWithImpl<$Res, User>;
+ @useResult
+ $Res call(
+ {String id,
+ String email,
+ String name,
+ String? avatarUrl,
+ String? phoneNumber,
+ DateTime? lastSeen,
+ bool? isOnline});
+}
+
+/// @nodoc
+class _$UserCopyWithImpl<$Res, $Val extends User>
+ implements $UserCopyWith<$Res> {
+ _$UserCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? id = null,
+ Object? email = null,
+ Object? name = null,
+ Object? avatarUrl = freezed,
+ Object? phoneNumber = freezed,
+ Object? lastSeen = freezed,
+ Object? isOnline = freezed,
+ }) {
+ return _then(_value.copyWith(
+ id: null == id
+ ? _value.id
+ : id // ignore: cast_nullable_to_non_nullable
+ as String,
+ email: null == email
+ ? _value.email
+ : email // ignore: cast_nullable_to_non_nullable
+ as String,
+ name: null == name
+ ? _value.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ avatarUrl: freezed == avatarUrl
+ ? _value.avatarUrl
+ : avatarUrl // ignore: cast_nullable_to_non_nullable
+ as String?,
+ phoneNumber: freezed == phoneNumber
+ ? _value.phoneNumber
+ : phoneNumber // ignore: cast_nullable_to_non_nullable
+ as String?,
+ lastSeen: freezed == lastSeen
+ ? _value.lastSeen
+ : lastSeen // ignore: cast_nullable_to_non_nullable
+ as DateTime?,
+ isOnline: freezed == isOnline
+ ? _value.isOnline
+ : isOnline // ignore: cast_nullable_to_non_nullable
+ as bool?,
+ ) as $Val);
+ }
+}
+
+/// @nodoc
+abstract class _$$UserImplCopyWith<$Res> implements $UserCopyWith<$Res> {
+ factory _$$UserImplCopyWith(
+ _$UserImpl value, $Res Function(_$UserImpl) then) =
+ __$$UserImplCopyWithImpl<$Res>;
+ @override
+ @useResult
+ $Res call(
+ {String id,
+ String email,
+ String name,
+ String? avatarUrl,
+ String? phoneNumber,
+ DateTime? lastSeen,
+ bool? isOnline});
+}
+
+/// @nodoc
+class __$$UserImplCopyWithImpl<$Res>
+ extends _$UserCopyWithImpl<$Res, _$UserImpl>
+ implements _$$UserImplCopyWith<$Res> {
+ __$$UserImplCopyWithImpl(_$UserImpl _value, $Res Function(_$UserImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? id = null,
+ Object? email = null,
+ Object? name = null,
+ Object? avatarUrl = freezed,
+ Object? phoneNumber = freezed,
+ Object? lastSeen = freezed,
+ Object? isOnline = freezed,
+ }) {
+ return _then(_$UserImpl(
+ id: null == id
+ ? _value.id
+ : id // ignore: cast_nullable_to_non_nullable
+ as String,
+ email: null == email
+ ? _value.email
+ : email // ignore: cast_nullable_to_non_nullable
+ as String,
+ name: null == name
+ ? _value.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ avatarUrl: freezed == avatarUrl
+ ? _value.avatarUrl
+ : avatarUrl // ignore: cast_nullable_to_non_nullable
+ as String?,
+ phoneNumber: freezed == phoneNumber
+ ? _value.phoneNumber
+ : phoneNumber // ignore: cast_nullable_to_non_nullable
+ as String?,
+ lastSeen: freezed == lastSeen
+ ? _value.lastSeen
+ : lastSeen // ignore: cast_nullable_to_non_nullable
+ as DateTime?,
+ isOnline: freezed == isOnline
+ ? _value.isOnline
+ : isOnline // ignore: cast_nullable_to_non_nullable
+ as bool?,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$UserImpl implements _User {
+ const _$UserImpl(
+ {required this.id,
+ required this.email,
+ required this.name,
+ this.avatarUrl,
+ this.phoneNumber,
+ this.lastSeen,
+ this.isOnline});
+
+ @override
+ final String id;
+ @override
+ final String email;
+ @override
+ final String name;
+ @override
+ final String? avatarUrl;
+ @override
+ final String? phoneNumber;
+ @override
+ final DateTime? lastSeen;
+ @override
+ final bool? isOnline;
+
+ @override
+ String toString() {
+ return 'User(id: $id, email: $email, name: $name, avatarUrl: $avatarUrl, phoneNumber: $phoneNumber, lastSeen: $lastSeen, isOnline: $isOnline)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$UserImpl &&
+ (identical(other.id, id) || other.id == id) &&
+ (identical(other.email, email) || other.email == email) &&
+ (identical(other.name, name) || other.name == name) &&
+ (identical(other.avatarUrl, avatarUrl) ||
+ other.avatarUrl == avatarUrl) &&
+ (identical(other.phoneNumber, phoneNumber) ||
+ other.phoneNumber == phoneNumber) &&
+ (identical(other.lastSeen, lastSeen) ||
+ other.lastSeen == lastSeen) &&
+ (identical(other.isOnline, isOnline) ||
+ other.isOnline == isOnline));
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ runtimeType, id, email, name, avatarUrl, phoneNumber, lastSeen, isOnline);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$UserImplCopyWith<_$UserImpl> get copyWith =>
+ __$$UserImplCopyWithImpl<_$UserImpl>(this, _$identity);
+}
+
+abstract class _User implements User {
+ const factory _User(
+ {required final String id,
+ required final String email,
+ required final String name,
+ final String? avatarUrl,
+ final String? phoneNumber,
+ final DateTime? lastSeen,
+ final bool? isOnline}) = _$UserImpl;
+
+ @override
+ String get id;
+ @override
+ String get email;
+ @override
+ String get name;
+ @override
+ String? get avatarUrl;
+ @override
+ String? get phoneNumber;
+ @override
+ DateTime? get lastSeen;
+ @override
+ bool? get isOnline;
+ @override
+ @JsonKey(ignore: true)
+ _$$UserImplCopyWith<_$UserImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
diff --git a/client-mobile/lib/features/auth/domain/repositories/auth_repository.dart b/client-mobile/lib/features/auth/domain/repositories/auth_repository.dart
new file mode 100644
index 0000000..6b32ebe
--- /dev/null
+++ b/client-mobile/lib/features/auth/domain/repositories/auth_repository.dart
@@ -0,0 +1,11 @@
+import '../../../../core/errors/result.dart';
+import '../entities/user.dart';
+
+abstract class AuthRepository {
+ Future> login(String email, String password);
+ Future> register(String email, String password, String name);
+ Future> logout();
+ Future> getCurrentUser();
+ Future> refreshToken();
+ bool get isLoggedIn;
+}
diff --git a/client-mobile/lib/features/auth/domain/usecases/login.dart b/client-mobile/lib/features/auth/domain/usecases/login.dart
new file mode 100644
index 0000000..eb09709
--- /dev/null
+++ b/client-mobile/lib/features/auth/domain/usecases/login.dart
@@ -0,0 +1,13 @@
+import '../../../../core/errors/result.dart';
+import '../repositories/auth_repository.dart';
+import '../entities/user.dart';
+
+class LoginUseCase {
+ final AuthRepository _repository;
+
+ LoginUseCase(this._repository);
+
+ Future> execute(String email, String password) {
+ return _repository.login(email, password);
+ }
+}
diff --git a/client-mobile/lib/features/auth/presentation/bloc/auth_bloc.dart b/client-mobile/lib/features/auth/presentation/bloc/auth_bloc.dart
new file mode 100644
index 0000000..498183d
--- /dev/null
+++ b/client-mobile/lib/features/auth/presentation/bloc/auth_bloc.dart
@@ -0,0 +1,36 @@
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'auth_event.dart';
+import 'auth_state.dart';
+
+class AuthBloc extends Bloc {
+ AuthBloc() : super(const AuthState.initial()) {
+ on(_onStarted);
+ on(_onLoginRequested);
+ on(_onRegisterRequested);
+ on(_onLogoutRequested);
+ on(_onAuthChecked);
+ on(_onEmailChanged);
+ on(_onPasswordChanged);
+ on(_onNameChanged);
+ }
+
+ Future _onStarted(AuthEventStarted event, emit) async {}
+
+ Future _onLoginRequested(AuthEventLoginRequested event, emit) async {
+ emit(const AuthState.loading());
+ emit(const AuthState.authenticated('user_123'));
+ }
+
+ Future _onRegisterRequested(AuthEventRegisterRequested event, emit) async {
+ emit(const AuthState.loading());
+ }
+
+ Future _onLogoutRequested(AuthEventLogoutRequested event, emit) async {
+ emit(const AuthState.unauthenticated());
+ }
+
+ Future _onAuthChecked(AuthEventAuthChecked event, emit) async {}
+ void _onEmailChanged(AuthEventEmailChanged event, emit) {}
+ void _onPasswordChanged(AuthEventPasswordChanged event, emit) {}
+ void _onNameChanged(AuthEventNameChanged event, emit) {}
+}
diff --git a/client-mobile/lib/features/auth/presentation/bloc/auth_event.dart b/client-mobile/lib/features/auth/presentation/bloc/auth_event.dart
new file mode 100644
index 0000000..7c46efc
--- /dev/null
+++ b/client-mobile/lib/features/auth/presentation/bloc/auth_event.dart
@@ -0,0 +1,15 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'auth_event.freezed.dart';
+
+@freezed
+class AuthEvent with _$AuthEvent {
+ const factory AuthEvent.started() = AuthEventStarted;
+ const factory AuthEvent.loginRequested(String email, String password) = AuthEventLoginRequested;
+ const factory AuthEvent.registerRequested(String email, String password, String name) = AuthEventRegisterRequested;
+ const factory AuthEvent.logoutRequested() = AuthEventLogoutRequested;
+ const factory AuthEvent.authChecked() = AuthEventAuthChecked;
+ const factory AuthEvent.emailChanged(String email) = AuthEventEmailChanged;
+ const factory AuthEvent.passwordChanged(String password) = AuthEventPasswordChanged;
+ const factory AuthEvent.nameChanged(String name) = AuthEventNameChanged;
+}
diff --git a/client-mobile/lib/features/auth/presentation/bloc/auth_event.freezed.dart b/client-mobile/lib/features/auth/presentation/bloc/auth_event.freezed.dart
new file mode 100644
index 0000000..e936ce4
--- /dev/null
+++ b/client-mobile/lib/features/auth/presentation/bloc/auth_event.freezed.dart
@@ -0,0 +1,1459 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of 'auth_event.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
+
+/// @nodoc
+mixin _$AuthEvent {
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $AuthEventCopyWith<$Res> {
+ factory $AuthEventCopyWith(AuthEvent value, $Res Function(AuthEvent) then) =
+ _$AuthEventCopyWithImpl<$Res, AuthEvent>;
+}
+
+/// @nodoc
+class _$AuthEventCopyWithImpl<$Res, $Val extends AuthEvent>
+ implements $AuthEventCopyWith<$Res> {
+ _$AuthEventCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+}
+
+/// @nodoc
+abstract class _$$AuthEventStartedImplCopyWith<$Res> {
+ factory _$$AuthEventStartedImplCopyWith(_$AuthEventStartedImpl value,
+ $Res Function(_$AuthEventStartedImpl) then) =
+ __$$AuthEventStartedImplCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$$AuthEventStartedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventStartedImpl>
+ implements _$$AuthEventStartedImplCopyWith<$Res> {
+ __$$AuthEventStartedImplCopyWithImpl(_$AuthEventStartedImpl _value,
+ $Res Function(_$AuthEventStartedImpl) _then)
+ : super(_value, _then);
+}
+
+/// @nodoc
+
+class _$AuthEventStartedImpl implements AuthEventStarted {
+ const _$AuthEventStartedImpl();
+
+ @override
+ String toString() {
+ return 'AuthEvent.started()';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType && other is _$AuthEventStartedImpl);
+ }
+
+ @override
+ int get hashCode => runtimeType.hashCode;
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return started();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return started?.call();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (started != null) {
+ return started();
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return started(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return started?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (started != null) {
+ return started(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventStarted implements AuthEvent {
+ const factory AuthEventStarted() = _$AuthEventStartedImpl;
+}
+
+/// @nodoc
+abstract class _$$AuthEventLoginRequestedImplCopyWith<$Res> {
+ factory _$$AuthEventLoginRequestedImplCopyWith(
+ _$AuthEventLoginRequestedImpl value,
+ $Res Function(_$AuthEventLoginRequestedImpl) then) =
+ __$$AuthEventLoginRequestedImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String email, String password});
+}
+
+/// @nodoc
+class __$$AuthEventLoginRequestedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventLoginRequestedImpl>
+ implements _$$AuthEventLoginRequestedImplCopyWith<$Res> {
+ __$$AuthEventLoginRequestedImplCopyWithImpl(
+ _$AuthEventLoginRequestedImpl _value,
+ $Res Function(_$AuthEventLoginRequestedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? email = null,
+ Object? password = null,
+ }) {
+ return _then(_$AuthEventLoginRequestedImpl(
+ null == email
+ ? _value.email
+ : email // ignore: cast_nullable_to_non_nullable
+ as String,
+ null == password
+ ? _value.password
+ : password // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthEventLoginRequestedImpl implements AuthEventLoginRequested {
+ const _$AuthEventLoginRequestedImpl(this.email, this.password);
+
+ @override
+ final String email;
+ @override
+ final String password;
+
+ @override
+ String toString() {
+ return 'AuthEvent.loginRequested(email: $email, password: $password)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthEventLoginRequestedImpl &&
+ (identical(other.email, email) || other.email == email) &&
+ (identical(other.password, password) ||
+ other.password == password));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, email, password);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthEventLoginRequestedImplCopyWith<_$AuthEventLoginRequestedImpl>
+ get copyWith => __$$AuthEventLoginRequestedImplCopyWithImpl<
+ _$AuthEventLoginRequestedImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return loginRequested(email, password);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return loginRequested?.call(email, password);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (loginRequested != null) {
+ return loginRequested(email, password);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return loginRequested(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return loginRequested?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (loginRequested != null) {
+ return loginRequested(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventLoginRequested implements AuthEvent {
+ const factory AuthEventLoginRequested(
+ final String email, final String password) =
+ _$AuthEventLoginRequestedImpl;
+
+ String get email;
+ String get password;
+ @JsonKey(ignore: true)
+ _$$AuthEventLoginRequestedImplCopyWith<_$AuthEventLoginRequestedImpl>
+ get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$AuthEventRegisterRequestedImplCopyWith<$Res> {
+ factory _$$AuthEventRegisterRequestedImplCopyWith(
+ _$AuthEventRegisterRequestedImpl value,
+ $Res Function(_$AuthEventRegisterRequestedImpl) then) =
+ __$$AuthEventRegisterRequestedImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String email, String password, String name});
+}
+
+/// @nodoc
+class __$$AuthEventRegisterRequestedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventRegisterRequestedImpl>
+ implements _$$AuthEventRegisterRequestedImplCopyWith<$Res> {
+ __$$AuthEventRegisterRequestedImplCopyWithImpl(
+ _$AuthEventRegisterRequestedImpl _value,
+ $Res Function(_$AuthEventRegisterRequestedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? email = null,
+ Object? password = null,
+ Object? name = null,
+ }) {
+ return _then(_$AuthEventRegisterRequestedImpl(
+ null == email
+ ? _value.email
+ : email // ignore: cast_nullable_to_non_nullable
+ as String,
+ null == password
+ ? _value.password
+ : password // ignore: cast_nullable_to_non_nullable
+ as String,
+ null == name
+ ? _value.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthEventRegisterRequestedImpl implements AuthEventRegisterRequested {
+ const _$AuthEventRegisterRequestedImpl(this.email, this.password, this.name);
+
+ @override
+ final String email;
+ @override
+ final String password;
+ @override
+ final String name;
+
+ @override
+ String toString() {
+ return 'AuthEvent.registerRequested(email: $email, password: $password, name: $name)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthEventRegisterRequestedImpl &&
+ (identical(other.email, email) || other.email == email) &&
+ (identical(other.password, password) ||
+ other.password == password) &&
+ (identical(other.name, name) || other.name == name));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, email, password, name);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthEventRegisterRequestedImplCopyWith<_$AuthEventRegisterRequestedImpl>
+ get copyWith => __$$AuthEventRegisterRequestedImplCopyWithImpl<
+ _$AuthEventRegisterRequestedImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return registerRequested(email, password, name);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return registerRequested?.call(email, password, name);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (registerRequested != null) {
+ return registerRequested(email, password, name);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return registerRequested(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return registerRequested?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (registerRequested != null) {
+ return registerRequested(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventRegisterRequested implements AuthEvent {
+ const factory AuthEventRegisterRequested(
+ final String email, final String password, final String name) =
+ _$AuthEventRegisterRequestedImpl;
+
+ String get email;
+ String get password;
+ String get name;
+ @JsonKey(ignore: true)
+ _$$AuthEventRegisterRequestedImplCopyWith<_$AuthEventRegisterRequestedImpl>
+ get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$AuthEventLogoutRequestedImplCopyWith<$Res> {
+ factory _$$AuthEventLogoutRequestedImplCopyWith(
+ _$AuthEventLogoutRequestedImpl value,
+ $Res Function(_$AuthEventLogoutRequestedImpl) then) =
+ __$$AuthEventLogoutRequestedImplCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$$AuthEventLogoutRequestedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventLogoutRequestedImpl>
+ implements _$$AuthEventLogoutRequestedImplCopyWith<$Res> {
+ __$$AuthEventLogoutRequestedImplCopyWithImpl(
+ _$AuthEventLogoutRequestedImpl _value,
+ $Res Function(_$AuthEventLogoutRequestedImpl) _then)
+ : super(_value, _then);
+}
+
+/// @nodoc
+
+class _$AuthEventLogoutRequestedImpl implements AuthEventLogoutRequested {
+ const _$AuthEventLogoutRequestedImpl();
+
+ @override
+ String toString() {
+ return 'AuthEvent.logoutRequested()';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthEventLogoutRequestedImpl);
+ }
+
+ @override
+ int get hashCode => runtimeType.hashCode;
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return logoutRequested();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return logoutRequested?.call();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (logoutRequested != null) {
+ return logoutRequested();
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return logoutRequested(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return logoutRequested?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (logoutRequested != null) {
+ return logoutRequested(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventLogoutRequested implements AuthEvent {
+ const factory AuthEventLogoutRequested() = _$AuthEventLogoutRequestedImpl;
+}
+
+/// @nodoc
+abstract class _$$AuthEventAuthCheckedImplCopyWith<$Res> {
+ factory _$$AuthEventAuthCheckedImplCopyWith(_$AuthEventAuthCheckedImpl value,
+ $Res Function(_$AuthEventAuthCheckedImpl) then) =
+ __$$AuthEventAuthCheckedImplCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$$AuthEventAuthCheckedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventAuthCheckedImpl>
+ implements _$$AuthEventAuthCheckedImplCopyWith<$Res> {
+ __$$AuthEventAuthCheckedImplCopyWithImpl(_$AuthEventAuthCheckedImpl _value,
+ $Res Function(_$AuthEventAuthCheckedImpl) _then)
+ : super(_value, _then);
+}
+
+/// @nodoc
+
+class _$AuthEventAuthCheckedImpl implements AuthEventAuthChecked {
+ const _$AuthEventAuthCheckedImpl();
+
+ @override
+ String toString() {
+ return 'AuthEvent.authChecked()';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthEventAuthCheckedImpl);
+ }
+
+ @override
+ int get hashCode => runtimeType.hashCode;
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return authChecked();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return authChecked?.call();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (authChecked != null) {
+ return authChecked();
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return authChecked(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return authChecked?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (authChecked != null) {
+ return authChecked(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventAuthChecked implements AuthEvent {
+ const factory AuthEventAuthChecked() = _$AuthEventAuthCheckedImpl;
+}
+
+/// @nodoc
+abstract class _$$AuthEventEmailChangedImplCopyWith<$Res> {
+ factory _$$AuthEventEmailChangedImplCopyWith(
+ _$AuthEventEmailChangedImpl value,
+ $Res Function(_$AuthEventEmailChangedImpl) then) =
+ __$$AuthEventEmailChangedImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String email});
+}
+
+/// @nodoc
+class __$$AuthEventEmailChangedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventEmailChangedImpl>
+ implements _$$AuthEventEmailChangedImplCopyWith<$Res> {
+ __$$AuthEventEmailChangedImplCopyWithImpl(_$AuthEventEmailChangedImpl _value,
+ $Res Function(_$AuthEventEmailChangedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? email = null,
+ }) {
+ return _then(_$AuthEventEmailChangedImpl(
+ null == email
+ ? _value.email
+ : email // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthEventEmailChangedImpl implements AuthEventEmailChanged {
+ const _$AuthEventEmailChangedImpl(this.email);
+
+ @override
+ final String email;
+
+ @override
+ String toString() {
+ return 'AuthEvent.emailChanged(email: $email)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthEventEmailChangedImpl &&
+ (identical(other.email, email) || other.email == email));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, email);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthEventEmailChangedImplCopyWith<_$AuthEventEmailChangedImpl>
+ get copyWith => __$$AuthEventEmailChangedImplCopyWithImpl<
+ _$AuthEventEmailChangedImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return emailChanged(email);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return emailChanged?.call(email);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (emailChanged != null) {
+ return emailChanged(email);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return emailChanged(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return emailChanged?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (emailChanged != null) {
+ return emailChanged(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventEmailChanged implements AuthEvent {
+ const factory AuthEventEmailChanged(final String email) =
+ _$AuthEventEmailChangedImpl;
+
+ String get email;
+ @JsonKey(ignore: true)
+ _$$AuthEventEmailChangedImplCopyWith<_$AuthEventEmailChangedImpl>
+ get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$AuthEventPasswordChangedImplCopyWith<$Res> {
+ factory _$$AuthEventPasswordChangedImplCopyWith(
+ _$AuthEventPasswordChangedImpl value,
+ $Res Function(_$AuthEventPasswordChangedImpl) then) =
+ __$$AuthEventPasswordChangedImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String password});
+}
+
+/// @nodoc
+class __$$AuthEventPasswordChangedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventPasswordChangedImpl>
+ implements _$$AuthEventPasswordChangedImplCopyWith<$Res> {
+ __$$AuthEventPasswordChangedImplCopyWithImpl(
+ _$AuthEventPasswordChangedImpl _value,
+ $Res Function(_$AuthEventPasswordChangedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? password = null,
+ }) {
+ return _then(_$AuthEventPasswordChangedImpl(
+ null == password
+ ? _value.password
+ : password // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthEventPasswordChangedImpl implements AuthEventPasswordChanged {
+ const _$AuthEventPasswordChangedImpl(this.password);
+
+ @override
+ final String password;
+
+ @override
+ String toString() {
+ return 'AuthEvent.passwordChanged(password: $password)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthEventPasswordChangedImpl &&
+ (identical(other.password, password) ||
+ other.password == password));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, password);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthEventPasswordChangedImplCopyWith<_$AuthEventPasswordChangedImpl>
+ get copyWith => __$$AuthEventPasswordChangedImplCopyWithImpl<
+ _$AuthEventPasswordChangedImpl>(this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return passwordChanged(password);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return passwordChanged?.call(password);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (passwordChanged != null) {
+ return passwordChanged(password);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return passwordChanged(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return passwordChanged?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (passwordChanged != null) {
+ return passwordChanged(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventPasswordChanged implements AuthEvent {
+ const factory AuthEventPasswordChanged(final String password) =
+ _$AuthEventPasswordChangedImpl;
+
+ String get password;
+ @JsonKey(ignore: true)
+ _$$AuthEventPasswordChangedImplCopyWith<_$AuthEventPasswordChangedImpl>
+ get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$AuthEventNameChangedImplCopyWith<$Res> {
+ factory _$$AuthEventNameChangedImplCopyWith(_$AuthEventNameChangedImpl value,
+ $Res Function(_$AuthEventNameChangedImpl) then) =
+ __$$AuthEventNameChangedImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String name});
+}
+
+/// @nodoc
+class __$$AuthEventNameChangedImplCopyWithImpl<$Res>
+ extends _$AuthEventCopyWithImpl<$Res, _$AuthEventNameChangedImpl>
+ implements _$$AuthEventNameChangedImplCopyWith<$Res> {
+ __$$AuthEventNameChangedImplCopyWithImpl(_$AuthEventNameChangedImpl _value,
+ $Res Function(_$AuthEventNameChangedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? name = null,
+ }) {
+ return _then(_$AuthEventNameChangedImpl(
+ null == name
+ ? _value.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthEventNameChangedImpl implements AuthEventNameChanged {
+ const _$AuthEventNameChangedImpl(this.name);
+
+ @override
+ final String name;
+
+ @override
+ String toString() {
+ return 'AuthEvent.nameChanged(name: $name)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthEventNameChangedImpl &&
+ (identical(other.name, name) || other.name == name));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, name);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthEventNameChangedImplCopyWith<_$AuthEventNameChangedImpl>
+ get copyWith =>
+ __$$AuthEventNameChangedImplCopyWithImpl<_$AuthEventNameChangedImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() started,
+ required TResult Function(String email, String password) loginRequested,
+ required TResult Function(String email, String password, String name)
+ registerRequested,
+ required TResult Function() logoutRequested,
+ required TResult Function() authChecked,
+ required TResult Function(String email) emailChanged,
+ required TResult Function(String password) passwordChanged,
+ required TResult Function(String name) nameChanged,
+ }) {
+ return nameChanged(name);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? started,
+ TResult? Function(String email, String password)? loginRequested,
+ TResult? Function(String email, String password, String name)?
+ registerRequested,
+ TResult? Function()? logoutRequested,
+ TResult? Function()? authChecked,
+ TResult? Function(String email)? emailChanged,
+ TResult? Function(String password)? passwordChanged,
+ TResult? Function(String name)? nameChanged,
+ }) {
+ return nameChanged?.call(name);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? started,
+ TResult Function(String email, String password)? loginRequested,
+ TResult Function(String email, String password, String name)?
+ registerRequested,
+ TResult Function()? logoutRequested,
+ TResult Function()? authChecked,
+ TResult Function(String email)? emailChanged,
+ TResult Function(String password)? passwordChanged,
+ TResult Function(String name)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (nameChanged != null) {
+ return nameChanged(name);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthEventStarted value) started,
+ required TResult Function(AuthEventLoginRequested value) loginRequested,
+ required TResult Function(AuthEventRegisterRequested value)
+ registerRequested,
+ required TResult Function(AuthEventLogoutRequested value) logoutRequested,
+ required TResult Function(AuthEventAuthChecked value) authChecked,
+ required TResult Function(AuthEventEmailChanged value) emailChanged,
+ required TResult Function(AuthEventPasswordChanged value) passwordChanged,
+ required TResult Function(AuthEventNameChanged value) nameChanged,
+ }) {
+ return nameChanged(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthEventStarted value)? started,
+ TResult? Function(AuthEventLoginRequested value)? loginRequested,
+ TResult? Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult? Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult? Function(AuthEventAuthChecked value)? authChecked,
+ TResult? Function(AuthEventEmailChanged value)? emailChanged,
+ TResult? Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult? Function(AuthEventNameChanged value)? nameChanged,
+ }) {
+ return nameChanged?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthEventStarted value)? started,
+ TResult Function(AuthEventLoginRequested value)? loginRequested,
+ TResult Function(AuthEventRegisterRequested value)? registerRequested,
+ TResult Function(AuthEventLogoutRequested value)? logoutRequested,
+ TResult Function(AuthEventAuthChecked value)? authChecked,
+ TResult Function(AuthEventEmailChanged value)? emailChanged,
+ TResult Function(AuthEventPasswordChanged value)? passwordChanged,
+ TResult Function(AuthEventNameChanged value)? nameChanged,
+ required TResult orElse(),
+ }) {
+ if (nameChanged != null) {
+ return nameChanged(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthEventNameChanged implements AuthEvent {
+ const factory AuthEventNameChanged(final String name) =
+ _$AuthEventNameChangedImpl;
+
+ String get name;
+ @JsonKey(ignore: true)
+ _$$AuthEventNameChangedImplCopyWith<_$AuthEventNameChangedImpl>
+ get copyWith => throw _privateConstructorUsedError;
+}
diff --git a/client-mobile/lib/features/auth/presentation/bloc/auth_state.dart b/client-mobile/lib/features/auth/presentation/bloc/auth_state.dart
new file mode 100644
index 0000000..a0751f7
--- /dev/null
+++ b/client-mobile/lib/features/auth/presentation/bloc/auth_state.dart
@@ -0,0 +1,12 @@
+import 'package:freezed_annotation/freezed_annotation.dart';
+
+part 'auth_state.freezed.dart';
+
+@freezed
+class AuthState with _$AuthState {
+ const factory AuthState.initial() = AuthInitial;
+ const factory AuthState.loading() = AuthLoading;
+ const factory AuthState.authenticated(String userId) = AuthAuthenticated;
+ const factory AuthState.unauthenticated() = AuthUnauthenticated;
+ const factory AuthState.error(String message) = AuthError;
+}
diff --git a/client-mobile/lib/features/auth/presentation/bloc/auth_state.freezed.dart b/client-mobile/lib/features/auth/presentation/bloc/auth_state.freezed.dart
new file mode 100644
index 0000000..ff1c054
--- /dev/null
+++ b/client-mobile/lib/features/auth/presentation/bloc/auth_state.freezed.dart
@@ -0,0 +1,757 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: type=lint
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
+
+part of 'auth_state.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+ 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
+
+/// @nodoc
+mixin _$AuthState {
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() initial,
+ required TResult Function() loading,
+ required TResult Function(String userId) authenticated,
+ required TResult Function() unauthenticated,
+ required TResult Function(String message) error,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? initial,
+ TResult? Function()? loading,
+ TResult? Function(String userId)? authenticated,
+ TResult? Function()? unauthenticated,
+ TResult? Function(String message)? error,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? initial,
+ TResult Function()? loading,
+ TResult Function(String userId)? authenticated,
+ TResult Function()? unauthenticated,
+ TResult Function(String message)? error,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthInitial value) initial,
+ required TResult Function(AuthLoading value) loading,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthError value) error,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthInitial value)? initial,
+ TResult? Function(AuthLoading value)? loading,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthError value)? error,
+ }) =>
+ throw _privateConstructorUsedError;
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthInitial value)? initial,
+ TResult Function(AuthLoading value)? loading,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthError value)? error,
+ required TResult orElse(),
+ }) =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $AuthStateCopyWith<$Res> {
+ factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) =
+ _$AuthStateCopyWithImpl<$Res, AuthState>;
+}
+
+/// @nodoc
+class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState>
+ implements $AuthStateCopyWith<$Res> {
+ _$AuthStateCopyWithImpl(this._value, this._then);
+
+ // ignore: unused_field
+ final $Val _value;
+ // ignore: unused_field
+ final $Res Function($Val) _then;
+}
+
+/// @nodoc
+abstract class _$$AuthInitialImplCopyWith<$Res> {
+ factory _$$AuthInitialImplCopyWith(
+ _$AuthInitialImpl value, $Res Function(_$AuthInitialImpl) then) =
+ __$$AuthInitialImplCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$$AuthInitialImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$AuthInitialImpl>
+ implements _$$AuthInitialImplCopyWith<$Res> {
+ __$$AuthInitialImplCopyWithImpl(
+ _$AuthInitialImpl _value, $Res Function(_$AuthInitialImpl) _then)
+ : super(_value, _then);
+}
+
+/// @nodoc
+
+class _$AuthInitialImpl implements AuthInitial {
+ const _$AuthInitialImpl();
+
+ @override
+ String toString() {
+ return 'AuthState.initial()';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType && other is _$AuthInitialImpl);
+ }
+
+ @override
+ int get hashCode => runtimeType.hashCode;
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() initial,
+ required TResult Function() loading,
+ required TResult Function(String userId) authenticated,
+ required TResult Function() unauthenticated,
+ required TResult Function(String message) error,
+ }) {
+ return initial();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? initial,
+ TResult? Function()? loading,
+ TResult? Function(String userId)? authenticated,
+ TResult? Function()? unauthenticated,
+ TResult? Function(String message)? error,
+ }) {
+ return initial?.call();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? initial,
+ TResult Function()? loading,
+ TResult Function(String userId)? authenticated,
+ TResult Function()? unauthenticated,
+ TResult Function(String message)? error,
+ required TResult orElse(),
+ }) {
+ if (initial != null) {
+ return initial();
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthInitial value) initial,
+ required TResult Function(AuthLoading value) loading,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthError value) error,
+ }) {
+ return initial(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthInitial value)? initial,
+ TResult? Function(AuthLoading value)? loading,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthError value)? error,
+ }) {
+ return initial?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthInitial value)? initial,
+ TResult Function(AuthLoading value)? loading,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthError value)? error,
+ required TResult orElse(),
+ }) {
+ if (initial != null) {
+ return initial(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthInitial implements AuthState {
+ const factory AuthInitial() = _$AuthInitialImpl;
+}
+
+/// @nodoc
+abstract class _$$AuthLoadingImplCopyWith<$Res> {
+ factory _$$AuthLoadingImplCopyWith(
+ _$AuthLoadingImpl value, $Res Function(_$AuthLoadingImpl) then) =
+ __$$AuthLoadingImplCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$$AuthLoadingImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$AuthLoadingImpl>
+ implements _$$AuthLoadingImplCopyWith<$Res> {
+ __$$AuthLoadingImplCopyWithImpl(
+ _$AuthLoadingImpl _value, $Res Function(_$AuthLoadingImpl) _then)
+ : super(_value, _then);
+}
+
+/// @nodoc
+
+class _$AuthLoadingImpl implements AuthLoading {
+ const _$AuthLoadingImpl();
+
+ @override
+ String toString() {
+ return 'AuthState.loading()';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType && other is _$AuthLoadingImpl);
+ }
+
+ @override
+ int get hashCode => runtimeType.hashCode;
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() initial,
+ required TResult Function() loading,
+ required TResult Function(String userId) authenticated,
+ required TResult Function() unauthenticated,
+ required TResult Function(String message) error,
+ }) {
+ return loading();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? initial,
+ TResult? Function()? loading,
+ TResult? Function(String userId)? authenticated,
+ TResult? Function()? unauthenticated,
+ TResult? Function(String message)? error,
+ }) {
+ return loading?.call();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? initial,
+ TResult Function()? loading,
+ TResult Function(String userId)? authenticated,
+ TResult Function()? unauthenticated,
+ TResult Function(String message)? error,
+ required TResult orElse(),
+ }) {
+ if (loading != null) {
+ return loading();
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthInitial value) initial,
+ required TResult Function(AuthLoading value) loading,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthError value) error,
+ }) {
+ return loading(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthInitial value)? initial,
+ TResult? Function(AuthLoading value)? loading,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthError value)? error,
+ }) {
+ return loading?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthInitial value)? initial,
+ TResult Function(AuthLoading value)? loading,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthError value)? error,
+ required TResult orElse(),
+ }) {
+ if (loading != null) {
+ return loading(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthLoading implements AuthState {
+ const factory AuthLoading() = _$AuthLoadingImpl;
+}
+
+/// @nodoc
+abstract class _$$AuthAuthenticatedImplCopyWith<$Res> {
+ factory _$$AuthAuthenticatedImplCopyWith(_$AuthAuthenticatedImpl value,
+ $Res Function(_$AuthAuthenticatedImpl) then) =
+ __$$AuthAuthenticatedImplCopyWithImpl<$Res>;
+ @useResult
+ $Res call({String userId});
+}
+
+/// @nodoc
+class __$$AuthAuthenticatedImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$AuthAuthenticatedImpl>
+ implements _$$AuthAuthenticatedImplCopyWith<$Res> {
+ __$$AuthAuthenticatedImplCopyWithImpl(_$AuthAuthenticatedImpl _value,
+ $Res Function(_$AuthAuthenticatedImpl) _then)
+ : super(_value, _then);
+
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? userId = null,
+ }) {
+ return _then(_$AuthAuthenticatedImpl(
+ null == userId
+ ? _value.userId
+ : userId // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+}
+
+/// @nodoc
+
+class _$AuthAuthenticatedImpl implements AuthAuthenticated {
+ const _$AuthAuthenticatedImpl(this.userId);
+
+ @override
+ final String userId;
+
+ @override
+ String toString() {
+ return 'AuthState.authenticated(userId: $userId)';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthAuthenticatedImpl &&
+ (identical(other.userId, userId) || other.userId == userId));
+ }
+
+ @override
+ int get hashCode => Object.hash(runtimeType, userId);
+
+ @JsonKey(ignore: true)
+ @override
+ @pragma('vm:prefer-inline')
+ _$$AuthAuthenticatedImplCopyWith<_$AuthAuthenticatedImpl> get copyWith =>
+ __$$AuthAuthenticatedImplCopyWithImpl<_$AuthAuthenticatedImpl>(
+ this, _$identity);
+
+ @override
+ @optionalTypeArgs
+ TResult when({
+ required TResult Function() initial,
+ required TResult Function() loading,
+ required TResult Function(String userId) authenticated,
+ required TResult Function() unauthenticated,
+ required TResult Function(String message) error,
+ }) {
+ return authenticated(userId);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? whenOrNull({
+ TResult? Function()? initial,
+ TResult? Function()? loading,
+ TResult? Function(String userId)? authenticated,
+ TResult? Function()? unauthenticated,
+ TResult? Function(String message)? error,
+ }) {
+ return authenticated?.call(userId);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeWhen({
+ TResult Function()? initial,
+ TResult Function()? loading,
+ TResult Function(String userId)? authenticated,
+ TResult Function()? unauthenticated,
+ TResult Function(String message)? error,
+ required TResult orElse(),
+ }) {
+ if (authenticated != null) {
+ return authenticated(userId);
+ }
+ return orElse();
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult map({
+ required TResult Function(AuthInitial value) initial,
+ required TResult Function(AuthLoading value) loading,
+ required TResult Function(AuthAuthenticated value) authenticated,
+ required TResult Function(AuthUnauthenticated value) unauthenticated,
+ required TResult Function(AuthError value) error,
+ }) {
+ return authenticated(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult? mapOrNull({
+ TResult? Function(AuthInitial value)? initial,
+ TResult? Function(AuthLoading value)? loading,
+ TResult? Function(AuthAuthenticated value)? authenticated,
+ TResult? Function(AuthUnauthenticated value)? unauthenticated,
+ TResult? Function(AuthError value)? error,
+ }) {
+ return authenticated?.call(this);
+ }
+
+ @override
+ @optionalTypeArgs
+ TResult maybeMap({
+ TResult Function(AuthInitial value)? initial,
+ TResult Function(AuthLoading value)? loading,
+ TResult Function(AuthAuthenticated value)? authenticated,
+ TResult Function(AuthUnauthenticated value)? unauthenticated,
+ TResult Function(AuthError value)? error,
+ required TResult orElse(),
+ }) {
+ if (authenticated != null) {
+ return authenticated(this);
+ }
+ return orElse();
+ }
+}
+
+abstract class AuthAuthenticated implements AuthState {
+ const factory AuthAuthenticated(final String userId) =
+ _$AuthAuthenticatedImpl;
+
+ String get userId;
+ @JsonKey(ignore: true)
+ _$$AuthAuthenticatedImplCopyWith<_$AuthAuthenticatedImpl> get copyWith =>
+ throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class _$$AuthUnauthenticatedImplCopyWith<$Res> {
+ factory _$$AuthUnauthenticatedImplCopyWith(_$AuthUnauthenticatedImpl value,
+ $Res Function(_$AuthUnauthenticatedImpl) then) =
+ __$$AuthUnauthenticatedImplCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$$AuthUnauthenticatedImplCopyWithImpl<$Res>
+ extends _$AuthStateCopyWithImpl<$Res, _$AuthUnauthenticatedImpl>
+ implements _$$AuthUnauthenticatedImplCopyWith<$Res> {
+ __$$AuthUnauthenticatedImplCopyWithImpl(_$AuthUnauthenticatedImpl _value,
+ $Res Function(_$AuthUnauthenticatedImpl) _then)
+ : super(_value, _then);
+}
+
+/// @nodoc
+
+class _$AuthUnauthenticatedImpl implements AuthUnauthenticated {
+ const _$AuthUnauthenticatedImpl();
+
+ @override
+ String toString() {
+ return 'AuthState.unauthenticated()';
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _$AuthUnauthenticatedImpl);
+ }
+
+ @override
+ int get hashCode => runtimeType.hashCode;
+
+ @override
+ @optionalTypeArgs
+ TResult when