-
Notifications
You must be signed in to change notification settings - Fork 60
Add Verdure example #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Verdure example #510
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # Verdure Landscape Design Example | ||
|
|
||
| This directory contains a sample application demonstrating a Flutter client interacting with a Python-based A2A (Agent-to-Agent) server for landscape design. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Flutter SDK | ||
| - Python 3.13 or higher | ||
| - [UV](https://docs.astral.sh/uv/) | ||
| - A Gemini API Key | ||
| - You can create one using [AI Studio](https://ai.google.dev/aistudio). | ||
|
|
||
| ## Running the Example | ||
|
|
||
| To run this example, you need to start both the server and the client application. | ||
|
|
||
| ### 1. Start the Server | ||
|
|
||
| a. Navigate to the server directory: | ||
|
|
||
| ```bash | ||
| cd server | ||
| ``` | ||
|
|
||
| b. Create a `.env` file with your Gemini API key: | ||
|
|
||
| ```bash | ||
| echo "GEMINI_API_KEY=YOUR_API_KEY_HERE" > .env | ||
| ``` | ||
| *Replace `YOUR_API_KEY_HERE` with your actual Gemini API key.* | ||
|
|
||
| c. Install dependencies and run the server using UV: | ||
|
|
||
| ```bash | ||
| uv run verdure | ||
| ``` | ||
|
|
||
| The server will start on `http://localhost:10002` by default. | ||
|
|
||
| ### 2. Run the Client | ||
|
|
||
| a. Open a new terminal window. | ||
|
|
||
| b. Navigate to the client directory: | ||
|
|
||
| ```bash | ||
| cd client | ||
| ``` | ||
|
|
||
| c. Run the Flutter application on your desired device: | ||
|
|
||
| ```bash | ||
| flutter run | ||
| ``` | ||
|
|
||
| The Flutter application will connect to the server running on `localhost:10002` to interact with the landscape design agent. | ||
|
|
||
| ## Disclaimer | ||
|
|
||
| Important: The sample code provided is for demonstration purposes and illustrates the mechanics of the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity. | ||
|
|
||
| All data received from an external agent—including but not limited to its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. Failure to properly validate and sanitize this data before use can introduce security vulnerabilities into your application. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # This file tracks properties of this Flutter project. | ||
| # Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
| # | ||
| # This file should be version controlled and should not be manually edited. | ||
|
|
||
| version: | ||
| revision: "bff5cb4a90f1bc1e24fff1eef39ee2596917c07b" | ||
| channel: "main" | ||
|
|
||
| project_type: app | ||
|
|
||
| # Tracks metadata for the flutter migrate command | ||
| migration: | ||
| platforms: | ||
| - platform: root | ||
| create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| - platform: android | ||
| create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| - platform: ios | ||
| create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| - platform: linux | ||
| create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| - platform: macos | ||
| create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| - platform: web | ||
| create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
| base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b | ||
|
|
||
| # User provided section | ||
|
|
||
| # List of Local paths (relative to this file) that should be | ||
| # ignored by the migrate tool. | ||
| # | ||
| # Files that are not part of the templates will be ignored by default. | ||
| unmanaged_files: | ||
| - 'lib/main.dart' | ||
| - 'ios/Runner.xcodeproj/project.pbxproj' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| gradle-wrapper.jar | ||
| /.gradle | ||
| /captures/ | ||
| /gradlew | ||
| /gradlew.bat | ||
| /local.properties | ||
| GeneratedPluginRegistrant.java | ||
| .cxx/ | ||
|
|
||
| # Remember to never publicly share your keystore. | ||
| # See https://flutter.dev/to/reference-keystore | ||
| key.properties | ||
| **/*.keystore | ||
| **/*.jks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| plugins { | ||
| id("com.android.application") | ||
| id("kotlin-android") | ||
| // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. | ||
| id("dev.flutter.flutter-gradle-plugin") | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.example.verdure" | ||
| compileSdk = flutter.compileSdkVersion | ||
| ndkVersion = flutter.ndkVersion | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
|
|
||
| kotlinOptions { | ||
| jvmTarget = JavaVersion.VERSION_17.toString() | ||
| } | ||
|
|
||
| defaultConfig { | ||
| // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | ||
| applicationId = "com.example.verdure" | ||
| // You can update the following values to match your application needs. | ||
| // For more information, see: https://flutter.dev/to/review-gradle-config. | ||
| minSdk = flutter.minSdkVersion | ||
| targetSdk = flutter.targetSdkVersion | ||
| versionCode = flutter.versionCode | ||
| versionName = flutter.versionName | ||
| } | ||
|
|
||
| buildTypes { | ||
| release { | ||
| // TODO: Add your own signing config for the release build. | ||
| // Signing with the debug keys for now, so `flutter run --release` works. | ||
| signingConfig = signingConfigs.getByName("debug") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| flutter { | ||
| source = "../.." | ||
| } |
12 changes: 12 additions & 0 deletions
12
examples/verdure/client/android/app/src/debug/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!-- Copyright 2025 The Flutter Authors. | ||
| Use of this source code is governed by a BSD-style license that can be | ||
| found in the LICENSE file. --> | ||
|
|
||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <application android:networkSecurityConfig="@xml/network_security_config" /> | ||
| <!-- The INTERNET permission is required for development. Specifically, | ||
| the Flutter tool needs it to communicate with the running application | ||
| to allow setting breakpoints, to provide hot reload, etc. | ||
| --> | ||
| <uses-permission android:name="android.permission.INTERNET"/> | ||
| </manifest> |
50 changes: 50 additions & 0 deletions
50
examples/verdure/client/android/app/src/main/AndroidManifest.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <!-- Copyright 2025 The Flutter Authors. | ||
| Use of this source code is governed by a BSD-style license that can be | ||
| found in the LICENSE file. --> | ||
|
|
||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <uses-permission android:name="android.permission.INTERNET" /> | ||
| <application | ||
| android:label="verdure" | ||
| android:name="${applicationName}" | ||
| android:icon="@mipmap/ic_launcher" | ||
| <activity | ||
| android:name=".MainActivity" | ||
| android:exported="true" | ||
| android:launchMode="singleTop" | ||
| android:taskAffinity="" | ||
| android:theme="@style/LaunchTheme" | ||
| android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" | ||
| android:hardwareAccelerated="true" | ||
| android:windowSoftInputMode="adjustResize"> | ||
| <!-- Specifies an Android theme to apply to this Activity as soon as | ||
| the Android process has started. This theme is visible to the user | ||
| while the Flutter UI initializes. After that, this theme continues | ||
| to determine the Window background behind the Flutter UI. --> | ||
| <meta-data | ||
| android:name="io.flutter.embedding.android.NormalTheme" | ||
| android:resource="@style/NormalTheme" | ||
| /> | ||
| <intent-filter> | ||
| <action android:name="android.intent.action.MAIN"/> | ||
| <category android:name="android.intent.category.LAUNCHER"/> | ||
| </intent-filter> | ||
| </activity> | ||
| <!-- Don't delete the meta-data below. | ||
| This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> | ||
| <meta-data | ||
| android:name="flutterEmbedding" | ||
| android:value="2" /> | ||
| </application> | ||
| <!-- Required to query activities that can process text, see: | ||
| https://developer.android.com/training/package-visibility and | ||
| https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT. | ||
|
|
||
| In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. --> | ||
| <queries> | ||
| <intent> | ||
| <action android:name="android.intent.action.PROCESS_TEXT"/> | ||
| <data android:mimeType="text/plain"/> | ||
| </intent> | ||
| </queries> | ||
| </manifest> |
9 changes: 9 additions & 0 deletions
9
examples/verdure/client/android/app/src/main/kotlin/com/example/verdure/MainActivity.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // Copyright 2025 The Flutter Authors. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| package com.example.verdure | ||
|
|
||
| import io.flutter.embedding.android.FlutterActivity | ||
|
|
||
| class MainActivity : FlutterActivity() |
16 changes: 16 additions & 0 deletions
16
examples/verdure/client/android/app/src/main/res/drawable-v21/launch_background.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright 2025 The Flutter Authors. | ||
| Use of this source code is governed by a BSD-style license that can be | ||
| found in the LICENSE file. --> | ||
|
|
||
| <!-- Modify this file to customize your launch splash screen --> | ||
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <item android:drawable="?android:colorBackground" /> | ||
|
|
||
| <!-- You can insert your own image assets here --> | ||
| <!-- <item> | ||
| <bitmap | ||
| android:gravity="center" | ||
| android:src="@mipmap/launch_image" /> | ||
| </item> --> | ||
| </layer-list> |
16 changes: 16 additions & 0 deletions
16
examples/verdure/client/android/app/src/main/res/drawable/launch_background.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright 2025 The Flutter Authors. | ||
| Use of this source code is governed by a BSD-style license that can be | ||
| found in the LICENSE file. --> | ||
|
|
||
| <!-- Modify this file to customize your launch splash screen --> | ||
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <item android:drawable="@android:color/white" /> | ||
|
|
||
| <!-- You can insert your own image assets here --> | ||
| <!-- <item> | ||
| <bitmap | ||
| android:gravity="center" | ||
| android:src="@mipmap/launch_image" /> | ||
| </item> --> | ||
| </layer-list> |
Binary file added
BIN
+544 Bytes
examples/verdure/client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+442 Bytes
examples/verdure/client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+721 Bytes
examples/verdure/client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.01 KB
examples/verdure/client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.41 KB
examples/verdure/client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions
22
examples/verdure/client/android/app/src/main/res/values-night/styles.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- Copyright 2025 The Flutter Authors. | ||
| Use of this source code is governed by a BSD-style license that can be | ||
| found in the LICENSE file. --> | ||
|
|
||
| <resources> | ||
| <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on --> | ||
| <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
| <!-- Show a splash screen on the activity. Automatically removed when | ||
| the Flutter engine draws its first frame --> | ||
| <item name="android:windowBackground">@drawable/launch_background</item> | ||
| </style> | ||
| <!-- Theme applied to the Android Window as soon as the process has started. | ||
| This theme determines the color of the Android Window while your | ||
| Flutter UI initializes, as well as behind your Flutter UI while its | ||
| running. | ||
|
|
||
| This Theme is only used starting with V2 of Flutter's Android embedding. --> | ||
| <style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar"> | ||
| <item name="android:windowBackground">?android:colorBackground</item> | ||
| </style> | ||
| </resources> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.