Skip to content

Instantly share code, notes, and snippets.

@MarcinusX
Created August 24, 2018 15:52
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/6f20fac94cff0587581cb5bbffadbfaa to your computer and use it in GitHub Desktop.
Save MarcinusX/6f20fac94cff0587581cb5bbffadbfaa to your computer and use it in GitHub Desktop.
class GenderArrow extends StatelessWidget {
final double angle;
const GenderArrow({Key key, this.angle}) : super(key: key);
double _arrowLength(BuildContext context) => screenAwareSize(32.0, context);
double _translationOffset(BuildContext context) => _arrowLength(context) * -0.4;
@override
Widget build(BuildContext context) {
return Transform.rotate(
angle: angle,
child: Transform.translate(
offset: Offset(0.0, _translationOffset(context)),
child: Transform.rotate(
angle: -_defaultGenderAngle,
child: SvgPicture.asset(
"images/gender_arrow.svg",
height: _arrowLength(context),
width: _arrowLength(context),
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment