bubble_chart 0.3.0 copy "bubble_chart: ^0.3.0" to clipboard
bubble_chart: ^0.3.0 copied to clipboard

outdated

A simple Dart implementation of bubble chart. It creates bubbles in random points and collide its all to container center. Can be implemented with any features.

example/lib/main.dart

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

final root = BubbleNode.node(
  padding: 15,
  children: [
    BubbleNode.node(
      padding: 30,
      children: [
        BubbleNode.leaf(
          options: BubbleOptions(
            color: Colors.brown,
          ),
          value: 2583,
        ),
        BubbleNode.leaf(
          options: BubbleOptions(
            color: Colors.brown,
          ),
          value: 4159,
        ),
        BubbleNode.leaf(
          options: BubbleOptions(
            color: Colors.brown,
          ),
          value: 4159,
        ),
      ],
    ),
    BubbleNode.leaf(
      value: 4159,
    ),
    BubbleNode.leaf(
      value: 2074,
    ),
    BubbleNode.leaf(
      value: 4319,
    ),
    BubbleNode.leaf(
      value: 2074,
    ),
    BubbleNode.leaf(
      value: 2074,
    ),
    BubbleNode.leaf(
      value: 2074,
    ),
    BubbleNode.leaf(
      value: 2074,
    ),
  ],
);

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        brightness: Brightness.dark,
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        height: 600,
        width: 600,
        child: BubbleChartLayout(
          root: root,
        ),
      ),
    );
  }
}
15
likes
0
pub points
85%
popularity

Publisher

unverified uploader

A simple Dart implementation of bubble chart. It creates bubbles in random points and collide its all to container center. Can be implemented with any features.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on bubble_chart