Skip to content

Customizable tooltip for Flutter. Provides enhanced control over Traditional tooltip appearance and behavior. Unlike Flutter's default tooltip, this allows complete customization of the tooltip's shape, position, and content.

License

Notifications You must be signed in to change notification settings

mohammedhashim790/MTooltip

Repository files navigation

mtooltip

A lightweight, highly-customizable tooltip widget for Flutter with support for top/bottom positioning, controllers, and rich content.

Quick links

Features

  • Custom shape with arrow indicator (top / bottom)
  • Attach a controller to programmatically show / remove tooltips
  • Accepts any widget as tooltip content (cards, texts, images, etc.)
  • Fade-in/out animation and configurable timings
  • Example app included: example/lib/main.dart

Installation Add this package to your project's pubspec.yaml:

dependencies:
  mtooltip:  

Requirements

  • Dart SDK: ^3.9.2 (see package pubspec) — pubspec.yaml
  • Flutter: >=1.17.0

Basic usage

final controller = MTooltipController();

MTooltip(
  context: context,
  child: Icon(Icons.info),
  tooltipContent: const Text('Simple tooltip content'),
  backgroundColor: Colors.blue,
  mTooltipController: controller,
);

Programmatic control

Use the controller to show or remove the tooltip:

controller.show();
controller.remove();

Controller API: MTooltipController.show and MTooltipController.remove.

Advanced usage (custom card)

final controller = MTooltipController();

MTooltip(
  context: context,
  mTooltipController: controller,
  tooltipAlign: TooltipAlign.top,
  backgroundColor: Colors.black87,
  tooltipContent: Container(
    child: Column(
        children: [
            Text("This is a Tooltip"),
            IconButton(
                onPressed: () {
                    mc1.remove();
                    mc2.show();
            },
            icon: Icon(Icons.navigate_next),
        ),
    ]),
  ),
  child: const Text('Tap to show tooltip'),
);

See MTooltipCard for the card structure.

API notes

Example and testing

flutter test

Tests live at test/mtooltip_test.dart.

Contributing

Contributions are welcome. Please follow standard fork/branch/PR workflow and update or add tests where appropriate.

License

This project is MIT-licensed — see LICENSE.

About

Customizable tooltip for Flutter. Provides enhanced control over Traditional tooltip appearance and behavior. Unlike Flutter's default tooltip, this allows complete customization of the tooltip's shape, position, and content.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages