# Project export: Caren AI

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2025
- Tagline: Because everyone deserves someone who cares
- Devpost: https://devpost.com/software/caren-ai
- GitHub: https://github.com/Tap2Call/flutterflow
- Demo: http://tap2call.flutterflow.app/
- Video: https://www.youtube.com/embed/8ZOR9M53RlM?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Result: winner (Flutterflow: Best Use of FlutterFlow ($2,000 Cash + meet w/ founders [1st] & $1,500 Cash [2nd] & iPad 10.9"s [3rd]))
- Team: 2 GitHub contributor(s) — FlutterFlow (4 commits), Tirth Patel (1 commits)

## Devpost submission (written by the team)

### Inspiration

Every year, 850 million insurance claims are denied in the U.S., leaving patients with unexpected medical bills and financial stress. Shockingly, less than 1% of these denied claims are ever appealed not because they lack merit, but because the appeal process is frustrating, time-consuming, and complicated (Wall Street Journal). As a result, nearly 1/3 of Americans contribute to $220 billion in medical debt, often due to denied or mishandled claims (Consumer Financial Protection Bureau). We wanted to level the playing field by putting AI in the patient’s corner. What if an AI negotiator could read the fine print, fight back against denials, and handle everything seamlessly? That’s how Caren AI was born—to empower patients, recover their rightful coverage, and eliminate unfair medical debt.

### What it does

Caren AI automates the insurance claim appeal process and negotiates with insurance providers on behalf of patients. Our AI reads insurance denial letters, cross-references them with Evidence of Coverage (EOC) documents, and calls insurance companies to dispute denials using legally backed arguments. Key Features: AI-Powered Claim Negotiation – Caren AI analyzes insurance policies and denial letters, then calls the insurance provider via Twilio to dispute the claim. Automated Healthcare Scheduling – The AI finds available doctor appointments and books them for the patient in seconds. Intelligent Appeals Processing – Uses ElevenLabs Conversational AI, trained on insurance documents, to craft strong, evidence-based appeal arguments. Caren AI features two AI agents dedicated to simplifying healthcare management: Sam (Scheduling AI) – Helps users book and manage doctor appointments based on availability and medical history. Noa (Negotiation AI) – Calls insurance providers, disputes denied claims, and negotiates fair settlements to reduce costs. Result: Patients save thousands on medical bills without the hassle of navigating complex insurance policies themselves.

### How we built it

We designed Caren AI as a full-stack AI-powered assistant, ensuring seamless automation of insurance claim disputes and healthcare scheduling. Frontend: FlutterFlow (Dart) – A clean, user-friendly interface for patients. AI Backend: ElevenLabs Conversational AI – Trained on insurance policy documents for intelligent claim analysis. Fastest AI Model: Gemini 2.0 Flash – Parses complex medical and insurance documentation. Live Call Automation: Twilio API – AI negotiates claims directly with insurers via automated phone calls. Authentication: Firebase Authentication – Secure user logins and data protection. By combining AI, automation, and real-time negotiation, we eliminated the need for manual claim appeals, making the process fast, accurate, and effortless for patients.

### Challenges we ran into

Training AI on Complex Insurance Policies – Extracting accurate insights from dense, jargon-heavy documents required custom model fine-tuning. Real-Time Insurance Call Handling – Ensuring AI could hold a live, logical conversation with insurers using Twilio without sounding robotic was a key challenge. Using Flutter for the First Time – Since our team was new to FlutterFlow, we had to learn its UI-building framework and state management quickly to build a seamless frontend experience. Through iterative testing, API optimizations, and AI refinement, we successfully overcame these hurdles to create a seamless patient experience.

### Accomplishments we're proud of

Built a Fully Functional AI-Powered Claim Negotiator – Our AI successfully disputes insurance claims in real-time. Implemented End-to-End Automation – From claim upload to resolution, everything happens without manual intervention. Integrated Live Twilio Call Handling – Caren AI makes phone calls to insurers, delivering legally sound counterarguments. Designed a Scalable, Patient-Friendly Platform – Built using FlutterFlow, making it accessible to all users, regardless of tech expertise. Our solution doesn’t just solve a problem it revolutionizes patient advocacy in healthcare.

### What we learned

