104 lines
3.3 KiB
Dart
104 lines
3.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../pages/mine/setting/user_manual.dart';
|
|
import '../pages/mine/setting/privacy_policy.dart';
|
|
|
|
class PrivacyAgreement extends StatelessWidget {
|
|
final bool checked;
|
|
final Function(bool?) onChanged;
|
|
final Color? checkboxActiveColor;
|
|
|
|
const PrivacyAgreement({
|
|
super.key,
|
|
required this.checked,
|
|
required this.onChanged,
|
|
this.checkboxActiveColor = Colors.grey,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center, // 确保垂直居中对齐
|
|
children: [
|
|
SizedBox(
|
|
width: 20,
|
|
height: 20,
|
|
child: Transform.scale(
|
|
scale: 0.7,
|
|
child: Checkbox(
|
|
value: checked,
|
|
checkColor: Colors.white,
|
|
activeColor: Colors.white,
|
|
side: const BorderSide(color: Colors.grey),
|
|
fillColor: MaterialStateProperty.resolveWith((states) {
|
|
if (states.contains(MaterialState.selected)) {
|
|
return const Color.fromRGBO(255, 255, 255, 0.3); // 30%透明度的白色
|
|
}
|
|
return Colors.transparent;
|
|
}),
|
|
shape: const CircleBorder(),
|
|
onChanged: onChanged,
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(width: 8), // 选中框与文字的间距
|
|
Expanded(
|
|
child: Row(
|
|
children: [
|
|
const Text(
|
|
'我已阅读',
|
|
style: TextStyle(
|
|
fontSize: 11, // 修改字号为11
|
|
color: Color.fromRGBO(255, 255, 255, 0.3),
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(builder: (context) => const UserManualPage()),
|
|
);
|
|
},
|
|
child: const Text(
|
|
'《用户协议》',
|
|
style: TextStyle(
|
|
fontSize: 11, // 修改字号为11
|
|
color: Color.fromRGBO(255, 255, 255, 0.6),
|
|
),
|
|
),
|
|
),
|
|
const Text(
|
|
'和',
|
|
style: TextStyle(
|
|
fontSize: 11, // 修改字号为11
|
|
color: Color.fromRGBO(255, 255, 255, 0.3),
|
|
),
|
|
),
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(builder: (context) => const PrivacyPolicyPage()),
|
|
);
|
|
},
|
|
child: const Text(
|
|
'《隐私政策》',
|
|
style: TextStyle(
|
|
fontSize: 11, // 修改字号为11
|
|
color: Color.fromRGBO(255, 255, 255, 0.6),
|
|
),
|
|
),
|
|
),
|
|
const Text(
|
|
'并理解相应条款内容',
|
|
style: TextStyle(
|
|
fontSize: 11, // 修改字号为11
|
|
color: Color.fromRGBO(255, 255, 255, 0.3),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |