import 'package:flutter/material.dart'; import 'package:trackoffical_app/route.dart'; import 'package:trackoffical_app/service/api.dart'; import 'package:trackoffical_app/view/web_view.dart'; import 'package:trackoffical_app/widget/app_dialog.dart'; import 'package:trackoffical_app/widget/app_top_bar.dart'; import 'package:trackoffical_app/widget/setting_list_element.dart'; import 'package:get/get.dart'; class PrivacySettingsView extends StatelessWidget{ const PrivacySettingsView({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppTopBar(title: const Text('隐私设置'), automaticallyImplyLeading: true), body: Column( children: [ SettingListElement( leading: const Text('注销账户'), actions: const [SettingsRightArrow()], onTap: (){ Get.dialog( AppDialog( title: const Text('警告!'), content: const Text('账户注销后将无法恢复,确定要注销吗?'), onConfirm: ()async{ await ApiService.to.closeAccount(); Get.offAllNamed(RouteName.home); }, onConfirmText: '确定', onCancelText: '取消', ) ); }, ), SettingListElement( leading: const Text('隐私政策'), actions: const [SettingsRightArrow()], onTap: (){ Get.to(WebView(url: 'https://beswell.com/privacy-ot.html')); }, ) ]), ); } }