Skip to content

Overview

  • File: lib/views/rapid_connect_page.dart

The rapid_connect_page.dart file implements the Rapid Connect interface for the HVC XR application. This page provides a streamlined way for users to join video calls using a unique join code, with features like session expiration handling and visual feedback.

Class Structure

dart
class RapidConnectPage extends StatelessWidget {
  static const String routeName = '/RapidConnectPage';

  final RapidConnectDto rapidConnectDto;

  RapidConnectPage({Key? key, required this.rapidConnectDto}) : super(key: key);
}

Dependencies

  • flutter/material.dart - Flutter UI components
  • get/get.dart - State management
  • get/get_core/src/get_main.dart - GetX core functionality

Key Components

Controllers

  • meetingsController - Manages meeting state and rapid connect functionality
  • realTimeController - Handles real-time communication for rapid connect

Data Model

  • RapidConnectDto - Contains rapid connect session information:
    • uniqueId - Unique identifier for the session
    • joinCode - Code used to join the session
    • displayName - Name displayed for the session
    • durationInSeconds - Session duration in seconds

Core Functionality

Rapid Connect Initialization

dart
realTimeController
    .initRapidConnect(rapidConnectDto.uniqueId, rapidConnectDto.joinCode)
    .then((value) {
  if (value != null) {
    if (value.success) {
      HlkDialog.showSuccessSnackBar(
          value.message ?? 'Rapid connect request sent successfully');
    } else {
      HlkDialog.showErrorSnackBar(
          value.message ?? 'Rapid connect request failed');
    }
  }
});

Timer Management

dart
var hasTimer = rapidConnectDto.durationInSeconds > 0;
if (hasTimer) meetingsController.initRapidConnectCounter();

UI Components

Main Layout

  • AppBar with dynamic title
  • Centered content with join code display
  • Progress indicator for session duration

Dynamic Elements

  • Title changes based on timer state
  • Join code display with conditional styling
  • Progress bar showing session time remaining

State Management

  • Uses GetX for reactive state management
  • Manages timer state through meetingsController
  • Handles rapid connect session state

Device Orientation

dart
return OrientationBuilder(builder: (context, orientation) {
  // UI implementation
});

Dependencies

  • get - State management
  • flutter/material.dart - UI components

Styling

  • Follow application theme
  • Use consistent text styles
  • Implement responsive layouts
  • Handle different screen sizes
  • Support orientation changes

Integration Points

  • Connects with meetingsController for session management
  • Integrates with realTimeController for communication
  • Uses HlkDialog for user notifications
  • Utilizes HlkUtils for layout helpers

Released under the MIT License.