extended_tooltip 0.0.4 copy "extended_tooltip: ^0.0.4" to clipboard
extended_tooltip: ^0.0.4 copied to clipboard

Extended tooltip package, it extends the functionality of [Tooltip] adding the option to pass a Widget as tooltip.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:extended_tooltip/extended_tooltip.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Extended ToolTip Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Extended ToolTip Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int value = 0;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ExtendedToolTip(
              horizontalPosition: ExtendedTooltipPosition.left,
              message: Container(
                width: 200,
                height: 200,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(10),
                  color: Colors.red,
                ),
                child: const Center(child: Text('My custom Message')),
              ),
              child: Text(
                'ExtendToolTip Example',
                style: Theme.of(context).textTheme.headlineMedium,
              ),
            ),
            const SizedBox(height: 30),
            const ExtendedToolTip(
                horizontalPosition: ExtendedTooltipPosition.right,
                message: CircleAvatar(
                  radius: 30,
                  child: Icon(Icons.person),
                ),
                child: Icon(Icons.person)),
            const SizedBox(height: 30),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                ExtendedToolTip(
                  message: IconButton(
                    onPressed: () {
                      setState(() {
                        value++;
                      });
                    },
                    icon: const Icon(Icons.add),
                  ),
                  child: Text('tooltip interaction $value'),
                ),
              ],
            )
          ],
        ),
      ),
    );
  }
}
0
likes
160
pub points
47%
popularity

Publisher

unverified uploader

Extended tooltip package, it extends the functionality of [Tooltip] adding the option to pass a Widget as tooltip.

Homepage
Repository (GitHub)
View/report issues

Topics

#tooltip #widget

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on extended_tooltip