Skip to content

Commit

Permalink
started chat screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelSena19 committed Sep 21, 2023
1 parent c46d554 commit 038531f
Showing 1 changed file with 59 additions and 2 deletions.
61 changes: 59 additions & 2 deletions lib/screens/chat_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,66 @@ class _ChatScreenState extends State<ChatScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: appbarWidget('Chat'),
appBar: appbarWidget('Chats'),
drawer: drawerWidget(context),
body: const Placeholder(),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
child: ListView.builder(
itemCount: 5,
itemBuilder: (context, index){
return const TextCard(
imagePath: 'assets/user.jpg',
senderName: 'Name',
text: 'This is a text',
time: '0:00',
);
},
),
),
);
}
}

class TextCard extends StatelessWidget {
const TextCard(
{super.key,
required this.imagePath,
required this.senderName,
required this.text,
required this.time});

final String imagePath;
final String senderName;
final String text;
final String time;

@override
Widget build(BuildContext context) {
return ListTile(
leading: ClipOval(
child: Image.asset(
imagePath,
fit: BoxFit.fill,
),
),
title: Row(
children: [
Text(
senderName,
style: const TextStyle(
fontWeight: FontWeight.bold,
color: Colors.lightBlue,
),
),
Expanded(child: Container()),
Text(
time,
style: const TextStyle(color: Colors.grey),
),
],
),
subtitle: Text(text),
tileColor: Colors.white,
);
}
}

0 comments on commit 038531f

Please sign in to comment.