treemap 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

Treemap #

pub package travis

A simple Dart implementation of treemap.

Usage #

Add treemap to your pubspec:

dependencies:
  treemap: any # or the latest version on Pub

Add in you project.

  Widget build(BuildContext context) {
    return child: TreeMapLayout(
      tile: Binary(),
      root: TreeNode.node(
        // padding: EdgeInsets.symmetric(horizontal: 20),
        children: [
          TreeNode.leaf(
            value: 16,
            margin: EdgeInsets.all(5),
          ),
          TreeNode.leaf(
            value: 57,
            margin: EdgeInsets.all(5),
          ),
          TreeNode.leaf(
            value: 97,
            margin: EdgeInsets.all(5),
          ),
          TreeNode.leaf(
            value: 3,
            margin: EdgeInsets.all(5),
          ),
          TreeNode.leaf(
            value: 43,
            margin: EdgeInsets.all(5),
          ),
          TreeNode.leaf(
            value: 54,
            margin: EdgeInsets.all(5),
          ),
        ]),
    );
  }

Run the example #

See the example/ folder for a working example app.

[0.1.0] - 11/06/2019 #

  • inital release

example/lib/main.dart

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

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: Center(
        child: Container(
          color: Colors.red,
          width: 425,
          height: 425,
          child: TreeMapLayout(
            tile: Binary(),
            root: TreeNode.node(
                // padding: EdgeInsets.symmetric(horizontal: 20),
                children: [
                  TreeNode.leaf(
                    value: 16,
                    margin: EdgeInsets.all(5),
                  ),
                  TreeNode.leaf(
                    value: 57,
                    margin: EdgeInsets.all(5),
                  ),
                  TreeNode.leaf(
                    value: 97,
                    margin: EdgeInsets.all(5),
                  ),
                  TreeNode.leaf(
                    value: 3,
                    margin: EdgeInsets.all(5),
                  ),
                  TreeNode.leaf(
                    value: 43,
                    margin: EdgeInsets.all(5),
                  ),
                  TreeNode.leaf(
                    value: 54,
                    margin: EdgeInsets.all(5),
                  ),
                ]),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  treemap: ^0.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:treemap/treemap.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
66
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package not compatible with SDK dart

because of import path [treemap]

Health issues and suggestions

Document public APIs. (-0.47 points)

55 out of 56 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test