admin
2022-05-07 4c7cde7ae5ed57335405459e47de4bbd2726c4ba
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import 'dart:io';
import 'dart:ui';
 
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:makemoney/utils/ui_utils.dart';
import 'package:makemoney/utils/user_util.dart';
import '../../ui/common/browser.dart';
import '../../utils/config_util.dart';
import '../../utils/share_preference.dart';
import '../../utils/string_util.dart';
import '../../utils/ui_constant.dart';
import '../../ui/widget/nav.dart';
import '../../utils/pageutils.dart';
 
import 'advice_submit.dart';
import 'package:launch_review/launch_review.dart';
import 'package:package_info/package_info.dart';
 
class AboutUsPage extends StatefulWidget {
  AboutUsPage({Key? key, required this.title}) : super(key: key);
 
  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.
 
  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".
 
  final String title;
 
  @override
  _AboutUsPageState createState() => _AboutUsPageState();
}
 
class _AboutUsPageState extends State<AboutUsPage>
    with SingleTickerProviderStateMixin {
  String versionName = "";
  static const Color FONT_COLOR = ColorConstant.theme;
 
  @override
  void initState() {
    super.initState();
    PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
      setState(() {
        versionName = packageInfo.version;
      });
    });
  }
 
  BoxDecoration getItemDecoration(Color bgColor, Color shadowColor) {
    return BoxDecoration(
        borderRadius: const BorderRadius.all(Radius.elliptical(10, 10)),
        color: bgColor,
        boxShadow: [
          BoxShadow(
              color: shadowColor,
              blurRadius: 2.0,
              offset: const Offset(0.0, 5.0), //阴影y轴偏移量
              spreadRadius: 1 //阴影扩散程度
              )
        ]);
  }
 
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Color(0xFFFFFFFF),
        body: Container(
          child: Flex(
            direction: Axis.vertical,
            children: [
              TopNavBar(title: "关于我们"),
              Container(
                  child: AspectRatio(
                      aspectRatio: 1.689,
                      child:
                          Stack(alignment: Alignment.bottomCenter, children: [
                        Image.asset(
                            "assets/imgs/common/ic_about_us_top_bg.png"),
                        Column(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          mainAxisSize: MainAxisSize.min,
                          children: [
                            ClipRRect(
                              borderRadius: BorderRadius.circular(12),
                              child: Image.asset(
                                "assets/imgs/icon.png",
                                height: 82,
                              ),
                            ),
                            const SizedBox(
                              height: 39,
                            ),
                            Text(
                              "版本号:$versionName",
                              style: const TextStyle(
                                  fontSize: 15, color: FONT_COLOR),
                            ),
                            const SizedBox(
                              height: 26,
                            ),
                          ],
                        )
                      ]))),
              const SizedBox(
                height: 30,
              ),
              getItemView(
                  title: "用户协议",
                  onTap: () {
                    NavigatorUtil.navigateToNextPage(
                        context,
                        BrowserPage(title: "用户协议", url: Constant.PROTOCOL_URL),
                        (data) {});
                  }),
              getItemView(
                  title: "隐私政策",
                  onTap: () {
                    NavigatorUtil.navigateToNextPage(
                        context,
                        BrowserPage(title: "隐私政策", url: Constant.PRIVACY_URL),
                        (data) {});
                  }),
              getItemView(
                  title: "隐私投诉",
                  onTap: () {
                    ConfigUtil.getConfig(context, "privacyComplain")
                        .then((value) {
                      if (value == null) {
                        return;
                      }
                      NavigatorUtil.navigateToNextPage(context,
                          BrowserPage(title: "隐私投诉", url: value), (data) {});
                    });
                  }),
              getItemView(
                  title: "注销账户",
                  onTap: () {
                    UserUtil.isLogin().then((value) {
                      if (!value) {
                        ToastUtil.toast("尚未登录", context);
                        return;
                      }
 
                      ConfigUtil.getConfig(context, "unRegister").then((value) {
                        if (value == null) {
                          return;
                        }
                        NavigatorUtil.navigateToNextPage(context,
                            BrowserPage(title: "注销账户", url: value), (data) {});
                      });
                    });
                  }),
              getItemView(
                  title: "免责声明",
                  onTap: () {
                    ConfigUtil.getConfig(context, "disclaimerLink").then((value) {
                      if (value == null) {
                        return;
                      }
                      NavigatorUtil.navigateToNextPage(context,
                          BrowserPage(title: "免责声明", url: value), (data) {});
                    });
 
                  }),
            ],
          ),
        ));
  }
 
  Widget getItemView(
      {required String title, required GestureTapCallback onTap}) {
    return InkWell(
      onTap: () {
        onTap();
      },
      child: Container(
        height: 50,
        padding: const EdgeInsets.fromLTRB(25, 0, 25, 0),
        margin: const EdgeInsets.fromLTRB(10, 0, 10, 0),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Text(
              title,
              style: const TextStyle(fontSize: 15, color: FONT_COLOR),
            ),
            Expanded(child: Container()),
            const Icon(
              Icons.chevron_right,
              color: FONT_COLOR,
            )
          ],
        ),
      ),
    );
  }
}