AbstractTransitionComponent<T extends AbstractTransitionProps, S extends AbstractTransitionState> class
abstract
How to use AbstractTransitionComponent:
-
Create props and state the extend AbstractTransitionProps and AbstractTransitionState.
@Props() class CustomComponentProps extends AbstractTransitionProps {} @State() class CustomComponentState extends AbstractTransitionProps {} -
Have your component extend AbstractTransitionComponent.
@Component() class CustomComponent extends AbstractTransitionComponent<CustomComponentProps, CustomComponentState> {} -
Override initiallyShown, getTransitionDomNode and optionally hasTransition.
-
Use helper getters to render your component.
@override render() { if (!shouldRender) { return false; } var classes = forwardingClassNameBuilder() ..add('class-to-start-transition', isShown); return (Dom.div() ..className = classes.toClassName() )() } -
Granular lifecycle methods available:
-
API methods that you get for free:
- Inheritance
-
- Object
- Component
- UiComponent<
T> - UiStatefulComponent<
T, S> - UiStatefulComponent<
T, S> - AbstractTransitionComponent
- Annotations
-
- @Deprecated('Use the `AbstractTransitionComponent` exported from `package:over_react/components.dart` instead. Will be removed in the 4.0.0 release.')
- @AbstractComponent()
Constructors
Properties
-
$defaultConsumedProps
→ Iterable<
ConsumedProps> -
The default consumed props, taken from the keys generated in the associated @annotations.Props class.
no setterinherited
- $isClassGenerated → bool
-
Whether this class has been generated.
no setterinherited
-
childContextKeys
→ Iterable<
String> -
The keys this component uses in its child context map (returned by
getChildContext).no setterinherited -
consumedProps
→ Iterable<
ConsumedProps> ? -
The props for the non-forwarding props defined in this component.
no setteroverride
- context ↔ dynamic
-
The React context map of this component, passed down from its ancestors'
getChildContextvalue.getter/setter pairinherited -
contextKeys
→ Iterable<
String> -
The keys of context used by this component.
no setterinherited
- displayName → String?
-
Allows the ReactJS
displayNameproperty to be set for debugging purposes.no setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- hasTransition → bool
-
Whether transitions are enabled for this component.
no setter
- hasTransitionIn → bool
-
Whether the Element returned by getTransitionDomNode will have a transition event when showing.
no setter
- hasTransitionOut → bool
-
Whether the Element returned by getTransitionDomNode will have a transition event when hiding.
no setter
- initiallyShown → bool
-
Whether the AbstractTransitionComponent should be visible initially when mounted.
no setter
- isOrWillBeHidden → bool
-
Whether the AbstractTransitionComponent is hidden or in the process of hiding.
no setter
- isOrWillBeShown → bool
-
Whether the AbstractTransitionComponent is shown or in the process of showing.
no setter
- isShown → bool
-
Whether the AbstractTransitionComponent is in a "visible" state.
no setter
- jsThis → dynamic
-
The JavaScript
ReactComponentinstance of thisComponentreturned byrender.no setterinherited - nextContext ↔ Map?
-
Private reference to the value of
contextfor the upcoming render cycle.getter/setter pairinherited - nextProps ↔ Map?
-
Reference to the value of
propsfor the upcoming render cycle.getter/setter pairinherited - nextState → Map
-
Public getter for
_nextState.no setterinherited - prevContext ↔ Map?
-
Reference to the value of
contextfrom the previous render cycle, used internally for proxying the ReactJS lifecycle method.getter/setter pairinherited - prevState ↔ Map?
-
Reference to the value of
statefrom the previous render cycle, used internally for proxying the ReactJS lifecycle method andcomponentDidUpdate.getter/setter pairinherited - props ↔ T
-
A typed props object corresponding to the current untyped props Map (unwrappedProps).
getter/setter pairinherited
- ref ↔ RefMethod
-
DEPRECATED.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setStateCallbacks → List
-
The List of callbacks to be called after the component has been updated from a call to
setState.no setterinherited - shouldRender → bool
-
Whether the AbstractTransitionComponent should render.
no setter
- state ↔ S
-
A typed state object corresponding to the current untyped state Map (unwrappedState).
getter/setter pairinherited
- transactionalSetStateCallbacks → List
-
The List of transactional
setStatecallbacks to be called before the component updates.no setterinherited - transitionInCount → int
-
The number of
transitionendevents that occur when the transition node is shown.no setter - transitionOutCount → int
-
The number of
transitionendevents that occur when the transition node is hidden.no setter - transitionTimeout → Duration
-
The duration that can elapse before a transition timeout occurs.
no setter
- unwrappedProps ↔ Map
-
The props Map that will be used to create the typed props object.
getter/setter pairinherited
- unwrappedState ↔ Map
-
The state Map that will be used to create the typed state object.
getter/setter pairinherited
Methods
-
awaitBeforeDispose<
T> (Future< T> future) → Future<T> -
Add
futureto a list of futures that will be awaited before the object is disposed.inherited -
componentDidMount(
) → void -
ReactJS lifecycle method that is invoked once, only on the client (not on the server), immediately after the
initial rendering occurs.
inherited
-
componentDidUpdate(
Map prevProps, Map prevState) → void -
ReactJS lifecycle method that is invoked immediately after the
Component's updates are flushed to the DOM.override -
componentWillMount(
) → void -
ReactJS lifecycle method that is invoked once, both on the client and server, immediately before the initial
rendering occurs.
inherited
-
componentWillReceiveProps(
Map nextProps) → void -
ReactJS lifecycle method that is invoked when a
Componentis receivingnewProps.inherited -
componentWillReceivePropsWithContext(
Map newProps, dynamic nextContext) → void -
UNSUPPORTED IN COMPONENT2
This API was never stable in any version of ReactJS, and was replaced with a new, incompatible context API in ReactJS 16.
This will be completely removed alongside the Component class.
inherited -
componentWillUnmount(
) → void -
ReactJS lifecycle method that is invoked immediately before a
Componentis unmounted from the DOM.override -
componentWillUpdate(
Map nextProps, Map nextState) → void -
ReactJS lifecycle method that is invoked immediately before rendering when
nextPropsornextStateare being received.inherited -
componentWillUpdateWithContext(
Map nextProps, Map nextState, Map? nextContext) → void -
DEPRECATED - DO NOT USE
This API was never stable in any version of ReactJS, and was replaced with a new, incompatible context API in ReactJS 16.
This will be completely removed alongside the Component class.
inherited -
copyProps(
{bool omitReservedReactProps = true, bool onlyCopyDomProps = false, Iterable? keysToOmit, Iterable< Iterable> ? keySetsToOmit}) → Map -
Returns a copy of this component's props with React props optionally omitted, and
with the specified
keysToOmitandkeySetsToOmitomitted.inherited -
copyUnconsumedDomProps(
) → Map -
Returns a copy of this component's props with keys found in consumedProps and non-DOM props omitted.
inherited
-
copyUnconsumedProps(
) → Map -
Returns a copy of this component's props with keys found in consumedProps omitted.
inherited
-
forwardingClassNameBuilder(
) → ClassNameBuilder -
Returns a new ClassNameBuilder with className and blacklist values added from CssClassPropsMixin.className and
CssClassPropsMixin.classNameBlacklist, if they are specified.
inherited
-
getChildContext(
) → Map< String, dynamic> -
Returns a Map of context to be passed to descendant components.
inherited
-
getDefaultProps(
) → Map -
Invoked once and cached when
registerComponentis called. Values in the mapping will be set on props if that prop is not specified by the parent component.override -
getInitialState(
) → Map -
Invoked once before the
Componentis mounted. The return value will be used as the initial value of state.override -
getManagedDelayedFuture<
T> (Duration duration, T callback()) → Future< T> -
Creates a Future that will complete, with the value
returned by
callback, after the given amount of time has elapsed.inherited -
getManagedDisposer(
Disposer disposer) → ManagedDisposer -
Automatically handle arbitrary disposals using a callback.
inherited
-
getManagedPeriodicTimer(
Duration duration, void callback(Timer timer)) → Timer -
Creates a periodic Timer that will be cancelled if active
upon disposal.
inherited
-
getManagedTimer(
Duration duration, void callback()) → Timer -
Creates a Timer instance that will be cancelled if active
upon disposal.
inherited
-
getTransitionDomNode(
) → Element? - Returns the DOM node that will transition.
-
getTransitionTestAttributes(
) → Map< String, String?> - Returns attributes only available during testing that indicate the state of the transition.
-
handleHidden(
) → void -
Method that will be called when AbstractTransitionComponent first enters the
hiddenstate. -
handleHiding(
) → void -
Method that will be called when AbstractTransitionComponent first enters the
hidingstate. -
handlePreShowing(
) → void -
Method that will be called when AbstractTransitionComponent first enters the
preShowingstate. -
handleShowing(
) → void -
Method that will be called when AbstractTransitionComponent first enters the
showingstate. -
handleShown(
) → void -
Method that will be called when AbstractTransitionComponent first enters the
shownstate. -
hide(
) → void - Hides the AbstractTransitionComponent by removing the CSS class that invokes a CSS transition.
-
initComponentInternal(
Map props, void _jsRedraw(), [RefMethod? ref, dynamic _jsThis, Map? context]) → dynamic -
inherited
-
initStateInternal(
) → dynamic -
inherited
-
listenToStream<
T> (Stream< T> stream, void onData(T event), {Function? onError, void onDone()?, bool? cancelOnError}) → StreamSubscription<T> -
Returns a StreamSubscription which handles events from the stream using
the provided
onData,onErrorandonDonehandlers.inherited -
manageAndReturnDisposable(
Disposable disposable) → Disposable -
inherited
-
manageAndReturnTypedDisposable<
T extends Disposable> (T disposable) → T -
Automatically dispose another object when this object is disposed.
inherited
-
manageCompleter<
T> (Completer< T> completer) → Completer<T> -
Ensure that a completer is completed when the object is disposed.
inherited
-
manageDisposable(
Disposable disposable) → void -
inherited
-
manageDisposer(
Disposer disposer) → void -
DEPRECATED. Use
getManagedDisposerinstead.inherited -
manageStreamController(
StreamController controller) → void -
Automatically cancel a stream controller when this object is disposed.
inherited
-
manageStreamSubscription(
StreamSubscription subscription) → void -
DEPRECATED. Use
listenToStreaminstead.inherited -
newProps(
) → T -
Returns a typed props object backed by a new Map.
inherited
-
newState(
) → S -
Returns a typed state object backed by a new Map.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onNextTransitionEnd(
dynamic complete()) → void -
Listens for the next
transitionendevent and invokes a callback after the event is dispatched. -
prepareHide(
) → void - Method that will be called right before the AbstractTransitionComponent begins to hide.
-
prepareShow(
) → void - Method that will be called right before the AbstractTransitionComponent begins to show.
-
redraw(
[dynamic callback()?]) → void -
Force a call to
renderby callingsetState, which effectively "redraws" theComponent.inherited -
render(
) → dynamic -
Required.
inherited
-
replaceState(
Map? newState, [dynamic callback()?]) → void -
Set
_nextStateto providednewStatevalue and force a re-render.inherited -
setState(
covariant dynamic newState, [dynamic callback()?]) → void -
Triggers a rerender with new state obtained by shallow-merging
newStateinto the currentstate.inherited -
shouldComponentUpdate(
Map nextProps, Map nextState) → bool -
ReactJS lifecycle method that is invoked before rendering when
nextPropsornextStateare being received.inherited -
shouldComponentUpdateWithContext(
Map nextProps, Map nextState, Map? nextContext) → bool? -
DEPRECATED - DO NOT USE
This API was never stable in any version of ReactJS, and was replaced with a new, incompatible context API in ReactJS 16.
This will be completely removed alongside the Component class.
inherited -
show(
) → void - Shows the AbstractTransitionComponent by adding the CSS class that invokes a CSS transition.
-
toggle(
) → void -
Toggles the visibility of the AbstractTransitionComponent based on the value of
AbstractTransitionState.transitionPhase. -
toString(
) → String -
A string representation of this object.
inherited
-
transferComponentState(
) → void -
Transfers
Component_nextStatetostate, andstatetoprevState.inherited -
typedPropsFactory(
Map propsMap) → T -
Returns a typed props object backed by the specified
propsMap. Required to properly instantiate the genericTPropsclass.inherited -
typedStateFactory(
Map? stateMap) → S -
Returns a typed state object backed by the specified
stateMap.inherited -
validateProps(
Map appliedProps) → void -
Throws a PropError if
appliedPropsare invalid.inherited -
validateRequiredProps(
Map appliedProps) → void -
Validates that props with the
@requiredPropannotation are present.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- transitionPhaseTestAttr → const String
- The DOM attribute used to indicate the current transition phase, added in test mode in getTransitionTestAttributes.