对接用户协议和隐私政策

This commit is contained in:
2026-11-11 17:00:51 +08:00
parent 985bcf4b55
commit 6cf6bea082
7 changed files with 46 additions and 66 deletions

View File

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:maibu_satabot_v2/components/legal_document.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:maibu_satabot_v2/components/app_logo.dart';
@@ -547,13 +548,13 @@ class _LoginPageV2State extends State<LoginPageV2>
style: const TextStyle(fontSize: 13, color: _grayText),
),
_protocolText(loc.translate('login.user_agreement_link'),
() => _showProtocolDetail(loc.translate('login.user_agreement_link'))),
() => openLegalDocument(context, LegalDocument.terms)),
Text(
loc.translate('login.agree_and'),
style: const TextStyle(fontSize: 13, color: _grayText),
),
_protocolText(loc.translate('login.privacy_policy_link'),
() => _showProtocolDetail(loc.translate('login.privacy_policy_link'))),
() => openLegalDocument(context, LegalDocument.privacy)),
],
),
),
@@ -594,66 +595,7 @@ class _LoginPageV2State extends State<LoginPageV2>
}
*/
void _showProtocolDetail(String title) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
backgroundColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
),
builder: (context) => Container(
padding: const EdgeInsets.all(24),
height: MediaQuery.of(context).size.height * 0.7,
child: Column(
children: [
Text(
title,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: _navy,
),
),
const Divider(height: 32, color: _inputBorder),
Expanded(
child: SingleChildScrollView(
child: Text(
(AppLocalizations.of(context)
.translate('login.protocol_detail_text')
.replaceAll('%s', title) +
'\n') *
20,
style: const TextStyle(
color: _tabUnselectedText,
height: 1.5,
),
),
),
),
const SizedBox(height: 16),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ElevatedButton.styleFrom(
backgroundColor: _primaryBlue,
foregroundColor: Colors.white,
elevation: 0,
padding: const EdgeInsets.symmetric(vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Text(AppLocalizations.of(context)
.translate('login.understood')),
),
),
],
),
),
);
}
}
/// 主按钮:横向蓝色渐变胶囊(#2BAFFE → #1C96F6 → #0B7DEE),带前置箭头。