Skip to content

Pin interactivity #51

@andreagr

Description

@andreagr

I was trying to add an "onTap" feature on the pins but the original code of the flutter_logo.dart was built around BoxDecoration, thus not allowing interactivity.

I have rewritten it this way, can it be useful? I'm new to contributions, but i would like to help.

Widget build(BuildContext context) {
    final IconThemeData iconTheme = IconTheme.of(context);
    final double iconSize = size ?? iconTheme.size;
    final MaterialColor logoColors = colors ?? Colors.blue;
    return new GestureDetector(
        onTap: (){print("I am a pin");},
        child: new Container(
            width: iconSize,
            height: iconSize,

            decoration:new BoxDecoration(

              image: new DecorationImage(
                image: new ExactAssetImage('assets/pins/pin.png'),
                fit: BoxFit.contain,

              ),
            )
        )
    );
  }```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions