72 lines
2.1 KiB
Dart
72 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SettingsPage extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SingleChildScrollView(
|
|
padding: EdgeInsets.all(16),
|
|
child: Column(
|
|
children: [
|
|
_buildSettingsSection('账户设置', [
|
|
_buildSettingsItem('隐私设置', Icons.privacy_tip),
|
|
_buildSettingsItem('安全设置', Icons.security),
|
|
_buildSettingsItem('账号绑定', Icons.link),
|
|
]),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
_buildSettingsSection('通知设置', [
|
|
_buildSettingsItem('推送通知', Icons.notifications_active, hasSwitch: true),
|
|
_buildSettingsItem('声音提醒', Icons.volume_up, hasSwitch: true),
|
|
_buildSettingsItem('震动提醒', Icons.vibration, hasSwitch: true),
|
|
]),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
_buildSettingsSection('其他设置', [
|
|
_buildSettingsItem('清理缓存', Icons.cleaning_services),
|
|
_buildSettingsItem('语言设置', Icons.language),
|
|
_buildSettingsItem('主题设置', Icons.color_lens),
|
|
_buildSettingsItem('关于应用', Icons.info_outline),
|
|
]),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildSettingsSection(String title, List<Widget> children) {
|
|
return Card(
|
|
elevation: 2,
|
|
child: Padding(
|
|
padding: EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
title,
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.grey[700],
|
|
),
|
|
),
|
|
SizedBox(height: 8),
|
|
...children,
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildSettingsItem(String title, IconData icon, {bool hasSwitch = false}) {
|
|
return ListTile(
|
|
leading: Icon(icon, color: Colors.blue),
|
|
title: Text(title),
|
|
trailing: hasSwitch
|
|
? Switch(value: true, onChanged: (value) {})
|
|
: Icon(Icons.arrow_forward_ios, size: 16),
|
|
onTap: () {},
|
|
);
|
|
}
|
|
}
|