Make flutter web Image widgets clickable

Viewed 455

How can I download an image from flutter web?

The image is not clickable/dragable and shows no context menu on right click, for example to "save as". Web implementation - http://watools.xyz/ankush_apis/flutter_projects/youtube/#/

Is there an alternative Image widget, to make it web clickable? Like Text and SelectableText. Maybe an Property, a pub package? Any answers appreciated.

1 Answers

Did you try to use the InkWell widget? It supports gesture and already implements the clickable effect.

     InkWell(
          child: Image.network(
              'https://i.picsum.photos/id/9/250/250.jpg?hmac=tqDH5wEWHDN76mBIWEPzg1in6egMl49qZeguSaH9_VI'),
          onTap: () {
            showDialog(
              context: context,
              builder: (context) => AlertDialog(
                title: Text('Options'),
                actions: [
                  TextButton(
                    child: Text('Save image'),
                    onPressed: () {
                      //Code for download the image
                    },
                  ),
                ],
              ),
            );
          },
        ),
Related