gxh_branch
parent
19c0e22ae2
commit
5e2b3648cf
@ -1,15 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SettingsScreen extends StatelessWidget {
|
||||
class SettingsScreen extends StatefulWidget {
|
||||
const SettingsScreen({super.key});
|
||||
|
||||
@override
|
||||
_SettingsScreenState createState() => _SettingsScreenState();
|
||||
}
|
||||
|
||||
class _SettingsScreenState extends State<SettingsScreen> {
|
||||
bool _notifications = false;
|
||||
bool _darkTheme = false;
|
||||
String _language = 'English';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('设置'),
|
||||
),
|
||||
body: const Center(
|
||||
child: Text('设置界面'),
|
||||
));
|
||||
appBar: AppBar(
|
||||
title: const Text('设置'),
|
||||
),
|
||||
body: ListView(
|
||||
children: <Widget>[
|
||||
SwitchListTile(
|
||||
title: const Text('接收通知'),
|
||||
value: _notifications,
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
_notifications = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
SwitchListTile(
|
||||
title: const Text('深色主题'),
|
||||
value: _darkTheme,
|
||||
onChanged: (bool value) {
|
||||
setState(() {
|
||||
_darkTheme = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
title: const Text('语言'),
|
||||
trailing: DropdownButton<String>(
|
||||
value: _language,
|
||||
onChanged: (String? newValue) {
|
||||
if (newValue != null) {
|
||||
setState(() {
|
||||
_language = newValue;
|
||||
});
|
||||
}
|
||||
},
|
||||
items: <String>['English', '中文']
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
// 在这里添加更多的设置选项
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue