├── .github
├── dependabot.yaml
└── workflows
│ ├── flutter.yml
│ └── publish.yml
├── .gitignore
├── .idx
└── dev.nix
├── .metadata
├── .vscode
└── launch.json
├── CHANGELOG.md
├── LICENSE
├── README.md
├── README
└── screenshot.png
├── analysis_options.yaml
├── example
├── .firebase
│ └── hosting.YnVpbGQvd2Vi.cache
├── .gitignore
├── .metadata
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle.kts
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── flutter_ai_toolkit_example
│ │ │ │ │ └── MainActivity.kt
│ │ │ └── res
│ │ │ │ ├── drawable-v21
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── drawable
│ │ │ │ └── launch_background.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values-night
│ │ │ │ └── styles.xml
│ │ │ │ └── values
│ │ │ │ └── styles.xml
│ │ │ └── profile
│ │ │ └── AndroidManifest.xml
│ ├── build.gradle.kts
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle.kts
├── assets
│ ├── README.md
│ ├── halloween-bg.png
│ └── recipes_default.json
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Podfile.lock
│ ├── 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-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ └── Icon-App-83.5x83.5@2x.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
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── lib
│ ├── callbacks
│ │ ├── on_cancel.dart
│ │ └── on_error.dart
│ ├── cupertino
│ │ └── cupertino.dart
│ ├── custom_styles
│ │ └── custom_styles.dart
│ ├── dark_mode
│ │ └── dark_mode.dart
│ ├── dark_style.dart
│ ├── demo
│ │ └── demo.dart
│ ├── echo
│ │ └── echo.dart
│ ├── firebase_options.dart
│ ├── function_calls
│ │ └── function_calls.dart
│ ├── gemini
│ │ └── gemini.dart
│ ├── history
│ │ └── history.dart
│ ├── logging
│ │ └── logging.dart
│ ├── main.dart
│ ├── recipes
│ │ ├── data
│ │ │ ├── recipe_data.dart
│ │ │ ├── recipe_repository.dart
│ │ │ └── settings.dart
│ │ ├── pages
│ │ │ ├── edit_recipe_page.dart
│ │ │ ├── home_page.dart
│ │ │ └── split_or_tabs.dart
│ │ ├── recipes.dart
│ │ └── views
│ │ │ ├── recipe_content_view.dart
│ │ │ ├── recipe_list_view.dart
│ │ │ ├── recipe_response_view.dart
│ │ │ ├── recipe_view.dart
│ │ │ ├── search_box.dart
│ │ │ └── settings_drawer.dart
│ ├── restricted
│ │ └── restricted.dart
│ ├── styles
│ │ └── styles.dart
│ ├── suggestions
│ │ └── suggestions.dart
│ ├── vertex
│ │ └── vertex.dart
│ └── welcome
│ │ └── welcome.dart
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Podfile
│ ├── Podfile.lock
│ ├── 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
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── pubspec.yaml
└── web
│ ├── favicon.png
│ ├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
│ ├── index.html
│ └── manifest.json
├── font_svg
├── README.md
├── reply_24dp_5F6368_FILL0_wght400_GRAD0_opsz24.svg
├── spark-icon.svg
└── submit-icon.svg
├── idx-template.json
├── idx-template.nix
├── lib
├── flutter_ai_toolkit.dart
├── fonts
│ └── FatIcons.ttf
└── src
│ ├── chat_view_model
│ ├── chat_view_model.dart
│ ├── chat_view_model_client.dart
│ └── chat_view_model_provider.dart
│ ├── dialogs
│ ├── adaptive_dialog.dart
│ ├── adaptive_snack_bar
│ │ ├── adaptive_snack_bar.dart
│ │ └── cupertino_snack_bar.dart
│ └── image_preview_dialog.dart
│ ├── llm_exception.dart
│ ├── platform_helper
│ ├── platform_helper.dart
│ ├── platform_helper_io.dart
│ └── platform_helper_web.dart
│ ├── providers
│ ├── implementations
│ │ ├── echo_provider.dart
│ │ └── firebase_provider.dart
│ ├── interface
│ │ ├── attachments.dart
│ │ ├── chat_message.dart
│ │ ├── llm_provider.dart
│ │ └── message_origin.dart
│ └── providers.dart
│ ├── styles
│ ├── action_button_style.dart
│ ├── action_button_type.dart
│ ├── chat_input_style.dart
│ ├── file_attachment_style.dart
│ ├── llm_chat_view_style.dart
│ ├── llm_message_style.dart
│ ├── styles.dart
│ ├── suggestion_style.dart
│ ├── tookit_icons.dart
│ ├── toolkit_colors.dart
│ ├── toolkit_text_styles.dart
│ └── user_message_style.dart
│ ├── utility.dart
│ └── views
│ ├── action_button.dart
│ ├── adaptive_progress_indicator.dart
│ ├── attachment_view
│ ├── attachment_view.dart
│ ├── file_attatchment_view.dart
│ └── image_attachment_view.dart
│ ├── chat_history_view.dart
│ ├── chat_input
│ ├── attachments_action_bar.dart
│ ├── attachments_view.dart
│ ├── chat_input.dart
│ ├── chat_suggestion_view.dart
│ ├── editing_indicator.dart
│ ├── input_button.dart
│ ├── input_state.dart
│ ├── removable_attachment.dart
│ └── text_or_audio_input.dart
│ ├── chat_message_view
│ ├── adaptive_copy_text.dart
│ ├── hovering_buttons.dart
│ ├── llm_message_view.dart
│ └── user_message_view.dart
│ ├── chat_text_field.dart
│ ├── jumping_dots_progress_indicator
│ ├── jumping_dot.dart
│ └── jumping_dots_progress_indicator.dart
│ ├── llm_chat_view
│ ├── llm_chat_view.dart
│ └── llm_response.dart
│ └── response_builder.dart
├── pubspec.yaml
└── test
├── smoke_test.dart
└── suggestions_test.dart
/.github/dependabot.yaml:
--------------------------------------------------------------------------------
1 | version: 2
2 | enable-beta-ecosystems: true
3 | updates:
4 | # Github actions ecosystem.
5 | - package-ecosystem: "github-actions"
6 | directory: "/"
7 | schedule:
8 | interval: "daily"
9 | # Updating patch versions for "github-actions" is too chatty.
10 | # See https://github.com/flutter/flutter/issues/158350.
11 | ignore:
12 | - dependency-name: "*"
13 | update-types: ["version-update:semver-patch"]
14 | # Pub ecosystem.
15 | - package-ecosystem: "pub"
16 | versioning-strategy: "increase-if-necessary"
17 | directory: "/"
18 | schedule:
19 | interval: "daily"
20 |
--------------------------------------------------------------------------------
/.github/workflows/flutter.yml:
--------------------------------------------------------------------------------
1 | name: Flutter CI
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | pull_request:
7 | branches: [main]
8 | workflow_dispatch:
9 | schedule:
10 | - cron: "0 0 * * *" # Every day at midnight
11 |
12 | jobs:
13 | lint-and-test:
14 | name: Test Flutter ${{ matrix.flutter_version }}
15 | runs-on: ubuntu-latest
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | flutter_version: [stable, beta]
20 | steps:
21 | - uses: actions/checkout@v4
22 | - name: Set up Flutter
23 | uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
24 | with:
25 | channel: ${{ matrix.flutter_version }}
26 | - run: dart --version
27 | - run: flutter --version
28 | - run: flutter pub get
29 | - name: Lint analysis
30 | run: dart analyze --fatal-infos
31 | - name: Dart format
32 | run: dart format --output none --set-exit-if-changed .
33 | - name: dart fix
34 | run: dart fix --dry-run
35 | - name: Run tests
36 | run: flutter test
37 | - name: Check API docs can generate
38 | run: dart doc --dry-run
39 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish to pub.dev
2 |
3 | on:
4 | push:
5 | tags:
6 | - 'v[0-9]+.[0-9]+.[0-9]+*'
7 |
8 | jobs:
9 | publish:
10 | name: Publish to pub.dev
11 | runs-on: ubuntu-latest
12 | permissions:
13 | id-token: write
14 | steps:
15 | - uses: actions/checkout@v4
16 | - uses: dart-lang/setup-dart@v1
17 | - uses: subosito/flutter-action@e938fdf56512cc96ef2f93601a5a40bde3801046
18 | with:
19 | channel: 'stable'
20 | - run: flutter pub get
21 | - name: Publish
22 | run: flutter pub publish --force
23 |
--------------------------------------------------------------------------------
/.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 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26 | /pubspec.lock
27 | **/doc/api/
28 | .dart_tool/
29 | build/
30 | example/.env
31 | example/firebase.json
32 | example/.firebaserc
33 | example/android/app/google-services.json
34 | example/ios/Runner/GoogleService-Info.plist
35 | example/macos/Runner/GoogleService-Info.plist
36 | example/lib/echo.dart
37 | .flutter-plugins
38 | .flutter-plugins-dependencies
39 | .vscode/settings.json
40 |
--------------------------------------------------------------------------------
/.idx/dev.nix:
--------------------------------------------------------------------------------
1 | # To learn more about how to use Nix to configure your environment
2 | # see: https://developers.google.com/idx/guides/customize-idx-env
3 | { pkgs, ... }: {
4 | # Which nixpkgs channel to use.
5 | channel = "stable-24.05"; # or "unstable"
6 | # Use https://search.nixos.org/packages to find packages
7 | packages = [
8 | pkgs.nodePackages.firebase-tools
9 | pkgs.jdk17
10 | pkgs.unzip
11 | ];
12 | # Sets environment variables in the workspace
13 | env = {
14 | PATH = ["/home/user/.pub-cache/bin" "/home/user/flutter/bin" "./.flutter-sdk/flutter/bin"];
15 | };
16 | idx = {
17 | # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id"
18 | extensions = [
19 | "Dart-Code.flutter"
20 | "Dart-Code.dart-code"
21 | ];
22 | workspace = {
23 | # Runs when a workspace is first created with this `dev.nix` file
24 | onCreate = {
25 | build-flutter = ''
26 | cd /home/user/myapp/example/android
27 |
28 | ./gradlew \
29 | --parallel \
30 | -Pverbose=true \
31 | -Ptarget-platform=android-x86 \
32 | -Ptarget=/home/user/myapp/lib/main.dart \
33 | -Pbase-application-name=android.app.Application \
34 | -Pdart-defines=RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC85NzU1MDkwN2I3MGY0ZjNiMzI4YjZjMTYwMGRmMjFmYWMxYTE4ODlhLw== \
35 | -Pdart-obfuscation=false \
36 | -Ptrack-widget-creation=true \
37 | -Ptree-shake-icons=false \
38 | -Pfilesystem-scheme=org-dartlang-root \
39 | assembleDebug
40 |
41 | # TODO: Execute web build in debug mode.
42 | # flutter run does this transparently either way
43 | # https://github.com/flutter/flutter/issues/96283#issuecomment-1144750411
44 | # flutter build web --profile --dart-define=Dart2jsOptimization=O0
45 |
46 | adb -s localhost:5555 wait-for-device
47 | '';
48 | installDependencies = "flutter channel stable && flutter upgrade && flutter pub get";
49 | };
50 | };
51 | # Enable previews and customize configuration
52 | previews = {
53 | enable = true;
54 | previews = {
55 | web = {
56 | command = ["flutter" "run" "--machine" "-d" "web-server" "--web-hostname" "0.0.0.0" "--web-port" "$PORT"];
57 | manager = "flutter";
58 | cwd = "example";
59 | };
60 | android = {
61 | command = ["flutter" "run" "--machine" "-d" "android" "-d" "localhost:5555"];
62 | manager = "flutter";
63 | cwd = "example";
64 | };
65 | };
66 | };
67 | };
68 | }
69 |
--------------------------------------------------------------------------------
/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
8 | channel: "stable"
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "main",
6 | "cwd": "example",
7 | "request": "launch",
8 | "type": "dart",
9 | "program": "lib/main.dart",
10 | },
11 | {
12 | "name": "gemini",
13 | "cwd": "example",
14 | "request": "launch",
15 | "type": "dart",
16 | "program": "lib/gemini/gemini.dart",
17 | },
18 | {
19 | "name": "vertex",
20 | "cwd": "example",
21 | "request": "launch",
22 | "type": "dart",
23 | "program": "lib/vertex/vertex.dart",
24 | },
25 | {
26 | "name": "demo",
27 | "cwd": "example",
28 | "request": "launch",
29 | "type": "dart",
30 | "program": "lib/demo/demo.dart",
31 | },
32 | {
33 | "name": "welcome",
34 | "cwd": "example",
35 | "request": "launch",
36 | "type": "dart",
37 | "program": "lib/welcome/welcome.dart",
38 | },
39 | {
40 | "name": "cupertino",
41 | "cwd": "example",
42 | "request": "launch",
43 | "type": "dart",
44 | "program": "lib/cupertino/cupertino.dart",
45 | },
46 | {
47 | "name": "custom styles",
48 | "cwd": "example",
49 | "request": "launch",
50 | "type": "dart",
51 | "program": "lib/custom_styles/custom_styles.dart",
52 | },
53 | {
54 | "name": "dark mode",
55 | "cwd": "example",
56 | "request": "launch",
57 | "type": "dart",
58 | "program": "lib/dark_mode/dark_mode.dart",
59 | },
60 | {
61 | "name": "history",
62 | "cwd": "example",
63 | "request": "launch",
64 | "type": "dart",
65 | "program": "lib/history/history.dart",
66 | },
67 | {
68 | "name": "suggestions",
69 | "cwd": "example",
70 | "request": "launch",
71 | "type": "dart",
72 | "program": "lib/suggestions/suggestions.dart",
73 | },
74 | {
75 | "name": "logging",
76 | "cwd": "example",
77 | "request": "launch",
78 | "type": "dart",
79 | "program": "lib/logging/logging.dart",
80 | },
81 | {
82 | "name": "on cancel",
83 | "cwd": "example",
84 | "request": "launch",
85 | "type": "dart",
86 | "program": "lib/callbacks/on_cancel.dart",
87 | },
88 | {
89 | "name": "on error",
90 | "cwd": "example",
91 | "request": "launch",
92 | "type": "dart",
93 | "program": "lib/callbacks/on_error.dart",
94 | },
95 | {
96 | "name": "function calls",
97 | "cwd": "example",
98 | "request": "launch",
99 | "type": "dart",
100 | "program": "lib/function_calls/function_calls.dart",
101 | },
102 | {
103 | "name": "restricted",
104 | "cwd": "example",
105 | "request": "launch",
106 | "type": "dart",
107 | "program": "lib/restricted/restricted.dart",
108 | },
109 | {
110 | "name": "recipes",
111 | "cwd": "example",
112 | "request": "launch",
113 | "type": "dart",
114 | "program": "lib/recipes/recipes.dart",
115 | },
116 | ]
117 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2014 The Flutter Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without modification,
4 | are permitted provided that the following conditions are met:
5 |
6 | * Redistributions of source code must retain the above copyright
7 | notice, this list of conditions and the following disclaimer.
8 | * Redistributions in binary form must reproduce the above
9 | copyright notice, this list of conditions and the following
10 | disclaimer in the documentation and/or other materials provided
11 | with the distribution.
12 | * Neither the name of Google Inc. nor the names of its
13 | contributors may be used to endorse or promote products derived
14 | from this software without specific prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/README/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/README/screenshot.png
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | linter:
4 | rules:
5 | public_member_api_docs: true
6 |
--------------------------------------------------------------------------------
/example/.firebase/hosting.YnVpbGQvd2Vi.cache:
--------------------------------------------------------------------------------
1 | manifest.json,1722130836723,f81e4554dc7f05633a2c5597416813859de5ace688342db41b201d42790fb8a7
2 | flutter.js,1726080818000,dec659847e4e16b505a257eb15bc32ef814f99a319e44e15b9c56294de0c9ecd
3 | favicon.png,1716580864393,fcc7c4545d5b62ad01682589e6fdc7ea03d0a3b42069963c815c344b632eb5cf
4 | icons/Icon-maskable-512.png,1716580886213,e7983524dc70254adc61764657d7e03d19284de8da586b5818d737bc08c6d14e
5 | icons/Icon-maskable-192.png,1716580886213,dd96c123fdf6817cdf7e63d9693bcc246bac2e3782a41a6952fa41c0617c5573
6 | icons/Icon-512.png,1716580864394,7a31ce91e554f1941158ca46f31c7f3f2b7c8c129229ea74a8fae1affe335033
7 | icons/Icon-192.png,1716580864394,d2e0131bb7851eb9d98f7885edb5ae4b4d6b7a6c7addf8a25b9b712b39274c0f
8 | canvaskit/skwasm.worker.js,1726081188000,ff1a6b2c254c1954106d62ce10432547fa6d6a7d99c0aaf9ea6144a23ef0c09b
9 | canvaskit/skwasm.wasm,1726081188000,204bb6c7deaa41ccfdb811d09107bcacd7162a848d8e9faa45e46390fe0dda9a
10 | canvaskit/skwasm.js.symbols,1726081188000,ea615fdcd1320bad0f3fb6b3e5bcb0dd3a4d8480c221af6a84455860775987c1
11 | canvaskit/skwasm.js,1726081188000,3da3d8d5b168f8f2cba2513cba2c65a9bfa650723545145cffa76a102a678e9d
12 | canvaskit/canvaskit.wasm,1726081100000,2e91b313aa59675be755df469bb88efdfa2be8cdccc4e49bf743f9f22d16f933
13 | canvaskit/canvaskit.js.symbols,1726081098000,7687fed87ac2c6f61e5d991be1e3f8c0191e4271128c73a5afea2f28562ad0b8
14 | canvaskit/canvaskit.js,1726081100000,95f051f3c2845fb04127fd56e1fa3e52a69d271eea561869e97bfe4374548109
15 | canvaskit/chromium/canvaskit.wasm,1726081122000,d865adf21902388e4d4af54a5e430479e5ef37ac660649017db1877b29976a08
16 | canvaskit/chromium/canvaskit.js.symbols,1726081120000,9d7b8e9cc146e9ad2b68af9f0c8092b144a9aac73666941b468b8b2fd36cdb27
17 | canvaskit/chromium/canvaskit.js,1726081122000,c448a9b3e29d0dad724aa33a554695e7f1257c58b28baca305177fd18e62e411
18 | assets/packages/record_web/assets/js/record.worklet.js,1726247519128,bd510fc16afe17c0cfc943194267c8d2af8a4b88fa63b525926c95d319e544c7
19 | assets/packages/record_web/assets/js/record.fixwebmduration.js,1726247519130,77e2fe77324499420d0a882273998e7574fa885c3a7d944a8e69382e5daaab08
20 | assets/assets/recipes_default.json,1727751782273,1f90b422a85d1e7a708fd4d255d8b7db1b6206bf002813cb380d6cce0fbb4bd8
21 | assets/assets/halloween-bg.png,1729875831180,aa155fdcd4249179b89ca8e6dbfbff642a622534635e9cc6dce5c099d7445b7e
22 | version.json,1730136001205,8e7012f17ec662cfb721c69523e82a27ac216e8e3c973b248b847e9a118cf603
23 | index.html,1730135983527,4c1651c60b2cd671eb40ebf9e77cd7d7f1894a90b21182fa149ead727d85095f
24 | assets/FontManifest.json,1730136001277,d1784484a5fbf123cc38d6fb83f618e2f855cfc9a47c4b87c34565736fb1025f
25 | flutter_service_worker.js,1730136002322,09a340c85d8522734c4db9521a920665aef469eec44a7162064304be50c817ee
26 | assets/AssetManifest.json,1730136001277,5ee990889da9f2ce04fb308d72dfb0a4df0a2a8c4cfe808dcc784e0cea9560ea
27 | assets/AssetManifest.bin.json,1730136001277,599a0b1e65a657294c65f94df02a01c115e4f2ef9a651ce3bbadad941866dc9d
28 | assets/AssetManifest.bin,1730136001277,71fc78fcaf72348505ddacbfc2fc03fb686e543376e18388ecdca2509e70245d
29 | flutter_bootstrap.js,1730135983509,257003d38cfc778893260c7ce9a69c191aa5c23c05402fb287677767cc049188
30 | assets/packages/flutter_ai_toolkit/lib/fonts/FatIcons.ttf,1730136002032,59c80e8640bde5d1fc73af52961bb52ed3f08fddd3af8f8fe172880442cc33b7
31 | assets/packages/cupertino_icons/assets/CupertinoIcons.ttf,1730136002030,a9dec9e47fcee105fc5f7ea79904e588215596ef681f1ba97034cd0829c0554b
32 | assets/shaders/ink_sparkle.frag,1730136001332,80c6e65c75f1de434b1b22dba61e96ad82dba0f2fc5e8b3b59c2def46d794354
33 | assets/fonts/MaterialIcons-Regular.otf,1730136002034,d1e5ecfde56f17e87cc9b0e73792a40eadf95ed0372e336e13038744c8dc09cf
34 | assets/NOTICES,1730136001278,b7c968ec8b44aa16ccd1a0138cfee73251738e425cae9fcc8fbdca9051337fc6
35 | main.dart.js,1730136001025,34484a94aff99c34bb6608f95d1a7e3d39b2bd66184d520341ff826ace776120
36 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .build/
9 | .buildlog/
10 | .history
11 | .svn/
12 | .swiftpm/
13 | migrate_working_dir/
14 |
15 | # IntelliJ related
16 | *.iml
17 | *.ipr
18 | *.iws
19 | .idea/
20 |
21 | # The .vscode folder contains launch configuration and tasks you configure in
22 | # VS Code which you may wish to be included in version control, so this line
23 | # is commented out by default.
24 | #.vscode/
25 |
26 | # Flutter/Dart/Pub related
27 | **/doc/api/
28 | **/ios/Flutter/.last_build_id
29 | .dart_tool/
30 | .flutter-plugins
31 | .flutter-plugins-dependencies
32 | .pub-cache/
33 | .pub/
34 | /build/
35 | pubspec.lock
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Android Studio will place build artifacts here
44 | /android/app/debug
45 | /android/app/profile
46 | /android/app/release
47 |
--------------------------------------------------------------------------------
/example/.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 and should not be manually edited.
5 |
6 | version:
7 | revision: "35c388afb57ef061d06a39b537336c87e0e3d1b1"
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: 35c388afb57ef061d06a39b537336c87e0e3d1b1
17 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
18 | - platform: android
19 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
20 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
21 | - platform: ios
22 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
23 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
24 | - platform: macos
25 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
26 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
27 | - platform: web
28 | create_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
29 | base_revision: 35c388afb57ef061d06a39b537336c87e0e3d1b1
30 |
31 | # User provided section
32 |
33 | # List of Local paths (relative to this file) that should be
34 | # ignored by the migrate tool.
35 | #
36 | # Files that are not part of the templates will be ignored by default.
37 | unmanaged_files:
38 | - 'lib/main.dart'
39 | - 'ios/Runner.xcodeproj/project.pbxproj'
40 |
--------------------------------------------------------------------------------
/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 | .cxx/
9 |
10 | # Remember to never publicly share your keystore.
11 | # See https://flutter.dev/to/reference-keystore
12 | key.properties
13 | **/*.keystore
14 | **/*.jks
15 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.application")
3 | // START: FlutterFire Configuration
4 | id("com.google.gms.google-services")
5 | // END: FlutterFire Configuration
6 | id("kotlin-android")
7 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
8 | id("dev.flutter.flutter-gradle-plugin")
9 | }
10 |
11 | android {
12 | namespace = "com.example.flutter_ai_toolkit_example"
13 | compileSdk = flutter.compileSdkVersion
14 | ndkVersion = flutter.ndkVersion
15 |
16 | compileOptions {
17 | sourceCompatibility = JavaVersion.VERSION_11
18 | targetCompatibility = JavaVersion.VERSION_11
19 | }
20 |
21 | kotlinOptions {
22 | jvmTarget = JavaVersion.VERSION_11.toString()
23 | }
24 |
25 | defaultConfig {
26 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
27 | applicationId = "com.example.flutter_ai_toolkit_example"
28 | // You can update the following values to match your application needs.
29 | // For more information, see: https://flutter.dev/to/review-gradle-config.
30 | minSdk = 23 // Firebase requires Android 23
31 | targetSdk = flutter.targetSdkVersion
32 | versionCode = flutter.versionCode
33 | versionName = flutter.versionName
34 | }
35 |
36 | buildTypes {
37 | release {
38 | // TODO: Add your own signing config for the release build.
39 | // Signing with the debug keys for now, so `flutter run --release` works.
40 | signingConfig = signingConfigs.getByName("debug")
41 | }
42 | }
43 | }
44 |
45 | flutter {
46 | source = "../.."
47 | }
48 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/flutter_ai_toolkit_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.flutter_ai_toolkit_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity : FlutterActivity()
6 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/build.gradle.kts:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
9 | rootProject.layout.buildDirectory.value(newBuildDir)
10 |
11 | subprojects {
12 | val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
13 | project.layout.buildDirectory.value(newSubprojectBuildDir)
14 | }
15 | subprojects {
16 | project.evaluationDependsOn(":app")
17 | }
18 |
19 | tasks.register("clean") {
20 | delete(rootProject.layout.buildDirectory)
21 | }
22 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/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-8.10.2-all.zip
6 |
--------------------------------------------------------------------------------
/example/android/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | val flutterSdkPath = run {
3 | val properties = java.util.Properties()
4 | file("local.properties").inputStream().use { properties.load(it) }
5 | val flutterSdkPath = properties.getProperty("flutter.sdk")
6 | require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7 | flutterSdkPath
8 | }
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21 | id("com.android.application") version "8.7.0" apply false
22 | // START: FlutterFire Configuration
23 | id("com.google.gms.google-services") version("4.3.15") apply false
24 | // END: FlutterFire Configuration
25 | id("org.jetbrains.kotlin.android") version "1.8.22" apply false
26 | }
27 |
28 | include(":app")
29 |
--------------------------------------------------------------------------------
/example/assets/README.md:
--------------------------------------------------------------------------------
1 | The following assets have been generated by the Gemini LLM and are being used royalty-free in this project:
2 | - halloween-bg.png
3 | - recipes_default.json
--------------------------------------------------------------------------------
/example/assets/halloween-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/assets/halloween-bg.png
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 | 13.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Firebase requires iOS 13
2 | platform :ios, '13.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 |
33 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
34 | target 'RunnerTests' do
35 | inherit! :search_paths
36 | end
37 | end
38 |
39 | post_install do |installer|
40 | installer.pods_project.targets.each do |target|
41 | flutter_additional_ios_build_settings(target)
42 | end
43 | end
44 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 |
4 | @main
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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/flutter/ai/c71883d7c2fa9ad0d87e8794f21ba6fb0c66b2e0/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/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.
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Flutter Ai Toolkit Example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | flutter_ai_toolkit_example
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | NSCameraUsageDescription
28 | $(PRODUCT_NAME) would like to access your camera.
29 | NSMicrophoneUsageDescription
30 | $(PRODUCT_NAME) would like to access your microphone.
31 | NSPhotoLibraryUsageDescription
32 | $(PRODUCT_NAME) would like access to your photos.
33 | UIApplicationSupportsIndirectInputEvents
34 |
35 | UILaunchStoryboardName
36 | LaunchScreen
37 | UIMainStoryboardFile
38 | Main
39 | UISupportedInterfaceOrientations
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationLandscapeLeft
43 | UIInterfaceOrientationLandscapeRight
44 |
45 | UISupportedInterfaceOrientations~ipad
46 |
47 | UIInterfaceOrientationPortrait
48 | UIInterfaceOrientationPortraitUpsideDown
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | CADisableMinimumFrameDurationOnPhone
53 |
54 | UIApplicationSupportsIndirectInputEvents
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example/lib/callbacks/on_cancel.dart:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | import 'package:firebase_ai/firebase_ai.dart';
6 | import 'package:firebase_core/firebase_core.dart';
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
9 |
10 | // from `flutterfire config`: https://firebase.google.com/docs/flutter/setup
11 | import '../firebase_options.dart';
12 |
13 | void main() async {
14 | WidgetsFlutterBinding.ensureInitialized();
15 | await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
16 | runApp(const App());
17 | }
18 |
19 | class App extends StatelessWidget {
20 | static const title = 'Example: On Cancel';
21 |
22 | const App({super.key});
23 |
24 | @override
25 | Widget build(BuildContext context) =>
26 | const MaterialApp(title: title, home: ChatPage());
27 | }
28 |
29 | class ChatPage extends StatelessWidget {
30 | const ChatPage({super.key});
31 |
32 | void _onCancel(BuildContext context) {
33 | ScaffoldMessenger.of(
34 | context,
35 | ).showSnackBar(const SnackBar(content: Text('Chat cancelled')));
36 | }
37 |
38 | @override
39 | Widget build(BuildContext context) => Scaffold(
40 | appBar: AppBar(title: const Text(App.title)),
41 | body: LlmChatView(
42 | onCancelCallback: _onCancel,
43 | cancelMessage: 'Request cancelled',
44 | provider: FirebaseProvider(
45 | model: FirebaseAI.googleAI().generativeModel(model: 'gemini-2.0-flash'),
46 | ),
47 | ),
48 | );
49 | }
50 |
--------------------------------------------------------------------------------
/example/lib/callbacks/on_error.dart:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | import 'package:firebase_ai/firebase_ai.dart';
6 | import 'package:firebase_core/firebase_core.dart';
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
9 |
10 | // from `flutterfire config`: https://firebase.google.com/docs/flutter/setup
11 | import '../firebase_options.dart';
12 |
13 | void main() async {
14 | WidgetsFlutterBinding.ensureInitialized();
15 | await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
16 | runApp(const App());
17 | }
18 |
19 | class App extends StatelessWidget {
20 | static const title = 'Example: On Error';
21 |
22 | const App({super.key});
23 |
24 | @override
25 | Widget build(BuildContext context) =>
26 | const MaterialApp(title: title, home: ChatPage());
27 | }
28 |
29 | class ChatPage extends StatelessWidget {
30 | const ChatPage({super.key});
31 |
32 | void _onError(BuildContext context, LlmException error) {
33 | ScaffoldMessenger.of(
34 | context,
35 | ).showSnackBar(SnackBar(content: Text('Error: ${error.message}')));
36 | }
37 |
38 | @override
39 | Widget build(BuildContext context) => Scaffold(
40 | appBar: AppBar(title: const Text(App.title)),
41 | body: LlmChatView(
42 | onErrorCallback: _onError,
43 | errorMessage: 'An error occurred',
44 | provider: FirebaseProvider(
45 | model: FirebaseAI.googleAI().generativeModel(model: 'gemini-2.0-flash'),
46 | ),
47 | ),
48 | );
49 | }
50 |
--------------------------------------------------------------------------------
/example/lib/cupertino/cupertino.dart:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | import 'package:firebase_ai/firebase_ai.dart';
6 | import 'package:firebase_core/firebase_core.dart';
7 | import 'package:flutter/cupertino.dart';
8 | import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
9 |
10 | // from `flutterfire config`: https://firebase.google.com/docs/flutter/setup
11 | import '../firebase_options.dart';
12 |
13 | void main() async {
14 | WidgetsFlutterBinding.ensureInitialized();
15 | await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
16 | runApp(const App());
17 | }
18 |
19 | class App extends StatelessWidget {
20 | static const title = 'Example: Cupertino';
21 |
22 | const App({super.key});
23 |
24 | @override
25 | Widget build(BuildContext context) =>
26 | const CupertinoApp(title: title, home: ChatPage());
27 | }
28 |
29 | class ChatPage extends StatelessWidget {
30 | const ChatPage({super.key});
31 |
32 | @override
33 | Widget build(BuildContext context) => CupertinoPageScaffold(
34 | navigationBar: CupertinoNavigationBar(middle: Text(App.title)),
35 | child: LlmChatView(
36 | provider: FirebaseProvider(
37 | model: FirebaseAI.googleAI().generativeModel(model: 'gemini-2.0-flash'),
38 | ),
39 | ),
40 | );
41 | }
42 |
--------------------------------------------------------------------------------
/example/lib/dark_mode/dark_mode.dart:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | import 'package:firebase_ai/firebase_ai.dart';
6 | import 'package:firebase_core/firebase_core.dart';
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
9 |
10 | import '../dark_style.dart';
11 | // from `flutterfire config`: https://firebase.google.com/docs/flutter/setup
12 | import '../firebase_options.dart';
13 |
14 | void main() async {
15 | WidgetsFlutterBinding.ensureInitialized();
16 | await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
17 | runApp(const App());
18 | }
19 |
20 | class App extends StatelessWidget {
21 | static const title = 'Example: Dark Mode';
22 | static final themeMode = ValueNotifier(ThemeMode.dark);
23 |
24 | const App({super.key});
25 |
26 | @override
27 | Widget build(BuildContext context) => ValueListenableBuilder(
28 | valueListenable: themeMode,
29 | builder:
30 | (BuildContext context, ThemeMode mode, Widget? child) => MaterialApp(
31 | title: title,
32 | theme: ThemeData.light(),
33 | darkTheme: ThemeData.dark(),
34 | themeMode: mode,
35 | home: ChatPage(),
36 | debugShowCheckedModeBanner: false,
37 | ),
38 | );
39 | }
40 |
41 | class ChatPage extends StatefulWidget {
42 | const ChatPage({super.key});
43 |
44 | @override
45 | State createState() => _ChatPageState();
46 | }
47 |
48 | class _ChatPageState extends State {
49 | final _provider = FirebaseProvider(
50 | model: FirebaseAI.googleAI().generativeModel(model: 'gemini-2.0-flash'),
51 | );
52 |
53 | final _lightStyle = LlmChatViewStyle.defaultStyle();
54 | final _darkStyle = darkChatViewStyle();
55 |
56 | @override
57 | Widget build(BuildContext context) => Scaffold(
58 | appBar: AppBar(
59 | title: const Text(App.title),
60 | actions: [
61 | IconButton(
62 | onPressed:
63 | () =>
64 | App.themeMode.value =
65 | App.themeMode.value == ThemeMode.light
66 | ? ThemeMode.dark
67 | : ThemeMode.light,
68 | tooltip:
69 | App.themeMode.value == ThemeMode.light
70 | ? 'Dark Mode'
71 | : 'Light Mode',
72 | icon: const Icon(Icons.brightness_4_outlined),
73 | ),
74 | ],
75 | ),
76 | body: LlmChatView(
77 | provider: _provider,
78 | style: App.themeMode.value == ThemeMode.dark ? _darkStyle : _lightStyle,
79 | ),
80 | );
81 | }
82 |
--------------------------------------------------------------------------------
/example/lib/echo/echo.dart:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | import 'package:flutter/material.dart';
6 | import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
7 |
8 | void main() => runApp(App());
9 |
10 | class App extends StatefulWidget {
11 | static const title = 'Example: Echo Test';
12 |
13 | const App({super.key});
14 |
15 | @override
16 | State createState() => _AppState();
17 | }
18 |
19 | class _AppState extends State {
20 | final _provider = EchoProvider();
21 |
22 | @override
23 | Widget build(BuildContext context) => MaterialApp(
24 | title: App.title,
25 | home: Scaffold(
26 | appBar: AppBar(title: const Text(App.title)),
27 | body: LlmChatView(provider: _provider),
28 | ),
29 | );
30 | }
31 |
--------------------------------------------------------------------------------
/example/lib/firebase_options.dart:
--------------------------------------------------------------------------------
1 | // File normally generated by FlutterFire CLI. This is a stand-in.
2 | // See README.md for details.
3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4 |
5 | class DefaultFirebaseOptions {
6 | // TODO: Remove this file and run `flutterfire config` for Firebase options
7 | static FirebaseOptions get currentPlatform {
8 | throw UnimplementedError(
9 | 'Generate this file by running `flutterfire configure`. '
10 | 'See README.md for details.',
11 | );
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/lib/function_calls/function_calls.dart:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | import 'package:firebase_ai/firebase_ai.dart';
6 | import 'package:firebase_core/firebase_core.dart';
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_ai_toolkit/flutter_ai_toolkit.dart';
9 |
10 | // from `flutterfire config`: https://firebase.google.com/docs/flutter/setup
11 | import '../firebase_options.dart';
12 |
13 | void main() async {
14 | WidgetsFlutterBinding.ensureInitialized();
15 | await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
16 | runApp(const App());
17 | }
18 |
19 | class App extends StatelessWidget {
20 | static const title = 'Example: Function Calls';
21 |
22 | const App({super.key});
23 |
24 | @override
25 | Widget build(BuildContext context) =>
26 | const MaterialApp(title: title, home: ChatPage());
27 | }
28 |
29 | class ChatPage extends StatelessWidget {
30 | const ChatPage({super.key});
31 |
32 | @override
33 | Widget build(BuildContext context) => Scaffold(
34 | appBar: AppBar(title: const Text(App.title)),
35 | body: LlmChatView(
36 | provider: FirebaseProvider(
37 | model: FirebaseAI.googleAI().generativeModel(
38 | model: 'gemini-2.0-flash',
39 | tools: [
40 | Tool.functionDeclarations([
41 | FunctionDeclaration(
42 | 'get_temperature',
43 | 'Get the current local temperature',
44 | parameters: {},
45 | ),
46 | FunctionDeclaration(
47 | 'get_time',
48 | 'Get the current local time',
49 | parameters: {},
50 | ),
51 | ]),
52 | ],
53 | ),
54 | onFunctionCall: _onFunctionCall,
55 | ),
56 | ),
57 | );
58 |
59 | // note: we're not actually calling any external APIs in this example
60 | Future