How to show Tooltip in Flutter?

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




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.



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.

import 'package:flutter/material.dart';

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


class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return
MaterialApp(
title: 'ToolTip App',
home: Scaffold(
appBar: AppBar(title: Text('Tooltip',)),
body: Center(
child: Container(
child: Tooltip(
message: 'FlutterLogo',
child: FlutterLogo(size: 100,)),
),
),
),
);
}
}


Hope this example is useful to you.

Thanks,
Srikanth

Tags: tooltip








0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.


© 2018 - Fluttercentral | Email to me - seven.srikanth@gmail.com