-
-
Save MarcinusX/249b617df4d5099399b148433a09f6d0 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 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