reformat
This commit is contained in:
@@ -18,69 +18,68 @@ class Home extends StatelessWidget {
|
|||||||
Item selectedSport;
|
Item selectedSport;
|
||||||
|
|
||||||
return StatefulBuilder(
|
return StatefulBuilder(
|
||||||
builder: (context, StateSetter setState) => Scaffold(
|
builder: (context, StateSetter setState) => Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
title: DropdownButton<Item>(
|
title: DropdownButton<Item>(
|
||||||
value: selectedSport,
|
value: selectedSport,
|
||||||
icon: Icon(Icons.arrow_drop_down),
|
icon: Icon(Icons.arrow_drop_down),
|
||||||
iconSize: 24,
|
iconSize: 24,
|
||||||
style: TextStyle(color: Colors.black),
|
style: TextStyle(color: Colors.black),
|
||||||
iconEnabledColor: Colors.white,
|
iconEnabledColor: Colors.white,
|
||||||
onChanged: (Item value) {
|
onChanged: (Item value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedSport = value;
|
selectedSport = value;
|
||||||
_curSport[0] = selectedSport.name;
|
_curSport[0] = selectedSport.name;
|
||||||
_curSport[1] = selectedSport.color;
|
_curSport[1] = selectedSport.color;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
items: colorList.map<DropdownMenuItem<Item>>((Item item) {
|
items: colorList.map<DropdownMenuItem<Item>>((Item item) {
|
||||||
return DropdownMenuItem<Item>(
|
return DropdownMenuItem<Item>(
|
||||||
value: item,
|
value: item,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 100,
|
width: 100,
|
||||||
child: Text(item.name),
|
child: Text(item.name),
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
),
|
||||||
backgroundColor: _curSport[1],
|
);
|
||||||
),
|
}).toList(),
|
||||||
body: ListView(
|
),
|
||||||
children: <Widget>[
|
backgroundColor: _curSport[1],
|
||||||
HorizontalNewsFeed(newsFeed: feed, title: Text("Basketball")),
|
),
|
||||||
HorizontalNewsFeed(newsFeed: feed, title: Text("Soccer")),
|
body: ListView(
|
||||||
HorizontalNewsFeed(newsFeed: feed, title: Text("Football")),
|
children: <Widget>[
|
||||||
HorizontalNewsFeed(newsFeed: feed, title: Text("Volleyball")),
|
HorizontalNewsFeed(newsFeed: feed, title: Text("Basketball")),
|
||||||
],
|
HorizontalNewsFeed(newsFeed: feed, title: Text("Soccer")),
|
||||||
),
|
HorizontalNewsFeed(newsFeed: feed, title: Text("Football")),
|
||||||
bottomNavigationBar: BottomNavigationBar(
|
HorizontalNewsFeed(newsFeed: feed, title: Text("Volleyball")),
|
||||||
type: BottomNavigationBarType.fixed,
|
],
|
||||||
onTap: (int index) {
|
),
|
||||||
setState(() {
|
bottomNavigationBar: BottomNavigationBar(
|
||||||
_currentBodyIndex = index;
|
type: BottomNavigationBarType.fixed,
|
||||||
});
|
onTap: (int index) {
|
||||||
},
|
setState(() {
|
||||||
currentIndex: _currentBodyIndex,
|
_currentBodyIndex = index;
|
||||||
items: [
|
});
|
||||||
BottomNavigationBarItem(
|
},
|
||||||
icon: new Icon(Icons.home),
|
currentIndex: _currentBodyIndex,
|
||||||
title: new Text("Home"),
|
items: [
|
||||||
),
|
BottomNavigationBarItem(
|
||||||
BottomNavigationBarItem(
|
icon: new Icon(Icons.home),
|
||||||
icon: new Icon(Icons.calendar_today),
|
title: new Text("Home"),
|
||||||
title: new Text("Schedule")),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: new Icon(Icons.table_chart),
|
icon: new Icon(Icons.calendar_today),
|
||||||
title: new Text("Scores")),
|
title: new Text("Schedule")),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: new Icon(Icons.assessment),
|
icon: new Icon(Icons.table_chart), title: new Text("Scores")),
|
||||||
title: new Text("Standings")),
|
BottomNavigationBarItem(
|
||||||
BottomNavigationBarItem(
|
icon: new Icon(Icons.assessment), title: new Text("Standings")),
|
||||||
icon: new Icon(Icons.more_horiz), title: new Text("More"))
|
BottomNavigationBarItem(
|
||||||
],
|
icon: new Icon(Icons.more_horiz), title: new Text("More"))
|
||||||
),
|
],
|
||||||
));
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user