admin
2022-05-12 fa705507ba574c857b1667553737d23b1b7ff495
src/main/resources/code/flutter_module/lib/ui/mine/settings.dart
@@ -57,7 +57,8 @@
class _SettingPageState extends State<SettingPage>
    with SingleTickerProviderStateMixin {
  bool msg = false;
  bool ad = false;
  bool ad = true;
  bool content = true;
  bool login = false;
  String cacheSize = "0B";
@@ -77,12 +78,20 @@
    SettingUtil.isEnablePush().then((value) {
      setState(() {
        msg = value;
        msg = value!;
      });
    });
    SettingUtil.isEnableRecommendAd().then((value) {
      ad = value;
      setState(() {
        ad = value!;
      });
    });
    SettingUtil.isEnableRecommendContent().then((value) {
      setState(() {
        content = value!;
      });
    });
  }
@@ -125,7 +134,6 @@
        UserUtil.getUid();
        // popPage(context);
      });
    } else {
      ToastUtil.toast(map["msg"], context);
    }
@@ -141,7 +149,7 @@
            TopNavBar(title: "设置"),
            getBigItemView(
                title: "推送免打扰",
                content: "关闭后,21:00-09:00不接受任何推送",
                content: "开启后,21:00-9:00不接受任何推送",
                marginTop: 14,
                marginBottom: 1,
                checked: msg,
@@ -149,6 +157,19 @@
                  SettingUtil.setPush(value).then((value1) {
                    setState(() {
                      msg = value;
                    });
                  });
                }),
            getBigItemView(
                title: "个性化内容推荐",
                content: "关闭后,内容数量将不变,但内容相关度会降低",
                marginTop: 0,
                marginBottom: 1,
                checked: content,
                changed: (bool value) {
                  SettingUtil.setRecommendContent(value).then((value1) {
                    setState(() {
                      content = value;
                    });
                  });
                }),
@@ -166,36 +187,6 @@
                  });
                }),
            getCommonItemView(
                title: "清理缓存",
                content: cacheSize,
                onClick: () {
                  showCupertinoDialog(
                      context: context,
                      builder: (context) {
                        return AlertDialog(
                          title: const Text("是否清楚缓存"),
                          actions: <Widget>[
                            TextButton(
                              child: const Text('取消'),
                              onPressed: () {
                                Navigator.of(context).pop();
                              },
                            ),
                            TextButton(
                              child: const Text('确定'),
                              onPressed: () {
                                CacheUtil.clear().then((value) {
                                  ToastUtil.toast("缓存清除成功", context);
                                  _getCacheSize();
                                });
                                Navigator.of(context).pop();
                              },
                            ),
                          ],
                        );
                      });
                }),
            getCommonItemView(
                title: "检查更新",
                content: "版本号:$version",
                onClick: () {
@@ -205,8 +196,9 @@
                title: "账户注销",
                content: "",
                onClick: () {
    MySharedPreferences.getInstance().getString("unRegisterLink").then((value) {
                  MySharedPreferences.getInstance()
                      .getString("unRegisterLink")
                      .then((value) {
                    if (!StringUtil.isNullOrEmpty(value)) {
                      NavigatorUtil.navigateToNextPage(context,
                          BrowserPage(title: "账户注销", url: value!), (data) {});
@@ -217,7 +209,9 @@
                title: "隐私投诉",
                content: "",
                onClick: () {
    MySharedPreferences.getInstance().getString("feedBackLink").then((value) {
                  MySharedPreferences.getInstance()
                      .getString("feedBackLink")
                      .then((value) {
                    if (!StringUtil.isNullOrEmpty(value)) {
                      NavigatorUtil.navigateToNextPage(context,
                          BrowserPage(title: "隐私投诉", url: value!), (data) {});