Skip to content

HVC Mobile

Project Overview

HVC Mobile is a Flutter-based mobile application that serves as the mobile version of HVC. The application is built with Flutter SDK and follows the GetX pattern for state management.

Technology Stack

  • Framework: Flutter (SDK ^3.5.3)
  • State Management: GetX
  • Local Storage: ObjectBox, GetStorage
  • Authentication: Flutter AppAuth, JWT
  • Biometrics: Local Auth
  • Real-time Communication: SignalR, WebRTC
  • Scanning: Mobile Scanner
  • Push Notifications: OneSignal

Project Structure

lib/
├── controllers/     # GetX controllers for state management
├── data/           # Data layer including ObjectBox configurations
├── hlk_helpers/    # Helper utilities
├── models/         # Data models
├── pexip/         # Pexip integration related code
├── shared/        # Shared utilities and constants
├── views/         # UI screens and pages
├── widgets/       # Reusable UI components
├── main.dart      # Application entry point
└── objectbox.g.dart # Generated ObjectBox code

Setup and Installation

Prerequisites

  1. Flutter SDK (^3.5.3)
  2. Dart SDK
  3. Android Studio / Xcode
  4. FVM (Flutter Version Management) - optional but recommended

Getting Started

  1. Clone the repository
  2. Install dependencies:
    bash
    flutter pub get
  3. Generate ObjectBox models:
    bash
    flutter pub run build_runner build
  4. Run the application:
    bash
    flutter run

Key Dependencies

  • get: ^4.6.6 - State management and routing
  • get_storage: ^2.1.1 - Local storage solution
  • objectbox: ^4.1.0 - NoSQL database
  • flutter_webrtc: ^0.12.8 - WebRTC implementation
  • signalr_core: ^1.1.1 - SignalR client
  • local_auth: ^2.3.0 - Biometric authentication
  • onesignal_flutter: ^5.2.9 - Push notifications
  • flutter_appauth: ^8.0.3 - OAuth/OIDC authentication

Architecture

The application follows a clean architecture pattern with GetX for state management:

  1. Presentation Layer (Views)

    • Located in lib/views/
    • Contains UI screens and widgets
    • Uses GetX controllers for state management
  2. Business Logic Layer (Controllers)

    • Located in lib/controllers/
    • Handles business logic and state management
    • Implements GetX controllers
  3. Data Layer

    • Located in lib/data/ and lib/models/
    • Handles data persistence and API communication
    • Uses ObjectBox for local storage

Development Guidelines

Code Style

  • Follow Flutter's official style guide
  • Use camelCase for variables and methods
  • Use PascalCase for classes and types
  • Implement proper error handling
  • Write meaningful comments for complex logic

State Management

  • Use GetX controllers for state management
  • Keep controllers focused and single-responsibility
  • Implement proper dependency injection
  • Use reactive programming where appropriate

Performance Considerations

  • Implement proper widget rebuilding strategies
  • Use const constructors where possible
  • Implement pagination for lists
  • Optimize image assets
  • Handle memory leaks properly

Features and Components

Authentication

  • Implements OAuth2/OIDC via flutter_appauth
  • Supports biometric authentication
  • JWT token management

Real-time Communication

  • SignalR integration for real-time updates
  • WebRTC implementation for video calls
  • Push notifications via OneSignal

Data Management

  • Local storage with ObjectBox
  • Secure storage for sensitive data
  • Offline capability

Security Features

  • Screen protection implementation
  • Secure storage of credentials
  • Biometric authentication
  • Permission handling

UI Components

  • Custom widgets in lib/widgets/
  • Responsive design
  • Platform-specific adaptations
  • Loading indicators and error states

Released under the MIT License.