init property
dynamic Function()
get
init
Initialize your widget in init.
- init is called in the initState method. You can use this method to perform any operations before the widget is rendered.
E.g.
get init => () async {
await api<ApiService>((request) => request.fetchData());
setState(() {});
};
Implementation
Function() get init => () {
// Add your init code here
};