A Flutter application for phone number-based authentication with Firebase. This app demonstrates a complete phone login flow including phone number input, SMS verification, and authenticated user interfaces.
## Features
- Phone number authentication using Firebase
- International phone number input with country selection
- SMS verification with 6-digit code input
- Responsive UI with adaptive light/dark themes
- Proper state management with error handling
- Clean architecture following Flutter best practices
- Proper separation of concerns (presentation, domain, data layers)
## Architecture
The application follows a layered architecture with the following key components:
- **Authentication**: Managed through Firebase Authentication with `firebase_auth` package. The `AuthState` class handles authentication state using Provider pattern.
- **Navigation**: Implemented with `go_router` for declarative routing with authentication-aware redirects.
- **State Management**: Uses `provider` package with `ChangeNotifierProvider` for global state management.
- **UI Components**: Built with Flutter's Material Design widgets and enhanced with specialized packages:
-`intl_phone_field` for international phone number input
-`pinput` for PIN input fields on SMS verification
## Project Structure
```
lib/
├── main.dart # App entry point
├── app.dart # MaterialApp setup, theme, and routing
├── auth/ # Authentication-related screens and logic
│ ├── auth_state.dart # Manages authentication state
│ ├── phone_input_screen.dart
│ └── sms_verification_screen.dart
├── home/ # Home screen
│ └── home_screen.dart
├── profile/ # User profile screen
│ └── profile_screen.dart
├── services/ # Backend services (e.g., Firebase)
│ └── auth_service.dart
├── shared/ # Common models, widgets, and utilities