The Healthcare System is Stacked Against Patients – Insurance denials are often not justified, but most patients don’t have the knowledge or time to fight back. AI Can Level the Playing Field – With intelligent claim analysis and negotiation, AI can recover thousands of dollars for patients. User Experience Matters – Many users aren't tech-savvy, so creating a seamless, intuitive interface was crucial. Real-Time Communication with Insurers is Game-Changing – Automating insurance negotiations was far more effective than just document-based appeals. Caren AI isn’t just an app—it’s a movement. By leveraging AI negotiation, we’re fighting for patient rights and bringing fairness back to healthcare. Join the revolution, and let AI handle the hassle, so you can focus on your health.

### What's next

Callback Feature for Dropped Calls – If an insurance call disconnects, Caren AI will automatically redial and resume the negotiation. Multilingual Support– Expanding beyond English to support Spanish, French, and more to help non-native speakers navigate insurance issues. Family Insurance Management – A family plan feature that allows users to track and manage multiple insurance claims in one place.

## README (from the GitHub repository)

# Caren AI

A new Flutter project.

## Getting Started



## Detected evidence (automated analysis)

Indexed codebase: 109 recognized source files, 593 KB.
- C (language) — detected in the code
- Dart (language) — detected in the code
- HTML (language) — detected in the code
- JavaScript (language) — detected in the code
- Kotlin (language) — detected in the code
- Swift (language) — detected in the code
- Firebase (technology) — claimed on Devpost, not found in the code
- Google Gemini (technology) — claimed on Devpost, not found in the code

## Codebase structure (from repository index)

### Files (120 of 163)

```
analysis_options.yaml
android/.gitignore
android/app/build.gradle
android/app/google-services.json
android/app/proguard-rules.pro
android/app/src/debug/AndroidManifest.xml
android/app/src/main/AndroidManifest.xml
android/app/src/main/kotlin/com/example/my_project/MainActivity.kt
android/app/src/main/res/drawable/launch_background.xml
android/app/src/main/res/values-night-v31/styles.xml
android/app/src/main/res/values-night/styles.xml
android/app/src/main/res/values-v31/styles.xml
android/app/src/main/res/values/strings.xml
android/app/src/main/res/values/styles.xml
android/app/src/profile/AndroidManifest.xml
android/build.gradle
android/gradle.properties
android/gradle/wrapper/gradle-wrapper.properties
android/settings.gradle
dependencies/ff_commons/lib/api_requests/api_manager.dart
dependencies/ff_commons/lib/api_requests/api_paging_params.dart
dependencies/ff_commons/lib/api_requests/api_streaming.dart
dependencies/ff_commons/lib/api_requests/get_streamed_response_http.dart
dependencies/ff_commons/lib/api_requests/get_streamed_response_web.dart
dependencies/ff_commons/lib/api_requests/get_streamed_response.dart
dependencies/ff_commons/lib/flutter_flow/lat_lng.dart
dependencies/ff_commons/lib/flutter_flow/place.dart
dependencies/ff_commons/lib/flutter_flow/upload_data_class.dart
dependencies/ff_commons/lib/flutter_flow/uploaded_file.dart
dependencies/ff_commons/pubspec.yaml
dependencies/ff_theme/lib/flutter_flow/flutter_flow_theme.dart
dependencies/ff_theme/pubspec.yaml
dependencies/toggle_button_cmbg9l/.gitignore
dependencies/toggle_button_cmbg9l/.metadata
dependencies/toggle_button_cmbg9l/analysis_options.yaml
dependencies/toggle_button_cmbg9l/lib/components/button_model.dart
dependencies/toggle_button_cmbg9l/lib/components/button_widget.dart
dependencies/toggle_button_cmbg9l/lib/custom_code/widgets/custom_ripple_widget.dart
dependencies/toggle_button_cmbg9l/lib/custom_code/widgets/index.dart
dependencies/toggle_button_cmbg9l/lib/flutter_flow/flutter_flow_animations.dart
dependencies/toggle_button_cmbg9l/lib/flutter_flow/flutter_flow_model.dart
dependencies/toggle_button_cmbg9l/lib/flutter_flow/flutter_flow_util.dart
dependencies/toggle_button_cmbg9l/lib/flutter_flow/flutter_flow_widgets.dart
dependencies/toggle_button_cmbg9l/lib/flutter_flow/nav/nav.dart
dependencies/toggle_button_cmbg9l/lib/flutter_flow/nav/serialization_util.dart
dependencies/toggle_button_cmbg9l/lib/index.dart
dependencies/toggle_button_cmbg9l/lib/main.dart
dependencies/toggle_button_cmbg9l/lib/pages/home_page/home_page_model.dart
dependencies/toggle_button_cmbg9l/lib/pages/home_page/home_page_widget.dart
dependencies/toggle_button_cmbg9l/macos/.gitignore
dependencies/toggle_button_cmbg9l/macos/Flutter/Flutter-Debug.xcconfig
dependencies/toggle_button_cmbg9l/macos/Flutter/Flutter-Release.xcconfig
dependencies/toggle_button_cmbg9l/macos/Flutter/GeneratedPluginRegistrant.swift
dependencies/toggle_button_cmbg9l/macos/Podfile
dependencies/toggle_button_cmbg9l/macos/Runner.xcodeproj/project_auth.pbxproj
dependencies/toggle_button_cmbg9l/macos/Runner.xcodeproj/project.pbxproj
dependencies/toggle_button_cmbg9l/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
dependencies/toggle_button_cmbg9l/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
dependencies/toggle_button_cmbg9l/macos/Runner.xcworkspace/contents.xcworkspacedata
dependencies/toggle_button_cmbg9l/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
dependencies/toggle_button_cmbg9l/macos/Runner/AppDelegate.swift
dependencies/toggle_button_cmbg9l/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
dependencies/toggle_button_cmbg9l/macos/Runner/Base.lproj/MainMenu.xib
dependencies/toggle_button_cmbg9l/macos/Runner/Configs/AppInfo.xcconfig
dependencies/toggle_button_cmbg9l/macos/Runner/Configs/Debug.xcconfig
dependencies/toggle_button_cmbg9l/macos/Runner/Configs/Release.xcconfig
dependencies/toggle_button_cmbg9l/macos/Runner/Configs/Warnings.xcconfig
dependencies/toggle_button_cmbg9l/macos/Runner/DebugProfile.entitlements
dependencies/toggle_button_cmbg9l/macos/Runner/Info.plist
dependencies/toggle_button_cmbg9l/macos/Runner/MainFlutterWindow.swift
dependencies/toggle_button_cmbg9l/macos/Runner/Release.entitlements
dependencies/toggle_button_cmbg9l/pubspec.yaml
dependencies/toggle_button_cmbg9l/README.md
firebase/firebase.json
firebase/functions/api_manager.js
firebase/functions/index.js
firebase/functions/package.json
firebase/storage.rules
ios/.gitignore
ios/Flutter/AppFrameworkInfo.plist
ios/Flutter/Debug.xcconfig
ios/Flutter/Release.xcconfig
ios/ImageNotification/Info.plist
ios/ImageNotification/NotificationService.swift
ios/Podfile
ios/Runner.xcodeproj/project.pbxproj
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
ios/Runner.xcworkspace/contents.xcworkspacedata
ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
ios/Runner/AppDelegate.swift
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
ios/Runner/Base.lproj/LaunchScreen.storyboard
ios/Runner/Base.lproj/Main.storyboard
ios/Runner/GoogleService-Info.plist
ios/Runner/Info.plist
ios/Runner/PrivacyInfo.xcprivacy
ios/Runner/Runner-Bridging-Header.h
ios/Runner/Runner.entitlements
lib/agent/noa_negotiate/noa_negotiate_model.dart
lib/agent/noa_negotiate/noa_negotiate_widget.dart
lib/agent/noa/noa_model.dart
lib/agent/noa/noa_widget.dart
lib/agent/sam/sam_model.dart
lib/agent/sam/sam_widget.dart
lib/app_state.dart
lib/auth/auth_manager.dart
lib/auth/base_auth_user_provider.dart
lib/auth/create_account/create_account_model.dart
lib/auth/create_account/create_account_widget.dart
lib/auth/firebase_auth/anonymous_auth.dart
lib/auth/firebase_auth/apple_auth.dart
lib/auth/firebase_auth/auth_util.dart
lib/auth/firebase_auth/email_auth.dart
lib/auth/firebase_auth/firebase_auth_manager.dart
[43 more files omitted for size]
```

