Created
March 4, 2020 10:57
-
-
Save amitkot/e8ad05dbaf0cf70fe05697621c4ca178 to your computer and use it in GitHub Desktop.
A Colorful list widget for debugging
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 YYY extends StatelessWidget { | |
YYY({bloc, @required this.iconData}); | |
final IconData iconData; | |
static final r = Random(); | |
final colors = [ | |
for (final _ in range(100)) | |
Color.fromARGB( | |
r.nextInt(256), r.nextInt(256), r.nextInt(256), r.nextInt(256)), | |
]; | |
@override | |
Widget build(BuildContext context) => ListView.builder( | |
itemCount: colors.length, | |
itemBuilder: (_, i) { | |
return Container( | |
color: colors[i], | |
child: ListTile( | |
leading: Icon(iconData), | |
title: Text('$i'), | |
), | |
); | |
}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment