-
-
Save naveenadi/5f2a7a0a8fb1461dc34f3acfa2132fe6 to your computer and use it in GitHub Desktop.
with useEffect
This file contains hidden or 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