flutter_scatter 0.1.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new77

flutter_scatter

A widget that displays a collection of dispersed and non-overlapping children.

Pub Donate

Can be used to create word clouds: Word Cloud

Features

  • Built-in delegates (Spirals, Align, Ellipse).
  • Allow you to specify how to align chlidren.

Getting started

In the pubspec.yaml of your flutter project, add the following dependency: The latest version is Pub

dependencies:
  ...
  flutter_scatter: ^latest_version

In your library add the following import:

import 'package:flutter_scatter/flutter_scatter.dart';

For help getting started with Flutter, view the online documentation.

Widgets

You can simply create a Scatter by providing a delegate and a list of widgets.

The delegate is responsible for computing positions. For example if you want to position your widgets on a circle, you will use the EllipseScatterDelegate:

return Center(
    child: Scatter(
    delegate: EllipseScatterDelegate(
        a: 185.0,
        b: 185.0,
        step: 1.0 / count,
    ),
    children: widgets,
    ),
);

Ellipse

It may be useful to choose how children are aligned with the computed positions. By default, the center of the widgets will be placed on the positions generated by the delegate. If you want to be left aligned, you will change the alignment argument of the Scatter to be Alignment.topLeft.

By default, the Scatter will not try to fill gaps (for performance reasons). You can override this behavior by setting the fillGaps argument to true.

For example this is what the above word cloud would look if the fillGaps argument would be set to false: fillGaps to false

Delegates

Scatter has built-in delegates which can be highly parameterized:

Spirals

  • ArchimedeanSpiralScatterDelegate
  • FermatSpiralScatterDelegate
  • LogarithmicSpiralScatterDelegate

Spirals

Alignments

  • AlignScatterDelegate

Alignments

Ellipses

  • EllipseScatterDelegate

Ellipses

Examples

You can find more examples in this app.

Changelog

Please see the Changelog page to know what's recently changed.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a new feature, please send a pull request.

0.1.0

  • Initial Open Source release.

example/README.md

example

Example app for the scatter widget

Getting Started

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_scatter: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_scatter/flutter_scatter.dart';
  
Version Uploaded Documentation Archive
0.1.0 Nov 11, 2018 Go to the documentation of flutter_scatter 0.1.0 Download flutter_scatter 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
55
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test