Browse Source

move DC to home center

pull/18/head v0.4.0
Sun 4 years ago
parent
commit
6ec070428b
  1. 50
      lib/pages/home.dart

50
lib/pages/home.dart

@ -229,24 +229,15 @@ class _HomeListState extends State<HomeList> {
_SessionWidget(session: sessions[allKeys[index]]!), _SessionWidget(session: sessions[allKeys[index]]!),
), ),
ListView.builder( ListView.builder(
itemCount: INNER_SERVICES.length, itemCount: HOME_DIRECTORY.length,
itemBuilder: (BuildContext ctx, int index) { itemBuilder: (BuildContext ctx, int index) {
final params = INNER_SERVICES[index].params(lang); final params = HOME_DIRECTORY[index].params(lang);
return ListTile( return ListTile(
leading: Container( leading: Icon(params[0], color: Color(0xFF6174FF)),
width: 40.0, title: Text(params[1], style: TextStyle(fontSize: 16.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), trailing: Icon(Icons.keyboard_arrow_right),
onTap: () { onTap: () {
final widget = INNER_SERVICES[index].callback(); final widget = FilesList(path: params[2]);
if (widget != null) { if (widget != null) {
if (isDesktop) { if (isDesktop) {
Provider.of<AccountProvider>(context, listen: false).updateActivedWidget(widget); Provider.of<AccountProvider>(context, listen: false).updateActivedWidget(widget);
@ -254,20 +245,29 @@ class _HomeListState extends State<HomeList> {
Navigator.push(context, MaterialPageRoute(builder: (_) => widget)); Navigator.push(context, MaterialPageRoute(builder: (_) => widget));
} }
} }
}, }
); );
} }
), ),
ListView.builder( ListView.builder(
itemCount: HOME_DIRECTORY.length, itemCount: INNER_SERVICES.length,
itemBuilder: (BuildContext ctx, int index) { itemBuilder: (BuildContext ctx, int index) {
final params = HOME_DIRECTORY[index].params(lang); final params = INNER_SERVICES[index].params(lang);
return ListTile( return ListTile(
leading: Icon(params[0], color: Color(0xFF6174FF)), leading: Container(
title: Text(params[1], style: TextStyle(fontSize: 16.0)), 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), trailing: Icon(Icons.keyboard_arrow_right),
onTap: () { onTap: () {
final widget = FilesList(path: params[2]); final widget = INNER_SERVICES[index].callback();
if (widget != null) { if (widget != null) {
if (isDesktop) { if (isDesktop) {
Provider.of<AccountProvider>(context, listen: false).updateActivedWidget(widget); Provider.of<AccountProvider>(context, listen: false).updateActivedWidget(widget);
@ -275,7 +275,7 @@ class _HomeListState extends State<HomeList> {
Navigator.push(context, MaterialPageRoute(builder: (_) => widget)); Navigator.push(context, MaterialPageRoute(builder: (_) => widget));
} }
} }
} },
); );
} }
), ),
@ -300,14 +300,14 @@ class _HomeListState extends State<HomeList> {
inactiveColor: Colors.grey, inactiveColor: Colors.grey,
), ),
BottomNavyBarItem( BottomNavyBarItem(
icon: Icon(Icons.apps), icon: Icon(Icons.source),
title: Text(lang.services, style: TextStyle(fontSize: 15.0)), title: Text(lang.dataCenter, style: TextStyle(fontSize: 15.0)),
activeColor: Color(0xFF6174FF), activeColor: Color(0xFF6174FF),
inactiveColor: Colors.grey, inactiveColor: Colors.grey,
), ),
BottomNavyBarItem( BottomNavyBarItem(
icon: Icon(Icons.source), icon: Icon(Icons.apps),
title: Text(lang.dataCenter, style: TextStyle(fontSize: 15.0)), title: Text(lang.services, style: TextStyle(fontSize: 15.0)),
activeColor: Color(0xFF6174FF), activeColor: Color(0xFF6174FF),
inactiveColor: Colors.grey, inactiveColor: Colors.grey,
), ),

Loading…
Cancel
Save