File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments