flutter_fadein
一个简单的 Flutter 小部件,可在小部件挂载后淡入显示。
一个简单的 Flutter 小部件,可在小部件挂载后淡入显示
以下为英文项目原文快照,最新内容请访问 GitHub。
Simple Flutter widget to fade-in your widgets once they are mounted.
Supports Material & Cupertino widgets.
Required Dart >=2.12 (has null-safety support).
Add this as a dependency in your pubspec.yaml:
dependencies:
flutter_fadein: ^2.0.0
import 'package:flutter_fadein/flutter_fadein.dart';
FadeIn(
child: Text("This will be faded-in!"),
// Optional paramaters
duration: Duration(milliseconds: 250),
delay: Duration(milliseconds: 250)
curve: Curves.easeIn,
)
If you need more control over the animation timing, you can use FadeInController:
final controller = FadeInController();
// ...
FadeIn(
child: Text("This will be faded-in with a controller"),
controller: controller,
)
// ...
controller.fadeIn();
controller.fadeOut();
Using a controller with not automatically start. You can make it automatically start using FadeInController(autoStart: true).
Note that the delay parameter does not work while using a controller, and will therefore raise an exception.
依赖清单 1 项
{"sdk":"flutter"}先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