SimpleTip class

A widget for showing tips to it's child and automatically setup position.

The idea is mainly copy from material Tooltip.

Example:

Widget build(context) {
  return Tip(
    message: 'Now it's time to see your profile!',
    child: TextButton(
      onPressed: navigateToProfile,
      child: Text('See profile'),
    ),
  );
}
Inheritance

Constructors

SimpleTip({Key? key, String? title, String? message, Widget? content, BoxConstraints boxConstraints = const BoxConstraints(minHeight: 24.0), Decoration? decoration, TextStyle textStyle = const TextStyle(), required VoidCallback onClosed, EdgeInsets padding = const EdgeInsets.all(8.0), EdgeInsets margin = const EdgeInsets.symmetric(horizontal: 16.0), double verticalOffset = 24.0, String closerText = 'OK', Duration waitDuration = const Duration(milliseconds: 300), bool excludeFromSemantics = false, bool isDisabled = false, bool preferBelow = true, bool withBackdrop = false, required Widget child})
const

Properties

boxConstraints BoxConstraints
Tip's content constraints
final
child Widget
The widget below this widget in the tree.
final
closerText String
Text of button to close tip.
final
content Widget?
Content of tip
final
decoration Decoration?
Tip's container decoration
final
excludeFromSemantics bool
Whether the tip's message should be excluded from the semantics tree.
final
hashCode int
The hash code for this object.
no setterinherited
isDisabled bool
Disable tip.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsets
The empty space that surrounds the tip.
final
message String?
The text to display in the tip.
final
onClosed VoidCallback
A callback after the start of closing tip.
final
padding EdgeInsets
The amount of space by which to inset the tip's content.
final
preferBelow bool
Whether the tips defaults to being displayed below the widget.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textStyle TextStyle
Tip's text default style
final
title String?
The title to display in the tip.
final
verticalOffset double
The vertical gap between the widget and the displayed tip.
final
waitDuration Duration
The length of time that a tip will wait for showing.
final
withBackdrop bool
Whether use backdrop
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() SimpleTipState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited