| | |
| | | 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"; |
| | |
| | | |
| | | 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!; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | |
| | | UserUtil.getUid(); |
| | | // popPage(context); |
| | | }); |
| | | |
| | | } else { |
| | | ToastUtil.toast(map["msg"], context); |
| | | } |
| | |
| | | TopNavBar(title: "设置"), |
| | | getBigItemView( |
| | | title: "推送免打扰", |
| | | content: "关闭后,21:00-09:00不接受任何推送", |
| | | content: "开启后,21:00-9:00不接受任何推送", |
| | | marginTop: 14, |
| | | marginBottom: 1, |
| | | checked: msg, |
| | |
| | | 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; |
| | | }); |
| | | }); |
| | | }), |
| | |
| | | }); |
| | | }), |
| | | 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: () { |
| | |
| | | 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) {}); |
| | |
| | | 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) {}); |