Flutter Inkwell With Complete Examples

In this tutorial we will learn how to use Inkwell in Flutter. Its usages with example.

Inkwell in flutter

What is Inkwell?

When we want to perform some action on click/double-click/long-press or on tap, then we can use the Inkwell widget in flutter. It is a best widget to perform these types of actions. So this is a clickable widget that have multiple click fuctions.

Inkwell Methods in Flutter

Inkwell have some click methods which can be perform while :

  • onTap()
  • onDoubleTap()
  • onLongPress()

Complete Example

Following is the example of Inkwell in flutter with all its features which is as below:

onTap()

Will appear when you single tap or single click on the text.

onDoubleTap()

This will appear when you double click on the text.

onLongPress()

This will appear when you long press upon the text.

Explanations

To understand better, we wrapped a Text with Inkwell then Center then Center. Then we created a string variable. On the function of onTap, onDoubleTap and onLongpress we stored a different string in it and shows below the Inkwell’s text. You can learn more about from here.

Thank you for visiting this tutorial on fluttertpoint. Hope this helped you. Please visit more useful tutorials for flutter development.

Donโ€™t miss new tips!

We donโ€™t spam! Read our [link]privacy policy[/link] for more info.

Leave a Comment

Translate ยป
Scroll to Top