GitHub 儲存庫letsar/flutter_scatter

flutter_scatter

一個顯示分散且不重疊的子項集合的組件

flutter_scatter 專案封面
星標
89
分支
16
最近推送(UTC)
2021年3月26日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

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.

Romain Rastel GitHub avatar
GitHub 作者

Romain Rastel ↗

Flutter Developer

Rennes, France官方網站 ↗
語言DartObjective-CJava

分類

此儲存庫發佈的套件

使用的依賴

依賴清單 2 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