Tooltip
is a Widget inherited from StatefulWidget
. It does not need to call up methods. When the user long presses Tooltip
When the Widget is wrapped, the corresponding operation prompt will automatically pop up.
import'package:flutter/material.dart';
class ToolTipDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title:Text(‘tool tips demo‘)),
body:Center(
child: Tooltip(
message: ‘Reminder: Unable to operate’,
child: Icon(Icons.all_inclusive),
),
)
);
}
}
import'package:flutter/material .dart';
class ToolTipDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title:Text(‘tool tips demo‘)),
body:Center(
child: Tooltip(
message: ‘Reminder: Unable to operate’,
child: Icon(Icons.all_inclusive),
),
)
);
}
}