@@ -9,25 +9,6 @@ class _IndexState extends State<Index> {
9
9
super .initState ();
10
10
}
11
11
12
- List <dynamic > _getList () {
13
- return [
14
- {
15
- 'name' : AppLocalizations .$t ('common_mine_1.language' ),
16
- 'icon' : 59540 , // language
17
- 'index' : 0
18
- },
19
- ];
20
- }
21
-
22
- actionsEvent (int index) {
23
- print ('index $index ' );
24
- switch (index) {
25
- case 0 :
26
- this .openLanguageSelectMenu ();
27
- break ;
28
- }
29
- }
30
-
31
12
void pop ([message]) {
32
13
Navigator .pop (context);
33
14
if (message != null ) {
@@ -75,36 +56,56 @@ class _IndexState extends State<Index> {
75
56
@override
76
57
Widget build (BuildContext context) {
77
58
return Scaffold (
78
- appBar: AppBar (
79
- elevation: 0 ,
80
- centerTitle: true ,
81
- title: Text (AppLocalizations .$t ('nav_title_1' ))),
82
- body: ListView .builder (
83
- shrinkWrap: true ,
84
- itemCount: _getList ().length * 2 ,
85
- itemBuilder: (context, index) {
86
- double _index = index / 2 ;
87
- if (index % 2 == 0 ) {
88
- dynamic item = _getList ()[_index.toInt ()];
89
- return ListTile (
90
- onTap: () {
91
- actionsEvent (item['index' ]);
92
- },
93
- leading: Icon (
94
- IconData (
95
- item['icon' ],
96
- fontFamily: 'MaterialIcons' ,
97
- matchTextDirection: true ,
98
- ),
99
- ),
100
- title: Text (item['name' ]),
101
- );
102
- } else {
103
- return Divider (
59
+ appBar: AppBar (
60
+ elevation: 0 ,
61
+ centerTitle: true ,
62
+ title: Text (AppLocalizations .$t ('nav_title_1' ))),
63
+ body: ListView (
64
+ children: < Widget > [
65
+ ListTile (
66
+ onTap: () => this .openLanguageSelectMenu (),
67
+ leading: Icon (Icons .language),
68
+ title: Text (AppLocalizations .$t ('common_mine_1.language' )),
69
+ trailing: Container (
70
+ child: Row (
71
+ mainAxisSize: MainAxisSize .min,
72
+ children: < Widget > [
73
+ Text (AppLocalizations .languageCode),
74
+ Icon (Icons .navigate_next)
75
+ ],
76
+ ),
77
+ )),
78
+ Divider (
104
79
color: Color (AppTheme .lineColor),
105
- );
106
- }
107
- },
80
+ ),
81
+ ExpansionTile (
82
+ title: Text (AppLocalizations .$t ('common_mine_1.theme' )),
83
+ children: < Widget > [
84
+ Wrap (
85
+ //crossAxisAlignment: WrapCrossAlignment.start,
86
+ alignment: WrapAlignment .spaceEvenly,
87
+ runAlignment: WrapAlignment .spaceEvenly,
88
+ children: < Widget > [
89
+ this .Edage (AppTheme .yellow),
90
+ this .Edage (AppTheme .blue),
91
+ this .Edage (AppTheme .orange),
92
+ this .Edage (AppTheme .lightGreen),
93
+ this .Edage (AppTheme .red),
94
+ ],
95
+ )
96
+ ],
97
+ )
98
+ ],
99
+ ));
100
+ }
101
+
102
+ Widget Edage (color) {
103
+ return GestureDetector (
104
+ onTap: () {},
105
+ child: Container (
106
+ color: Color (color),
107
+ height: 30 ,
108
+ width: 30 ,
108
109
),
109
110
);
110
111
}
0 commit comments