Skip to content

Instantly share code, notes, and snippets.

@MarcinusX MarcinusX/gender_card.dart Secret
Created Aug 25, 2018

What would you like to do?
class _GenderCardState extends State<GenderCard> {
Gender selectedGender;
void initState() {
selectedGender = widget.initialGender ?? Gender.other; //<--- initialize selected gender
Widget _drawMainStack() {
return Container(
width: double.infinity, //<--- Expand stack width
child: Stack(
alignment: Alignment.bottomCenter,
children: <Widget>[
GenderIconTranslated(gender: Gender.female),
GenderIconTranslated(gender: Gender.other),
GenderIconTranslated(gender: Gender.male),
_drawGestureDetector(), //<--- Add gesutre detector
Widget _drawCircleIndicator() {
return Stack(
children: <Widget>[
GenderArrow(angle: _genderAngles[selectedGender]),//<--- make arrow display current gender
_drawGestureDetector() {
return Positioned.fill(
child: TapHandler(
onGenderTapped: (gender) => setState(() => selectedGender = gender),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.