提交 7faedf75 authored 作者: shixiaochen's avatar shixiaochen

1、优化MyPageAppBar属性(showBack是否展示默认的返回箭头)

上级 cd83a0b8
import 'package:flutter/material.dart';
class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget {
final String? title;
final Color? backgroundColor;
final Color? foregroundColor;
final bool showBack;
final String? title; // 标题
final Color? backgroundColor; // 背景颜色
final Color? foregroundColor; // 前景颜色
final bool showBack; // 是否展示返回箭头
final bool primary;
final Function()? onBack;
final List<Widget>? actions;
final bool exitApp;
final Widget? leading;
final double? elevation;
final Widget? titleWidget;
final List<Widget>? actions; // 右侧widget
final Widget? leading; // 左侧widget
final double? elevation; // 阴影
final Widget? titleWidget; // 自定义标题widget
const MyPageAppBar({
Key? key,
......@@ -20,9 +18,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget {
this.foregroundColor,
this.showBack = true,
this.primary = true,
this.onBack,
this.actions,
this.exitApp = false,
this.leading,
this.elevation = 0,
this.titleWidget,
......@@ -40,6 +36,7 @@ class MyPageAppBar extends StatelessWidget implements PreferredSizeWidget {
actions: actions,
leading: leading,
elevation: elevation,
automaticallyImplyLeading: showBack,
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论