Skip to content

Commit fe5b7db

Browse files
committed
feat:自定义expansionTile 组件
1 parent fc7ad76 commit fe5b7db

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

lib/components/expansionTile.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ class _ExpansionTileState extends State<ExpansionTile>
202202
_borderColorTween..end = theme.dividerColor;
203203
_headerColorTween
204204
..begin = theme.textTheme.subhead.color
205-
..end = theme.accentColor;
205+
..end = theme.primaryColor;
206206
_iconColorTween
207207
..begin = theme.unselectedWidgetColor
208-
..end = theme.accentColor;
208+
..end = theme.primaryColor;
209209
_backgroundColorTween..end = widget.backgroundColor;
210210
super.didChangeDependencies();
211211
}

lib/config/theme.dart

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AppTheme {
1515
static int blackColor = 0xFF000000;
1616
static int lineColor = 0xFFEEEEEE;
1717
static getThemeData(String theme) {
18-
print('==================================getThemeData=$theme');
18+
//print('==================================getThemeData=$theme');
1919
mainColor = materialColor[theme];
2020
ThemeData themData = ThemeData(
2121
textTheme: TextTheme(
@@ -36,14 +36,11 @@ class AppTheme {
3636
),
3737
accentColor: Colors.grey, // 选中颜色
3838
primaryColor: Color(mainColor), // appbar背景
39-
primaryTextTheme:TextTheme(
40-
title:TextStyle(
41-
// color: Colors.red
42-
),
43-
button: TextStyle(
44-
color: Colors.red
45-
)
46-
),
39+
primaryTextTheme: TextTheme(
40+
title: TextStyle(
41+
// color: Colors.red
42+
),
43+
button: TextStyle(color: Colors.red)),
4744
scaffoldBackgroundColor: Color(secondColor), // 整体的scaffold背景颜色
4845
);
4946
return themData;

lib/page/mine/index_2.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:efox_flutter/config/theme.dart' show AppTheme;
66
import 'package:efox_flutter/store/index.dart' show model;
77
import 'package:efox_flutter/config/color.dart' show materialColor;
88
import 'package:efox_flutter/utils/appVersion.dart' show AppVersion;
9+
import 'package:efox_flutter/components/expansionTile.dart' as Comp;
910

1011
class _IndexState extends State<Index> {
1112
@override
@@ -75,8 +76,9 @@ class _IndexState extends State<Index> {
7576
Divider(
7677
color: Color(AppTheme.lineColor),
7778
),
78-
ExpansionTile(
79+
Comp.ExpansionTile(
7980
leading: Icon(Icons.color_lens),
81+
headerBackgroundColor: Colors.transparent,
8082
title: Row(
8183
children: <Widget>[
8284
Text(AppLocalizations.$t('common_mine_1.theme')),

0 commit comments

Comments
 (0)