Created
February 17, 2021 16:40
-
-
Save marcossevilla/8f61dbd48b0133977f77d3059b43ee5a to your computer and use it in GitHub Desktop.
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 WidgetToShowNames extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Consumer( | |
builder: (_, watch, __) { | |
final List<String> names = watch(namesNotifier).state; | |
return ListView.builder( | |
itemCount: names.length, | |
itemBuilder: (_, index) { | |
final name = names[index]; | |
return Text(name); | |
} | |
); | |
}, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment