Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created August 24, 2018 15:50
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/f9e26f07e3b8df4bd688b17f00aa0695 to your computer and use it in GitHub Desktop.
Save MarcinusX/f9e26f07e3b8df4bd688b17f00aa0695 to your computer and use it in GitHub Desktop.
double _circleSize(BuildContext context) => screenAwareSize(80.0, context);
class _GenderCardState extends State<GenderCard> {
@override
Widget build(BuildContext context) {
return ...
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
CardTitle("GENDER"),
Padding(
padding: EdgeInsets.only(top: screenAwareSize(16.0, context)),
child: _drawMainStack(),
),
],
),
...
}
Widget _drawMainStack() {
return Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
_drawCircleIndicator(),
],
);
}
Widget _drawCircleIndicator() {
return Stack(
alignment: Alignment.center,
children: <Widget>[
GenderCircle(),
],
);
}
}
class GenderCircle extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: _circleSize(context),
height: _circleSize(context),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Color.fromRGBO(244, 244, 244, 1.0),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment