graphview 0.1.0 copy "graphview: ^0.1.0" to clipboard
graphview: ^0.1.0 copied to clipboard

outdated

GraphView is used to display data in graph structures.

example/example.dart

import 'package:flutter/material.dart';

import 'GraphViewClusterPage.dart';
import 'TreeViewPage.dart';


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

List<String> text = [
  "Tree View (BuchheimWalker)",
  "Graph Cluster View (FruchtermanReingold)",
];

List<Widget> widgets = [
  GraphViewPage(),
  GraphClusterViewPage(),
];

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) =>
      MaterialApp(
        home: Scaffold(
          body: Center(
            child: Column(children: [
              ...mapIndexed(
                  text,
                      (index, item) =>
                      FlatButton(
                          onPressed: () =>
                              Navigator.push(
                                context,
                                MaterialPageRoute(
                                    builder: (context) =>
                                        Scaffold(
                                          appBar: AppBar(),
                                          body: widgets[index],
                                        )),
                              ),
                          child: Text(
                            item.toString(),
                            style: TextStyle(color: Theme
                                .of(context)
                                .primaryColor),
                          ))),
            ]),
          ),
        ),
      );
}


Iterable<E> mapIndexed<E, T>(Iterable<T> items, E Function(int index, T item) f) sync* {
  var index = 0;

  for (final item in items) {
    yield f(index, item);
    index = index + 1;
  }
}
448
likes
0
pub points
96%
popularity

Publisher

verified publishernabilmh.com

GraphView is used to display data in graph structures.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on graphview