Created
April 16, 2018 16:17
-
-
Save xrigau/8d8248437eba0bbbe02bf3821daf959c to your computer and use it in GitHub Desktop.
Introduction to Redux in Flutter (to_do_list_page.dart)
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 ToDoListPage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) => StoreConnector<AppState, _ViewModel>( | |
converter: (Store<AppState> store) => _ViewModel.create(store), | |
builder: (BuildContext context, _ViewModel viewModel) => Scaffold( | |
appBar: AppBar( | |
title: Text(viewModel.pageTitle), | |
), | |
body: ListView(children: viewModel.items.map((_ItemViewModel item) => _createWidget(item)).toList()), | |
floatingActionButton: FloatingActionButton( | |
onPressed: viewModel.onNewItem, | |
tooltip: viewModel.newItemToolTip, | |
child: Icon(viewModel.newItemIcon), | |
), | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment