How to show Tooltip in Flutter?

This Article is posted by seven.srikanth at 5/28/2019 7:33:29 PM



<p>In this article, I'm going to share the example code of how to show Tooltip in Flutter. In Flutter, a tooltip appears when the related widget is long pressed, as shown in the below image.</p> <p>![](../../Uploads/cf360ae9-4082-470f-9d18-ac7282397a18.gifwidth="50%height="auto](</p> <p>Here is the example code of how to show tooltip in flutter. All you need to do is, copy this code into main.dart file to try this example. color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre-wrap;](color: #569cd6;](import color: #ce9178;]('package:flutter/material.dart'; color: #569cd6;](void main() { runApp(MyApp());}</p> <p>color: #569cd6;](class MyApp color: #569cd6;](extends StatelessWidget { color: #569cd6;](@override Widget build(BuildContext context) { color: #569cd6;](return MaterialApp( title: color: #ce9178;]('ToolTip App', home: Scaffold( appBar: AppBar(title: Text(color: #ce9178;]('Tooltip',)), body: Center( child: Container( child: Tooltip( message: color: #ce9178;]('FlutterLogo', child: FlutterLogo(size: color: #b5cea8;](100,)), ), ), ), ); }}</p> <p>Hope this example is useful to you. Thanks,Srikanth</p>


Tags: tooltip








0 Comments
Login to comment.
Recent Comments