DVTabWorkspaceController class
The state behind a tab strip: order, selection, tear-out and adoption.
Separated from the widget because every rule worth getting right — what happens to the selection when the active tab leaves, whether an emptied workspace closes its window — is state, not painting.
- Inheritance
-
- Object
- ChangeNotifier
- DVTabWorkspaceController
Constructors
-
DVTabWorkspaceController({List<
DVTab> tabs = const <DVTab>[], DVWindow? window})
Properties
- active → DVTab?
-
no setter
- activeIndex → int
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isEmpty → bool
-
no setter
- offersNewWindow → bool
-
Whether "open in new window" should be offered at all.
no setter
- offersTearOut → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tabs
→ List<
DVTab> -
no setter
- window → DVWindow?
-
The window this workspace lives in, when it is not the main one. An
emptied workspace closes it.
final
Methods
-
activate(
int index) → void -
add(
DVTab tab, {int? at}) → void -
Adds
tab, or activates it when the workspace already holds it. -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
moveTo(
DVTabWorkspaceController destination, int index) → Future< void> -
Moves a tab into
destination. Same convergence as a drag between strips: the receiving workspace adds the route, this one lets it go. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeAt(
int index, {DVTabExit reason = DVTabExit.closed}) → DVTab? -
Removes the tab at
index, returning it. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reorder(
int from, int to) → void - Moves a tab within the strip. Works on every target, including ones with no windowing capability at all — reordering is pure UI.
-
tearOut(
int index) → Future< DVWindow?> -
Detaches the tab at
indexinto its own window. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited