build method

List<Widget> build(
  1. BuildContext context,
  2. Graph<V> graph,
  3. GraphViewGrouping<V, G>? grouping
)

Implementation

List<Widget> build(
    BuildContext context, Graph<V> graph, GraphViewGrouping<V, G>? grouping) {
  final theme = GraphViewConfiguration.themeOf(context);
  return [
    if (grouping != null)
      ...grouping.getGroups(graph).entries.map((entry) =>
          GroupContainer<V, G>(
              groupId: entry.key,
              vertexIds: entry.value,
              borderRadius: groupBorderRadius,
              child: buildGroup(context, theme, entry))),
    ...graph.edges.values.map((edge) =>
        EdgeContainer<V>(edge: edge, child: buildEdge(context, theme, edge))),
    ...graph.vertices.values.map((vertex) => VertexContainer<V>(
        vertex: vertex, child: buildVertex(context, theme, vertex))),
  ];
}