Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color option for sent, delivered, and seen icons #6

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed images/screenshots/2022_2_4_main1.png
Binary file not shown.
Binary file removed images/screenshots/2022_2_4_main2.png
Binary file not shown.
Binary file removed images/screenshots/audio_bubble.png
Binary file not shown.
Binary file removed images/screenshots/datechip.png
Binary file not shown.
Binary file removed images/screenshots/imsg.png
Binary file not shown.
Binary file removed images/screenshots/screenshot_1.png
Binary file not shown.
Binary file removed images/screenshots/screenshot_1_old.png
Binary file not shown.
Binary file removed images/screenshots/screenshot_2.png
Binary file not shown.
Binary file removed images/screenshots/screenshot_2_old.png
Binary file not shown.
Binary file removed images/screenshots/screenshot_3_old.png
Binary file not shown.
Binary file removed images/screenshots/screenshot_4_old.png
Binary file not shown.
Binary file removed images/screenshots/single_bubble.png
Binary file not shown.
20 changes: 13 additions & 7 deletions lib/bubbles/bubble_normal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class BubbleNormal extends StatelessWidget {
final bool sent;
final bool delivered;
final bool seen;
final Color? sentColor;
final Color? deliveredColor;
final Color? seenColor;
final TextStyle textStyle;

BubbleNormal({
Expand All @@ -34,6 +37,9 @@ class BubbleNormal extends StatelessWidget {
this.sent = false,
this.delivered = false,
this.seen = false,
this.sentColor,
this.deliveredColor,
this.seenColor,
this.textStyle = const TextStyle(
color: Colors.black87,
fontSize: 16,
Expand All @@ -45,28 +51,28 @@ class BubbleNormal extends StatelessWidget {
Widget build(BuildContext context) {
bool stateTick = false;
Icon? stateIcon;
if (sent) {
if (sent) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done,
size: 18,
color: Color(0xFF97AD8E),
color: sentColor == null ? Color(0xFF97AD8E) : sentColor,
);
}
if (delivered) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF97AD8E),
color: deliveredColor == null ? Color(0xFF97AD8E) : deliveredColor,
);
}
if (seen) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF92DEDA),
color: seenColor == null ? Color(0xFF92DEDA) : seenColor,
);
}

Expand Down
18 changes: 12 additions & 6 deletions lib/bubbles/bubble_normal_audio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class BubbleNormalAudio extends StatelessWidget {
final bool sent;
final bool delivered;
final bool seen;
final Color? sentColor;
final Color? deliveredColor;
final Color? seenColor;
final TextStyle textStyle;

BubbleNormalAudio({
Expand All @@ -51,6 +54,9 @@ class BubbleNormalAudio extends StatelessWidget {
this.sent = false,
this.delivered = false,
this.seen = false,
this.sentColor,
this.deliveredColor,
this.seenColor,
this.textStyle = const TextStyle(
color: Colors.black87,
fontSize: 12,
Expand All @@ -64,26 +70,26 @@ class BubbleNormalAudio extends StatelessWidget {
Icon? stateIcon;
if (sent) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done,
size: 18,
color: Color(0xFF97AD8E),
color: sentColor == null ? Color(0xFF97AD8E) : sentColor,
);
}
if (delivered) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF97AD8E),
color: deliveredColor == null ? Color(0xFF97AD8E) : deliveredColor,
);
}
if (seen) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF92DEDA),
color: seenColor == null ? Color(0xFF92DEDA) : seenColor,
);
}

