Last active
February 23, 2020 06:58
-
-
Save androidfanatic/8b9bf64b74e8d3cd8279685ce48eafe5 to your computer and use it in GitHub Desktop.
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
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
final Random random = new Random(); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
theme: ThemeData( | |
primarySwatch: Colors.green, | |
), | |
home: Scaffold( | |
appBar: AppBar(title: Text('WhatsApp'), actions: [ | |
IconButton(icon: Icon(Icons.search), onPressed: () {}), | |
IconButton(icon: Icon(Icons.more_vert), onPressed: () {}), | |
]), | |
floatingActionButton: | |
FloatingActionButton(child: Icon(Icons.message), onPressed: () {}), | |
body: ListView.builder( | |
itemBuilder: (context, index) { | |
int randomNumber = random.nextInt(1000); | |
return ListTile( | |
title: Text("Contact $index"), | |
trailing: Column(children: [Text("13:00 pm")]), | |
leading: ClipRRect( | |
borderRadius: BorderRadius.circular(32.0), | |
child: Image.network( | |
"https://picsum.photos/$randomNumber", | |
height: 32, | |
width: 32, | |
), | |
)); | |
}, | |
itemCount: 20)), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment