Created
November 4, 2020 20:57
-
-
Save rei-codes/e58e4b97afedcf5937cab0d2c7a7a4d2 to your computer and use it in GitHub Desktop.
with useEffect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomePage extends HookWidget { | |
@override | |
Widget build(BuildContext context) { | |
useEffect( | |
() { | |
// initState | |
return () { | |
// dispose | |
}; | |
}, | |
[], // didUpdateWidget | |
// null: fires in every change | |
// empty list: fires only once on the first time | |
// list with items: fires when any of the items on the list change. | |
); | |
return Container(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment