mirrored_repositories/Whatsapp-User-Interface/WhatsApp UI
import 'package:flutter/material.dart';
import 'package:whatsapp/chat_model.dart';
class ChatScreen extends StatefulWidget {
  @override
  _ChatScreenState createState() => _ChatScreenState();
}

class _ChatScreenState extends State<ChatScreen> {
  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemCount: dummydata.length,
        itemBuilder:(context,i)=>Column(
          children: <Widget>[
            Divider(height: 10.0,
            ),
            ListTile(
              leading: CircleAvatar(
                foregroundColor: Theme.of(context).primaryColor,
                backgroundColor: Colors.blueGrey,
                backgroundImage: NetworkImage(dummydata[i].avatarUrl),
              ),
              title: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  Text(
                    dummydata[i].name,
                    style: TextStyle(fontWeight: FontWeight.bold),
                  ),
                  Text(
                    dummydata[i].time,
                    style: TextStyle(
                      color: Colors.grey,
                      fontSize: 14.0
                    ),
                  )
                ],
              ),
              subtitle: Container(
                padding: const EdgeInsets.only(top: 5.0),
                child: Text(
                  dummydata[i].message,
                  style: TextStyle(
                    color: Colors.grey,
                    fontSize: 15.0,
                  ),
                ),
              ),
            )
          ],
        )
    );
  }
}
