Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 38 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
.svn/
.swiftpm/
migrate_working_dir/
**/firepit-log.txt
**/pglite-debug.log
firepit-log.txt
pglite-debug.log

# Diagrams, produced by https://pub.dev/packages/layerlens.
DEPS.md
Expand All @@ -30,20 +30,20 @@ DEPS.md
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
**/.dart_tool/
**/.flutter-plugins-dependencies
**/.pub-cache/
**/.pub/
**/build/
**/coverage/
**/pubspec.lock
**/generated_plugins.cmake
**/GeneratedPluginRegistrant.*
**/generated_plugin_registrant.*
**/Podfile
**/Podfile.lock
**/Runner-Bridging-Header.h
**/contents.xcworkspacedata
.dart_tool/
.flutter-plugins-dependencies
.pub-cache/
.pub/
build/
coverage/
pubspec.lock
generated_plugins.cmake
GeneratedPluginRegistrant.*
generated_plugin_registrant.*
Podfile
Podfile.lock
Runner-Bridging-Header.h
contents.xcworkspacedata

# Symbolication related
app.*.symbols
Expand All @@ -57,13 +57,28 @@ app.*.map.json
**/android/app/release

# Firebase
**/google-services.json
google-services.json
**/lib/firebase_options.dart
**/firebase.json
**/GoogleService-Info.plist
**/.firebase
**/.firebaserc
firebase.json
GoogleService-Info.plist
.firebase
.firebaserc

# This package's specific logs.
**/*.log.*
**/*.log
*.log.*
*.log

# Python
__pycache__/
*.py[cod]
*$py.class
.venv
venv/
ENV/
.env
build/
dist/
*.egg-info/
.pytest_cache/
.coverage
htmlcov/
62 changes: 62 additions & 0 deletions examples/verdure/README.md
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.
42 changes: 42 additions & 0 deletions examples/verdure/client/.metadata
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'
14 changes: 14 additions & 0 deletions examples/verdure/client/android/.gitignore
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
44 changes: 44 additions & 0 deletions examples/verdure/client/android/app/build.gradle.kts
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 examples/verdure/client/android/app/src/debug/AndroidManifest.xml
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 examples/verdure/client/android/app/src/main/AndroidManifest.xml
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>
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()
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>
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>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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>
Loading
Loading