Widget buildFloatingActionButton(_Page page) { if (!page.fabDefined) { return(null); } if (this._extendedButtons) { return(FloatingActionButton.extended( key: new ValueKey <Key>(page.fabKey), tooltip: "Show explanation", backgroundColor: page.fabColor, icon: page.fabIcon, label: new Text(page.label.ToUpper()), onPressed: this._showExplanatoryText )); } return(new FloatingActionButton( key: page.fabKey, tooltip: "Show explanation", backgroundColor: page.fabColor, child: page.fabIcon, onPressed: this._showExplanatoryText )); }
public override void initState() { base.initState(); this._controller = new TabController(vsync: this, length: TabsFabDemoUtils._allPages.Count); this._controller.addListener(this._handleTabSelection); this._selectedPage = TabsFabDemoUtils._allPages[0]; }
Widget buildTabView(_Page page) { return(new Builder( builder: (BuildContext context) => { return new Container( key: new ValueKey <string>(page.label), padding: EdgeInsets.fromLTRB(48.0f, 48.0f, 48.0f, 96.0f), child: new Card( child: new Center( child: new Text(page.label, style: new TextStyle( color: page.labelColor, fontSize: 32.0f ), textAlign: TextAlign.center ) ) ) ); } )); }
void _handleTabSelection() { this.setState(() => { this._selectedPage = TabsFabDemoUtils._allPages[this._controller.index]; }); }