grafo 0.0.1 copy "grafo: ^0.0.1" to clipboard
grafo: ^0.0.1 copied to clipboard

Grafo builder UI

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const FlowDemo(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('workflow demo'),
      ),
      body: Center(
          child: Grafo(
        grafo: [
          GrafoNode(
              id: 0,
              name: 'createASession',
              position: const Offset(100, 100),
              size: const Size(100, 100),
              children: [
                GrafoNode(
                    id: 1,
                    name: 'isANewUser?',
                    position: const Offset(300, 120),
                    size: const Size(100, 100),
                    children: [
                      GrafoNode(
                          id: 2,
                          name: 'getUserInfoByPhone',
                          position: const Offset(500, 100),
                          size: const Size(100, 100),
                          children: [
                            GrafoNode(
                                id: 6,
                                position: const Offset(900, 300),
                                size: const Size(100, 100),
                                name: 'replyGreeting')
                          ]),
                      GrafoNode(
                          id: 3,
                          position: const Offset(500, 300),
                          size: const Size(100, 100),
                          name: 'extractUserInfo',
                          children: [
                            GrafoNode(
                                id: 4,
                                name: 'saveUserInfo',
                                position: const Offset(700, 100),
                                size: const Size(100, 100),
                                children: [
                                  GrafoNode(
                                      id: 5,
                                      position: const Offset(900, 100),
                                      size: const Size(100, 100),
                                      name: 'replyGreeting')
                                ]),
                          ])
                    ])
              ])
        ],
      )),
    );
  }
}
1
likes
130
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

Grafo builder UI

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

flutter

More

Packages that depend on grafo