├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── ava_v2
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-hdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-mdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-v21
│ │ │ ├── background.png
│ │ │ └── launch_background.xml
│ │ │ ├── drawable-xhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-xxhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ └── splash.png
│ │ │ ├── drawable
│ │ │ ├── background.png
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── launcher_icon.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── app_screenshots
├── credits.png
├── home.png
└── settings.png
├── assets
├── audio
│ └── WelcomeMessage.mp3
├── images
│ ├── icon.png
│ ├── logo-no-background.png
│ └── splash.png
└── lottie
│ ├── back.json
│ ├── clockwise_circles.json
│ ├── confirmation_animation.json
│ ├── double_line_loading.json
│ ├── outlined_circle.json
│ ├── polygonal_star.json
│ ├── shifting_blocks.json
│ ├── slinky.json
│ ├── tesseract.json
│ ├── triangles.json
│ └── triple_ven_diagram.json
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-50x50@1x.png
│ │ ├── Icon-App-50x50@2x.png
│ │ ├── Icon-App-57x57@1x.png
│ │ ├── Icon-App-57x57@2x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-72x72@1x.png
│ │ ├── Icon-App-72x72@2x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ ├── LaunchBackground.imageset
│ │ ├── Contents.json
│ │ └── background.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── controllers
│ ├── export_controllers.dart
│ └── input_question_controller.dart
├── database
│ ├── api_key_storage_helper.dart
│ └── prompt_storage_helper.dart
├── main.dart
├── providers
│ ├── chat_history_provider.dart
│ ├── export_providers.dart
│ ├── loading_icon_elevenlabs_provider.dart
│ ├── loading_icon_gpt_provider.dart
│ ├── settings_provider.dart
│ └── theme_provider.dart
├── view_models
│ ├── elevenlabs_api_view_model.dart
│ ├── export_view_models.dart
│ └── gpt_api_view_model.dart
├── views
│ ├── credits_screen.dart
│ ├── home_screen.dart
│ └── onboarding_screen.dart
└── widgets
│ ├── bottom_sheets
│ ├── prompt_bottom_sheet.dart
│ └── settings_bottom_sheet.dart
│ ├── credits_screen
│ ├── about_dialogue_popup.dart
│ └── export_credits_widgets.dart
│ └── home_screen
│ ├── credits_button.dart
│ ├── export_home_screen_widgets.dart
│ ├── input_box.dart
│ ├── input_clear_button.dart
│ ├── input_prompt_button.dart
│ ├── input_submit_button.dart
│ ├── output_box.dart
│ ├── output_tts_button.dart
│ ├── settings_button.dart
│ └── theme_mode_button.dart
├── linux
├── .gitignore
├── CMakeLists.txt
├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
├── main.cc
├── my_application.cc
└── my_application.h
├── macos
├── .gitignore
├── Flutter
│ ├── Flutter-Debug.xcconfig
│ ├── Flutter-Release.xcconfig
│ └── GeneratedPluginRegistrant.swift
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── app_icon_1024.png
│ │ ├── app_icon_128.png
│ │ ├── app_icon_16.png
│ │ ├── app_icon_256.png
│ │ ├── app_icon_32.png
│ │ ├── app_icon_512.png
│ │ └── app_icon_64.png
│ ├── Base.lproj
│ └── MainMenu.xib
│ ├── Configs
│ ├── AppInfo.xcconfig
│ ├── Debug.xcconfig
│ ├── Release.xcconfig
│ └── Warnings.xcconfig
│ ├── DebugProfile.entitlements
│ ├── Info.plist
│ ├── MainFlutterWindow.swift
│ └── Release.entitlements
├── pubspec.lock
├── pubspec.yaml
├── web
├── favicon.png
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
├── manifest.json
└── splash
│ ├── img
│ ├── dark-1x.png
│ ├── dark-2x.png
│ ├── dark-3x.png
│ ├── dark-4x.png
│ ├── light-1x.png
│ ├── light-2x.png
│ ├── light-3x.png
│ └── light-4x.png
│ ├── splash.js
│ └── style.css
└── windows
├── .gitignore
├── CMakeLists.txt
├── flutter
├── CMakeLists.txt
├── generated_plugin_registrant.cc
├── generated_plugin_registrant.h
└── generated_plugins.cmake
└── runner
├── CMakeLists.txt
├── Runner.rc
├── flutter_window.cpp
├── flutter_window.h
├── main.cpp
├── resource.h
├── resources
└── app_icon.ico
├── runner.exe.manifest
├── utils.cpp
├── utils.h
├── win32_window.cpp
└── win32_window.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 9944297138845a94256f1cf37beb88ff9a8e811a
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
17 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
18 | - platform: android
19 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
20 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
21 | - platform: ios
22 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
23 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
24 | - platform: linux
25 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
26 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
27 | - platform: macos
28 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
29 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
30 | - platform: web
31 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
32 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
33 | - platform: windows
34 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
35 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # AVA - Advanced Virtual Agent
6 |
7 | *AVA* stands for ***advanced virtual agent*** and is meant to help anyone with quick/on-tap question handling on mobile platforms. Created by Noah Velasco, AVA started as a personal project and will continue to be supported until further notice. This repository can be used by anyone however requires API key's anyone can generate for free from [OpenAI](https://platform.openai.com/account/api-keys) and [ElevenLabs](https://docs.elevenlabs.io/authentication/01-xi-api-key). The goal is to create a plug and play virtual agent that anyone can use with minor constraints such as the overall UI/UX experience.
8 |
9 |
10 | Technologies Used
11 |
12 |
13 |
14 |
15 |
16 |
17 | ---
18 | ## Preview
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | ---
27 | ## Live Demo
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ---
36 | ## Features & TODO's
37 | - [x] Light/Dark mode implementation
38 | - [x] Basic input and output from GPT-3.5-Turbo
39 | - [x] Reads GPT-3.5-Turbo output using ElevenLabs Text-To-Speech
40 | - [x] Modify/Update request parameters of GPT and ElevenLabs using sliders
41 | - [x] About and license page
42 | - [x] Modify/Update the API key's in App
43 | - [x] Store user gpt and elevenlabs slider configuations (volatile)
44 | - [x] Introduction page for initial user setup
45 | - [x] Store user API keys using secure storage (non volatile memory)
46 | - [x] Preset prompt selection using sqflite
47 | - [x] Comment cleanup
48 | - [x] Documentation
49 |
50 | ---
51 | ## How to use
52 | 1. Download flutter
53 | 2. Download this repo
54 | 3. `flutter run` in `./lib/main.dart`
55 |
56 | ---
57 |
58 | ## Build Info
59 | * Flutter 3.7.12
60 | * Dart 2.19.6
61 | * DevTools 2.20.1
62 |
63 | ---
64 | ## Possible Issues
65 |
66 | ### Both
67 | * Incompatible with Flutter 3.10
68 |
69 | ### Android
70 | * Enable developer mode on your phone
71 |
72 | ### iOS
73 | * Enable developer mode on your phone
74 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 | ndkVersion flutter.ndkVersion
31 |
32 | compileOptions {
33 | sourceCompatibility JavaVersion.VERSION_1_8
34 | targetCompatibility JavaVersion.VERSION_1_8
35 | }
36 |
37 | kotlinOptions {
38 | jvmTarget = '1.8'
39 | }
40 |
41 | sourceSets {
42 | main.java.srcDirs += 'src/main/kotlin'
43 | }
44 |
45 | defaultConfig {
46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
47 | applicationId "com.example.ava_v2"
48 | // You can update the following values to match your application needs.
49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
50 | minSdkVersion 18
51 | targetSdkVersion flutter.targetSdkVersion
52 | versionCode flutterVersionCode.toInteger()
53 | versionName flutterVersionName
54 | multiDexEnabled true //added by noah because of multidex issue
55 | }
56 |
57 | buildTypes {
58 | release {
59 | // TODO: Add your own signing config for the release build.
60 | // Signing with the debug keys for now, so `flutter run --release` works.
61 | signingConfig signingConfigs.debug
62 | }
63 | }
64 | }
65 |
66 | flutter {
67 | source '../..'
68 | }
69 |
70 | dependencies {
71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72 |
73 | implementation 'com.android.support:multidex:1.0.3' //added by noah because of multidex issue
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
10 |
11 |
12 |
20 |
24 |
28 |
29 |
30 |
31 |
32 |
33 |
35 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/ava_v2/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.ava_v2
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/drawable-hdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/drawable-mdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/drawable-v21/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/drawable-xhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/drawable-xxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/drawable-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/drawable/background.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-hdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-mdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
19 |
22 |
23 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.2.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/app_screenshots/credits.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/app_screenshots/credits.png
--------------------------------------------------------------------------------
/app_screenshots/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/app_screenshots/home.png
--------------------------------------------------------------------------------
/app_screenshots/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/app_screenshots/settings.png
--------------------------------------------------------------------------------
/assets/audio/WelcomeMessage.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/assets/audio/WelcomeMessage.mp3
--------------------------------------------------------------------------------
/assets/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/assets/images/icon.png
--------------------------------------------------------------------------------
/assets/images/logo-no-background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/assets/images/logo-no-background.png
--------------------------------------------------------------------------------
/assets/images/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/assets/images/splash.png
--------------------------------------------------------------------------------
/assets/lottie/back.json:
--------------------------------------------------------------------------------
1 | {"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.20","a":"","k":"","d":"","tc":""},"fr":32,"ip":0,"op":33,"w":192,"h":192,"nm":"back","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 6 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":2,"s":[96,96,0],"to":[-2.167,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":12,"s":[83,96,0],"to":[0,0,0],"ti":[-2.167,0,0]},{"t":22,"s":[96,96,0]}],"ix":2},"a":{"a":0,"k":[36.792,47.752,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[10.96,21.92],[-10.96,0],[10.96,-21.92]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.027456227471,0.022800712959,0.0242376795,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10.333,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[36.792,47.752],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":33,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/assets/lottie/clockwise_circles.json:
--------------------------------------------------------------------------------
1 | {"v":"4.6.3","fr":25,"ip":0,"op":24,"w":600,"h":600,"nm":"loading(2)_ looped","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","ks":{"o":{"a":0,"k":100},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":0,"s":[0],"e":[230]},{"t":23}]},"p":{"a":0,"k":[300,300,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[40,40,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[155,155]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0.2078431,0.2039216,0.1647059,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":40},"lc":2,"lj":1,"ml":4,"d":[{"n":"d","nm":"dash","v":{"a":0,"k":0}},{"n":"g","nm":"gap","v":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":12,"s":[61],"e":[50]},{"t":24}]}},{"n":"o","nm":"offset","v":{"a":0,"k":0}}],"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.506],"y":[0.982]},"o":{"x":[0.417],"y":[0.006]},"n":["0p506_0p982_0p417_0p006"],"t":12,"s":[0],"e":[35]},{"t":24}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.517],"y":[0.995]},"o":{"x":[0.167],"y":[0.167]},"n":["0p517_0p995_0p167_0p167"],"t":0,"s":[1],"e":[35]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0p833_1_0p167_0"],"t":11,"s":[35],"e":[38]},{"t":12}],"ix":2},"o":{"a":0,"k":-90,"ix":3},"m":1,"ix":4,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"},{"ty":"tr","p":{"a":0,"k":[0.031,-0.031],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group"},{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[155,155]},"p":{"a":0,"k":[0,0]},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse"},{"ty":"st","c":{"a":0,"k":[0.2078431,0.2039216,0.1647059,1]},"o":{"a":0,"k":100},"w":{"a":0,"k":40},"lc":2,"lj":1,"ml":4,"d":[{"n":"d","nm":"dash","v":{"a":0,"k":0}},{"n":"g","nm":"gap","v":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":12,"s":[61],"e":[50]},{"t":24}]}},{"n":"o","nm":"offset","v":{"a":0,"k":0}}],"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke"},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.506],"y":[0.982]},"o":{"x":[0.417],"y":[0.006]},"n":["0p506_0p982_0p417_0p006"],"t":12,"s":[0],"e":[35]},{"t":24}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.517],"y":[0.995]},"o":{"x":[0.167],"y":[0.167]},"n":["0p517_0p995_0p167_0p167"],"t":0,"s":[1],"e":[35]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"n":["0p833_1_0p167_0"],"t":11,"s":[35],"e":[38]},{"t":12}],"ix":2},"o":{"a":0,"k":-90,"ix":3},"m":1,"ix":4,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim"},{"ty":"tr","p":{"a":0,"k":[0.031,-0.031],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":180,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 2","np":4,"cix":2,"ix":2,"mn":"ADBE Vector Group"}],"ip":0,"op":24,"st":0,"bm":0,"sr":1}]}
--------------------------------------------------------------------------------
/assets/lottie/confirmation_animation.json:
--------------------------------------------------------------------------------
1 | {"v":"5.7.4","fr":27.0050048828125,"ip":35.0000063283998,"op":93.0000168154624,"w":1080,"h":1080,"nm":"Comp 2","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[540,540,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-290,-87],[-49,153],[197,-94]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"t":53.666,"s":[0]},{"t":59.3337607282198,"s":[31]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"t":53.666,"s":[0]},{"t":60.0000108486854,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.052263151431,0.694117647059,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":65,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":270.000048819084,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[540,540,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[710.812,710.812],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.052263151431,0.694117647059,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":65,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[26.008,29.93],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.333],"y":[0]},"t":39,"s":[100]},{"t":53.6662597034711,"s":[0]}],"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":-77,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":270.000048819084,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/assets/lottie/double_line_loading.json:
--------------------------------------------------------------------------------
1 | {"v":"5.5.7","meta":{"g":"LottieFiles AE 0.1.21","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":60.0000024438501,"w":900,"h":900,"nm":"line","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"line loading 3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[451,392,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-108,58],[106,58]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.347],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":8,"s":[0]},{"t":34.0000013848484,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.654],"y":[1]},"o":{"x":[0.347],"y":[0]},"t":2,"s":[0]},{"t":24.00000097754,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":37.0000015070409,"st":4.00000016292334,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"line loading 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[461,416,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-108,58],[106,58]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.471],"y":[0.706]},"o":{"x":[0.388],"y":[0]},"t":10,"s":[0]},{"i":{"x":[0.603],"y":[1]},"o":{"x":[0.276],"y":[0.303]},"t":29,"s":[82.421]},{"t":37.0000015070409,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.654],"y":[1]},"o":{"x":[0.347],"y":[0]},"t":5,"s":[0]},{"t":29.0000011811942,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":3.00000012219251,"op":40.0000016292334,"st":7.00000028511585,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/assets/lottie/slinky.json:
--------------------------------------------------------------------------------
1 | {"v":"5.7.8","fr":60,"ip":0,"op":360,"w":1080,"h":1080,"nm":"NVP-circle-animation","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"circle-5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[250]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[430]},{"t":359,"s":[250]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[250]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[430]},{"t":359,"s":[250]}],"ix":4}},"a":{"a":0,"k":[-700,-700,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[400,400],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.8,0.8,0.8,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-500,-500],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"circle-4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[200]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[480]},{"t":359,"s":[200]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[200]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[480]},{"t":359,"s":[200]}],"ix":4}},"a":{"a":0,"k":[-700,-700,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[400,400],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.8,0.8,0.8,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-500,-500],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"circle-3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[150]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[530]},{"t":359,"s":[150]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[150]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[530]},{"t":359,"s":[150]}],"ix":4}},"a":{"a":0,"k":[-700,-700,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[400,400],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.8,0.8,0.8,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-500,-500],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"circle-2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[100]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[580]},{"t":359,"s":[100]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[100]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[580]},{"t":359,"s":[100]}],"ix":4}},"a":{"a":0,"k":[-700,-700,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[400,400],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.8,0.8,0.8,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-500,-500],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"circle-1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[50]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[630]},{"t":359,"s":[50]}],"ix":3},"y":{"a":1,"k":[{"i":{"x":[0.417],"y":[1]},"o":{"x":[0.585],"y":[0]},"t":0,"s":[50]},{"i":{"x":[0.415],"y":[1]},"o":{"x":[0.587],"y":[0]},"t":180,"s":[630]},{"t":359,"s":[50]}],"ix":4}},"a":{"a":0,"k":[-700,-700,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[400,400],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.8,0.8,0.8,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-500,-500],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":360,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "background.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "author" : "xcode",
19 | "version" : 1
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "filename" : "LaunchImage.png",
5 | "idiom" : "universal",
6 | "scale" : "1x"
7 | },
8 | {
9 | "filename" : "LaunchImage@2x.png",
10 | "idiom" : "universal",
11 | "scale" : "2x"
12 | },
13 | {
14 | "filename" : "LaunchImage@3x.png",
15 | "idiom" : "universal",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "author" : "xcode",
21 | "version" : 1
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSAllowsArbitraryLoads
6 |
7 | CFBundleDevelopmentRegion
8 | $(DEVELOPMENT_LANGUAGE)
9 | CFBundleDisplayName
10 | AVA
11 | CFBundleExecutable
12 | $(EXECUTABLE_NAME)
13 | CFBundleIdentifier
14 | $(PRODUCT_BUNDLE_IDENTIFIER)
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | AVA
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | $(FLUTTER_BUILD_NAME)
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | $(FLUTTER_BUILD_NUMBER)
27 | LSRequiresIPhoneOS
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | UIViewControllerBasedStatusBarAppearance
47 |
48 | CADisableMinimumFrameDurationOnPhone
49 |
50 | UIApplicationSupportsIndirectInputEvents
51 |
52 | UIStatusBarHidden
53 |
54 | UIBackgroundModes
55 |
56 | audio
57 |
58 | NSSoundCategoryAmbient
59 | App sound
60 |
61 |
62 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/controllers/export_controllers.dart:
--------------------------------------------------------------------------------
1 | export 'input_question_controller.dart';
2 |
--------------------------------------------------------------------------------
/lib/controllers/input_question_controller.dart:
--------------------------------------------------------------------------------
1 | /*
2 | This input controller is for the input box in the home screen and is necessary since
3 | the text controller needs to be accessible to various widgets on the home screen. Hence,
4 | by making it a provider, it can be accessed from anywhere in the app.
5 | */
6 |
7 | import 'package:flutter/material.dart';
8 |
9 | class InputQuestionController extends ChangeNotifier {
10 | final TextEditingController inputQuestionTextEditingController =
11 | TextEditingController();
12 |
13 | String get text => inputQuestionTextEditingController.text;
14 |
15 | void setText(String text) {
16 | inputQuestionTextEditingController.text = text;
17 | notifyListeners();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/lib/database/api_key_storage_helper.dart:
--------------------------------------------------------------------------------
1 | /*
2 | This is a 'database' that stores the api keys using
3 | flutter_secure_storage.
4 |
5 | Since api keys are sensitive - this requires more attention
6 | to secure storage.
7 | */
8 |
9 | import 'package:flutter_secure_storage/flutter_secure_storage.dart';
10 |
11 | class APIKeyStorageHelper {
12 | final FlutterSecureStorage _secureStorage = const FlutterSecureStorage();
13 |
14 | Future saveGPTAPIKey(String gptKey) async {
15 | await _secureStorage.write(key: 'gptkey', value: gptKey);
16 | }
17 |
18 | Future saveELAPIKey(String elevenLabsKey) async {
19 | await _secureStorage.write(key: 'elevenlabskey', value: elevenLabsKey);
20 | }
21 |
22 | Future getGPTAPIKey() async {
23 | return await _secureStorage.read(key: 'gptkey');
24 | }
25 |
26 | Future getELAPIKey() async {
27 | return await _secureStorage.read(key: 'elevenlabskey');
28 | }
29 |
30 | void deleteGPTAPIKey() async {
31 | await _secureStorage.delete(key: 'gptkey');
32 | }
33 |
34 | void deleteELAPIKey() async {
35 | await _secureStorage.delete(key: 'elevenlabskey');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/lib/database/prompt_storage_helper.dart:
--------------------------------------------------------------------------------
1 | /*
2 | Prompt database:
3 |
4 | title: title for prompt
5 | prompt: the full prompt text that will user will use
6 | status: default or custom to identify which can be edited/deleted. Default stays.
7 | */
8 |
9 | import 'dart:async';
10 | import 'package:flutter/material.dart';
11 | import 'package:sqflite/sqflite.dart';
12 | import 'package:path/path.dart';
13 |
14 | class PromptStorageHelper {
15 | static Database? _database;
16 |
17 | Future get database async {
18 | if (_database != null) {
19 | return _database!;
20 | } else {
21 | _database = await _initDatabase();
22 | return _database!;
23 | }
24 | }
25 |
26 | Future _initDatabase() async {
27 | String databasesPath = await getDatabasesPath();
28 | String dbPath = join(databasesPath, 'prompt_database.db');
29 |
30 | Database db = await openDatabase(
31 | dbPath,
32 | version: 1,
33 | onCreate: _createDatabase,
34 | );
35 |
36 | //after creating db then initialize the prompts
37 | await _initializeDefaultPrompts(db);
38 |
39 | return db;
40 | }
41 |
42 | Future _createDatabase(Database db, int version) async {
43 | await db.execute(
44 | 'CREATE TABLE prompt_table (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, prompt TEXT, status TEXT)');
45 | }
46 |
47 | Future>> getAllData() async {
48 | Database db = await database;
49 | return db.query('prompt_table');
50 | }
51 |
52 | Future deleteTable() async {
53 | Database db = await database;
54 | await db.execute('DROP TABLE IF EXISTS prompt_table');
55 | }
56 |
57 | void deleteDB() async {
58 | Database db = await database;
59 | String databasesPath = await getDatabasesPath();
60 | String dbPath = join(databasesPath, 'prompt_database.db');
61 | //close the connections
62 | await db.close();
63 | // Delete the database
64 | await deleteDatabase(dbPath);
65 | debugPrint("Deleted the database!");
66 | }
67 |
68 | Future _initializeDefaultPrompts(Database db) async {
69 | final existingPrompts = await db.query('prompt_table');
70 | debugPrint(
71 | '\n\n==============================\n Initializing Default Prompts...\n==============================\n\n');
72 | if (existingPrompts.isEmpty) {
73 | await db.insert('prompt_table', {
74 | 'title': 'Follow-Up 1',
75 | 'prompt': 'Are you sure?',
76 | 'status': 'default'
77 | });
78 |
79 | await db.insert('prompt_table',
80 | {'title': 'Follow-Up 2', 'prompt': 'Why?', 'status': 'default'});
81 |
82 | await db.insert('prompt_table', {
83 | 'title': 'Follow-Up 3',
84 | 'prompt': 'Tell me more.',
85 | 'status': 'default'
86 | });
87 |
88 | await db.insert('prompt_table',
89 | {'title': 'Follow-Up 4', 'prompt': 'WWJD?', 'status': 'default'});
90 |
91 | await db.insert('prompt_table', {
92 | 'title': 'Follow-Up 5',
93 | 'prompt': 'Explain that to me again but like I\'m 10',
94 | 'status': 'default'
95 | });
96 |
97 | await db.insert('prompt_table', {
98 | 'title': 'Follow-Up 6',
99 | 'prompt': 'Has this be proven scientifically?',
100 | 'status': 'default'
101 | });
102 |
103 | await db.insert('prompt_table', {
104 | 'title': 'Follow-Up 7',
105 | 'prompt': 'What are the sources for this claim?',
106 | 'status': 'default'
107 | });
108 | }
109 | debugPrint(
110 | '\n\n==============================\n Initialized Default Prompts...\n==============================\n\n');
111 | }
112 |
113 | //For debugging purposes
114 | void printTableData() async {
115 | Database db = await database;
116 | debugPrint('Printing DB');
117 |
118 | final tableData = await db.rawQuery('SELECT * FROM prompt_table');
119 | for (final row in tableData) {
120 | final id = row['id'];
121 | final title = row['title'];
122 | final prompt = row['prompt'];
123 | final status = row['status'];
124 |
125 | debugPrint('ID: $id');
126 | debugPrint('Title: $title');
127 | debugPrint('Prompt: $prompt');
128 | debugPrint('Status: $status');
129 | debugPrint('-----------------------');
130 | }
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Created by Noah Velasco
4 |
5 | Instructions: Run this file to start the entire program
6 | - to update prompts visit ./lib/database/prompt_storage_helper.dart
7 | */
8 |
9 | import 'package:shared_preferences/shared_preferences.dart';
10 | import 'package:flutter/material.dart';
11 | import 'package:flutter/services.dart';
12 | import 'package:google_fonts/google_fonts.dart';
13 | import 'package:provider/provider.dart';
14 |
15 | import 'database/api_key_storage_helper.dart';
16 | import 'database/prompt_storage_helper.dart';
17 | import 'providers/export_providers.dart';
18 | import '../view_models/export_view_models.dart';
19 | import 'views/home_screen.dart';
20 | import 'views/onboarding_screen.dart';
21 |
22 | void main() async {
23 | WidgetsFlutterBinding.ensureInitialized();
24 |
25 | // lock the app into portrait mode
26 | SystemChrome.setPreferredOrientations([
27 | DeviceOrientation.portraitUp,
28 | DeviceOrientation.portraitDown,
29 | ]);
30 |
31 | final prefs = await SharedPreferences.getInstance();
32 | final bool showHome = prefs.getBool('showHome') ?? false;
33 |
34 | /*
35 | Secure storage created at root of widget tree so it's available in
36 | onboarding_screen.dart & home_screen.dart for both the API keys.
37 | */
38 | final APIKeyStorageHelper apiKeyStorageHelper = APIKeyStorageHelper();
39 |
40 | /*
41 | Setup Database
42 |
43 | promptStorageHelper - where the DB object and its helper functions are
44 | promptStorageHelper.database - instantiates the database
45 | promptList - the list of prompts from the database object in promptStorageHelper
46 | */
47 | final PromptStorageHelper promptStorageHelper = PromptStorageHelper();
48 | await promptStorageHelper.database;
49 | List> promptList =
50 | await promptStorageHelper.getAllData();
51 |
52 | runApp(
53 | MultiProvider(
54 | providers: [
55 | ChangeNotifierProvider(
56 | create: (_) => ThemeProvider(),
57 | ),
58 | ChangeNotifierProvider(
59 | create: (_) => SettingsProvider(),
60 | ),
61 | ChangeNotifierProvider(
62 | create: (_) => LoadingIconGPTProvider(),
63 | ),
64 | ChangeNotifierProvider(
65 | create: (_) => LoadingIconELProvider(),
66 | ),
67 | ChangeNotifierProvider(
68 | create: (_) => GPTAPIViewModel(),
69 | ),
70 | ChangeNotifierProvider(
71 | create: (_) => ELAPIViewModel(),
72 | ),
73 | ChangeNotifierProvider(
74 | create: (_) => ChatHistoryProvider(),
75 | ),
76 | ],
77 | //pass the api key database and the prompt list to the main app
78 | child: Ava(
79 | apiKeyStorageHelper: apiKeyStorageHelper,
80 | promptList: promptList,
81 | showHome: showHome,
82 | ),
83 | ),
84 | );
85 | }
86 |
87 | class Ava extends StatefulWidget {
88 | final bool showHome;
89 | final APIKeyStorageHelper apiKeyStorageHelper;
90 | final List> promptList;
91 |
92 | const Ava({
93 | Key? key,
94 | required this.showHome,
95 | required this.apiKeyStorageHelper,
96 | required this.promptList,
97 | }) : super(key: key);
98 |
99 | @override
100 | State createState() => _AvaState();
101 | }
102 |
103 | class _AvaState extends State {
104 | @override
105 | void initState() {
106 | super.initState();
107 | }
108 |
109 | @override
110 | Widget build(BuildContext context) {
111 | SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
112 | statusBarColor: Colors.transparent,
113 | ));
114 |
115 | return Consumer(
116 | builder: (context, provider, child) {
117 | return MaterialApp(
118 | title: 'AVA',
119 | debugShowCheckedModeBanner: false,
120 | theme: ThemeData(
121 | // light theme settings
122 | useMaterial3: true,
123 |
124 | /* light theme color settings */
125 | colorScheme: const ColorScheme.light(
126 | background: Color(0xFFE7ECEF),
127 | primary: Color(0xFFE7ECEF),
128 | secondary: Color(0xFF252525),
129 | ),
130 | textTheme: GoogleFonts.montserratTextTheme(
131 | const TextTheme(
132 | bodyMedium: TextStyle(
133 | color: Color(0xFF252525),
134 | fontSize: 16.0,
135 | ),
136 | bodyLarge: TextStyle(
137 | color: Color(0xFF252525),
138 | fontSize: 25.0,
139 | letterSpacing: 2.5,
140 | ),
141 | ),
142 | ),
143 | dialogTheme: DialogTheme(
144 | backgroundColor: Colors.transparent,
145 | surfaceTintColor: Colors.white,
146 | iconColor: const Color(0xFFE7ECEF),
147 | shape: RoundedRectangleBorder(
148 | borderRadius: BorderRadius.circular(15.0),
149 | side: const BorderSide(
150 | color: Color(0xFF252525),
151 | width: 5.0,
152 | ),
153 | ),
154 | ),
155 | ),
156 | darkTheme: ThemeData(
157 | // dark theme settings
158 | useMaterial3: true,
159 |
160 | //changes the background color of the app thumbnail
161 | colorScheme: const ColorScheme.dark(
162 | background: Color(0xFF252525),
163 | primary: Color(0xFF252525),
164 | secondary: Color(0xFFE7ECEF),
165 | ),
166 | textTheme: GoogleFonts.montserratTextTheme(
167 | const TextTheme(
168 | bodyMedium: TextStyle(
169 | color: Color(0xFFE7ECEF),
170 | fontSize: 16.0,
171 | ),
172 | bodyLarge: TextStyle(
173 | color: Color(0xFFE7ECEF),
174 | fontSize: 25.0,
175 | letterSpacing: 2.5,
176 | ),
177 | ),
178 | ),
179 |
180 | dialogTheme: DialogTheme(
181 | backgroundColor: Colors.transparent,
182 | surfaceTintColor: Colors.white,
183 | iconColor: const Color(0xFFE7ECEF),
184 | shape: RoundedRectangleBorder(
185 | borderRadius: BorderRadius.circular(15.0),
186 | side: const BorderSide(
187 | color: Color(0xFFE7ECEF),
188 | width: 5.0,
189 | ),
190 | ),
191 | ),
192 | ),
193 | themeMode: provider.theme,
194 | home: widget.showHome
195 | ? Home(
196 | apiKeyStorageHelper: widget.apiKeyStorageHelper,
197 | promptList: widget.promptList,
198 | )
199 | : OnBoardingPage(
200 | apiKeyStorageHelper: widget.apiKeyStorageHelper,
201 | promptList: widget.promptList,
202 | ),
203 | );
204 | },
205 | );
206 | }
207 | }
208 |
--------------------------------------------------------------------------------
/lib/providers/chat_history_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ChatHistoryProvider extends ChangeNotifier {
4 | final List> _chatHistory = [
5 | {"role": "system", "content": "You are a helpful assistant named ava."},
6 | {"role": "assistant", "content": "Hi, my name is Ava."},
7 | ];
8 |
9 | List> get chatHistory => _chatHistory;
10 |
11 | void addUserPrompt(String userPrompt) {
12 | _chatHistory.add({"role": "user", "content": userPrompt});
13 | notifyListeners();
14 | }
15 |
16 | void addGPTResponse(String gptResponse) {
17 | _chatHistory.add({"role": "assistant", "content": gptResponse});
18 | notifyListeners();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/providers/export_providers.dart:
--------------------------------------------------------------------------------
1 | export 'theme_provider.dart';
2 | export 'settings_provider.dart';
3 | export 'loading_icon_gpt_provider.dart';
4 | export 'loading_icon_elevenlabs_provider.dart';
5 | export 'chat_history_provider.dart';
6 |
--------------------------------------------------------------------------------
/lib/providers/loading_icon_elevenlabs_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class LoadingIconELProvider extends ChangeNotifier {
4 | bool _isLoading = false;
5 |
6 | bool get isLoading => _isLoading;
7 |
8 | void setIsLoading(bool value) {
9 | _isLoading = value;
10 | notifyListeners();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/providers/loading_icon_gpt_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class LoadingIconGPTProvider extends ChangeNotifier {
4 | bool _isLoading = false;
5 |
6 | bool get isLoading => _isLoading;
7 |
8 | void setIsLoading(bool value) {
9 | _isLoading = value;
10 | notifyListeners();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/providers/settings_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class SettingsProvider extends ChangeNotifier {
4 | /*
5 | _gptTemp: gpt temperature
6 | _elLabsExpr: eleven-labs voice expressiveness
7 | _elLabsClar: eleven-labs voice clarity
8 | */
9 |
10 | double _gptTemp = 0.7;
11 | double _elLabsExpr = 0.15;
12 | double _elLabsClar = 0.75;
13 |
14 | double get gptTemp => _gptTemp;
15 | double get elLabsExpr => _elLabsExpr;
16 | double get elLabsClar => _elLabsClar;
17 |
18 | void setGPTTemp(double temp) {
19 | _gptTemp = temp;
20 | notifyListeners();
21 | }
22 |
23 | void setElLabsExpr(double expr) {
24 | _elLabsExpr = expr;
25 | notifyListeners();
26 | }
27 |
28 | void setElLabsClar(double clar) {
29 | _elLabsClar = clar;
30 | notifyListeners();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/providers/theme_provider.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class ThemeProvider extends ChangeNotifier {
4 | //_theme: keeps track of light mode and dark mode
5 | ThemeMode _theme = ThemeMode.dark;
6 | ThemeMode get theme => _theme;
7 |
8 | void toggleTheme() {
9 | final isDark = (_theme == ThemeMode.dark);
10 | _theme = isDark ? ThemeMode.light : ThemeMode.dark;
11 | notifyListeners();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/view_models/elevenlabs_api_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:just_audio/just_audio.dart';
3 | import 'package:http/http.dart' as http;
4 | import 'dart:async';
5 | import 'dart:convert';
6 | import 'package:provider/provider.dart';
7 |
8 | import '../database/api_key_storage_helper.dart';
9 | import '../providers/export_providers.dart';
10 |
11 | class ELAPIViewModel extends ChangeNotifier {
12 | //For the Text To Speech
13 | Future playTextToSpeech(
14 | BuildContext context,
15 | APIKeyStorageHelper apiStorage,
16 | ) async {
17 | final settingsProvider =
18 | Provider.of(context, listen: false);
19 |
20 | final isLoadingVoiceProvider =
21 | Provider.of(context, listen: false);
22 |
23 | final chatHistoryProvider =
24 | Provider.of(context, listen: false);
25 |
26 | final player = AudioPlayer(); //audio player that will be playing the audio
27 |
28 | isLoadingVoiceProvider.setIsLoading(true);
29 |
30 | String url =
31 | 'https://api.elevenlabs.io/v1/text-to-speech/21m00Tcm4TlvDq8ikWAM';
32 | final response = await http.post(
33 | Uri.parse(url),
34 | headers: {
35 | 'accept': 'audio/mpeg',
36 | 'xi-api-key': (await apiStorage.getELAPIKey()) ??
37 | "", //api key decrypted only once its needed for request
38 | 'Content-Type': 'application/json',
39 | },
40 | body: json.encode({
41 | "text": chatHistoryProvider.chatHistory.last['content'],
42 | "voice_settings": {
43 | "stability": settingsProvider.elLabsExpr,
44 | "similarity_boost": settingsProvider.elLabsClar,
45 | }
46 | }),
47 | );
48 |
49 | isLoadingVoiceProvider.setIsLoading(false);
50 |
51 | if (response.statusCode == 200) {
52 | final bytes = response.bodyBytes; //get the bytes ElevenLabs sent back
53 | await player.setAudioSource(MyCustomSource(
54 | bytes)); //send the bytes to be read from the JustAudio library
55 | player.play(); //play the audio
56 | } else {
57 | // throw Exception('Failed to load audio');
58 | return;
59 | }
60 | } //getResponse from Eleven Labs
61 | }
62 |
63 | // Feed your own stream of bytes into the player - Taken from JustAudio package
64 | class MyCustomSource extends StreamAudioSource {
65 | final List bytes;
66 | MyCustomSource(this.bytes);
67 |
68 | @override
69 | Future request([int? start, int? end]) async {
70 | start ??= 0;
71 | end ??= bytes.length;
72 | return StreamAudioResponse(
73 | sourceLength: bytes.length,
74 | contentLength: end - start,
75 | offset: start,
76 | stream: Stream.value(bytes.sublist(start, end)),
77 | contentType: 'audio/mpeg',
78 | );
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lib/view_models/export_view_models.dart:
--------------------------------------------------------------------------------
1 | export 'gpt_api_view_model.dart';
2 | export 'elevenlabs_api_view_model.dart';
3 |
--------------------------------------------------------------------------------
/lib/view_models/gpt_api_view_model.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'package:flutter/material.dart';
3 | import 'package:http/http.dart' as http;
4 | import 'package:provider/provider.dart';
5 |
6 | import '../database/api_key_storage_helper.dart';
7 | import '../providers/export_providers.dart';
8 |
9 | class GPTAPIViewModel extends ChangeNotifier {
10 | Future fetchGPTResponse(
11 | BuildContext context,
12 | APIKeyStorageHelper apiStorage,
13 | String input,
14 | ) async {
15 | /*
16 |
17 | Initialize all the providers we need first to get needed fields or to update fields
18 |
19 | - settingsProvider: to get the api key and temperature
20 | - isLoadingProvider: to set the loading icon to true
21 | - chatHistoryProvider: to add the user prompt and the gpt response to the chat history for conversational context
22 | */
23 |
24 | final settingsProvider =
25 | Provider.of(context, listen: false);
26 |
27 | final isLoadingProvider =
28 | Provider.of(context, listen: false);
29 |
30 | final chatHistoryProvider =
31 | Provider.of(context, listen: false);
32 |
33 | //since we are fetching request - we will set the loading icon to true so we can display it in answer text box temporarily
34 | isLoadingProvider.setIsLoading(true);
35 |
36 | //add the user prompt to the chat history
37 | chatHistoryProvider.addUserPrompt(input);
38 |
39 | //only supporting gpt-3.5-turbo for now
40 | String apiUrl = 'https://api.openai.com/v1/chat/completions';
41 |
42 | Map headers = {
43 | 'Content-Type': 'application/json',
44 | 'Authorization':
45 | 'Bearer ${(await apiStorage.getGPTAPIKey()) ?? ""}', //api key decrypted only once its needed for request
46 | };
47 |
48 | Map requestBody = {
49 | "model": "gpt-3.5-turbo",
50 | "messages": chatHistoryProvider.chatHistory,
51 | "temperature": settingsProvider.gptTemp,
52 | "max_tokens": 200,
53 | };
54 |
55 | try {
56 | //this is where we send the request to the gpt api
57 | http.Response response = await http.post(
58 | Uri.parse(apiUrl),
59 | headers: headers,
60 | body: json.encode(requestBody),
61 | );
62 |
63 | //set the loading icon to false since we are done fetching the response
64 | isLoadingProvider.setIsLoading(false);
65 |
66 | debugPrint(response.body);
67 |
68 | if (response.statusCode == 200) {
69 | Map responseJson = json.decode(response.body);
70 | String answer = responseJson['choices'][0]['message']
71 | ['content']; //extract the message from the response
72 |
73 | //add the gpt response to the history to keep conversational context
74 | chatHistoryProvider.addGPTResponse(answer);
75 | } else {
76 | //uncomment 'responeJson' below if you want to get the exact error code retrieved from API otherwise its useless
77 | // Map responseJson = json.decode(response.body);
78 | String errorSummary =
79 | "Your GPT API key is invalid. Please update your GPT API key and CONFIRM it in the settings section!";
80 | chatHistoryProvider.addGPTResponse(errorSummary);
81 | }
82 | } catch (e) {
83 | debugPrint("catch error");
84 | debugPrint('Request failed with error: $e');
85 | } finally {
86 | //notify the listeners to update the ui to remove the loading icon and display the answer regardless of success or failure
87 | notifyListeners();
88 | }
89 | } //get response from chatgpt future function
90 | }
91 |
--------------------------------------------------------------------------------
/lib/views/credits_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:animate_gradient/animate_gradient.dart';
3 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
4 | import '../widgets/credits_screen/export_credits_widgets.dart';
5 |
6 | class CreditsScreen extends StatefulWidget {
7 | const CreditsScreen({super.key});
8 |
9 | @override
10 | State createState() => _CreditsScreenState();
11 | }
12 |
13 | class _CreditsScreenState extends State
14 | with SingleTickerProviderStateMixin {
15 | //This controller is used to make the background gradient animate
16 | late AnimationController _controller;
17 |
18 | @override
19 | void initState() {
20 | super.initState();
21 | _controller = AnimationController(
22 | vsync: this,
23 | animationBehavior: AnimationBehavior.normal,
24 | duration: const Duration(
25 | seconds:
26 | 3), //controlls how long the animation will take in its entirety
27 | )..repeat(reverse: true);
28 | }
29 |
30 | @override
31 | void dispose() {
32 | _controller
33 | .dispose(); // dispose the controller so there is no error with the ticker
34 | super.dispose();
35 | }
36 |
37 | @override
38 | Widget build(BuildContext context) {
39 | ColorScheme colorScheme = Theme.of(context).colorScheme;
40 |
41 | return Scaffold(
42 | body: AnimateGradient(
43 | controller: _controller,
44 | primaryBegin: Alignment.topLeft,
45 | primaryEnd: Alignment.topRight,
46 | secondaryBegin: Alignment.bottomCenter,
47 | secondaryEnd: Alignment.bottomLeft,
48 | primaryColors: [
49 | colorScheme.primary,
50 | colorScheme.secondary,
51 | ],
52 | secondaryColors: [
53 | colorScheme.secondary,
54 | colorScheme.primary,
55 | ],
56 | //The sized box allows the background animated gradient to take over the entire screen
57 | child: Column(
58 | mainAxisAlignment: MainAxisAlignment.center,
59 | children: const [
60 | AboutDialoguePopUp(),
61 | ],
62 | ),
63 | ),
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/views/home_screen.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:just_audio/just_audio.dart';
3 | import 'package:shared_preferences/shared_preferences.dart';
4 |
5 | import '../database/api_key_storage_helper.dart';
6 | import '../widgets/home_screen/export_home_screen_widgets.dart';
7 | import '../controllers/input_question_controller.dart';
8 |
9 | class Home extends StatefulWidget {
10 | final APIKeyStorageHelper apiKeyStorageHelper;
11 | final List> promptList;
12 |
13 | const Home({
14 | super.key,
15 | required this.apiKeyStorageHelper,
16 | required this.promptList,
17 | });
18 |
19 | @override
20 | State createState() => _HomeState();
21 | }
22 |
23 | class _HomeState extends State {
24 | late InputQuestionController inputQuestionEditingController;
25 |
26 | @override
27 | void initState() {
28 | super.initState();
29 | playWelcomeMessage();
30 |
31 | //set the initial text for the input controller here
32 | inputQuestionEditingController = InputQuestionController();
33 | inputQuestionEditingController.setText("");
34 | }
35 |
36 | @override
37 | void dispose() {
38 | // Dispose of the controller when no longer needed
39 | inputQuestionEditingController.dispose();
40 | super.dispose();
41 | }
42 |
43 | void playWelcomeMessage() async {
44 | SharedPreferences prefs = await SharedPreferences.getInstance();
45 | bool? hasBeenPlayed = prefs.getBool('welcomeMessagePlayed') ?? false;
46 |
47 | //if the welcome message hasnt been played then play it
48 | if (hasBeenPlayed == false) {
49 | AudioPlayer audioPlayer = AudioPlayer();
50 |
51 | try {
52 | await audioPlayer.setAsset('../../assets/audio/WelcomeMessage.mp3');
53 | await audioPlayer.play();
54 | } catch (e) {
55 | debugPrint('Error playing audio: $e');
56 | } finally {
57 | audioPlayer.dispose();
58 | }
59 |
60 | // Set the flag to indicate it has been played
61 | await prefs.setBool('welcomeMessagePlayed', true);
62 | }
63 | }
64 |
65 | @override
66 | Widget build(BuildContext context) {
67 | final theme = Theme.of(context);
68 | final colorScheme = theme.colorScheme;
69 |
70 | return Scaffold(
71 | appBar: null,
72 | body: Container(
73 | color: colorScheme.background,
74 | child: Column(
75 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
76 | children: [
77 | Column(
78 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
79 | children: [
80 | const OutputBox(),
81 | const SizedBox(height: 15),
82 | OutputTTSButton(
83 | apiKeyStorageHelper: widget.apiKeyStorageHelper,
84 | ),
85 | ],
86 | ),
87 | Row(
88 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
89 | children: [
90 | Column(
91 | mainAxisAlignment: MainAxisAlignment.center,
92 | children: [
93 | InputBox(controller: inputQuestionEditingController),
94 | const SizedBox(height: 15),
95 | Row(
96 | children: [
97 | InputPromptButton(
98 | inputQuestionController:
99 | inputQuestionEditingController,
100 | promptList: widget.promptList,
101 | ),
102 | const SizedBox(width: 15),
103 | InputClearButton(
104 | controller: inputQuestionEditingController,
105 | ),
106 | const SizedBox(width: 15),
107 | InputSubmitButton(
108 | apiKeyStorageHelper: widget.apiKeyStorageHelper,
109 | controller: inputQuestionEditingController,
110 | ),
111 | ],
112 | ),
113 | ],
114 | ),
115 | ],
116 | ),
117 | Row(
118 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
119 | children: [
120 | const CreditsButton(),
121 | const ThemeModeButton(),
122 | SettingsButton(
123 | apiKeyStorageHelper: widget.apiKeyStorageHelper,
124 | ),
125 | ],
126 | )
127 | ],
128 | ),
129 | ),
130 | );
131 | }
132 | }
133 |
--------------------------------------------------------------------------------
/lib/widgets/bottom_sheets/prompt_bottom_sheet.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:provider/provider.dart';
3 |
4 | import '../../controllers/export_controllers.dart';
5 | import '../../providers/theme_provider.dart';
6 |
7 | class PromptBottomSheet extends StatefulWidget {
8 | final InputQuestionController inputQuestionController;
9 | final List> promptList;
10 |
11 | const PromptBottomSheet({
12 | Key? key,
13 | required this.inputQuestionController,
14 | required this.promptList,
15 | }) : super(key: key);
16 |
17 | @override
18 | State createState() => _PromptBottomSheetState();
19 | }
20 |
21 | class _PromptBottomSheetState extends State {
22 | @override
23 | void initState() {
24 | super.initState();
25 | }
26 |
27 | @override
28 | void dispose() {
29 | super.dispose();
30 | }
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | double width = MediaQuery.of(context).size.width;
35 | double height = MediaQuery.of(context).size.height;
36 |
37 | ColorScheme colorScheme = Theme.of(context).colorScheme;
38 | final provider = Provider.of(context);
39 |
40 | return SizedBox(
41 | height: height * .75,
42 | child: Scrollbar(
43 | thumbVisibility: true,
44 | radius: const Radius.circular(5.0),
45 | thickness: 5,
46 | child: ListView.builder(
47 | itemCount: widget.promptList.length,
48 | itemBuilder: (context, index) {
49 | final item = widget.promptList[index];
50 | final title = item['title'];
51 | final prompt = item['prompt'];
52 |
53 | return Padding(
54 | padding: const EdgeInsets.all(13.0),
55 | child: SizedBox(
56 | width: width,
57 | height: height * .09,
58 | child: NeumorphicButton(
59 | minDistance: -5,
60 | style: NeumorphicStyle(
61 | lightSource: LightSource.topLeft,
62 | intensity: provider.theme == ThemeMode.light ? .8 : .6,
63 | color: colorScheme.primary,
64 | shadowDarkColor: Colors.black,
65 | shadowLightColorEmboss: Colors.white,
66 | shadowDarkColorEmboss: Colors.black,
67 | depth: 2,
68 | shape: NeumorphicShape.flat,
69 | boxShape:
70 | NeumorphicBoxShape.roundRect(BorderRadius.circular(16)),
71 | ),
72 | child: Column(
73 | mainAxisAlignment: MainAxisAlignment.spaceEvenly,
74 | children: [
75 | Row(
76 | mainAxisAlignment: MainAxisAlignment.end,
77 | children: [
78 | Text(
79 | title,
80 | style: const TextStyle(
81 | fontSize: 10,
82 | fontStyle: FontStyle.italic,
83 | ),
84 | ),
85 | ],
86 | ),
87 | Scrollbar(
88 | child: SingleChildScrollView(
89 | scrollDirection: Axis.horizontal,
90 | child: Text(
91 | prompt,
92 | ),
93 | ),
94 | )
95 | ],
96 | ),
97 | onPressed: () {
98 | widget.inputQuestionController.setText(prompt);
99 | Navigator.pop(context);
100 | },
101 | ),
102 | ),
103 | );
104 | },
105 | ),
106 | ),
107 | );
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/lib/widgets/credits_screen/about_dialogue_popup.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
3 |
4 | class AboutDialoguePopUp extends StatefulWidget {
5 | const AboutDialoguePopUp({super.key});
6 |
7 | @override
8 | State createState() => _AboutDialoguePopUpState();
9 | }
10 |
11 | class _AboutDialoguePopUpState extends State {
12 | @override
13 | Widget build(BuildContext context) {
14 | final colorScheme = Theme.of(context).colorScheme;
15 | final textTheme = Theme.of(context).textTheme;
16 | final textThemeItalicized = textTheme.bodyMedium!.copyWith(
17 | fontStyle: FontStyle.italic,
18 | );
19 |
20 | double width = MediaQuery.of(context).size.width;
21 | double height = MediaQuery.of(context).size.height;
22 | return Center(
23 | child: AboutDialog(
24 | applicationName: "A.V.A.\nAdvanced Virtual Agent",
25 | applicationVersion: "2.0",
26 | applicationIcon: Image.asset(
27 | 'assets/images/icon.png',
28 | width: width * .15,
29 | color: colorScheme.secondary,
30 | ),
31 | applicationLegalese:
32 | "Copyright © 2023 Noah Velasco.\nAll rights reserved.",
33 | children: [
34 | Divider(
35 | height: height * .05,
36 | color: colorScheme.secondary,
37 | ),
38 | Text(
39 | "• Flutter Version: 3.7.12",
40 | style: textTheme.bodyMedium,
41 | ),
42 | Text(
43 | "• Dart SDK Version: 2.19.6",
44 | style: textTheme.bodyMedium,
45 | ),
46 | Divider(
47 | height: height * .05,
48 | color: colorScheme.secondary,
49 | ),
50 | Text(
51 | "Inspired by Ava and Samantha",
52 | style: textThemeItalicized,
53 | ),
54 | ],
55 | ),
56 | );
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/widgets/credits_screen/export_credits_widgets.dart:
--------------------------------------------------------------------------------
1 | export 'about_dialogue_popup.dart';
2 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/credits_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:font_awesome_flutter/font_awesome_flutter.dart';
3 | import 'package:provider/provider.dart';
4 |
5 | import '../../providers/theme_provider.dart';
6 | import '../../views/credits_screen.dart';
7 |
8 | class CreditsButton extends StatefulWidget {
9 | const CreditsButton({super.key});
10 |
11 | @override
12 | State createState() => _CreditsButtonState();
13 | }
14 |
15 | class _CreditsButtonState extends State {
16 | @override
17 | Widget build(BuildContext context) {
18 | final provider = Provider.of(context);
19 | ColorScheme colorScheme = Theme.of(context).colorScheme;
20 |
21 | return NeumorphicButton(
22 | padding: EdgeInsets.all(MediaQuery.of(context).size.width * 0.05),
23 | minDistance: -5,
24 | style: NeumorphicStyle(
25 | lightSource: LightSource.topLeft,
26 | intensity: provider.theme == ThemeMode.light ? .8 : .4,
27 | color: colorScheme.primary,
28 | shadowLightColor: Colors.white,
29 | shadowDarkColor: Colors.black,
30 | shadowLightColorEmboss: Colors.white,
31 | shadowDarkColorEmboss: Colors.black,
32 | depth: provider.theme == ThemeMode.light ? 9 : 3,
33 | shape: NeumorphicShape.concave,
34 | surfaceIntensity: .5,
35 | boxShape: const NeumorphicBoxShape.circle(),
36 | ),
37 | onPressed: () {
38 | FocusManager.instance.primaryFocus?.unfocus();
39 |
40 | //navigate to credits screen
41 | Navigator.of(context).push(
42 | MaterialPageRoute(
43 | builder: (BuildContext context) => const CreditsScreen(),
44 | ),
45 | );
46 | },
47 | child: const FaIcon(
48 | FontAwesomeIcons.info,
49 | ),
50 | );
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/export_home_screen_widgets.dart:
--------------------------------------------------------------------------------
1 | export 'output_box.dart';
2 | export 'input_box.dart';
3 | export 'settings_button.dart';
4 | export '../bottom_sheets/settings_bottom_sheet.dart';
5 | export 'credits_button.dart';
6 | export 'theme_mode_button.dart';
7 | export 'input_clear_button.dart';
8 | export 'input_prompt_button.dart';
9 | export 'output_tts_button.dart';
10 | export 'input_submit_button.dart';
11 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/input_box.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/services.dart';
2 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
3 | import 'package:provider/provider.dart';
4 |
5 | import '../../providers/export_providers.dart';
6 | import '../../view_models/gpt_api_view_model.dart';
7 | import '../../controllers/input_question_controller.dart';
8 |
9 | class InputBox extends StatefulWidget {
10 | //Text editing controller is being passed into here and will be 'controller'
11 | final InputQuestionController controller;
12 | const InputBox({super.key, required this.controller});
13 |
14 | @override
15 | State createState() => _InputBoxState();
16 | }
17 |
18 | class _InputBoxState extends State {
19 | GPTAPIViewModel gptAPIViewModel = GPTAPIViewModel();
20 |
21 | @override
22 | void dispose() {
23 | super.dispose();
24 | }
25 |
26 | @override
27 | Widget build(BuildContext context) {
28 | final provider = Provider.of(context);
29 | TextTheme textTheme = Theme.of(context).textTheme;
30 | ColorScheme colorScheme = Theme.of(context).colorScheme;
31 | ScrollController inputScrollController = ScrollController();
32 | double width = MediaQuery.of(context).size.width;
33 | double height = MediaQuery.of(context).size.height;
34 |
35 | return Row(
36 | mainAxisAlignment: MainAxisAlignment.center,
37 | children: [
38 | SizedBox(
39 | width: width * 0.75,
40 | height: height * 0.2,
41 | child: Neumorphic(
42 | padding: EdgeInsets.all(MediaQuery.of(context).size.width * 0.025),
43 | style: NeumorphicStyle(
44 | lightSource: LightSource.topLeft,
45 | intensity: provider.theme == ThemeMode.light ? .8 : .6,
46 | color: colorScheme.primary,
47 | shadowLightColor: Colors.white,
48 | shadowDarkColor: Colors.black,
49 | shadowLightColorEmboss: Colors.white,
50 | shadowDarkColorEmboss: Colors.black,
51 | depth: provider.theme == ThemeMode.light ? 9 : 3,
52 | shape: NeumorphicShape.flat,
53 | boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(8)),
54 | ),
55 | child: RawScrollbar(
56 | thumbVisibility: true,
57 | trackVisibility: true,
58 | thickness: 2.0,
59 | thumbColor: colorScheme.secondary,
60 | trackColor: colorScheme.primary,
61 | interactive: true,
62 | controller: inputScrollController,
63 | child: SingleChildScrollView(
64 | padding: const EdgeInsets.only(right: 10),
65 | controller: inputScrollController,
66 | scrollDirection: Axis.vertical,
67 | child: TextField(
68 | controller:
69 | widget.controller.inputQuestionTextEditingController,
70 |
71 | cursorColor: provider.theme == ThemeMode.light
72 | ? Colors.black
73 | : Colors.white,
74 | maxLines: null,
75 | maxLength: 150, //max chars for the box
76 | maxLengthEnforcement: MaxLengthEnforcement.enforced,
77 | decoration: InputDecoration(
78 | hintStyle: TextStyle(
79 | color: colorScheme.secondary.withOpacity(.3),
80 | fontStyle: FontStyle.italic),
81 | border: InputBorder.none,
82 | hintText: 'Who was socrates?',
83 | ),
84 | style: textTheme.bodyMedium,
85 | ),
86 | ),
87 | ),
88 | ),
89 | ),
90 | ],
91 | );
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/input_clear_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:provider/provider.dart';
3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart';
4 | import '../../controllers/input_question_controller.dart';
5 |
6 | import '../../providers/theme_provider.dart';
7 |
8 | class InputClearButton extends StatefulWidget {
9 | //Text editing controller is being passed into here and will be 'controller'
10 | final InputQuestionController controller;
11 | const InputClearButton({super.key, required this.controller});
12 | @override
13 | State createState() => _InputClearButtonState();
14 | }
15 |
16 | class _InputClearButtonState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | final provider = Provider.of(context);
20 | ColorScheme colorScheme = Theme.of(context).colorScheme;
21 |
22 | double width = MediaQuery.of(context).size.width;
23 | double height = MediaQuery.of(context).size.height;
24 |
25 | return SizedBox(
26 | width: width * 0.22,
27 | height: height * 0.05,
28 | child: NeumorphicButton(
29 | padding: EdgeInsets.all(MediaQuery.of(context).size.width * 0.025),
30 | minDistance: -5,
31 | onPressed: () {
32 | FocusManager.instance.primaryFocus?.unfocus();
33 | widget.controller.inputQuestionTextEditingController.clear();
34 | },
35 | style: NeumorphicStyle(
36 | lightSource: LightSource.topLeft,
37 | intensity: provider.theme == ThemeMode.light ? .8 : .6,
38 | color: colorScheme.primary,
39 | shadowDarkColor: Colors.black,
40 | shadowLightColorEmboss: Colors.white,
41 | shadowDarkColorEmboss: Colors.black,
42 | depth: 2,
43 | shape: NeumorphicShape.flat,
44 | boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(8)),
45 | ),
46 | child: const Center(
47 | child: FaIcon(
48 | FontAwesomeIcons.x,
49 | size: 16,
50 | ),
51 | ),
52 | ),
53 | );
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/input_prompt_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:provider/provider.dart';
3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart';
4 |
5 | import '../../controllers/input_question_controller.dart';
6 | import '../../providers/theme_provider.dart';
7 | import '../bottom_sheets/prompt_bottom_sheet.dart';
8 |
9 | class InputPromptButton extends StatefulWidget {
10 | final InputQuestionController inputQuestionController;
11 | final List> promptList;
12 |
13 | const InputPromptButton({
14 | super.key,
15 | required this.inputQuestionController,
16 | required this.promptList,
17 | });
18 |
19 | @override
20 | State createState() => _InputPromptButtonState();
21 | }
22 |
23 | class _InputPromptButtonState extends State {
24 | @override
25 | Widget build(BuildContext context) {
26 | final provider = Provider.of(context);
27 | ColorScheme colorScheme = Theme.of(context).colorScheme;
28 |
29 | return SizedBox(
30 | width: MediaQuery.of(context).size.width * 0.22,
31 | height: MediaQuery.of(context).size.height * 0.05,
32 | child: NeumorphicButton(
33 | padding: EdgeInsets.all(MediaQuery.of(context).size.width * 0.025),
34 | minDistance: -5,
35 | style: NeumorphicStyle(
36 | lightSource: LightSource.topLeft,
37 | intensity: provider.theme == ThemeMode.light ? .8 : .6,
38 | color: colorScheme.primary,
39 | shadowLightColor: Colors.white,
40 | shadowDarkColor: Colors.black,
41 | shadowLightColorEmboss: Colors.white,
42 | shadowDarkColorEmboss: Colors.black,
43 | depth: 2,
44 | shape: NeumorphicShape.flat,
45 | boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(8)),
46 | ),
47 | onPressed: () {
48 | FocusManager.instance.primaryFocus?.unfocus();
49 |
50 | showModalBottomSheet(
51 | context: context,
52 | backgroundColor: colorScheme.primary,
53 | isScrollControlled: true,
54 | shape: RoundedRectangleBorder(
55 | side: BorderSide(
56 | color: colorScheme.secondary, strokeAlign: 5, width: 5),
57 | borderRadius: const BorderRadius.vertical(
58 | top: Radius.circular(0),
59 | ),
60 | ),
61 | builder: (BuildContext context) {
62 | return PromptBottomSheet(
63 | inputQuestionController: widget.inputQuestionController,
64 | promptList: widget.promptList,
65 | );
66 | });
67 | },
68 | child: const Center(
69 | child: FaIcon(
70 | FontAwesomeIcons.lightbulb,
71 | size: 16,
72 | ),
73 | ),
74 | ),
75 | );
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/input_submit_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:provider/provider.dart';
3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart';
4 |
5 | import '../../controllers/input_question_controller.dart';
6 | import '../../database/api_key_storage_helper.dart';
7 | import '../../providers/theme_provider.dart';
8 | import '../../view_models/gpt_api_view_model.dart';
9 |
10 | class InputSubmitButton extends StatefulWidget {
11 | //Is being passed down from home and will be sent to "fetchGPTResponse()"
12 | final APIKeyStorageHelper apiKeyStorageHelper;
13 |
14 | //Text editing controller is being passed into here and will be 'controller'
15 | final InputQuestionController controller;
16 |
17 | const InputSubmitButton({
18 | super.key,
19 | required this.apiKeyStorageHelper,
20 | required this.controller,
21 | });
22 |
23 | @override
24 | State createState() => _InputSubmitButtonState();
25 | }
26 |
27 | class _InputSubmitButtonState extends State {
28 | GPTAPIViewModel gptAPIViewModel = GPTAPIViewModel();
29 |
30 | @override
31 | Widget build(BuildContext context) {
32 | final provider = Provider.of(context);
33 | ColorScheme colorScheme = Theme.of(context).colorScheme;
34 |
35 | return SizedBox(
36 | width: MediaQuery.of(context).size.width * 0.22,
37 | height: MediaQuery.of(context).size.height * 0.05,
38 | child: NeumorphicButton(
39 | padding: EdgeInsets.all(MediaQuery.of(context).size.width * 0.025),
40 | minDistance: -5,
41 | onPressed: () {
42 | FocusManager.instance.primaryFocus?.unfocus();
43 | gptAPIViewModel.fetchGPTResponse(context, widget.apiKeyStorageHelper,
44 | widget.controller.inputQuestionTextEditingController.text);
45 | },
46 | style: NeumorphicStyle(
47 | lightSource: LightSource.topLeft,
48 | intensity: provider.theme == ThemeMode.light ? .8 : .6,
49 | color: colorScheme.primary,
50 | shadowLightColor: Colors.white,
51 | shadowDarkColor: Colors.black,
52 | shadowLightColorEmboss: Colors.white,
53 | shadowDarkColorEmboss: Colors.black,
54 | depth: 2,
55 | shape: NeumorphicShape.flat,
56 | boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(8)),
57 | ),
58 | child: const Center(
59 | child: FaIcon(
60 | FontAwesomeIcons.paperPlane,
61 | size: 16,
62 | ),
63 | ),
64 | ),
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/output_box.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:animated_text_kit/animated_text_kit.dart';
3 | import 'package:flutter/services.dart';
4 | import 'package:lottie/lottie.dart';
5 | import 'package:provider/provider.dart';
6 |
7 | import '../../providers/export_providers.dart';
8 |
9 | class OutputBox extends StatefulWidget {
10 | const OutputBox({super.key});
11 |
12 | @override
13 | State createState() => _OutputBoxState();
14 | }
15 |
16 | class _OutputBoxState extends State {
17 | @override
18 | Widget build(BuildContext context) {
19 | double width = MediaQuery.of(context).size.width;
20 | double height = MediaQuery.of(context).size.height;
21 |
22 | final themeProvider = Provider.of(context);
23 | final isLoadingProvider = Provider.of(context);
24 | final ChatHistoryProvider chatHistoryProvider =
25 | Provider.of(context);
26 | ColorScheme colorScheme = Theme.of(context).colorScheme;
27 | TextTheme textTheme = Theme.of(context).textTheme;
28 |
29 | ScrollController outputScrollController = ScrollController();
30 |
31 | return Row(
32 | mainAxisAlignment: MainAxisAlignment.center,
33 | children: [
34 | SizedBox(
35 | width: width * 0.75,
36 | height: height * 0.2,
37 | child: NeumorphicButton(
38 | padding: EdgeInsets.all(MediaQuery.of(context).size.width * 0.025),
39 | minDistance: -5,
40 | onPressed: () {
41 | FocusManager.instance.primaryFocus?.unfocus();
42 | Clipboard.setData(
43 | ClipboardData(
44 | text: chatHistoryProvider.chatHistory.last["content"]!,
45 | ),
46 | );
47 | final snackBar = SnackBar(
48 | dismissDirection: DismissDirection.vertical,
49 | margin:
50 | EdgeInsets.only(left: 20, right: 20, bottom: height * 0.90),
51 | behavior: SnackBarBehavior.floating,
52 | content: Center(
53 | child: Text(
54 | 'Copied to clipboard!',
55 | style: textTheme.bodyMedium,
56 | ),
57 | ),
58 | backgroundColor: Colors.grey,
59 | shape: ShapeBorder.lerp(
60 | RoundedRectangleBorder(
61 | borderRadius: BorderRadius.circular(10),
62 | ),
63 | RoundedRectangleBorder(
64 | borderRadius: BorderRadius.circular(10),
65 | ),
66 | 1,
67 | ),
68 | );
69 | ScaffoldMessenger.of(context).showSnackBar(snackBar);
70 | },
71 | style: NeumorphicStyle(
72 | lightSource: LightSource.topLeft,
73 | intensity: themeProvider.theme == ThemeMode.light ? .8 : .6,
74 | color: colorScheme.primary,
75 | shadowLightColor: Colors.white,
76 | shadowDarkColor: Colors.black,
77 | shadowLightColorEmboss: Colors.white,
78 | shadowDarkColorEmboss: Colors.black,
79 | depth: themeProvider.theme == ThemeMode.light ? 9 : 3,
80 | shape: NeumorphicShape.flat,
81 | boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(8)),
82 | ),
83 | child: isLoadingProvider.isLoading
84 | ? ColorFiltered(
85 | colorFilter: ColorFilter.mode(
86 | colorScheme.secondary, BlendMode.srcIn),
87 | child: Center(
88 | child: Lottie.asset('assets/lottie/polygonal_star.json'),
89 | ),
90 | )
91 | : RawScrollbar(
92 | thumbVisibility: true,
93 | trackVisibility: true,
94 | thickness: 2.0,
95 | thumbColor: colorScheme.secondary,
96 | trackColor: colorScheme.primary,
97 | interactive: true,
98 | controller: outputScrollController,
99 | child: SingleChildScrollView(
100 | controller: outputScrollController,
101 | scrollDirection: Axis.vertical,
102 | child: Padding(
103 | padding: const EdgeInsets.only(left: 5.0),
104 | child: SizedBox(
105 | width: width,
106 | child: AnimatedTextKit(
107 | isRepeatingAnimation: false,
108 | animatedTexts: [
109 | TyperAnimatedText(
110 | chatHistoryProvider
111 | .chatHistory.last["content"]!,
112 | ),
113 | ],
114 | ),
115 | ),
116 | ),
117 | ),
118 | ),
119 | ),
120 | ),
121 | ],
122 | );
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/output_tts_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:provider/provider.dart';
3 |
4 | import '../../database/api_key_storage_helper.dart';
5 | import '../../view_models/export_view_models.dart';
6 | import '../../providers/export_providers.dart';
7 |
8 | class OutputTTSButton extends StatefulWidget {
9 | //Is being passed down from home and will be sent to "fetchGPTResponse()"
10 | final APIKeyStorageHelper apiKeyStorageHelper;
11 |
12 | const OutputTTSButton({super.key, required this.apiKeyStorageHelper});
13 |
14 | @override
15 | State createState() => _OutputTTSButtonState();
16 | }
17 |
18 | class _OutputTTSButtonState extends State {
19 | ELAPIViewModel gptAPIViewModel = ELAPIViewModel();
20 |
21 | @override
22 | Widget build(BuildContext context) {
23 | final provider = Provider.of(context);
24 | final isLoadingVoiceProvider = Provider.of(context);
25 | ColorScheme colorScheme = Theme.of(context).colorScheme;
26 |
27 | double width = MediaQuery.of(context).size.width;
28 | double height = MediaQuery.of(context).size.height;
29 |
30 | return SizedBox(
31 | width: width * 0.75,
32 | height: height * 0.05,
33 | child: NeumorphicButton(
34 | padding: EdgeInsets.all(width * 0.025),
35 | minDistance: -5,
36 | onPressed: () {
37 | FocusManager.instance.primaryFocus?.unfocus();
38 | gptAPIViewModel.playTextToSpeech(
39 | context,
40 | widget.apiKeyStorageHelper,
41 | );
42 | },
43 | style: NeumorphicStyle(
44 | lightSource: LightSource.topLeft,
45 | intensity: provider.theme == ThemeMode.light ? .8 : .6,
46 | color: colorScheme.primary,
47 | shadowLightColor: Colors.white,
48 | shadowDarkColor: Colors.black,
49 | shadowLightColorEmboss: Colors.white,
50 | shadowDarkColorEmboss: Colors.black,
51 | depth: 2,
52 | shape: NeumorphicShape.flat,
53 | boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(8)),
54 | ),
55 | child: Center(
56 | child: isLoadingVoiceProvider.isLoading
57 | ? LinearProgressIndicator(
58 | color: colorScheme.secondary,
59 | backgroundColor: colorScheme.primary,
60 | minHeight: 2,
61 | )
62 | : const Icon(Icons.volume_up_outlined, size: 25),
63 | ),
64 | ),
65 | );
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/settings_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:font_awesome_flutter/font_awesome_flutter.dart';
3 | import 'package:provider/provider.dart';
4 |
5 | import '../../providers/theme_provider.dart';
6 | import '../../database/api_key_storage_helper.dart';
7 | import '../bottom_sheets/settings_bottom_sheet.dart';
8 |
9 | class SettingsButton extends StatefulWidget {
10 | final APIKeyStorageHelper apiKeyStorageHelper;
11 |
12 | const SettingsButton({super.key, required this.apiKeyStorageHelper});
13 |
14 | @override
15 | State createState() => _SettingsButtonState();
16 | }
17 |
18 | class _SettingsButtonState extends State {
19 | @override
20 | Widget build(BuildContext context) {
21 | final provider = Provider.of(context);
22 |
23 | ColorScheme colorScheme = Theme.of(context).colorScheme;
24 | double width = MediaQuery.of(context).size.width;
25 |
26 | return NeumorphicButton(
27 | padding: EdgeInsets.all(width * 0.03),
28 | minDistance: -5,
29 | style: NeumorphicStyle(
30 | lightSource: LightSource.topLeft,
31 | intensity: provider.theme == ThemeMode.light ? .8 : .4,
32 | color: colorScheme.primary,
33 | shadowLightColor: Colors.white,
34 | shadowDarkColor: Colors.black,
35 | shadowLightColorEmboss: Colors.white,
36 | shadowDarkColorEmboss: Colors.black,
37 | depth: provider.theme == ThemeMode.light ? 9 : 3,
38 | shape: NeumorphicShape.concave,
39 | surfaceIntensity: .5,
40 | boxShape: NeumorphicBoxShape.roundRect(BorderRadius.circular(50)),
41 | ),
42 | onPressed: () {
43 | FocusManager.instance.primaryFocus?.unfocus();
44 |
45 | showModalBottomSheet(
46 | context: context,
47 | backgroundColor: colorScheme.primary,
48 | isScrollControlled: true,
49 | shape: RoundedRectangleBorder(
50 | side: BorderSide(
51 | color: colorScheme.secondary, strokeAlign: 5, width: 5),
52 | borderRadius: const BorderRadius.vertical(
53 | top: Radius.circular(0),
54 | ),
55 | ),
56 | builder: (BuildContext context) {
57 | return SettingsBottomSheet(
58 | apiKeyStorageHelper: widget.apiKeyStorageHelper,
59 | );
60 | },
61 | );
62 | },
63 | child: const FaIcon(FontAwesomeIcons.sliders),
64 | );
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/widgets/home_screen/theme_mode_button.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_neumorphic/flutter_neumorphic.dart';
2 | import 'package:provider/provider.dart';
3 |
4 | import '../../providers/theme_provider.dart';
5 |
6 | class ThemeModeButton extends StatefulWidget {
7 | const ThemeModeButton({super.key});
8 |
9 | @override
10 | State createState() => _ThemeModeButtonState();
11 | }
12 |
13 | class _ThemeModeButtonState extends State {
14 | @override
15 | Widget build(BuildContext context) {
16 | final provider = Provider.of(context);
17 | ColorScheme colorScheme = Theme.of(context).colorScheme;
18 |
19 | return NeumorphicButton(
20 | padding: EdgeInsets.all(MediaQuery.of(context).size.width * 0.05),
21 | minDistance: -5,
22 | style: NeumorphicStyle(
23 | lightSource: LightSource.topLeft,
24 | intensity: provider.theme == ThemeMode.light ? .8 : .4,
25 | color: colorScheme.primary,
26 | shadowLightColor: Colors.white,
27 | shadowDarkColor: Colors.black,
28 | shadowLightColorEmboss: Colors.white,
29 | shadowDarkColorEmboss: Colors.black,
30 | depth: provider.theme == ThemeMode.light ? 9 : 3,
31 | shape: NeumorphicShape.concave,
32 | surfaceIntensity: .5,
33 | boxShape: const NeumorphicBoxShape.circle(),
34 | ),
35 | onPressed: () {
36 | FocusManager.instance.primaryFocus?.unfocus();
37 | provider.toggleTheme();
38 | },
39 | child: Icon(
40 | provider.theme == ThemeMode.light ? Icons.mode_night : Icons.sunny,
41 | size: 30,
42 | ),
43 | );
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/linux/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.10)
3 | project(runner LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "ava_v2")
8 | # The unique GTK application identifier for this application. See:
9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID
10 | set(APPLICATION_ID "com.example.ava_v2")
11 |
12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
13 | # versions of CMake.
14 | cmake_policy(SET CMP0063 NEW)
15 |
16 | # Load bundled libraries from the lib/ directory relative to the binary.
17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
18 |
19 | # Root filesystem for cross-building.
20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT)
21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
27 | endif()
28 |
29 | # Define build configuration options.
30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
31 | set(CMAKE_BUILD_TYPE "Debug" CACHE
32 | STRING "Flutter build mode" FORCE)
33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
34 | "Debug" "Profile" "Release")
35 | endif()
36 |
37 | # Compilation settings that should be applied to most targets.
38 | #
39 | # Be cautious about adding new options here, as plugins use this function by
40 | # default. In most cases, you should add new options to specific targets instead
41 | # of modifying this function.
42 | function(APPLY_STANDARD_SETTINGS TARGET)
43 | target_compile_features(${TARGET} PUBLIC cxx_std_14)
44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror)
45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>")
46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>")
47 | endfunction()
48 |
49 | # Flutter library and tool build rules.
50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
51 | add_subdirectory(${FLUTTER_MANAGED_DIR})
52 |
53 | # System-level dependencies.
54 | find_package(PkgConfig REQUIRED)
55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
56 |
57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
58 |
59 | # Define the application target. To change its name, change BINARY_NAME above,
60 | # not the value here, or `flutter run` will no longer work.
61 | #
62 | # Any new source files that you add to the application should be added here.
63 | add_executable(${BINARY_NAME}
64 | "main.cc"
65 | "my_application.cc"
66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
67 | )
68 |
69 | # Apply the standard set of build settings. This can be removed for applications
70 | # that need different build settings.
71 | apply_standard_settings(${BINARY_NAME})
72 |
73 | # Add dependency libraries. Add any application-specific dependencies here.
74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter)
75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
76 |
77 | # Run the Flutter tool portions of the build. This must not be removed.
78 | add_dependencies(${BINARY_NAME} flutter_assemble)
79 |
80 | # Only the install-generated bundle's copy of the executable will launch
81 | # correctly, since the resources must in the right relative locations. To avoid
82 | # people trying to run the unbundled copy, put it in a subdirectory instead of
83 | # the default top-level location.
84 | set_target_properties(${BINARY_NAME}
85 | PROPERTIES
86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
87 | )
88 |
89 | # Generated plugin build rules, which manage building the plugins and adding
90 | # them to the application.
91 | include(flutter/generated_plugins.cmake)
92 |
93 |
94 | # === Installation ===
95 | # By default, "installing" just makes a relocatable bundle in the build
96 | # directory.
97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
100 | endif()
101 |
102 | # Start with a clean build bundle directory every time.
103 | install(CODE "
104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
105 | " COMPONENT Runtime)
106 |
107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
109 |
110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
111 | COMPONENT Runtime)
112 |
113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
114 | COMPONENT Runtime)
115 |
116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
117 | COMPONENT Runtime)
118 |
119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
120 | install(FILES "${bundled_library}"
121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
122 | COMPONENT Runtime)
123 | endforeach(bundled_library)
124 |
125 | # Fully re-copy the assets directory on each build to avoid having stale files
126 | # from a previous install.
127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
128 | install(CODE "
129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
130 | " COMPONENT Runtime)
131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
133 |
134 | # Install the AOT library on non-Debug builds only.
135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
137 | COMPONENT Runtime)
138 | endif()
139 |
--------------------------------------------------------------------------------
/linux/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.10)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 |
12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...),
13 | # which isn't available in 3.10.
14 | function(list_prepend LIST_NAME PREFIX)
15 | set(NEW_LIST "")
16 | foreach(element ${${LIST_NAME}})
17 | list(APPEND NEW_LIST "${PREFIX}${element}")
18 | endforeach(element)
19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
20 | endfunction()
21 |
22 | # === Flutter Library ===
23 | # System-level dependencies.
24 | find_package(PkgConfig REQUIRED)
25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
28 |
29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
30 |
31 | # Published to parent scope for install step.
32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
36 |
37 | list(APPEND FLUTTER_LIBRARY_HEADERS
38 | "fl_basic_message_channel.h"
39 | "fl_binary_codec.h"
40 | "fl_binary_messenger.h"
41 | "fl_dart_project.h"
42 | "fl_engine.h"
43 | "fl_json_message_codec.h"
44 | "fl_json_method_codec.h"
45 | "fl_message_codec.h"
46 | "fl_method_call.h"
47 | "fl_method_channel.h"
48 | "fl_method_codec.h"
49 | "fl_method_response.h"
50 | "fl_plugin_registrar.h"
51 | "fl_plugin_registry.h"
52 | "fl_standard_message_codec.h"
53 | "fl_standard_method_codec.h"
54 | "fl_string_codec.h"
55 | "fl_value.h"
56 | "fl_view.h"
57 | "flutter_linux.h"
58 | )
59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
60 | add_library(flutter INTERFACE)
61 | target_include_directories(flutter INTERFACE
62 | "${EPHEMERAL_DIR}"
63 | )
64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
65 | target_link_libraries(flutter INTERFACE
66 | PkgConfig::GTK
67 | PkgConfig::GLIB
68 | PkgConfig::GIO
69 | )
70 | add_dependencies(flutter flutter_assemble)
71 |
72 | # === Flutter tool backend ===
73 | # _phony_ is a non-existent file to force this command to run every time,
74 | # since currently there's no way to get a full input/output list from the
75 | # flutter tool.
76 | add_custom_command(
77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_
79 | COMMAND ${CMAKE_COMMAND} -E env
80 | ${FLUTTER_TOOL_ENVIRONMENT}
81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
83 | VERBATIM
84 | )
85 | add_custom_target(flutter_assemble DEPENDS
86 | "${FLUTTER_LIBRARY}"
87 | ${FLUTTER_LIBRARY_HEADERS}
88 | )
89 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 |
12 | void fl_register_plugins(FlPluginRegistry* registry) {
13 | g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
14 | fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
15 | flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
16 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
17 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
18 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
19 | }
20 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | flutter_secure_storage_linux
7 | url_launcher_linux
8 | )
9 |
10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
11 | )
12 |
13 | set(PLUGIN_BUNDLED_LIBRARIES)
14 |
15 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
20 | endforeach(plugin)
21 |
22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
25 | endforeach(ffi_plugin)
26 |
--------------------------------------------------------------------------------
/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/linux/my_application.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | #include
4 | #ifdef GDK_WINDOWING_X11
5 | #include
6 | #endif
7 |
8 | #include "flutter/generated_plugin_registrant.h"
9 |
10 | struct _MyApplication {
11 | GtkApplication parent_instance;
12 | char** dart_entrypoint_arguments;
13 | };
14 |
15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
16 |
17 | // Implements GApplication::activate.
18 | static void my_application_activate(GApplication* application) {
19 | MyApplication* self = MY_APPLICATION(application);
20 | GtkWindow* window =
21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
22 |
23 | // Use a header bar when running in GNOME as this is the common style used
24 | // by applications and is the setup most users will be using (e.g. Ubuntu
25 | // desktop).
26 | // If running on X and not using GNOME then just use a traditional title bar
27 | // in case the window manager does more exotic layout, e.g. tiling.
28 | // If running on Wayland assume the header bar will work (may need changing
29 | // if future cases occur).
30 | gboolean use_header_bar = TRUE;
31 | #ifdef GDK_WINDOWING_X11
32 | GdkScreen* screen = gtk_window_get_screen(window);
33 | if (GDK_IS_X11_SCREEN(screen)) {
34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
36 | use_header_bar = FALSE;
37 | }
38 | }
39 | #endif
40 | if (use_header_bar) {
41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
42 | gtk_widget_show(GTK_WIDGET(header_bar));
43 | gtk_header_bar_set_title(header_bar, "ava_v2");
44 | gtk_header_bar_set_show_close_button(header_bar, TRUE);
45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
46 | } else {
47 | gtk_window_set_title(window, "ava_v2");
48 | }
49 |
50 | gtk_window_set_default_size(window, 1280, 720);
51 | gtk_widget_show(GTK_WIDGET(window));
52 |
53 | g_autoptr(FlDartProject) project = fl_dart_project_new();
54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
55 |
56 | FlView* view = fl_view_new(project);
57 | gtk_widget_show(GTK_WIDGET(view));
58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
59 |
60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view));
61 |
62 | gtk_widget_grab_focus(GTK_WIDGET(view));
63 | }
64 |
65 | // Implements GApplication::local_command_line.
66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
67 | MyApplication* self = MY_APPLICATION(application);
68 | // Strip out the first argument as it is the binary name.
69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
70 |
71 | g_autoptr(GError) error = nullptr;
72 | if (!g_application_register(application, nullptr, &error)) {
73 | g_warning("Failed to register: %s", error->message);
74 | *exit_status = 1;
75 | return TRUE;
76 | }
77 |
78 | g_application_activate(application);
79 | *exit_status = 0;
80 |
81 | return TRUE;
82 | }
83 |
84 | // Implements GObject::dispose.
85 | static void my_application_dispose(GObject* object) {
86 | MyApplication* self = MY_APPLICATION(object);
87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
89 | }
90 |
91 | static void my_application_class_init(MyApplicationClass* klass) {
92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate;
93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
95 | }
96 |
97 | static void my_application_init(MyApplication* self) {}
98 |
99 | MyApplication* my_application_new() {
100 | return MY_APPLICATION(g_object_new(my_application_get_type(),
101 | "application-id", APPLICATION_ID,
102 | "flags", G_APPLICATION_NON_UNIQUE,
103 | nullptr));
104 | }
105 |
--------------------------------------------------------------------------------
/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import audio_session
9 | import flutter_secure_storage_macos
10 | import just_audio
11 | import path_provider_foundation
12 | import shared_preferences_foundation
13 | import sqflite
14 | import url_launcher_macos
15 |
16 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
17 | AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
18 | FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))
19 | JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
20 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
21 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
22 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
23 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
24 | }
25 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = AVA;
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.avaV2
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController.init()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: ava_v2
2 | description: A new Flutter project.
3 | # The following line prevents the package from being accidentally published to
4 | # pub.dev using `flutter pub publish`. This is preferred for private packages.
5 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
6 |
7 | # The following defines the version and build number for your application.
8 | # A version number is three numbers separated by dots, like 1.2.43
9 | # followed by an optional build number separated by a +.
10 | # Both the version and the builder number may be overridden in flutter
11 | # build by specifying --build-name and --build-number, respectively.
12 | # In Android, build-name is used as versionName while build-number used as versionCode.
13 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
14 | # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
15 | # Read more about iOS versioning at
16 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17 | # In Windows, build-name is used as the major, minor, and patch parts
18 | # of the product and file versions while build-number is used as the build suffix.
19 | version: 1.0.0+1
20 |
21 | environment:
22 | sdk: '>=2.19.2 <3.0.0'
23 |
24 | # Dependencies specify other packages that your package needs in order to work.
25 | # To automatically upgrade your package dependencies to the latest versions
26 | # consider running `flutter pub upgrade --major-versions`. Alternatively,
27 | # dependencies can be manually updated by changing the version numbers below to
28 | # the latest version available on pub.dev. To see which dependencies have newer
29 | # versions available, run `flutter pub outdated`.
30 | dependencies:
31 | flutter:
32 | sdk: flutter
33 | url_launcher: ^6.1.10
34 | introduction_screen: ^3.1.8
35 | carousel_slider: ^4.2.1
36 | just_audio: ^0.9.32
37 | http: ^0.13.6
38 | lottie: ^2.3.2
39 | font_awesome_flutter: ^10.4.0
40 | google_fonts: ^4.0.4
41 | animate_gradient: ^0.0.2
42 | provider: ^6.0.5
43 | flutter_neumorphic: ^3.2.0
44 | cupertino_icons: ^1.0.2
45 | sqflite: ^2.2.8+1
46 | flutter_secure_storage: ^8.0.0
47 | path: ^1.8.2
48 | animated_text_kit: ^4.2.2
49 | shared_preferences: ^2.1.2
50 |
51 | dev_dependencies:
52 | flutter_launcher_icons: ^0.13.1
53 | flutter_native_splash: ^2.2.19
54 | flutter_test:
55 | sdk: flutter
56 |
57 | # The "flutter_lints" package below contains a set of recommended lints to
58 | # encourage good coding practices. The lint set provided by the package is
59 | # activated in the `analysis_options.yaml` file located at the root of your
60 | # package. See that file for information about deactivating specific lint
61 | # rules and activating additional ones.
62 | flutter_lints: ^2.0.0
63 |
64 | flutter_launcher_icons:
65 | android: "launcher_icon"
66 | ios: true
67 | image_path: "assets/images/icon.png"
68 | min_sdk_android: 21 # android min sdk min:16, default 21
69 |
70 | # web:
71 | # generate: true
72 | # image_path: "path/to/image.png"
73 | # background_color: "#hexcode"
74 | # theme_color: "#hexcode"
75 |
76 | # windows:
77 | # generate: true
78 | # image_path: "path/to/image.png"
79 | # icon_size: 48 # min:48, max:256, default: 48
80 |
81 | # macos:
82 | # generate: true
83 | # image_path: "path/to/image.png"
84 |
85 | flutter_native_splash:
86 | color: "#252525"
87 | image: assets/images/splash.png
88 |
89 |
90 | # For information on the generic Dart part of this file, see the
91 | # following page: https://dart.dev/tools/pub/pubspec
92 |
93 | # The following section is specific to Flutter packages.
94 | flutter:
95 |
96 | # The following line ensures that the Material Icons font is
97 | # included with your application, so that you can use the icons in
98 | # the material Icons class.
99 | uses-material-design: true
100 |
101 | # To add assets to your application, add an assets section, like this:
102 | assets:
103 | - assets/images/
104 | - assets/lottie/
105 | - assets/audio/
106 |
107 | # An image asset can refer to one or more resolution-specific "variants", see
108 | # https://flutter.dev/assets-and-images/#resolution-aware
109 |
110 | # For details regarding adding assets from package dependencies, see
111 | # https://flutter.dev/assets-and-images/#from-packages
112 |
113 | # To add custom fonts to your application, add a fonts section here,
114 | # in this "flutter" section. Each entry in this list should have a
115 | # "family" key with the font family name, and a "fonts" key with a
116 | # list giving the asset and other descriptors for the font. For
117 | # example:
118 | # fonts:
119 | # - family: Schyler
120 | # fonts:
121 | # - asset: fonts/Schyler-Regular.ttf
122 | # - asset: fonts/Schyler-Italic.ttf
123 | # style: italic
124 | # - family: Trajan Pro
125 | # fonts:
126 | # - asset: fonts/TrajanPro.ttf
127 | # - asset: fonts/TrajanPro_Bold.ttf
128 | # weight: 700
129 | #
130 | # For details regarding fonts from package dependencies,
131 | # see https://flutter.dev/custom-fonts/#from-packages
132 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | AVA
31 |
32 |
33 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ava_v2",
3 | "short_name": "ava_v2",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/web/splash/img/dark-1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/dark-1x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/dark-2x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/dark-3x.png
--------------------------------------------------------------------------------
/web/splash/img/dark-4x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/dark-4x.png
--------------------------------------------------------------------------------
/web/splash/img/light-1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/light-1x.png
--------------------------------------------------------------------------------
/web/splash/img/light-2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/light-2x.png
--------------------------------------------------------------------------------
/web/splash/img/light-3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/light-3x.png
--------------------------------------------------------------------------------
/web/splash/img/light-4x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/web/splash/img/light-4x.png
--------------------------------------------------------------------------------
/web/splash/splash.js:
--------------------------------------------------------------------------------
1 | function removeSplashFromWeb() {
2 | document.getElementById("splash")?.remove();
3 | document.getElementById("splash-branding")?.remove();
4 | document.body.style.background = "transparent";
5 | }
6 |
--------------------------------------------------------------------------------
/web/splash/style.css:
--------------------------------------------------------------------------------
1 | html {
2 | height: 100%
3 | }
4 |
5 | body {
6 | margin: 0;
7 | min-height: 100%;
8 | background-color: #252525;
9 | background-size: 100% 100%;
10 | }
11 |
12 | .center {
13 | margin: 0;
14 | position: absolute;
15 | top: 50%;
16 | left: 50%;
17 | -ms-transform: translate(-50%, -50%);
18 | transform: translate(-50%, -50%);
19 | }
20 |
21 | .contain {
22 | display:block;
23 | width:100%; height:100%;
24 | object-fit: contain;
25 | }
26 |
27 | .stretch {
28 | display:block;
29 | width:100%; height:100%;
30 | }
31 |
32 | .cover {
33 | display:block;
34 | width:100%; height:100%;
35 | object-fit: cover;
36 | }
37 |
38 | .bottom {
39 | position: absolute;
40 | bottom: 0;
41 | left: 50%;
42 | -ms-transform: translate(-50%, 0);
43 | transform: translate(-50%, 0);
44 | }
45 |
46 | .bottomLeft {
47 | position: absolute;
48 | bottom: 0;
49 | left: 0;
50 | }
51 |
52 | .bottomRight {
53 | position: absolute;
54 | bottom: 0;
55 | right: 0;
56 | }
57 |
--------------------------------------------------------------------------------
/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/windows/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Project-level configuration.
2 | cmake_minimum_required(VERSION 3.14)
3 | project(ava_v2 LANGUAGES CXX)
4 |
5 | # The name of the executable created for the application. Change this to change
6 | # the on-disk name of your application.
7 | set(BINARY_NAME "ava_v2")
8 |
9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10 | # versions of CMake.
11 | cmake_policy(SET CMP0063 NEW)
12 |
13 | # Define build configuration option.
14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
15 | if(IS_MULTICONFIG)
16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
17 | CACHE STRING "" FORCE)
18 | else()
19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
20 | set(CMAKE_BUILD_TYPE "Debug" CACHE
21 | STRING "Flutter build mode" FORCE)
22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
23 | "Debug" "Profile" "Release")
24 | endif()
25 | endif()
26 | # Define settings for the Profile build mode.
27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")
30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
31 |
32 | # Use Unicode for all projects.
33 | add_definitions(-DUNICODE -D_UNICODE)
34 |
35 | # Compilation settings that should be applied to most targets.
36 | #
37 | # Be cautious about adding new options here, as plugins use this function by
38 | # default. In most cases, you should add new options to specific targets instead
39 | # of modifying this function.
40 | function(APPLY_STANDARD_SETTINGS TARGET)
41 | target_compile_features(${TARGET} PUBLIC cxx_std_17)
42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")
43 | target_compile_options(${TARGET} PRIVATE /EHsc)
44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0")
45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>")
46 | endfunction()
47 |
48 | # Flutter library and tool build rules.
49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
50 | add_subdirectory(${FLUTTER_MANAGED_DIR})
51 |
52 | # Application build; see runner/CMakeLists.txt.
53 | add_subdirectory("runner")
54 |
55 | # Generated plugin build rules, which manage building the plugins and adding
56 | # them to the application.
57 | include(flutter/generated_plugins.cmake)
58 |
59 |
60 | # === Installation ===
61 | # Support files are copied into place next to the executable, so that it can
62 | # run in place. This is done instead of making a separate bundle (as on Linux)
63 | # so that building and running from within Visual Studio will work.
64 | set(BUILD_BUNDLE_DIR "$")
65 | # Make the "install" step default, as it's required to run.
66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
69 | endif()
70 |
71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
73 |
74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
75 | COMPONENT Runtime)
76 |
77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
78 | COMPONENT Runtime)
79 |
80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
81 | COMPONENT Runtime)
82 |
83 | if(PLUGIN_BUNDLED_LIBRARIES)
84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}"
85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
86 | COMPONENT Runtime)
87 | endif()
88 |
89 | # Fully re-copy the assets directory on each build to avoid having stale files
90 | # from a previous install.
91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
92 | install(CODE "
93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
94 | " COMPONENT Runtime)
95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
97 |
98 | # Install the AOT library on non-Debug builds only.
99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
100 | CONFIGURATIONS Profile;Release
101 | COMPONENT Runtime)
102 |
--------------------------------------------------------------------------------
/windows/flutter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # This file controls Flutter-level build steps. It should not be edited.
2 | cmake_minimum_required(VERSION 3.14)
3 |
4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
5 |
6 | # Configuration provided via flutter tool.
7 | include(${EPHEMERAL_DIR}/generated_config.cmake)
8 |
9 | # TODO: Move the rest of this into files in ephemeral. See
10 | # https://github.com/flutter/flutter/issues/57146.
11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")
12 |
13 | # === Flutter Library ===
14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")
15 |
16 | # Published to parent scope for install step.
17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE)
21 |
22 | list(APPEND FLUTTER_LIBRARY_HEADERS
23 | "flutter_export.h"
24 | "flutter_windows.h"
25 | "flutter_messenger.h"
26 | "flutter_plugin_registrar.h"
27 | "flutter_texture_registrar.h"
28 | )
29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/")
30 | add_library(flutter INTERFACE)
31 | target_include_directories(flutter INTERFACE
32 | "${EPHEMERAL_DIR}"
33 | )
34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")
35 | add_dependencies(flutter flutter_assemble)
36 |
37 | # === Wrapper ===
38 | list(APPEND CPP_WRAPPER_SOURCES_CORE
39 | "core_implementations.cc"
40 | "standard_codec.cc"
41 | )
42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/")
43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN
44 | "plugin_registrar.cc"
45 | )
46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/")
47 | list(APPEND CPP_WRAPPER_SOURCES_APP
48 | "flutter_engine.cc"
49 | "flutter_view_controller.cc"
50 | )
51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")
52 |
53 | # Wrapper sources needed for a plugin.
54 | add_library(flutter_wrapper_plugin STATIC
55 | ${CPP_WRAPPER_SOURCES_CORE}
56 | ${CPP_WRAPPER_SOURCES_PLUGIN}
57 | )
58 | apply_standard_settings(flutter_wrapper_plugin)
59 | set_target_properties(flutter_wrapper_plugin PROPERTIES
60 | POSITION_INDEPENDENT_CODE ON)
61 | set_target_properties(flutter_wrapper_plugin PROPERTIES
62 | CXX_VISIBILITY_PRESET hidden)
63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter)
64 | target_include_directories(flutter_wrapper_plugin PUBLIC
65 | "${WRAPPER_ROOT}/include"
66 | )
67 | add_dependencies(flutter_wrapper_plugin flutter_assemble)
68 |
69 | # Wrapper sources needed for the runner.
70 | add_library(flutter_wrapper_app STATIC
71 | ${CPP_WRAPPER_SOURCES_CORE}
72 | ${CPP_WRAPPER_SOURCES_APP}
73 | )
74 | apply_standard_settings(flutter_wrapper_app)
75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter)
76 | target_include_directories(flutter_wrapper_app PUBLIC
77 | "${WRAPPER_ROOT}/include"
78 | )
79 | add_dependencies(flutter_wrapper_app flutter_assemble)
80 |
81 | # === Flutter tool backend ===
82 | # _phony_ is a non-existent file to force this command to run every time,
83 | # since currently there's no way to get a full input/output list from the
84 | # flutter tool.
85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_")
86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE)
87 | add_custom_command(
88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN}
90 | ${CPP_WRAPPER_SOURCES_APP}
91 | ${PHONY_OUTPUT}
92 | COMMAND ${CMAKE_COMMAND} -E env
93 | ${FLUTTER_TOOL_ENVIRONMENT}
94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
95 | windows-x64 $
96 | VERBATIM
97 | )
98 | add_custom_target(flutter_assemble DEPENDS
99 | "${FLUTTER_LIBRARY}"
100 | ${FLUTTER_LIBRARY_HEADERS}
101 | ${CPP_WRAPPER_SOURCES_CORE}
102 | ${CPP_WRAPPER_SOURCES_PLUGIN}
103 | ${CPP_WRAPPER_SOURCES_APP}
104 | )
105 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 |
12 | void RegisterPlugins(flutter::PluginRegistry* registry) {
13 | FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
14 | registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
15 | UrlLauncherWindowsRegisterWithRegistrar(
16 | registry->GetRegistrarForPlugin("UrlLauncherWindows"));
17 | }
18 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | flutter_secure_storage_windows
7 | url_launcher_windows
8 | )
9 |
10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
11 | )
12 |
13 | set(PLUGIN_BUNDLED_LIBRARIES)
14 |
15 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
20 | endforeach(plugin)
21 |
22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
25 | endforeach(ffi_plugin)
26 |
--------------------------------------------------------------------------------
/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Add preprocessor definitions for the build version.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29 |
30 | # Disable Windows macros that collide with C++ standard library functions.
31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32 |
33 | # Add dependency libraries and include directories. Add any application-specific
34 | # dependencies here.
35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38 |
39 | # Run the Flutter tool portions of the build. This must not be removed.
40 | add_dependencies(${BINARY_NAME} flutter_assemble)
41 |
--------------------------------------------------------------------------------
/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD)
64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0,0
67 | #endif
68 |
69 | #if defined(FLUTTER_VERSION)
70 | #define VERSION_AS_STRING FLUTTER_VERSION
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.example" "\0"
93 | VALUE "FileDescription", "ava_v2" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "ava_v2" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "ava_v2.exe" "\0"
98 | VALUE "ProductName", "ava_v2" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 |
30 | flutter_controller_->engine()->SetNextFrameCallback([&]() {
31 | this->Show();
32 | });
33 |
34 | return true;
35 | }
36 |
37 | void FlutterWindow::OnDestroy() {
38 | if (flutter_controller_) {
39 | flutter_controller_ = nullptr;
40 | }
41 |
42 | Win32Window::OnDestroy();
43 | }
44 |
45 | LRESULT
46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
47 | WPARAM const wparam,
48 | LPARAM const lparam) noexcept {
49 | // Give Flutter, including plugins, an opportunity to handle window messages.
50 | if (flutter_controller_) {
51 | std::optional result =
52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
53 | lparam);
54 | if (result) {
55 | return *result;
56 | }
57 | }
58 |
59 | switch (message) {
60 | case WM_FONTCHANGE:
61 | flutter_controller_->engine()->ReloadSystemFonts();
62 | break;
63 | }
64 |
65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
66 | }
67 |
--------------------------------------------------------------------------------
/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.Create(L"ava_v2", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noahvelasco/AVA-Advanced-Virtual-Agent/c7151b7249e87300845ce298525cd74a3c579acc/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr);
51 | std::string utf8_string;
52 | if (target_length == 0 || target_length > utf8_string.max_size()) {
53 | return utf8_string;
54 | }
55 | utf8_string.resize(target_length);
56 | int converted_length = ::WideCharToMultiByte(
57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
58 | -1, utf8_string.data(),
59 | target_length, nullptr, nullptr);
60 | if (converted_length == 0) {
61 | return std::string();
62 | }
63 | return utf8_string;
64 | }
65 |
--------------------------------------------------------------------------------
/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/windows/runner/win32_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_WIN32_WINDOW_H_
2 | #define RUNNER_WIN32_WINDOW_H_
3 |
4 | #include
5 |
6 | #include
7 | #include
8 | #include
9 |
10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be
11 | // inherited from by classes that wish to specialize with custom
12 | // rendering and input handling
13 | class Win32Window {
14 | public:
15 | struct Point {
16 | unsigned int x;
17 | unsigned int y;
18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {}
19 | };
20 |
21 | struct Size {
22 | unsigned int width;
23 | unsigned int height;
24 | Size(unsigned int width, unsigned int height)
25 | : width(width), height(height) {}
26 | };
27 |
28 | Win32Window();
29 | virtual ~Win32Window();
30 |
31 | // Creates a win32 window with |title| that is positioned and sized using
32 | // |origin| and |size|. New windows are created on the default monitor. Window
33 | // sizes are specified to the OS in physical pixels, hence to ensure a
34 | // consistent size this function will scale the inputted width and height as
35 | // as appropriate for the default monitor. The window is invisible until
36 | // |Show| is called. Returns true if the window was created successfully.
37 | bool Create(const std::wstring& title, const Point& origin, const Size& size);
38 |
39 | // Show the current window. Returns true if the window was successfully shown.
40 | bool Show();
41 |
42 | // Release OS resources associated with window.
43 | void Destroy();
44 |
45 | // Inserts |content| into the window tree.
46 | void SetChildContent(HWND content);
47 |
48 | // Returns the backing Window handle to enable clients to set icon and other
49 | // window properties. Returns nullptr if the window has been destroyed.
50 | HWND GetHandle();
51 |
52 | // If true, closing this window will quit the application.
53 | void SetQuitOnClose(bool quit_on_close);
54 |
55 | // Return a RECT representing the bounds of the current client area.
56 | RECT GetClientArea();
57 |
58 | protected:
59 | // Processes and route salient window messages for mouse handling,
60 | // size change and DPI. Delegates handling of these to member overloads that
61 | // inheriting classes can handle.
62 | virtual LRESULT MessageHandler(HWND window,
63 | UINT const message,
64 | WPARAM const wparam,
65 | LPARAM const lparam) noexcept;
66 |
67 | // Called when CreateAndShow is called, allowing subclass window-related
68 | // setup. Subclasses should return false if setup fails.
69 | virtual bool OnCreate();
70 |
71 | // Called when Destroy is called.
72 | virtual void OnDestroy();
73 |
74 | private:
75 | friend class WindowClassRegistrar;
76 |
77 | // OS callback called by message pump. Handles the WM_NCCREATE message which
78 | // is passed when the non-client area is being created and enables automatic
79 | // non-client DPI scaling so that the non-client area automatically
80 | // responsponds to changes in DPI. All other messages are handled by
81 | // MessageHandler.
82 | static LRESULT CALLBACK WndProc(HWND const window,
83 | UINT const message,
84 | WPARAM const wparam,
85 | LPARAM const lparam) noexcept;
86 |
87 | // Retrieves a class instance pointer for |window|
88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept;
89 |
90 | // Update the window frame's theme to match the system theme.
91 | static void UpdateTheme(HWND const window);
92 |
93 | bool quit_on_close_ = false;
94 |
95 | // window handle for top level window.
96 | HWND window_handle_ = nullptr;
97 |
98 | // window handle for hosted content.
99 | HWND child_content_ = nullptr;
100 | };
101 |
102 | #endif // RUNNER_WIN32_WINDOW_H_
103 |
--------------------------------------------------------------------------------