Closed arun-sahadevan closed 6 years ago
@arun-sahadevan I would recommend using the Future.delayed
constructor.
import 'dart:async';
import 'package:over_react/over_react.dart';
@Factory()
UiFactory<WidgetProps> Widget;
@Props()
class WidgetProps extends UiProps {}
@Component()
class WidgetComponent extends UiComponent<WidgetProps> {
@override
void componentDidMount() {
new Future.delayed(const Duration(/* whatever duration you want to wait */)).then((_) {
// Do something once the delay is over
});
}
@override
render() {
// ...
}
}
How can we use time out function inside overreact on load of a component?
Tried javascript and jquery functions . But they were not compatible with Overeact . Can you please give a sample where an action is performed on page load with a timeout ?
FYI: @greglittlefield-wf @aaronlademann-wf @kealjones-wk @evanweible-wf @maxwellpeterson-w