TabHero class
A part of a tab, such as its title or its latest message, that flies on its own between the tab's thumbnail and its page as the tab zooms in and out: a hero animation of its own, in step with the tab's.
Put a TabHero with the same tag in what TabOverview.tabThumbnailBuilder builds and in what TabOverview.tabBuilder builds:
TabOverview<Chat>.builder(
controller: controller,
tabThumbnailBuilder: (context, chat) => Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TabHero(tag: 'name', child: Text(chat.name)),
TabHero(tag: 'last message', child: Text(chat.lastMessage)),
],
),
// ChatPage shows the name in its bar, and the last message at its
// bottom, each in a TabHero with the same tag.
tabBuilder: (context, chat) => ChatPage(chat),
)
As the tab expands, each part flies from where it is on the thumbnail to where it is on the page, and back as the tab collapses. A part that's a scaled copy of the other, such as a name set bigger, grows or shrinks as it flies. One of another shape, such as a message wrapped to another width, fades from the one into the other as it flies, each keeping its own lines, so no word jumps from line to line. While one is wider than the flying part, it's scaled down to fit, so it stays inside the tab.
A tag needs to be unique only among the tab's own parts. A part on only one of the two, such as a message that the page's list hasn't built, doesn't fly: it zooms and fades with the rest. Outside a TabOverview, a TabHero shows its child.
- Inheritance
Constructors
Properties
- child → Widget
-
What the part shows.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tag → Object
-
What the part flies by: the same on the tab's thumbnail and on its page,
and unique among the tab's parts.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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, int wrapWidth = 65}) → 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