Expand Down
20 changes: 13 additions & 7 deletions lib/bubbles/bubble_special_one.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class BubbleSpecialOne extends StatelessWidget {
final bool sent;
final bool delivered;
final bool seen;
final Color? sentColor;
final Color? deliveredColor;
final Color? seenColor;
final TextStyle textStyle;

const BubbleSpecialOne({
Expand All @@ -28,6 +31,9 @@ class BubbleSpecialOne extends StatelessWidget {
this.sent = false,
this.delivered = false,
this.seen = false,
this.sentColor,
this.deliveredColor,
this.seenColor,
this.textStyle = const TextStyle(
color: Colors.black87,
fontSize: 16,
Expand All @@ -39,28 +45,28 @@ class BubbleSpecialOne extends StatelessWidget {
Widget build(BuildContext context) {
bool stateTick = false;
Icon? stateIcon;
if (sent) {
if (sent) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done,
size: 18,
color: Color(0xFF97AD8E),
color: sentColor == null ? Color(0xFF97AD8E) : sentColor,
);
}
if (delivered) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF97AD8E),
color: deliveredColor == null ? Color(0xFF97AD8E) : deliveredColor,
);
}
if (seen) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF92DEDA),
color: seenColor == null ? Color(0xFF92DEDA) : seenColor,
);
}

Expand Down
19 changes: 13 additions & 6 deletions lib/bubbles/bubble_special_three.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class BubbleSpecialThree extends StatelessWidget {
final bool sent;
final bool delivered;
final bool seen;
final Color? sentColor;
final Color? deliveredColor;
final Color? seenColor;
final TextStyle textStyle;

const BubbleSpecialThree({
Expand All @@ -28,6 +31,9 @@ class BubbleSpecialThree extends StatelessWidget {
this.sent = false,
this.delivered = false,
this.seen = false,
this.sentColor,
this.deliveredColor,
this.seenColor,
this.textStyle = const TextStyle(
color: Colors.black87,
fontSize: 16,
Expand All @@ -41,26 +47,26 @@ class BubbleSpecialThree extends StatelessWidget {
Icon? stateIcon;
if (sent) {
stateTick = true;
stateIcon = const Icon(
stateIcon = Icon(
Icons.done,
size: 18,
color: Color(0xFF97AD8E),
color: sentColor == null ? Color(0xFF97AD8E) : sentColor,
);
}
if (delivered) {
stateTick = true;
stateIcon = const Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF97AD8E),
color: deliveredColor == null ? Color(0xFF97AD8E) : deliveredColor,
);
}
if (seen) {
stateTick = true;
stateIcon = const Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF92DEDA),
color: seenColor == null ? Color(0xFF92DEDA) : seenColor,
);
}

Expand All @@ -84,6 +90,7 @@ class BubbleSpecialThree extends StatelessWidget {
: const EdgeInsets.fromLTRB(17, 7, 7, 7),
child: Stack(
children: <Widget>[

Padding(
padding: stateTick
? const EdgeInsets.only(left: 4, right: 20)
Expand Down
20 changes: 13 additions & 7 deletions lib/bubbles/bubble_special_two.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class BubbleSpecialTwo extends StatelessWidget {
final bool sent;
final bool delivered;
final bool seen;
final Color? sentColor;
final Color? deliveredColor;
final Color? seenColor;
final TextStyle textStyle;

const BubbleSpecialTwo({
Expand All @@ -28,6 +31,9 @@ class BubbleSpecialTwo extends StatelessWidget {
this.sent = false,
this.delivered = false,
this.seen = false,
this.sentColor,
this.deliveredColor,
this.seenColor,
this.textStyle = const TextStyle(
color: Colors.black87,
fontSize: 16,
Expand All @@ -39,28 +45,28 @@ class BubbleSpecialTwo extends StatelessWidget {
Widget build(BuildContext context) {
bool stateTick = false;
Icon? stateIcon;
if (sent) {
if (sent) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done,
size: 18,
color: Color(0xFF97AD8E),
color: sentColor == null ? Color(0xFF97AD8E) : sentColor,
);
}
if (delivered) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF97AD8E),
color: deliveredColor == null ? Color(0xFF97AD8E) : deliveredColor,
);
}
if (seen) {
stateTick = true;
stateIcon = Icon(
stateIcon = Icon(
Icons.done_all,
size: 18,
color: Color(0xFF92DEDA),
color: seenColor == null ? Color(0xFF92DEDA) : seenColor,
);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: chat_bubbles
description: Flutter chat bubble widgets, similar to Whatsapp and more shapes. Easy to use and implement
chat bubbles.
version: 1.2.0
version: 1.3.0
homepage: https://github.com/prahack/chat_bubbles

environment:
Expand Down