action_flow 1.0.0 copy "action_flow: ^1.0.0" to clipboard
action_flow: ^1.0.0 copied to clipboard

A user operation of executing the pipeline infrastructure library.

example/action_flow_example.dart

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

import 'analytics_interceptor_example.dart';

void main() {
  // App 启动时初始化
  ActionRunner.init(
    ActionPipeline([
      DebounceInterceptor(),
      AnalyticsInterceptorExample(),
      // VipInterceptor(), // 项目级
    ]),
  );

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: IconButton(
        icon: const Icon(Icons.send),
        onPressed: () {
          ActionRunner.run(
            context,
            tag: 'chat_send',
            action: sendMessage,
          );
        },
      ),
    );
  }

  Future<void> sendMessage() async {
    // do something
  }
}
0
likes
150
points
60
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A user operation of executing the pipeline infrastructure library.

Repository (GitHub)

License

MIT (license)

Dependencies

flutter

More

Packages that depend on action_flow