### Dependencies

- firebase/functions/package.json: @mux/mux-node@^7.3.3, @onesignal/node-onesignal@^2.0.1-beta2, axios@1.7.4, braintree@^3.6.0, eslint@^6.8.0, eslint-plugin-promise@^4.2.1, firebase-admin@^11.11.0, firebase-functions@^4.4.1, qs@^6.7.0, razorpay@^2.8.4, stripe@^8.0.1

### Recent commits (newest first)

- Update README.md
- Restyling the UI with new colors and logos
- Fixed bug with noa_negotiate page
- Added more for Noa and Sam (agent pages)
- Updating with our latest flutterflow state

## Key source files (fetched from GitHub, selected and truncated for size)

### firebase/functions/package.json

```
{
  "name": "cloud-functions",
  "description": "Firebase Cloud Functions",
  "dependencies": {
    "firebase-admin": "^11.11.0",
    "firebase-functions": "^4.4.1",
    "braintree": "^3.6.0",
    "@mux/mux-node": "^7.3.3",
    "stripe": "^8.0.1",
    "axios": "1.7.4",
    "razorpay": "^2.8.4",
    "qs": "^6.7.0",
    "@onesignal/node-onesignal": "^2.0.1-beta2"
  },
  "devDependencies": {
    "eslint": "^6.8.0",
    "eslint-plugin-promise": "^4.2.1"
  },
  "scripts": {
    "lint": "./node_modules/.bin/eslint --max-warnings=0 .",
    "serve": "firebase -P treehacks-3f859 emulators:start --only functions",
    "shell": "firebase -P treehacks-3f859 functions:shell",
    "start": "npm run shell",
    "logs": "firebase -P treehacks-3f859 functions:log",
    "compile": "cp ../../tsconfig.template.json ./tsconfig-compile.json && tsc --project tsconfig-compile.json"
  },
  "engines": {
    "node": "18"
  },
  "private": true
}

```

### firebase/functions/index.js

```javascript
const functions = require("firebase-functions");
const admin = require("firebase-admin");
admin.initializeApp();

```

### analysis_options.yaml

```yaml



analyzer:
  exclude:
    - lib/custom_code/**
    - lib/flutter_flow/custom_functions.dart

```

### pubspec.yaml

