Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created September 3, 2018 04:35
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/249b617df4d5099399b148433a09f6d0 to your computer and use it in GitHub Desktop.
Save MarcinusX/249b617df4d5099399b148433a09f6d0 to your computer and use it in GitHub Desktop.
class PriceTab extends StatefulWidget {
final double height;
const PriceTab({Key key, this.height}) : super(key: key);
@override
_PriceTabState createState() => _PriceTabState();
}
class _PriceTabState extends State<PriceTab> with TickerProviderStateMixin {
final double _initialPlanePaddingBottom = 16.0;
double get _planeTopPadding => widget.height - _initialPlanePaddingBottom - _planeSize;
double get _planeSize => 60.0;
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
child: Stack(
alignment: Alignment.center,
children: <Widget>[_buildPlane()],
),
);
}
Widget _buildPlane() {
return Positioned(
top: _planeTopPadding,
child: Column(
children: <Widget>[
_buildPlaneIcon(),
],
),
);
}
Widget _buildPlaneIcon() {
return Icon(
Icons.airplanemode_active,
color: Colors.red,
size: _planeSize,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment