animated_loading_border

Flutter Website Dart Website MIT License

关键定义

  • 一个提供现代方法的包,用于在加载小部件时显示动画边框作为占位符,易于自定义且可直接使用。

预览

animated_loading_border animated_loading_border

基本用法

将其导入到您的项目文件

import 'package:animated_loading_border/animated_loading_border.dart';

并以最基本的形式添加它,例如

AnimatedLoadingBorder(
  child: Container(),
  controller: (animationController) {
     // Here we get animationController     
  },
);

AnimatedLoadingBorder的必需参数


参数 描述
Widget 子项 AnimatedLoadingBorder包含的子部件

AnimatedLoadingBorder的可选参数


参数 默认值 描述
ValueChanged? controller 提供AnimatedLoadingBorder的AnimationController的回调
Duration duration Duration(seconds: 4) 定义动画时长
double cornerRadius 0.0 定义边框的圆角
double borderWidth 1 定义边框的宽度
Color borderColor Colors.black 定义边框的颜色
Color trailingBorderColor Colors.black 定义边框后半部分的颜色
EdgeInsets padding EdgeInsets.zero 用于添加子部件的内边距
bool startWithRandomPosition 用于设置SweepGradient的起始位置
bool isTrailingTransparent 用于设置SweepGradient的起始颜色

贡献者指南