How synvex/twoareone_flutter works
Purpose and entry points
This is a Flutter client for a profile-based matching/social experience: onboarding, authentication, profile setup, location and question collection, profile discovery, favorites, chat, privacy, and settings are represented in the UI and data layers. Flutter starts at lib/main.dart; platform shells host it through android/app/src/main/kotlin/com/example/twoAreOne/app/MainActivity.kt and ios/Runner/AppDelegate.swift.
Application composition and navigation
The app is organized as a layered Flutter application:
• Shared UI primitives, styling, errors, and route definitions reside in lib/core/ and lib/core/routes/routes.dart.
• User-facing screens are grouped by feature under lib/ui/views/.
• Feature state is partially represented by view models under lib/ui/viewmodels/.
Routing is a key control boundary between authentication, onboarding/setup, main flow, and secondary screens.
Authentication and account recovery
Authentication screens support login, signup, OTP verification, password recovery, and reset/failure states:
• lib/ui/views/auth/login.dart
• lib/ui/views/auth/sign_up.dart
• lib/ui/views/auth/email_otp_verification.dart
Network-facing account operations are centralized in lib/data/services/auth_service.dart, separating credential flows from widgets.
Profile onboarding and editable identity
The initial user-data collection flow appears to combine location selection, profile setup, questions, and video:
• lib/ui/views/main/main_screen.dart
• lib/ui/views/main/profile_setup_screen.dart
• lib/ui/views/main/question_screen.dart
• lib/ui/views/main/location_selector.dart
Domain models for user identity, full profiles, locations, questions, and matching criteria live in lib/data/models/user_info.dart, lib/data/models/user_full_profile.dart, and lib/data/models/seeking.dart. This is the boundary where form/UI data becomes service payloads.
Discovery, matching, and engagement
The primary post-setup experience is bottom-navigation-based, spanning home/discovery, favorites, profile, and chat:
• lib/ui/views/bottom_nav/custom_nav_bar.dart
• lib/ui/views/bottom_nav/home_screen.dart
• lib/ui/views/bottom_nav/favourite_screen.dart
Discovery includes filtering, profile cards/details, question editing, and full-screen/inline video presentation in lib/ui/views/home/. Matching/profile retrieval is represented by lib/data/services/home_service.dart, lib/data/services/profiles_services.dart, and lib/data/models/user_match_model.dart; favorites are isolated in lib/data/services/fav_services.dart.
API, state, and error boundary
Remote integration is concentrated in the data-services layer. lib/data/services/Api_Helper/api_manager.dart is the likely common HTTP execution boundary, while lib/data/end_points.dart defines service targets and lib/core/Error/api_error.dart provides an application error representation. Feature services—such as lib/data/services/question_service.dart and lib/data/services/setting.dart—should depend on this shared API layer rather than widgets directly. Fetch-oriented UI state is anchored by lib/ui/viewmodels/base_fetch_view_model.dart.
Runtime and external infrastructure
The project targets Android, iOS, and web through Flutter (android/, ios/, web/). Firebase is materially configured via lib/firebase_options.dart, android/app/google-services.json, and firebase.json; the exact Firebase products used are not established by the supplied tree. Static visual and animation assets are bundled under assets/, including JSON animation resources in assets/jsonImg/.
Main entry points: api_manager.dart API manager · main.dart Flutter entry point · routes.dart Route control · profile_setup_screen.dart Profile setup flow
Components 21
Runtime
- Android shell
android/app/src/main/kotlin/com/example/twoAreOne/app/MainActivity.kt - iOS shell
ios/Runner/AppDelegate.swift - Firebase configuration · Configured Firebase products are not identified.
lib/firebase_options.dart
Flutter client
- Flutter entry point
lib/main.dart - Core UI and shared utilities
lib/core/app_colors.dart - Route control · Separates auth, setup, main, and secondary flows.
lib/core/routes/routes.dart - Authentication screens · Login, signup, OTP, and recovery flows.
lib/ui/views/auth/login.dart - Profile setup flow · Collects profile, location, questions, and video.
lib/ui/views/main/profile_setup_screen.dart - Main flow
lib/ui/views/main/main_screen.dart - Bottom navigation · Hosts discovery, favorites, profile, and chat.
lib/ui/views/bottom_nav/custom_nav_bar.dart - Discovery UI · Profiles, filters, cards, details, and video presentation.
lib/ui/views/home/profile_details_screen.dart - Fetch view-model base
lib/ui/viewmodels/base_fetch_view_model.dart
Data layer
- Profile and seeking models · Transforms setup and profile data into service payloads.
lib/data/models/user_info.dart - Match models
lib/data/models/user_match_model.dart - Authentication service
lib/data/services/auth_service.dart - Profile and discovery services · Retrieves profiles and matching data.
lib/data/services/home_service.dart - Favorites service
lib/data/services/fav_services.dart - Questions and settings services
lib/data/services/question_service.dart - API manager · Common remote execution boundary.
lib/data/services/Api_Helper/api_manager.dart - API endpoints
lib/data/end_points.dart - API error model
lib/core/Error/api_error.dart
Connections 23
- Android shell → Flutter entry point: hosts
- iOS shell → Flutter entry point: hosts
- Flutter entry point → Core UI and shared utilities: initializes
- Flutter entry point → Route control: uses
- Flutter entry point → Firebase configuration: loads configuration
- Route control → Authentication screens: routes to
- Route control → Profile setup flow: routes to
- Route control → Main flow: routes to
- Main flow → Bottom navigation: contains
- Bottom navigation → Discovery UI: opens
- Authentication screens → Authentication service: authenticates through
- Profile setup flow → Profile and seeking models: collects
- Profile setup flow → Questions and settings services: submits through
- Discovery UI → Fetch view-model base: uses state
- Fetch view-model base → Profile and discovery services: fetches through
- Profile and discovery services → Match models: returns
- Bottom navigation → Favorites service: manages favorites through
- Authentication service → API manager: uses
- Profile and discovery services → API manager: uses
- Favorites service → API manager: uses
- Questions and settings services → API manager: uses
- API manager → API endpoints: targets
- API manager → API error model: maps failures to