vengamo_chat_ui 1.3.7 vengamo_chat_ui: ^1.3.7 copied to clipboard
A Flutter package for displaying chat bubbles with customizable styles and animations. It provides a user-friendly interface for creating chat interfaces in Flutter applications.
import 'package:flutter/material.dart';
import 'package:vengamo_chat_ui/vengamo_chat_ui.dart';
import 'package:vengamo_chat_ui/theme/app_color.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'James Wagon',
theme: ThemeData(
primarySwatch: Colors.blueGrey,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
themeMode: ThemeMode.dark,
home: const VengamoChatScreen(),
);
}
}
class VengamoChatScreen extends StatelessWidget {
const VengamoChatScreen({super.key});
String getTime() {
int hour = DateTime.now().hour;
int min = DateTime.now().minute;
String hRes = hour <= 9 ? '0$hour' : hour.toString();
String mRes = min <= 9 ? '0$min' : min.toString();
return '$hRes:$mRes';
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('James Wagon'),
),
body: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: const BoxDecoration(
color: AppColors.backgroundColor,
),
child: SingleChildScrollView(
child: Padding(
padding:
const EdgeInsets.only(left: 20, right: 20, bottom: 20, top: 2),
child: Column(
children: [
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: false,
time: getTime(),
isAudio: true,
audioSource:
'http://www.uscis.gov/files/nativedocuments/Track%2093.mp3',
timeLabelColor: AppColors.iconColor,
pointer: true,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
const SizedBox(
height: 10,
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: false,
isNextMessageFromSameSender: false,
time: getTime(),
isAudio: true,
messageReply:Text("Why did the sun never want to join"),
audioSource:
'https://weellu.s3.amazonaws.com/f8f34cbe-fba4-4935-8a0a-718cd2192615.mp3',
timeLabelColor: AppColors.iconColor,
pointer: true,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
// const SizedBox(height: 10,),
// VengamoChatUI(
// senderBgColor: AppColors.softGreenColor,
// receiverBgColor: AppColors.white,
// timeLabelColor: AppColors.darkModeBackgroundColor,
// isSender: false,
// isNextMessageFromSameSender: false,
// imgUrl : 'https://static.wikia.nocookie.net/frstarwars/images/4/43/TheChild-Fathead.png/revision/latest?cb=20201101090715',
// caption : "check this out! Why don't skeletons fight each other? They don't have the guts!",
// time: getTime(),
// pointer: true,
// ack: Image.asset(
// 'assets/images/seen.png',
// height: 12,
// width: 12,
// ),
// ),
const SizedBox(
height: 10,
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: false,
timeLabelColor: AppColors.iconColor,
isNextMessageFromSameSender: false,
imgUrl: 'https://cdn.wallpapersafari.com/28/2/vrIzJD.jpg',
time: getTime(),
messageReply: Text("It's Crazy time fly fast"),
pointer: true,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
const SizedBox(
height: 10,
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: false,
timeLabelColor: AppColors.iconColor,
isNextMessageFromSameSender: false,
imgUrl:
'https://weellu.s3.us-east-2.amazonaws.com/test/kYFhiApyyVRX.jpeg',
time: getTime(),
messageReply:Text("Why did the sun never want to join"),
pointer: true,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: false,
time: getTime(),
timeLabelColor: AppColors.softBlackcolor,
text: const Text(
"Yolla ✋ Hey, guess what?",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: true,
ack: const Icon(
Icons.check,
color:
AppColors.iconColor, // You can customize the color here
size: 13, // You can customize the size here
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: true,
time: getTime(),
timeLabelColor: AppColors.softBlackcolor,
text: const Text(
"What?",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: false,
ack: Image.asset(
'assets/images/double_tick_grey.png',
height: 13,
width: 13,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: false,
isNextMessageFromSameSender: false,
time: getTime(),
text: const Text(
"I invented a new word!.",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: true,
ack: Image.asset(
'assets/images/double_tick_green.png',
height: 14,
width: 15,
),
),
const SizedBox(
height: 5,
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
timeLabelColor: AppColors.darkModeBackgroundColor,
isSender: true,
isNextMessageFromSameSender: false,
imgUrl: 'https://wallpaperaccess.com/full/1248267.jpg',
caption: const Text("Why did the sun never want to join the galaxy's talent show? Because it didn't want to be a star performer, it preferred to shine solo", style: TextStyle(
fontSize: 14,
)),
messageReply:Text("Pour récupérer vos conversations WhatsApp, il vous suffit de désinstaller et réinstaller l'application. À l'ouverture, celle-ci vous demandera de vérifier votre numéro de téléphone et vous"),
time: getTime(),
pointer: true,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: false,
isNextMessageFromSameSender: true,
time: getTime(),
text: const Text(
"Hold on, a sec, let me pick this call?",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: false,
ack: Image.asset(
'assets/images/double_tick_green.png',
height: 14,
width: 15,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: false,
isNextMessageFromSameSender: true,
time: getTime(),
text: const Text(
"Plagiarism! 💫 😂 ",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: false,
ack: Image.asset(
'assets/images/double_tick_green.png',
height: 14,
width: 15,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: false,
time: getTime(),
text: const Text(
"Plagiarism!? 😂.",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: true,
ack: Image.asset(
'assets/images/sent.png',
height: 12,
width: 12,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: true,
time: getTime(),
text: const Text(
"Thanks! I thought you'd like it 🤪",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: false,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: true,
messageReply:Text("Pour récupérer vos conversations WhatsApp, il vous suffit de désinstaller et réinstaller l'application. À l'ouverture, celle-ci vous demandera de vérifier votre numéro de téléphone et vous"),
time: getTime(),
text: const Text(
"Why don't scientists!",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: false,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
VengamoChatUI(
textStyle: const TextStyle(fontSize: 16),
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: false,
isNextMessageFromSameSender: false,
time: getTime(),
text: const Text(
"check this out! Why do",
style: TextStyle(fontSize: 16),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
pointer: true,
messageReply:Text("You look amazing bros, hear more jokes or have any other questions, feel free to ask.😂🤪"),
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
const SizedBox(
height: 5,
),
VengamoChatUI(
textStyle: const TextStyle(
fontSize: 14,
),
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: false,
imgUrl:
'https://cache.marieclaire.fr/data/photo/w1000_ci/1ju/sean-connery-james-bond.jpg',
messageReply: const Text("Why did the sun never want to join the galaxy's talent show? Because it didn't want to be a star performer, it preferred to shine solo, il vous suffit de désinstaller et réinstaller l'application. À l'ouverture, celle-ci vous demandera de vérifier votre numéro de téléphone et vous, By using the adjustHeight function, you can ensure consistent adjustments for both minHeight and maxHeight without causing non-normalized constraints"),
time: getTime(),
pointer: true,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
),
),
VengamoChatUI(
senderBgColor: AppColors.softGreenColor,
receiverBgColor: AppColors.white,
isSender: true,
isNextMessageFromSameSender: false,
imgUrl:'https://i.pinimg.com/1200x/19/3f/89/193f898bc73a09e14685f915a3989504.jpg',
time: getTime(),
timeLabelColor: AppColors.iconColor,
caption: const Text("Ola my bros", style: TextStyle(
fontSize: 14,
)),
pointer: false,
ack: Image.asset(
'assets/images/seen.png',
height: 12,
width: 12,
)
),
],
),
),
),
), // Use Vengamo Chat UI component here
);
}
}