Search packages, repositories and app categories

Package detailsv0.0.5

clickable_widget

This Flutter plugin provides some flutter widgets having gesture handlers their don't natively have in Flutter.

AndroidiOSmacOSWindowsLinux
30-day downloads
53
Likes
8
Pub points
140

Install package

flutter pub add clickable_widget

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The clickable_widget package extends Flutter's widget library by adding gesture handlers to widgets that don't natively support them. It enables tap, long press, and other gestures on non-interactive widgets like Text, Icon, or Container, improving usability without requiring custom wrappers. Ideal for creating interactive UI elements with minimal boilerplate, it enhances user experience across platforms.

Use cases

  • Adding taps to text elements
  • Creating interactive icons
  • Building custom buttons from non-interactive widgets
  • Enhancing form inputs with touch feedback
  • Simplifying gesture handling in complex layouts

Key features

  • Gesture support for non-interactive widgets
  • Minimal code overhead
  • Cross-platform compatibility
  • Supports tap, long press, and more
  • Easy integration with existing widgets

Suitable for

  • UI developers seeking quick gesture additions
  • Projects needing lightweight interactive components
  • Teams avoiding custom gesture detectors
  • Designers implementing interactive prototypes
  • Apps targeting multiple platforms

Considerations

  • Limited to basic gesture types
  • May require careful layout management
  • Not suitable for complex gesture chains
  • No built-in animation support
  • Depends on correct widget hierarchy

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Clickable Widget

This Flutter plugin provides some flutter widgets having gesture handlers their don't natively have in Flutter.

By default some flutter widgets (Widget Without Gesture) do not trigger gesture events so we wrap them inside the InkWell/GestureDetector widget. To overcome this, I decide to build a package which give developpers some gesture handlers directly inside WWG.

Available gesture handlers

  • onTap;
  • onTapDown;
  • onTapUp;
  • onTapCancel
  • onDoubleTapDown
  • onDoubleTap
  • onDoubleTapCancel
  • onLongPressDown
  • onLongPressCancel
  • onLongPress
  • onLongPressStart
  • onLongPressMoveUpdate
  • onLongPressUp
  • onLongPressEnd

Available widgets

  1. ClickableContainer
  2. ClickableImage
  3. ClickableCard
  4. ClickableGridTile
  5. ClickableSizedBox
  6. ClickableText
  7. ClickableRow
  8. ClickableColumn

Usage

Add Clickable Widget to your pubspec.yaml in dependencies: section.

dependencies:
  clickable_widget: ^latest

Update dependencies

  $ flutter pub get

Import Clickable Container widget in your code

  ClickableContainer(
    onTap: () {
      debugPrint("container tapped");
    },
    alignment: Alignment.center,
    width: 100.0,
    height: 100.0,
    color: Colors.grey,
    child: const Text("Tap me!"),
  ),

Import Clickable Image widget in your code

   ClickableImage(
    onTap: () {
      debugPrint("network image tapped");
    },
    clickableImageType: ClickableImageType.network,
    src: "https://pixabay.com/fr/images/search/nature/",
  ),

Import Clickable GridTile widget in your code

  ClickableGridTile(
    onTap: () {
      debugPrint("grid tile tapped");
    },
    child: const Text("Tap me!"),
  ),

For more exmample, refer to the example section.

Meta

Gael Vinou [gaelvinou@gmail.com](mailto:gaelvinou@gmail.com)

https://github.com/GV-22/clickable_widget

Distributed under the MIT License

Contributing

  1. Fork it (https://github.com/GV-22/clickable_widget/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Categories

Source repository

Projects using this package

No data available yet.