Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created September 3, 2018 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcinusX/28b967f18ef447ad6fd533d2c34a5dc0 to your computer and use it in GitHub Desktop.
Save MarcinusX/28b967f18ef447ad6fd533d2c34a5dc0 to your computer and use it in GitHub Desktop.
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