From 6ec070428bb506329459a855c4265dae4790bdd0 Mon Sep 17 00:00:00 2001 From: Sun Date: Wed, 3 Nov 2021 19:38:50 +0800 Subject: [PATCH] move DC to home center --- lib/pages/home.dart | 50 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/pages/home.dart b/lib/pages/home.dart index bed5dfe..6ee522f 100644 --- a/lib/pages/home.dart +++ b/lib/pages/home.dart @@ -229,24 +229,15 @@ class _HomeListState extends State { _SessionWidget(session: sessions[allKeys[index]]!), ), ListView.builder( - itemCount: INNER_SERVICES.length, + itemCount: HOME_DIRECTORY.length, itemBuilder: (BuildContext ctx, int index) { - final params = INNER_SERVICES[index].params(lang); + final params = HOME_DIRECTORY[index].params(lang); return ListTile( - leading: Container( - width: 40.0, - height: 40.0, - padding: const EdgeInsets.all(6.0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10.0), - ), - child: Image.asset(params[2]), - ), - title: Text(params[0], style: TextStyle(fontSize: 16.0)), - subtitle: Text(params[1], style: TextStyle(fontSize: 12.0)), + leading: Icon(params[0], color: Color(0xFF6174FF)), + title: Text(params[1], style: TextStyle(fontSize: 16.0)), trailing: Icon(Icons.keyboard_arrow_right), onTap: () { - final widget = INNER_SERVICES[index].callback(); + final widget = FilesList(path: params[2]); if (widget != null) { if (isDesktop) { Provider.of(context, listen: false).updateActivedWidget(widget); @@ -254,20 +245,29 @@ class _HomeListState extends State { Navigator.push(context, MaterialPageRoute(builder: (_) => widget)); } } - }, + } ); } ), ListView.builder( - itemCount: HOME_DIRECTORY.length, + itemCount: INNER_SERVICES.length, itemBuilder: (BuildContext ctx, int index) { - final params = HOME_DIRECTORY[index].params(lang); + final params = INNER_SERVICES[index].params(lang); return ListTile( - leading: Icon(params[0], color: Color(0xFF6174FF)), - title: Text(params[1], style: TextStyle(fontSize: 16.0)), + leading: Container( + width: 40.0, + height: 40.0, + padding: const EdgeInsets.all(6.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + ), + child: Image.asset(params[2]), + ), + title: Text(params[0], style: TextStyle(fontSize: 16.0)), + subtitle: Text(params[1], style: TextStyle(fontSize: 12.0)), trailing: Icon(Icons.keyboard_arrow_right), onTap: () { - final widget = FilesList(path: params[2]); + final widget = INNER_SERVICES[index].callback(); if (widget != null) { if (isDesktop) { Provider.of(context, listen: false).updateActivedWidget(widget); @@ -275,7 +275,7 @@ class _HomeListState extends State { Navigator.push(context, MaterialPageRoute(builder: (_) => widget)); } } - } + }, ); } ), @@ -300,14 +300,14 @@ class _HomeListState extends State { inactiveColor: Colors.grey, ), BottomNavyBarItem( - icon: Icon(Icons.apps), - title: Text(lang.services, style: TextStyle(fontSize: 15.0)), + icon: Icon(Icons.source), + title: Text(lang.dataCenter, style: TextStyle(fontSize: 15.0)), activeColor: Color(0xFF6174FF), inactiveColor: Colors.grey, ), BottomNavyBarItem( - icon: Icon(Icons.source), - title: Text(lang.dataCenter, style: TextStyle(fontSize: 15.0)), + icon: Icon(Icons.apps), + title: Text(lang.services, style: TextStyle(fontSize: 15.0)), activeColor: Color(0xFF6174FF), inactiveColor: Colors.grey, ),