chat bubble plugin
flutter chat bubble widgets, similar to the whatsapp and more shapes. easy to use and implement chat bubbles.
getting started
add this to your package’s pubspec.yaml
file:
dependencies:
chat_bubbles: ^1.0.0+3
usage
then you just have to import the package with
import 'package:chat_bubbles/chat_bubbles.dart'
now you can use this plugin to implement various types of chat bubbles and date chips.
example
single bubble example
bubblespecialone(
text: 'hi, how are you? ',
issender: false,
color: colors.purple.shade100,
textstyle: textstyle(
fontsize: 20,
color: colors.purple,
fontstyle: fontstyle.italic,
fontweight: fontweight.bold,
),
),
date chip example
datechip(
date: new datetime(2021, 5, 7),
color: color(0x558ad3d5),
),
main example (chat view)
final now = new datetime.now();
return scaffold(
appbar: appbar(
title: text(widget.title),
),
body: center(
child: singlechildscrollview(
child: column(
mainaxisalignment: mainaxisalignment.center,
children: <widget>[
bubblenormal(
text: 'bubble normal with tail',
issender: false,
color: color(0xff1b97f3),
tail: true,
textstyle: textstyle(
fontsize: 20,
color: colors.white,
),
),
bubblenormal(
text: 'bubble normal with tail',
issender: true,
color: color(0xffe8e8ee),
tail: true,
sent: true,
),
datechip(
date: new datetime(now.year, now.month, now.day - 2),
),
bubblenormal(
text: 'bubble normal without tail',
issender: false,
color: color(0xff1b97f3),
tail: false,
textstyle: textstyle(
fontsize: 20,
color: colors.white,
),
),
bubblenormal(
text: 'bubble normal without tail',
color: color(0xffe8e8ee),
tail: false,
sent: true,
seen: true,
delivered: true,
),
bubblespecialone(
text: 'bubble special one with tail',
issender: false,
color: color(0xff1b97f3),
textstyle: textstyle(
fontsize: 20,
color: colors.white,
),
),
datechip(
date: new datetime(now.year, now.month, now.day - 1),
),
bubblespecialone(
text: 'bubble special one with tail',
color: color(0xffe8e8ee),
seen: true,
),
bubblespecialone(
text: 'bubble special one without tail',
issender: false,
tail: false,
color: color(0xff1b97f3),
textstyle: textstyle(
fontsize: 20,
color: colors.black,
),
),
bubblespecialone(
text: 'bubble special one without tail',
tail: false,
color: color(0xffe8e8ee),
sent: true,
),
bubblespecialtwo(
text: 'bubble special tow with tail',
issender: false,
color: color(0xff1b97f3),
textstyle: textstyle(
fontsize: 20,
color: colors.black,
),
),
datechip(
date: now,
),
bubblespecialtwo(
text: 'bubble special tow with tail',
issender: true,
color: color(0xffe8e8ee),
sent: true,
),
bubblespecialtwo(
text: 'bubble special tow without tail',
issender: false,
tail: false,
color: color(0xff1b97f3),
textstyle: textstyle(
fontsize: 20,
color: colors.black,
),
),
bubblespecialtwo(
text: 'bubble special tow without tail',
tail: false,
color: color(0xffe8e8ee),
delivered: true,
),
],
),
),
),
);
Comments are closed.