FLUTTER ECOSYSTEM

schmidtwmark/FlutterSpinner

固定サイズのコンテナのセットをスクロールするアニメーションを行うFlutterウィジェットです。

FlutterSpinner のプロジェクト画像
Stars
8
Forks
1
最終プッシュ(UTC)
2020/04/05
プロジェクト状態
公開中
Mark Schmidt GitHub avatar
GITHUB User

Mark Schmidt ↗

言語DartKotlinSwiftObjective-C

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 2 件
  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

README を開く / 閉じる

Spinner

This flutter package implements a simple Spinner animation that cycles through any number of fixed size child widgets. Useful for selecting a random word from a list and displaying it to a user.

It can animate vertically, up or down:

https://raw.githubusercontent.com/schmidtwmark/FlutterSpinner/HEAD/example/VerticalScroll.gif

Or horizontally, left or right:

https://raw.githubusercontent.com/schmidtwmark/FlutterSpinner/HEAD/example/horizontalScroll.gif

Usage

To use this plugin, add spinner as a dependency in your pubspec.yaml file.

Example

See the example project in the repo for a quick demo

API

Spinner has several useful parameters. You can see them used in the example file

  • duration: change the duration of the animation

  • animationSpeed: change how fast the animation moves and what index the animation lands on

  • spinDirection: change the direction of animation

  • containerCount: number of containers that should appear on screen

  • containerSize: for vertical scroll, this is the width of each container produced by the builder function. For horizontal, this is the height

  • builder: a function that takes in an integer and returns a widget with height/width of containerSize

  • curve: the curve for the animation to follow. Defaults to easeInOutCubic

  • callback: a function called when the animation completes

  • zoomFactor: optional zoom in by this amount during the animation. It looks something like this, with a zoom factor of 1.5:

https://raw.githubusercontent.com/schmidtwmark/FlutterSpinner/HEAD/example/zoom.gif