Skip to content

Commit 4ed4808

Browse files
author
tangyueyang
committed
Mod 状态栏颜色
1 parent fb8dbf7 commit 4ed4808

File tree

2 files changed

+69
-6
lines changed

2 files changed

+69
-6
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import 'package:flutter/material.dart';
2+
3+
class GeneralSettings extends StatelessWidget {
4+
@override
5+
Widget build(BuildContext context) {
6+
return Scaffold(
7+
backgroundColor: Color(0xFFF6F6F6),
8+
appBar: AppBar(
9+
title: Text('通用', style: TextStyle(color: Colors.black)),
10+
centerTitle: true,
11+
iconTheme: IconThemeData(color: Colors.black),
12+
backgroundColor: Colors.white,
13+
brightness: Brightness.light,
14+
elevation: 0,
15+
),
16+
body: Container(
17+
color: Colors.white,
18+
child: SingleChildScrollView(
19+
child: Column(children: <Widget>[
20+
ListTile(
21+
title: Text('消息推送设置', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),),
22+
trailing: Icon(Icons.navigate_next),
23+
),
24+
ListTile(
25+
title: Text('隐私设置', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),),
26+
trailing: Icon(Icons.navigate_next),
27+
),
28+
ListTile(
29+
title: Text('WLAN环境下自动播放视频', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),),
30+
trailing: Switch(value: true, activeColor: Colors.red, onChanged: (status) {}),
31+
),
32+
ListTile(
33+
title: Text('截屏弹出分享弹窗', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),),
34+
trailing: Switch(value: true, activeColor: Colors.red, onChanged: (status) {}),
35+
),
36+
ListTile(
37+
title: Text('网络诊断', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),),
38+
trailing: Icon(Icons.navigate_next),
39+
),
40+
ListTile(
41+
title: Text('清除本地缓存', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),),
42+
trailing: Text('50.5M'),
43+
),
44+
ListTile(
45+
title: Text('切换站点', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),),
46+
trailing: Icon(Icons.navigate_next),
47+
),
48+
]),
49+
),
50+
),
51+
);
52+
}
53+
}

lib/pages/settings/settings.dart

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class _SettingsState extends State<Settings> {
3232
centerTitle: true,
3333
iconTheme: IconThemeData(color: Colors.black),
3434
backgroundColor: Colors.white,
35+
brightness: Brightness.light,
3536
elevation: 0,
3637
),
3738
body: settings == null
@@ -48,7 +49,13 @@ class _SettingsState extends State<Settings> {
4849
'settingsUserInfo_flo_388',
4950
'settingsFloors_flo_389'
5051
].contains(item.bId))
51-
.map((item) => _settingCard(item.data.nodes))
52+
.map(
53+
(item) => _settingCard(
54+
item.data.nodes,
55+
onTap: (item) => Navigator.of(context)
56+
.pushNamed('/general_settings'),
57+
),
58+
)
5259
.toList(),
5360
GestureDetector(
5461
child: Container(
@@ -93,7 +100,7 @@ class _SettingsState extends State<Settings> {
93100
'https://storage.360buyimg.com/i.imageUpload/494dccc6eedad0a1b1a631353834363036343330373230_big.jpg',
94101
scale: 1.8),
95102
),
96-
title: Text('Flutter Admin'),
103+
title: Text('Flutter Admin', style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold)),
97104
subtitle: Text('用户名: Flutter Admin'),
98105
trailing: Icon(Icons.navigate_next),
99106
),
@@ -102,7 +109,7 @@ class _SettingsState extends State<Settings> {
102109
child: ListTile(
103110
title: Text(address.nodes.first != null
104111
? address.nodes.first.title.value
105-
: ''),
112+
: '', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)),
106113
trailing: Icon(Icons.navigate_next),
107114
),
108115
),
@@ -111,23 +118,26 @@ class _SettingsState extends State<Settings> {
111118
);
112119
}
113120

114-
_settingCard(List<SettingsResponseFloorsDataNode> nodes) {
121+
_settingCard(List<SettingsResponseFloorsDataNode> nodes,
122+
{void Function(SettingsResponseFloorsDataNode) onTap}) {
115123
return Container(
116124
margin: EdgeInsets.only(top: 15),
117125
decoration: BoxDecoration(
118126
color: Colors.white,
119127
borderRadius: BorderRadius.circular(10),
120128
),
121-
child: ListView.builder(
129+
child: ListView.separated(
130+
separatorBuilder: (context, index) => Divider(height: 1,),
122131
physics: const NeverScrollableScrollPhysics(),
123132
shrinkWrap: true,
124133
itemCount: nodes.length,
125134
padding: EdgeInsets.zero,
126135
itemBuilder: (context, index) {
127136
return ListTile(
128-
title: Text(nodes[index].title.value),
137+
title: Text(nodes[index].title.value, style: TextStyle(fontSize: 14,fontWeight: FontWeight.bold, fontFamily: 'PingFang', color: Colors.black)),
129138
subtitle: Text(nodes[index].subtitle.value),
130139
trailing: Icon(Icons.navigate_next),
140+
onTap: () => onTap(nodes[index]),
131141
);
132142
},
133143
),

0 commit comments

Comments
 (0)