Blame view

lib/common/widgets/we_app_bar.dart 1.74 KB
2a29701f   liangchengyou   feat:提交代码
1
  import 'package:flutter/material.dart';
da82bd70   Key   feat: user_inform...
2
  import 'package:flutter_screenutil/flutter_screenutil.dart';
60e47f7c   liangchengyou   feat:课程选择功能
3
  import 'package:wow_english/common/extension/string_extension.dart';
2a29701f   liangchengyou   feat:提交代码
4
5
6
7
8
9
10
  
  class WEAppBar extends StatelessWidget implements PreferredSizeWidget {
    final String? titleText;
    final bool? centerTitle;
    final VoidCallback? onBack;
    final Color? backgroundColor;
    final PreferredSizeWidget? bottom;
60e47f7c   liangchengyou   feat:课程选择功能
11
    final Widget? leading;
4b858f67   吴启风   feat:webview库替换
12
    final double? leadingWidth;
60e47f7c   liangchengyou   feat:课程选择功能
13
    final List<Widget>? actions;
da82bd70   Key   feat: user_inform...
14
  
4b858f67   吴启风   feat:webview库替换
15
16
17
18
19
20
21
22
23
    const WEAppBar({this.titleText,
      this.centerTitle = true,
      this.onBack,
      this.backgroundColor,
      this.bottom,
      this.leading,
      this.leadingWidth,
      this.actions,
      super.key});
2a29701f   liangchengyou   feat:提交代码
24
25
26
27
28
  
    @override
    Widget build(BuildContext context) {
      return AppBar(
        centerTitle: centerTitle,
da82bd70   Key   feat: user_inform...
29
30
31
32
33
34
        title: Text(
          titleText ?? '',
          style: TextStyle(
            fontSize: 25.sp,
            color: const Color(0xFF333333),
            fontWeight: FontWeight.w700,
60e47f7c   liangchengyou   feat:课程选择功能
35
36
          ),
        ),
4b858f67   吴启风   feat:webview库替换
37
        leadingWidth: leadingWidth,
da82bd70   Key   feat: user_inform...
38
39
        leading: leading ??
            GestureDetector(
68dd7ba8   liangchengyou   feat:首页主题颜色+已知问题修改
40
41
42
43
44
45
46
              onTap: () {
                if (onBack == null) {
                  Navigator.pop(context);
                } else {
                  onBack!();
                }
              },
da82bd70   Key   feat: user_inform...
47
48
49
50
51
52
53
54
55
56
57
              child: Container(
                alignment: Alignment.center,
                child: Image.asset(
                  'back_around'.assetPng,
                  height: 40.h,
                  width: 40.w,
                ),
              ),
            ),
        backgroundColor: backgroundColor ?? Colors.white,
        actions: actions ?? [],
2a29701f   liangchengyou   feat:提交代码
58
59
60
61
62
      );
    }
  
    @override
    // TODO: implement preferredSize
4b858f67   吴启风   feat:webview库替换
63
64
65
    Size get preferredSize =>
        Size.fromHeight(kToolbarHeight +
            (bottom == null ? 0.0 : bottom!.preferredSize.height));
da82bd70   Key   feat: user_inform...
66
  }