flutter - 如何在 Flutter 中的 App Bar 上方或内部放置进度条?
问题描述
有谁知道我是否可以在应用栏中包含进度条?请参阅我正在尝试实现的屏幕截图。我正在尝试重用代码,如果我可以创建一个带有进度指示器的应用栏,那么没有。这将使用户能够在注册时完成此屏幕,然后在他们拥有帐户后在没有进度条的情况下编辑此屏幕。这甚至可能吗?
解决方案
我通过将进度条放在正文中解决了这个问题,将正文延伸到应用栏后面,然后使应用栏透明。
class SignUpForm extends StatelessWidget {
double progress = 0.22;
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.white,
extendBodyBehindAppBar: true,
appBar: BasicFormAppBar(),
body: Column(
children: [
SizedBox(height: 45),
Container(
child: LinearProgressIndicator(
value: progress,
valueColor: AlwaysStoppedAnimation(Colors.Blue),
backgroundColor: Colors.Grey,
),
), //column & scaffold are not closed in this snippet
推荐阅读
- javascript - 如何修复 windows.onload 中文档对象的未定义错误?
- f# - 如何从相同类型的序列中找到特定的可区分联合,然后返回该特定的可区分联合(如果存在)
- amazon-web-services - 如何使用 CloudFormation 模板将 BucketPolicy (LifecycleConfiguration) 应用于现有存储桶?
- puppeteer - 如何使用 puppeteer 获取所有具有样式的字体
- python - 如何批处理我的 R 机器学习模型?
- mysql - 当索引名称为“index”时如何在mysql中删除索引
- android - 如何在android应用程序中实现人脸识别以登录目的?
- powershell - 使用 powershell 创建符号链接
- node.js - 从 Oreilly 书籍代码安装 @types/d3 的 NPM 问题
- ios - 条件绑定的初始化程序必须具有可选类型,而不是“经销商”