```yaml
name: translate_using_groq_streaming_a_p_is
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=3.0.0 <4.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  flutter_web_plugins:
    sdk: flutter
  auto_size_text: 3.0.0
  cached_network_image: 3.4.1
  cached_network_image_platform_interface: 4.1.1
  cached_network_image_web: 1.3.1
  carousel_slider: 5.0.0
  collection: 1.19.0
  csv: 6.0.0
  equatable: 2.0.5
  fetch_api: 2.2.0
  fetch_client: 1.1.2
  ff_commons:
    path: ./dependencies/ff_commons # 1.0.0+1
  ff_theme:
    path: ./dependencies/ff_theme # 1.0.0+1
  firebase_auth: 5.3.3
  firebase_auth_platform_interface: 7.4.9
  firebase_auth_web: 5.13.4
  firebase_core: 3.8.0
  firebase_core_platform_interface: 5.3.0
  firebase_core_web: 2.18.1
  firebase_performance: 0.10.0+10
  firebase_performance_platform_interface: 0.1.4+46
  firebase_performance_web: 0.1.7+4
  flutter_animate: 4.5.0
  flutter_cache_manager: 3.4.1
  flutter_secure_storage: 9.2.2
  flutter_secure_storage_linux: 1.2.1
  flutter_secure_storage_macos: 3.1.2
  flutter_secure_storage_platform_interface: 1.1.2
  flutter_secure_storage_web: 1.2.1
  flutter_secure_storage_windows: 3.1.2
  font_awesome_flutter: 10.7.0
  from_css_color: 2.0.0
  go_router: 12.1.3
  google_fonts: 6.1.0
  google_sign_in: 6.2.1
  google_sign_in_android: 6.1.30
  google_sign_in_ios: 5.7.7
  google_sign_in_platform_interface: 2.4.5
  google_sign_in_web: 0.12.4+2
  http: 1.2.2
  intl: 0.19.0
  json_path: 0.7.2
  mime_type: 1.0.0
  page_transition: 2.1.0
  path_provider: 2.1.4
  path_provider_android: 2.2.10
  path_provider_foundation: 2.4.0
  path_provider_linux: 2.2.1
  path_provider_platform_interface: 2.1.2
  path_provider_windows: 2.3.0
  plugin_platform_interface: 2.1.8
  provider: 6.1.2
  rxdart: 0.27.7
  shared_preferences: 2.3.2
  shared_preferences_android: 2.3.2
  shared_preferences_foundation: 2.5.2
  shared_preferences_linux: 2.4.1
  shared_preferences_platform_interface: 2.4.1
  shared_preferences_web: 2.4.2
  shared_preferences_windows: 2.4.1
  sign_in_with_apple: 6.1.2
  sign_in_with_apple_platform_interface: 1.1.0
  sign_in_with_apple_web: 2.1.0
  simple_gradient_text: 1.2.3
  smooth_page_indicator: 1.1.0
  sqflite: 2.3.3+1
  sqflite_common: 2.5.4+3
  synchronized: 3.2.0
  timeago: 3.6.1
  toggle_button_cmbg9l:
    path: ./dependencies/toggle_button_cmbg9l # 0.0.8
  url_launcher: 6.3.0
  url_launcher_android: 6.3.10
  url_launcher_ios: 6.3.1
  url_launcher_linux: 3.2.0
  url_launcher_macos: 3.2.1
  url_launcher_platform_interface: 2.3.2
  url_launcher_web: 2.3.3
  url_launcher_windows: 3.1.2

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0

dependency_overrides:
  http: 1.2.2
  uuid: ^4.0.0

dev_dependencies:
  flutter_lints: 4.0.0
  lints: 4.0.0
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/fonts/
    - assets/images/
    - assets/videos/
    - assets/audios/
    - assets/rive_animations/
    - assets/pdfs/
    - assets/jsons/
    - dependencies/toggle_button_cmbg9l/assets/fonts/
    - dependencies/toggle_button_cmbg9l/assets/images/
    - dependencies/toggle_button_cmbg9l/assets/videos/
    - dependencies/toggle_button_cmbg9l/assets/audios/
    - dependencies/toggle_button_cmbg9l/assets/rive_animations/
    - dependencies/toggle_button_cmbg9l/assets/pdfs/
    - dependencies/toggle_button_cmbg9l/assets/jsons/



  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages


```

### web/flutter_bootstrap.js

```javascript
{{flutter_js}}
{{flutter_build_config}}

_flutter.loader.load(
    {
        onEntrypointLoaded: async function(engineInitializer) {
            // Initialize the Flutter engine
            let appRunner = await engineInitializer.initializeEngine({});
            // Run the app
            await appRunner.runApp();
          }
    }
);

```

### test/widget_test.dart

```dart
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.

import 'package:flutter_test/flutter_test.dart';

import 'package:translate_using_groq_streaming_a_p_is/main.dart';

void main() {
  testWidgets('Counter increments smoke test', (WidgetTester tester) async {
    // Build our app and trigger a frame.
    await tester.pumpWidget(MyApp());
  });
}

```

### lib/index.dart

```dart
// Export pages
export '/auth/onboarding_welcome/onboarding_welcome_widget.dart'
    show OnboardingWelcomeWidget;
export '/auth/login/login_widget.dart' show LoginWidget;
export '/auth/onboarding_call/onboarding_call_widget.dart'
    show OnboardingCallWidget;
export '/auth/onboarding_history/onboarding_history_widget.dart'
    show OnboardingHistoryWidget;
export '/auth/onboarding_schedule/onboarding_schedule_widget.dart'
    show OnboardingScheduleWidget;
export '/agent/noa/noa_widget.dart' show NoaWidget;
export '/agent/sam/sam_widget.dart' show SamWidget;
export '/interaction/dashboard/dashboard_widget.dart' show DashboardWidget;
export '/auth/create_account/create_account_widget.dart'
    show CreateAccountWidget;
export '/auth/onboarding_done/onboarding_done_widget.dart'
    show OnboardingDoneWidget;
export '/agent/noa_negotiate/noa_negotiate_widget.dart' show NoaNegotiateWidget;

```

