-
-
Save MarcinusX/28b967f18ef447ad6fd533d2c34a5dc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TicketsPage extends StatefulWidget { | |
@override | |
_TicketsPageState createState() => _TicketsPageState(); | |
} | |
class _TicketsPageState extends State<TicketsPage> | |
with TickerProviderStateMixin { | |
List<FlightStopTicket> stops = [ | |
new FlightStopTicket("Sahara", "SHE", "Macao", "MAC", "SE2341"), | |
new FlightStopTicket("Macao", "MAC", "Cape Verde", "CAP", "KU2342"), | |
new FlightStopTicket("Cape Verde", "CAP", "Ireland", "IRE", "KR3452"), | |
new FlightStopTicket("Ireland", "IRE", "Sahara", "SHE", "MR4321"), | |
]; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: new Stack( | |
children: <Widget>[ | |
AirAsiaBar(height: 180.0,), | |
Positioned.fill( | |
top: MediaQuery.of(context).padding.top + 64.0, | |
child: SingleChildScrollView( | |
child: new Column( | |
children: _buildTickets().toList(), | |
), | |
), | |
) | |
], | |
), | |
floatingActionButton: _buildFab(), | |
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, | |
); | |
} | |
Iterable<Widget> _buildTickets() { | |
return stops.map((stop) { | |
return Padding( | |
padding: const EdgeInsets.symmetric(vertical: 4.0, horizontal: 8.0), | |
child: TicketCard(stop: stop), | |
); | |
}); | |
} | |
_buildFab() { | |
return FloatingActionButton( | |
onPressed: () => Navigator.of(context).pop(), | |
child: new Icon(Icons.fingerprint), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment