flutter_app_functions 0.0.4 copy "flutter_app_functions: ^0.0.4" to clipboard
flutter_app_functions: ^0.0.4 copied to clipboard

Flutter plugin that mirrors the Android App Functions API. Register typed Dart functions that Android agents (Gemini and friends) can discover and invoke on-device.

0.0.4 #

  • Added .github/workflows/publish.yml — pushing a vX.Y.Z tag now auto-publishes the package to pub.dev via OpenID Connect (no PUB_CREDENTIALS secret is required). The workflow runs flutter analyze and flutter test before publishing; Kotlin tests are skipped because they need an Android SDK and the alpha08 KSP processor only completes inside a real build.
  • README: added a maintainer-only "Publishing releases" section that documents the one-time pub.dev OIDC setup, the version-bump-and-tag flow, and how to re-publish by deleting and re-pushing the tag. The pub.dev form's tag pattern uses {{version}} substitution (not a regex), so the form field is v{{version}} — the matching GitHub-side regex in the workflow's on.push.tags is independent.

0.0.3 #

  • Added AppFunctionPlatformNotSupportedException (extends UnsupportedError). The plugin now fails fast on iOS, macOS, Linux, Windows, and Web before any native code is touched.
  • FlutterAppFunctions.register, registerAll, invoke, and getPlatformVersion now throw AppFunctionPlatformNotSupportedException when defaultTargetPlatform != android. Local-only operations (unregister, unregisterAll, ensureInitialized, registry getters) remain no-ops on any platform.
  • The exception's platform field carries the offending platform name (e.g. "iOS"); the message links to developer.android.com/ai/appfunctions.
  • README: added the new exception to the Errors table and made the "Android only" limitation explicit.

0.0.2 #

  • Rewrote the plugin as a faithful wrapper of the Android App Functions API.
  • The Kotlin side now exposes a single @AppFunction executeAppFunction entry point that dispatches by functionId to a Dart-registered handler.
  • Replaced the single registerToolHandler Dart API with a typed, multi-function API:
    • FlutterAppFunctions.instance.register(AppFunctionDefinition(...)) / unregister / unregisterAll
    • AppFunctionParameter (string / int64 / double / bool / stringList, optional, enum-constrained)
    • AppFunctionReturnType (voidType / string / int64 / double / boolean / stringList)
    • AppFunctionContext (per-call functionId + validated parameters)
  • Added a typed exception hierarchy mirroring androidx.appfunctions.AppFunction*Exception 1:1:
    • AppFunctionException, AppFunctionInvalidArgumentException, AppFunctionElementNotFoundException, AppFunctionFunctionNotFoundException, AppFunctionNotSupportedException, AppFunctionPermissionRequiredException, AppFunctionDisabledException, AppFunctionAppUnknownException.
    • The Kotlin bridge now dispatches by functionId over a single parametersJson: String / result String wire channel; typed exceptions are wrapped as PlatformException on the way out and mapped back to their androidx.appfunctions subclass on the way in.
  • Added a FlutterAppFunctionsApplication base class that host apps extend to register the bridge with the AppFunctions runtime.
  • Plugin manifest now contributes the appfunctions <service>, the xmlns:appfn namespace, and a res/xml/app_metadata.xml entry that points at user-overridable strings.
  • Gradle: added ksp { arg("appfunctions:aggregateAppFunctions", "true") } so the KSP processor aggregates this module's @AppFunctions with the host app's.
  • Tests: expanded the Dart flutter_app_functions_test.dart and flutter_app_functions_method_channel_test.dart suites, and updated the example integration test. The Kotlin bridge's exception mapping is exercised end-to-end by the integration test (alpha08 AppFunction*Exception subclasses cannot be constructed in plain JVM unit tests because their constructors touch android.os.Bundle.EMPTY).
  • Example: registered four sample functions (createTask, countActiveTasks, searchContacts, markAllTasksDone) demonstrating typed parameters, typed returns, optional parameters, and a typed error.
  • README: rewrote to mirror developer.android.com/ai/appfunctions structure.

0.0.1 #

  • Initial release with Android App Functions support.
  • Added a Dart tool-handler bridge through MethodChannel.
  • Included an example app and Android unit tests.
5
likes
0
points
385
downloads

Publisher

verified publisherbrainovatech.in

Weekly Downloads

Flutter plugin that mirrors the Android App Functions API. Register typed Dart functions that Android agents (Gemini and friends) can discover and invoke on-device.

Repository (GitHub)
View/report issues

Topics

#appfunctions #android #ai #tools #gemini

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_app_functions

Packages that implement flutter_app_functions