### web/index.html

```html
<!DOCTYPE html>
<html>
<head>
  <!--
    If you are serving your web app in a path other than the root, change the
    href value below to reflect the base path you are serving from.

    The path provided below has to start and end with a slash "/" in order for
    it to work correctly.

    Alternatively, build your application passing the --base-href parameter
    specifying the new root path of your web app.

    Fore more details:
    * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
  -->
  <base href="$FLUTTER_BASE_HREF">

  <meta charset="UTF-8">
  <meta content="IE=Edge" http-equiv="X-UA-Compatible">

  <!-- iOS meta tags & icons -->
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="apple-mobile-web-app-title" content="Translate using Groq  Streaming APIs">

  

  <meta name="robots" content="noindex" />

  <!-- Favicon -->
  <link rel="icon" type="image/png" href="favicon.png" />

  <!-- Open Graph & SEO tags -->
  <meta property="og:title" content="Translate using Groq  Streaming APIs" />
  <meta property="og:description" content="Built with FlutterFlow." />
  <meta property="og:image" content="https://storage.googleapis.com/flutterflow-prod-hosting/og_splash_gradient.png" /> 
  <meta name="twitter:title" content="Translate using Groq  Streaming APIs" />
  <meta name="twitter:description" content="Built with FlutterFlow." />
  <meta name="twitter:image" content="https://storage.googleapis.com/flutterflow-prod-hosting/og_splash_gradient.png" />
  <meta name="twitter:card" content="summary_large_image" />

  <title> Translate using Groq  Streaming APIs </title>
  <meta name="description" content="Built with FlutterFlow." />
    

  <!-- Status Bar color in Safari browser (iOS) and PWA -->
  <meta name="theme-color" media="(prefers-color-scheme: light)" content="#f1f4f8">
  <meta name="theme-color" media="(prefers-color-scheme: dark)"  content="#1d2428">

  <link rel="manifest" href="manifest.json">
  
</head>
<body>
  
  
  
  
  
  <script>
    {{flutter_bootstrap_js}}
  </script>
</body>
</html>

```

### lib/main.dart

```dart
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';

import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_web_plugins/url_strategy.dart';
import 'auth/firebase_auth/firebase_user_provider.dart';
import 'auth/firebase_auth/auth_util.dart';

import 'backend/firebase/firebase_config.dart';
import 'package:ff_theme/flutter_flow/flutter_flow_theme.dart';
import 'flutter_flow/flutter_flow_util.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  GoRouter.optionURLReflectsImperativeAPIs = true;
  usePathUrlStrategy();

  await initFirebase();

  await FlutterFlowTheme.initialize();

  final appState = FFAppState(); // Initialize FFAppState
  await appState.initializePersistedState();

  runApp(MultiProvider(
    providers: [
      ChangeNotifierProvider(
        create: (context) => appState,
      ),
    ],
    child: MyApp(),
  ));
}

class MyApp extends StatefulWidget {
  // This widget is the root of your application.
  @override
  State<MyApp> createState() => _MyAppState();

  static _MyAppState of(BuildContext context) =>
      context.findAncestorStateOfType<_MyAppState>()!;
}

class _MyAppState extends State<MyApp> {
  ThemeMode _themeMode = FlutterFlowTheme.themeMode;

  late AppStateNotifier _appStateNotifier;
  late GoRouter _router;
  String getRoute([RouteMatch? routeMatch]) {
    final RouteMatch lastMatch =
        routeMatch ?? _router.routerDelegate.currentConfiguration.last;
    final RouteMatchList matchList = lastMatch is ImperativeRouteMatch
        ? lastMatch.matches
        : _router.routerDelegate.currentConfiguration;
    return matchList.uri.toString();
  }

  late Stream<BaseAuthUser> userStream;

  @override
  void initState() {
    super.initState();

    _appStateNotifier = AppStateNotifier.instance;
    _router = createRouter(_appStateNotifier);
    userStream = translateUsingGroqStreamingAPIsFirebaseUserStream()
      ..listen((user) {
        _appStateNotifier.update(user);
      });
    jwtTokenStream.listen((_) {});
    Future.delayed(
      Duration(milliseconds: 1000),
      () => _appStateNotifier.stopShowingSplashImage(),
    );
  }

  void setThemeMode(ThemeMode mode) => safeSetState(() {
        _themeMode = mode;
        FlutterFlowTheme.saveThemeMode(mode);
      });

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Translate using Groq  Streaming APIs',
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: const [Locale('en', '')],
      theme: ThemeData(
        brightness: Brightness.light,
        useMaterial3: false,
      ),
      darkTheme: ThemeData(
        brightness: Brightness.dark,
        useMaterial3: false,
      ),
      themeMode: _themeMode,
      routerConfig: _router,
    );
  }
}

```

