Skip to content

Instantly share code, notes, and snippets.

@amitkot
Created March 4, 2020 10:57
Show Gist options
  • Save amitkot/e8ad05dbaf0cf70fe05697621c4ca178 to your computer and use it in GitHub Desktop.
Save amitkot/e8ad05dbaf0cf70fe05697621c4ca178 to your computer and use it in GitHub Desktop.
A Colorful list widget for debugging
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