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

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

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