### lib/app_state.dart

```dart
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:csv/csv.dart';
import 'package:synchronized/synchronized.dart';
import 'flutter_flow/flutter_flow_util.dart';

class FFAppState extends ChangeNotifier {
  static FFAppState _instance = FFAppState._internal();

  factory FFAppState() {
    return _instance;
  }

  FFAppState._internal();

  static void reset() {
    _instance = FFAppState._internal();
  }

  Future initializePersistedState() async {
    secureStorage = FlutterSecureStorage();
    await _safeInitAsync(() async {
      _lastSelectedLanguage =
          await secureStorage.getString('ff_lastSelectedLanguage') ??
              _lastSelectedLanguage;
    });
    await _safeInitAsync(() async {
      _groqApiKey =
          await secureStorage.getString('ff_groqApiKey') ?? _groqApiKey;
    });
  }

  void update(VoidCallback callback) {
    callback();
    notifyListeners();
  }

  late FlutterSecureStorage secureStorage;

  String _translatedChunks = '';
  String get translatedChunks => _translatedChunks;
  set translatedChunks(String value) {
    _translatedChunks = value;
  }

  String _transcription = '';
  String get transcription => _transcription;
  set transcription(String value) {
    _transcription = value;
  }

  String _lastSelectedLanguage = '';
  String get lastSelectedLanguage => _lastSelectedLanguage;
  set lastSelectedLanguage(String value) {
    _lastSelectedLanguage = value;
    secureStorage.setString('ff_lastSelectedLanguage', value);
  }

  void deleteLastSelectedLanguage() {
    secureStorage.delete(key: 'ff_lastSelectedLanguage');
  }

  String _groqApiKey = '';
  String get groqApiKey => _groqApiKey;
  set groqApiKey(String value) {
    _groqApiKey = value;
    secureStorage.setString('ff_groqApiKey', value);
  }

  void deleteGroqApiKey() {
    secureStorage.delete(key: 'ff_groqApiKey');
  }
}

void _safeInit(Function() initializeField) {
  try {
    initializeField();
  } catch (_) {}
}

Future _safeInitAsync(Function() initializeField) async {
  try {
    await initializeField();
  } catch (_) {}
}

extension FlutterSecureStorageExtensions on FlutterSecureStorage {
  static final _lock = Lock();

  Future<void> writeSync({required String key, String? value}) async =>
      await _lock.synchronized(() async {
        await write(key: key, value: value);
      });

  void remove(String key) => delete(key: key);

  Future<String?> getString(String key) async => await read(key: key);
  Future<void> setString(String key, String value) async =>
      await writeSync(key: key, value: value);

  Future<bool?> getBool(String key) async => (await read(key: key)) == 'true';
  Future<void> setBool(String key, bool value) async =>
      await writeSync(key: key, value: value.toString());

  Future<int?> getInt(String key) async =>
      int.tryParse(await read(key: key) ?? '');
  Future<void> setInt(String key, int value) async =>
      await writeSync(key: key, value: value.toString());

  Future<double?> getDouble(String key) async =>
      double.tryParse(await read(key: key) ?? '');
  Future<void> setDouble(String key, double value) async =>
      await writeSync(key: key, value: value.toString());

  Future<List<String>?> getStringList(String key) async =>
      await read(key: key).then((result) {
        if (result == null || result.isEmpty) {
          return null;
        }
        return CsvToListConverter()
            .convert(result)
            .first
            .map((e) => e.toString())
            .toList();
      });
  Future<void> setStringList(String key, List<String> value) async =>
      await writeSync(key: key, value: ListToCsvConverter().convert([value]));
}

```

[96 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]