提交 5bb2bb49 authored 作者: shixiaochen's avatar shixiaochen

1、MyPageAppBar增加属性titleWidget

上级 ab05d096
...@@ -11,6 +11,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget { ...@@ -11,6 +11,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget {
final bool exitApp; final bool exitApp;
final Widget? leading; final Widget? leading;
final double? elevation; final double? elevation;
final Widget? titleWidget;
const MyPageAppBar({ const MyPageAppBar({
Key? key, Key? key,
...@@ -24,6 +25,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget { ...@@ -24,6 +25,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget {
this.exitApp = false, this.exitApp = false,
this.leading, this.leading,
this.elevation = 0, this.elevation = 0,
this.titleWidget,
}) : super(key: key); }) : super(key: key);
@override @override
...@@ -31,7 +33,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget { ...@@ -31,7 +33,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget {
return AppBar( return AppBar(
key: key, key: key,
centerTitle: true, centerTitle: true,
title: Text(title ?? "", style: TextStyle(color: foregroundColor)), title: titleWidget ?? Text(title ?? "", style: TextStyle(color: foregroundColor)),
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
foregroundColor: foregroundColor, foregroundColor: foregroundColor,
primary: primary, primary: primary,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论