Blame view

lib/pages/user/setting/setting_page.dart 1.99 KB
3840b7fe   liangchengyou   feat:更新设置页面
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  import 'package:flutter/material.dart';
  import 'package:flutter_screenutil/flutter_screenutil.dart';
  import 'package:wow_english/common/widgets/we_app_bar.dart';
  
  import '../../../route/route.dart';
  
  class SettingPage extends StatefulWidget {
    const SettingPage({super.key});
  
    @override
    State<StatefulWidget> createState() {
     return SettingPageState();
    }
  }
  
  class SettingPageState extends State<SettingPage> {
    @override
    Widget build(BuildContext context) {
      return  Scaffold(
        appBar: const WEAppBar(
          titleText: '设置',
        ),
        body: Container(
          color: Colors.white,
          padding: EdgeInsets.only(left: 17.w, right: 17.w),
          child: SafeArea(
            child: Center(
              child: ListView(
                children: [
                  34.verticalSpace,
                  _buildItemWidget('注销账号', onPress: (){
                    pushNamed(AppRouteName.deleteAccount);
                  }),
                  12.verticalSpace,
                  _buildItemWidget('清除缓存', onPress: (){
  
                  }),
                  12.verticalSpace,
                  _buildItemWidget('帮助与反馈', onPress: (){
                    pushNamed(AppRouteName.reBack);
                  }),
                ],
              ),
            ),
          ),
        ),
      );
    }
    
    Widget _buildItemWidget(String text,{VoidCallback? onPress}) {
      return OutlinedButton(
        onPressed: () => onPress?.call(),
        style: ButtonStyle(
          side: MaterialStateProperty.all(BorderSide(color: const Color(0xFF140C10), width: 1.5.w)),
          shape: MaterialStateProperty.all(RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.r))),
          minimumSize: MaterialStateProperty.all(Size(double.infinity, 58.h)),
          backgroundColor: MaterialStateProperty.all(Colors.white),
        ),
        child: Text(
          text,
          style: TextStyle(
            //fontWeight: FontWeight.w600,
            color: const Color(0xFF333333),
            fontSize: 21.sp,
          ),
        ),
      );
    }
  }