Skip to content

Commit 6ca6068

Browse files
authored
Add files via upload
1 parent 6571d6d commit 6ca6068

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

removeable/date_chip.dart

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import 'package:chat_bubbles/algo/algo.dart';
2+
import 'package:flutter/material.dart';
3+
4+
///[DateChip] use to show the date breakers on the chat view
5+
///[date] parameter is required
6+
///[color] parameter is optional default color code `8AD3D5`
7+
///
8+
///
9+
class DateChip extends StatelessWidget {
10+
final DateTime date;
11+
final Color color;
12+
final Color dateColor;
13+
14+
///
15+
///
16+
///
17+
const DateChip({
18+
Key? key,
19+
required this.date,
20+
this.color = const Color(0x558AD3D5),
21+
this.dateColor = const Color(0x558AD3D5),
22+
}) : super(key: key);
23+
@override
24+
Widget build(BuildContext context) {
25+
return Center(
26+
child: Padding(
27+
padding: const EdgeInsets.only(
28+
top: 7,
29+
bottom: 7,
30+
),
31+
child: Container(
32+
decoration: BoxDecoration(
33+
borderRadius: BorderRadius.all(Radius.circular(6)),
34+
color: color,
35+
),
36+
child: Padding(
37+
padding: const EdgeInsets.all(5.0),
38+
child: Text(
39+
Algo.dateChipText(date),
40+
style: TextStyle(
41+
color: dateColor,
42+
),
43+
),
44+
),
45+
),
46+
),
47+
);
48+
}
49+
}

0 commit comments

Comments
 (0)