appduct 0.15.0 copy "appduct: ^0.15.0" to clipboard
appduct: ^0.15.0 copied to clipboard

Call functions inside a running Flutter app from a terminal, a test runner or an agent.

example/example.md

Example #

Register a tool when the app starts. Run appduct sessions link --open ios-sim (or --open android) with the app running in debug mode, then appduct tools call seed_cart --input '{"items":3}'.

import 'package:appduct/appduct.dart';
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  Appduct.ensureInitialized();

  Appduct.instance.registerTool(
    'seed_cart',
    description: 'Fill the cart with test items.',
    inputSchema: {
      'type': 'object',
      'properties': {
        'items': {'type': 'number'},
      },
      'required': ['items'],
    },
    handler: (args, context) => {'added': (args['items'] as num).toInt()},
  );

  runApp(const MaterialApp(home: Scaffold(body: Center(child: Text('Shop')))));
}
0
likes
160
points
89
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Call functions inside a running Flutter app from a terminal, a test runner or an agent.

Homepage
Repository (GitHub)
View/report issues

Topics

#testing #automation #debugging #mcp #agents

License

MIT (license)

Dependencies

flutter, json_schema_builder

More

Packages that depend on appduct

Packages that implement appduct