flutter - 如何仅使用颤振制作自定义加载小部件
解决方案
我不知道你可以控制lotti资产和包。
https://pub.dev/packages/lottie
使用 lotti 资产,您可以制作如下所示的加载指示器页面。
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:lottie/lottie.dart';
class LoadingIndicatorPage extends StatelessWidget {
final Color backgroundColor;
LoadingIndicatorPage({this.backgroundColor});
@override
Widget build(BuildContext context) => Container(
color: backgroundColor ?? Colors.transparent,
child: Center(
child: Lottie.asset(
'assets/loading_indicator3.zip',
width: ScreenUtil().setWidth(64),
height: ScreenUtil().setWidth(64),
),
),
);
}
推荐阅读
- reactjs - React Fragments 简写 <> 打破了 VSCode 语法高亮
- outlook - VSTO:当单击仅更新表单区域的插件自定义功能区按钮时强制显示保存对话框
- google-apps-script - 优化脚本运行时收集大量电子表格选项卡信息
- google-apps-script - 为什么经常出现“ReferenceError: Drive is not defined”?
- python-3.x - 如何从命令行激活 PyTest 夹具?
- java - 滚动到 EditText 字段时隐藏键盘问题
- c# - C# 自定义属性传递给被调用的方法
- c# - C# 行程申请 - 在继续之前重复查询
- google-cloud-platform - GCP / Cloud Functions 是否有类似 AWS Lambda 层的库概念?
- python - 使用请求python模块发送删除请求但正文只是字符串而不是json?