Created
April 8, 2019 09:35
-
-
Save apptects/fb020232f3b081cb80c9402c8c1e3308 to your computer and use it in GitHub Desktop.
Use StoreConnector to create view-model
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 _SearchResultListState extends State<SearchResultList> { | |
| @override | |
| Widget build(BuildContext context) { | |
| return StoreConnector<AppState, List<TrackItem>>( | |
| converter: (store) => store.state.trackItems, | |
| builder: (_, trackItems) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| title: Text(widget.title), | |
| leading: ApptectsButton() | |
| ), | |
| body: _SearchResultList(trackItems), | |
| floatingActionButton: _SearchButton() | |
| ); | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment