@@ -16,18 +16,23 @@ class _IndexState extends State<Index> {
1616 {
1717 'name' : AppLocalizations .$t ('common.changeLanguage' ),
1818 'icon' : 59540 , // language
19+ 'index' : 0
1920 },
2021 {
2122 'name' : AppLocalizations .$t ('common.changeVersion' ) + ' ' + _version,
2223 'icon' : 58919 , // sync
24+ 'index' : 1
2325 },
2426 {
2527 'name' : AppLocalizations .$t ('common.changeEnvironment' ),
2628 'icon' : 57539 , // import_export
29+ 'index' : 2 ,
30+ 'show' : ! widget.model.config.state.isPro
2731 },
2832 {
2933 'name' : AppLocalizations .$t ('common.compProgress' ),
3034 'icon' : 57709 , // low_priority
35+ 'index' : 3
3136 }
3237 ];
3338 }
@@ -48,7 +53,7 @@ class _IndexState extends State<Index> {
4853 case 3 :
4954 FluroRouter .router.navigateTo (
5055 context,
51- '/webview?url=${Uri .encodeComponent (widget .model .config .state .env .githubWeb )}&title=${AppLocalizations .$t ('common.compProgress' )}' ,
56+ '/webview?url=${Uri .encodeComponent (widget .model .config .state .env .githubWeb )}&title=${Uri . encodeComponent ( AppLocalizations .$t ('common.compProgress' ) )}' ,
5257 );
5358 break ;
5459 }
@@ -79,6 +84,7 @@ class _IndexState extends State<Index> {
7984 ];
8085 },
8186 body: Builder (builder: (context) {
87+ List list = this ._getList ();
8288 return CustomScrollView (
8389 slivers: < Widget > [
8490 // SliverOverlapInjector与SliverOverlapAbsorber是相对成立的,
@@ -92,19 +98,24 @@ class _IndexState extends State<Index> {
9298 SliverList (
9399 delegate: SliverChildBuilderDelegate (
94100 (context, index) {
95- return ListTile (
96- onTap: () {
97- this .actionsEvent (index);
98- },
99- leading: Icon (
100- IconData (
101- this ._getList ()[index]['icon' ],
102- fontFamily: 'MaterialIcons' ,
103- matchTextDirection: true ,
101+ dynamic item = list[index];
102+ if (item['show' ] ?? true ) {
103+ return ListTile (
104+ onTap: () {
105+ this .actionsEvent (item['index' ]);
106+ },
107+ leading: Icon (
108+ IconData (
109+ item['icon' ],
110+ fontFamily: 'MaterialIcons' ,
111+ matchTextDirection: true ,
112+ ),
104113 ),
105- ),
106- title: Text ('${this ._getList ()[index ]['name' ]}' ),
107- );
114+ title: Text ('${item ['name' ]}' ),
115+ );
116+ } else {
117+ return Container ();
118+ }
108119 },
109120 childCount: this ._getList ().length,
110121 ),
0 commit comments