FLUTTER ECOSYSTEM

cytryn/loading-animations

一个包含一系列简单但高度可定制的加载动画的 Flutter 包。

加载动画 项目封面
Stars
171
Forks
19
最近推送(UTC)
2024年8月29日
项目状态
未归档
Andre Cytryn GitHub avatar
GITHUB User

Andre Cytryn ↗

@sparelabs Vancouver
语言DartCMakeC++HTMLObjective-CCSwiftJavaKotlin

技术话题

此仓库发布的插件

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

Flutter Loading Animations Pub

A simple yet very customizable set of loading animations for Flutter projects.

Installation

Add the following to your pubspec.yaml file:

...
dependencies:
  ...
  loading_animations: "^2.1.0"
...

Then import the file to your project:

import 'package:loading_animations/loading_animations.dart';

How to use

Choose a loading animation from the list:

Flipping
  • LoadingFlipping.circle()
  • LoadingFlipping.square()
Rotating
  • LoadingRotating.square()
Double Flipping
  • LoadingDoubleFlipping.circle()
  • LoadingDoubleFlipping.square()
Bouncing Grid
  • LoadingBouncingGrid.circle()
  • LoadingBouncingGrid.square()
Filling
  • LoadingFilling.square()
Fading Line
  • LoadingFadingLine.circle()
  • LoadingFadingLine.square()
Bouncing Line
  • LoadingBouncingLine.circle()
  • LoadingBouncingLine.square()
Jumping Line
  • LoadingJumpingLine.circle()
  • LoadingJumpingLine.square()
Bumping Line
  • LoadingBumpingLine.circle()
  • LoadingBumpingLine.square()

Then add the following code:

LoadingFlipping.circle(
  color: Colors.blue,
);

Or you can customize it a bit:

LoadingFlipping.square(
  borderColor: Colors.cyan,
  size: 30.0,
);

Or customize it even more!

LoadingFlipping.circle(
  borderColor: Colors.cyan,
  borderSize: 3.0,
  size: 30.0,
  backgroundColor: Colors.cyanAccent,
  duration: Duration(milliseconds: 500),
);

For more customization, please look inside the loading animation files.

Note: all the animations come ready to go just by calling LoadingDoubleFlipping.square(), for example.

Many basic animations contain .circle() and .square() variations by default.

Examples

Note: the following gifs are not yet updated to reflect version 2.1.0

For a more true experience of the animations and its variations, download the example project and run using flutter run --profile.

LoadingFlipCircle() LoadingRotatingSquare()
https://github.com/cytryn/loading-animations/blob/master/assets/LoadingFlipCircle.gif?raw=true https://github.com/cytryn/loading-animations/blob/master/assets/LoadingRotatingSquare.gif?raw=true
LoadingFlipBox() LoadingBouncingGrid()
https://github.com/cytryn/loading-animations/blob/master/assets/LoadingFlipBox.gif?raw=true https://github.com/cytryn/loading-animations/blob/master/assets/LoadingBouncingGrid.gif?raw=true

Contribution

Please feel free to:

  • ask questions
  • report issues and bugs
  • suggest code improvements
  • request new features

Create an issue or a pull request and I will be more than happy to review it and add to the project.

Thanks

This project was heavily based on cssfx

If you like this package, don't forget to hit the ⭐️ button!

Thanks and happy coding 👻