privacy_settings_view.dart 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:flutter/material.dart';
  2. import 'package:trackoffical_app/route.dart';
  3. import 'package:trackoffical_app/service/api.dart';
  4. import 'package:trackoffical_app/view/web_view.dart';
  5. import 'package:trackoffical_app/widget/app_dialog.dart';
  6. import 'package:trackoffical_app/widget/app_top_bar.dart';
  7. import 'package:trackoffical_app/widget/setting_list_element.dart';
  8. import 'package:get/get.dart';
  9. class PrivacySettingsView extends StatelessWidget{
  10. const PrivacySettingsView({super.key});
  11. @override
  12. Widget build(BuildContext context) {
  13. return Scaffold(
  14. appBar: AppTopBar(title: const Text('隐私设置'), automaticallyImplyLeading: true),
  15. body: Column(
  16. children: [
  17. SettingListElement(
  18. leading: const Text('注销账户'),
  19. actions: const [SettingsRightArrow()],
  20. onTap: (){
  21. Get.dialog(
  22. AppDialog(
  23. title: const Text('警告!'),
  24. content: const Text('账户注销后将无法恢复,确定要注销吗?'),
  25. onConfirm: ()async{
  26. await ApiService.to.closeAccount();
  27. Get.offAllNamed(RouteName.home);
  28. },
  29. onConfirmText: '确定',
  30. onCancelText: '取消',
  31. )
  32. );
  33. },
  34. ),
  35. SettingListElement(
  36. leading: const Text('隐私政策'),
  37. actions: const [SettingsRightArrow()],
  38. onTap: (){
  39. Get.to(WebView(url: 'https://beswell.com/privacy-ot.html'));
  40. },
  41. )
  42. ]),
  43. );
  44. }
  45. }