Skip to content

Commit 0ce3bd9

Browse files
authored
Add Verdure example (#510)
1 parent 688ec56 commit 0ce3bd9

File tree

148 files changed

+9689
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+9689
-36
lines changed

.gitignore

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
.svn/
1616
.swiftpm/
1717
migrate_working_dir/
18-
**/firepit-log.txt
19-
**/pglite-debug.log
18+
firepit-log.txt
19+
pglite-debug.log
2020

2121
# Diagrams, produced by https://pub.dev/packages/layerlens.
2222
DEPS.md
@@ -30,20 +30,20 @@ DEPS.md
3030
# Flutter/Dart/Pub related
3131
**/doc/api/
3232
**/ios/Flutter/.last_build_id
33-
**/.dart_tool/
34-
**/.flutter-plugins-dependencies
35-
**/.pub-cache/
36-
**/.pub/
37-
**/build/
38-
**/coverage/
39-
**/pubspec.lock
40-
**/generated_plugins.cmake
41-
**/GeneratedPluginRegistrant.*
42-
**/generated_plugin_registrant.*
43-
**/Podfile
44-
**/Podfile.lock
45-
**/Runner-Bridging-Header.h
46-
**/contents.xcworkspacedata
33+
.dart_tool/
34+
.flutter-plugins-dependencies
35+
.pub-cache/
36+
.pub/
37+
build/
38+
coverage/
39+
pubspec.lock
40+
generated_plugins.cmake
41+
GeneratedPluginRegistrant.*
42+
generated_plugin_registrant.*
43+
Podfile
44+
Podfile.lock
45+
Runner-Bridging-Header.h
46+
contents.xcworkspacedata
4747

4848
# Symbolication related
4949
app.*.symbols
@@ -57,13 +57,28 @@ app.*.map.json
5757
**/android/app/release
5858

5959
# Firebase
60-
**/google-services.json
60+
google-services.json
6161
**/lib/firebase_options.dart
62-
**/firebase.json
63-
**/GoogleService-Info.plist
64-
**/.firebase
65-
**/.firebaserc
62+
firebase.json
63+
GoogleService-Info.plist
64+
.firebase
65+
.firebaserc
6666

6767
# This package's specific logs.
68-
**/*.log.*
69-
**/*.log
68+
*.log.*
69+
*.log
70+
71+
# Python
72+
__pycache__/
73+
*.py[cod]
74+
*$py.class
75+
.venv
76+
venv/
77+
ENV/
78+
.env
79+
build/
80+
dist/
81+
*.egg-info/
82+
.pytest_cache/
83+
.coverage
84+
htmlcov/

examples/verdure/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Verdure Landscape Design Example
2+
3+
This directory contains a sample application demonstrating a Flutter client interacting with a Python-based A2A (Agent-to-Agent) server for landscape design.
4+
5+
## Prerequisites
6+
7+
- Flutter SDK
8+
- Python 3.13 or higher
9+
- [UV](https://docs.astral.sh/uv/)
10+
- A Gemini API Key
11+
- You can create one using [AI Studio](https://ai.google.dev/aistudio).
12+
13+
## Running the Example
14+
15+
To run this example, you need to start both the server and the client application.
16+
17+
### 1. Start the Server
18+
19+
a. Navigate to the server directory:
20+
21+
```bash
22+
cd server
23+
```
24+
25+
b. Create a `.env` file with your Gemini API key:
26+
27+
```bash
28+
echo "GEMINI_API_KEY=YOUR_API_KEY_HERE" > .env
29+
```
30+
*Replace `YOUR_API_KEY_HERE` with your actual Gemini API key.*
31+
32+
c. Install dependencies and run the server using UV:
33+
34+
```bash
35+
uv run verdure
36+
```
37+
38+
The server will start on `http://localhost:10002` by default.
39+
40+
### 2. Run the Client
41+
42+
a. Open a new terminal window.
43+
44+
b. Navigate to the client directory:
45+
46+
```bash
47+
cd client
48+
```
49+
50+
c. Run the Flutter application on your desired device:
51+
52+
```bash
53+
flutter run
54+
```
55+
56+
The Flutter application will connect to the server running on `localhost:10002` to interact with the landscape design agent.
57+
58+
## Disclaimer
59+
60+
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.
61+
62+
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.

examples/verdure/client/.metadata

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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: "bff5cb4a90f1bc1e24fff1eef39ee2596917c07b"
8+
channel: "main"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
17+
base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
18+
- platform: android
19+
create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
20+
base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
21+
- platform: ios
22+
create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
23+
base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
24+
- platform: linux
25+
create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
26+
base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
27+
- platform: macos
28+
create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
29+
base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
30+
- platform: web
31+
create_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
32+
base_revision: bff5cb4a90f1bc1e24fff1eef39ee2596917c07b
33+
34+
# User provided section
35+
36+
# List of Local paths (relative to this file) that should be
37+
# ignored by the migrate tool.
38+
#
39+
# Files that are not part of the templates will be ignored by default.
40+
unmanaged_files:
41+
- 'lib/main.dart'
42+
- 'ios/Runner.xcodeproj/project.pbxproj'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id("dev.flutter.flutter-gradle-plugin")
6+
}
7+
8+
android {
9+
namespace = "com.example.verdure"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
12+
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_17
15+
targetCompatibility = JavaVersion.VERSION_17
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_17.toString()
20+
}
21+
22+
defaultConfig {
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "com.example.verdure"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
buildTypes {
34+
release {
35+
// TODO: Add your own signing config for the release build.
36+
// Signing with the debug keys for now, so `flutter run --release` works.
37+
signingConfig = signingConfigs.getByName("debug")
38+
}
39+
}
40+
}
41+
42+
flutter {
43+
source = "../.."
44+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- Copyright 2025 The Flutter Authors.
2+
Use of this source code is governed by a BSD-style license that can be
3+
found in the LICENSE file. -->
4+
5+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
6+
<application android:networkSecurityConfig="@xml/network_security_config" />
7+
<!-- The INTERNET permission is required for development. Specifically,
8+
the Flutter tool needs it to communicate with the running application
9+
to allow setting breakpoints, to provide hot reload, etc.
10+
-->
11+
<uses-permission android:name="android.permission.INTERNET"/>
12+
</manifest>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!-- Copyright 2025 The Flutter Authors.
2+
Use of this source code is governed by a BSD-style license that can be
3+
found in the LICENSE file. -->
4+
5+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
<application
8+
android:label="verdure"
9+
android:name="${applicationName}"
10+
android:icon="@mipmap/ic_launcher"
11+
<activity
12+
android:name=".MainActivity"
13+
android:exported="true"
14+
android:launchMode="singleTop"
15+
android:taskAffinity=""
16+
android:theme="@style/LaunchTheme"
17+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
18+
android:hardwareAccelerated="true"
19+
android:windowSoftInputMode="adjustResize">
20+
<!-- Specifies an Android theme to apply to this Activity as soon as
21+
the Android process has started. This theme is visible to the user
22+
while the Flutter UI initializes. After that, this theme continues
23+
to determine the Window background behind the Flutter UI. -->
24+
<meta-data
25+
android:name="io.flutter.embedding.android.NormalTheme"
26+
android:resource="@style/NormalTheme"
27+
/>
28+
<intent-filter>
29+
<action android:name="android.intent.action.MAIN"/>
30+
<category android:name="android.intent.category.LAUNCHER"/>
31+
</intent-filter>
32+
</activity>
33+
<!-- Don't delete the meta-data below.
34+
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
35+
<meta-data
36+
android:name="flutterEmbedding"
37+
android:value="2" />
38+
</application>
39+
<!-- Required to query activities that can process text, see:
40+
https://developer.android.com/training/package-visibility and
41+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
42+
43+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
44+
<queries>
45+
<intent>
46+
<action android:name="android.intent.action.PROCESS_TEXT"/>
47+
<data android:mimeType="text/plain"/>
48+
</intent>
49+
</queries>
50+
</manifest>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright 2025 The Flutter Authors.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
package com.example.verdure
6+
7+
import io.flutter.embedding.android.FlutterActivity
8+
9+
class MainActivity : FlutterActivity()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2025 The Flutter Authors.
3+
Use of this source code is governed by a BSD-style license that can be
4+
found in the LICENSE file. -->
5+
6+
<!-- Modify this file to customize your launch splash screen -->
7+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
8+
<item android:drawable="?android:colorBackground" />
9+
10+
<!-- You can insert your own image assets here -->
11+
<!-- <item>
12+
<bitmap
13+
android:gravity="center"
14+
android:src="@mipmap/launch_image" />
15+
</item> -->
16+
</layer-list>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2025 The Flutter Authors.
3+
Use of this source code is governed by a BSD-style license that can be
4+
found in the LICENSE file. -->
5+
6+
<!-- Modify this file to customize your launch splash screen -->
7+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
8+
<item android:drawable="@android:color/white" />
9+
10+
<!-- You can insert your own image assets here -->
11+
<!-- <item>
12+
<bitmap
13+
android:gravity="center"
14+
android:src="@mipmap/launch_image" />
15+
</item> -->
16+
</layer-list>

0 commit comments

Comments
 (0)