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/f32248b7d8123df70bc2c1c1f341681c to your computer and use it in GitHub Desktop.
Save MarcinusX/f32248b7d8123df70bc2c1c1f341681c to your computer and use it in GitHub Desktop.
class TicketCard extends StatelessWidget {
final FlightStopTicket stop;
const TicketCard({Key key, this.stop}) : super(key: key);
@override
Widget build(BuildContext context) {
return Card(
elevation: 2.0,
margin: const EdgeInsets.all(2.0),
child: _buildCardContent(),
);
}
Container _buildCardContent() {
TextStyle airportNameStyle =
new TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600);
TextStyle airportShortNameStyle =
new TextStyle(fontSize: 36.0, fontWeight: FontWeight.w200);
TextStyle flightNumberStyle =
new TextStyle(fontSize: 12.0, fontWeight: FontWeight.w500);
return Container(
height: 104.0,
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 32.0, top: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(stop.from, style: airportNameStyle),
),
Text(stop.fromShort, style: airportShortNameStyle),
],
),
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Icon(
Icons.airplanemode_active,
color: Colors.red,
),
),
Text(stop.flightNumber, style: flightNumberStyle),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 40.0, top: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(stop.to, style: airportNameStyle),
),
Text(stop.toShort, style: airportShortNameStyle),
],
),
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment