bubble 1.1.4 bubble: ^1.1.4 copied to clipboard
A Flutter widget for chat like a speech bubble in Whatsapp and others.
Bubble #
A Flutter widget for chat like a speech bubble in Whatsapp and others.
Example #
See sources.
Usage #
Bubble(
child: Text('Hello, world!'),
),
Properties: nip, margin #
Bubble(
style: BubbleStyle(
nip: BubbleNip.TOP_RIGHT,
),
child: Text('Hello, world!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
nip: BubbleNip.TOP_LEFT,
),
child: Text('Hello, programmer!'),
),
Property: alignment #
Bubble(
style: BubbleStyle(
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
),
child: Text('Hello, world!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
),
child: Text('Hello, programmer!'),
),
Property: color #
Bubble(
style: BubbleStyle(
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
),
child: Text('Hello, programmer!'),
),
Property: radius #
Bubble(
style: BubbleStyle(
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
radius: 0,
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
radius: 10,
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
radius: 0,
),
child: Text('Hello, programmer!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
radius: 10,
),
child: Text('Hello, programmer!'),
),
Properties: nipWidth, nipHeight #
Bubble(
style: BubbleStyle(
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
nipWidth: 8,
nipHeight: 20,
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
nipWidth: 8,
nipHeight: 20,
),
child: Text('Hello, programmer!'),
),
Bubble(
style: BubbleStyle(
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
nipWidth: 30,
nipHeight: 12,
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
nipWidth: 30,
nipHeight: 12,
),
child: Text('Hello, programmer!'),
),
Property: nipRadius #
for (var i = 0; i <= 6; i++)
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 4),
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
nipWidth: 30,
nipHeight: 12,
nipRadius: i.toDouble(),
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
for (var i = 0; i <= 6; i++)
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 4),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
nipWidth: 30,
nipHeight: 12,
nipRadius: i.toDouble(),
),
child: Text('Hello, programmer!'),
),
Property: nipOffset #
for (var i = 0; i <= 6; i++)
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 4),
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
nipWidth: 30,
nipHeight: 12,
nipRadius: i.toDouble(),
nipOffset: 8,
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
for (var i = 0; i <= 6; i++)
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 4),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
nipWidth: 30,
nipHeight: 12,
nipRadius: i.toDouble(),
nipOffset: 8,
),
child: Text('Hello, programmer!'),
),
for (var i = 0; i <= 12; i += 3)
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 4),
alignment: Alignment.topRight,
nip: BubbleNip.TOP_RIGHT,
nipOffset: i.toDouble(),
color: Color.fromARGB(255, 225, 255, 199),
),
child: Text('Hello, world!'),
),
for (var i = 0; i <= 12; i += 3)
Bubble(
style: BubbleStyle(
margin: EdgeInsets.only(top: 4),
alignment: Alignment.topLeft,
nip: BubbleNip.TOP_LEFT,
nipOffset: i.toDouble(),
),
child: Text('Hello, programmer!'),
),