build method
- dynamic context
Builds each tab for each bus and also accounts for the users light preferences.
Implementation
@override
Widget build(BuildContext context) {
/// Controls the format (tabs on top, list of bus stops on bottom).
return Column(children: <Widget>[
/// The tab bar displayed when the bus icon is selected.
TabBar(
isScrollable: true,
tabs: busTabs,
labelColor: Theme.of(context).brightness == Brightness.light
? Colors.black
: null,
unselectedLabelColor: Theme.of(context).brightness == Brightness.light
? Colors.black
: null,
controller: _tabController,
),
/// The list of bus stops to be displayed.
Container(
height: MediaQuery.of(context).size.height * 0.7,
child: TabBarView(
controller: _tabController,
children: <Widget>[
busList(0, this.widget.containsFilter, this.widget.jumpMap),
busList(1, this.widget.containsFilter, this.widget.jumpMap),
busList(2, this.widget.containsFilter, this.widget.jumpMap),
],
),
)
]);
}