jjsos_autosos_flutter/lib/pages/splash/agreement_dialog.dart

40 lines
1.5 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import 'package:autosos_flutter/router/app_router.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
/// 隐私协议 + 服务协议弹窗(对应 Android ExplainXpopup
Future<bool?> showAgreementDialog(BuildContext context) {
return showDialog<bool>(
context: context,
barrierDismissible: false,
builder: (ctx) => AlertDialog(
title: const Text('用户协议与隐私政策'),
content: const SingleChildScrollView(
child: Text(
'在你使用之前,请仔细阅读《服务协议》和《隐私政策》的全部条款。\n\n'
'我们将依法保护你的个人信息安全,包括位置信息、设备信息等。\n\n'
'点击"同意并继续"即代表你接受上述协议。',
style: TextStyle(fontSize: 14, height: 1.6),
),
),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(false),
child: const Text('不同意并退出'),
),
TextButton(
onPressed: () => ctx.push('${Routes.webview}?url=https://t.jjsos.cn/index_xy.html&title=服务协议'),
child: const Text('服务协议'),
),
TextButton(
onPressed: () => ctx.push('${Routes.webview}?url=https://t.jjsos.cn/index_ys.html&title=隐私政策'),
child: const Text('隐私政策'),
),
ElevatedButton(
onPressed: () => Navigator.of(ctx).pop(true),
child: const Text('同意并继续'),
),
],
),
);
}