flutter - 为什么我不能在 Flutter 的 AppBar 中更改 CircleAvatar 或其他圆形小部件的高度?
问题描述
我试图在操作列表中放置一个CircleAvatar
,AppBar
但 CircleAvatar 会将其高度与 AppBar 的高度保持一致,从而无法调整它的大小并使其保持圆形。我已经尝试将它包装在 Container 或 SizedBox 中,但它不起作用。
例子:
import 'package:flutter/material.dart';
class HoursScreenEmployee extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.white10,
brightness: Brightness.light,
elevation: 0,
centerTitle: false,
actions: [
CircleAvatar(
backgroundImage: NetworkImage("https://picsum.photos/500/300"),
maxRadius: 15,
minRadius: 15,
),
],
title: Text(
"La Chance ",
style: TextStyle(
fontFamily: "Masiva",
fontSize: 27,
fontWeight: FontWeight.w800,
color: Colors.black,
),
),
),
);
}
}
解决方案
推荐阅读
- jquery - 无法将 jQuery gem 安装到 rails
- google-apps-script - 更新另一个单元格时更新谷歌表格中的单元格
- amazon-web-services - Jenkins 没有连接到 AWS EC2 Ubuntu 上的 8080 端口
- sql - SQL -Oracle - 以在 BO 屏幕中输入的输入的确切顺序返回结果 - 解决方案已更新
- database-design - 如何设计数据库,使项目有很多(发票/报价)哪些订单
- matplotlib - Matplotlib - 设置刻度标签的背景颜色
- mongodb - 如果没有主键,如何更新 mongodb 集合
- tcl - 在 tcl/tk 中删除标签框中的行
- javascript - 具体网址路径
- mysql - MySQL 更新或重命名 JSON 中的键