Aidra Driver 1.3.5+68
Aidra Driver - Your path to green energy
Loading...
Searching...
No Matches
notification_card.dart
Go to the documentation of this file.
1import 'package:fluentui_system_icons/fluentui_system_icons.dart';
2import 'package:flutter/material.dart';
3import 'package:flutter_screenutil/flutter_screenutil.dart';
4import 'package:timeago/timeago.dart' as timeago;
5
6import '../../../../../../core/ui/theme/color_palette.dart';
7import '../../../../domain/entities/notification_entity.dart';
8
9class NotificationCard extends StatelessWidget {
11
12 const NotificationCard({super.key, required this.notification});
13
14 @override
15 Widget build(BuildContext context) {
16 return Container(
17 margin: EdgeInsets.only(bottom: 12.h),
18 decoration: BoxDecoration(
20 // color: notification.isRead ? ColorPalette.lightGrey : ColorPalette.white,
21 borderRadius: BorderRadius.circular(16.r),
22 boxShadow: [
23 BoxShadow(
24 color: Colors.black.withValues(alpha: 0.07),
25 blurRadius: 8,
26 offset: const Offset(0, 2),
27 ),
28 ],
29 ),
30 child: Material(
31 color: Colors.transparent,
32 child: InkWell(
33 borderRadius: BorderRadius.circular(16.r),
34 onTap: () {},
35 child: Padding(
36 padding: EdgeInsets.all(16.sp),
37 child: Row(
38 crossAxisAlignment: CrossAxisAlignment.center,
39 children: [
40 Container(
41 padding: EdgeInsets.all(12.sp),
42 decoration: BoxDecoration(
43 color: ColorPalette.lightGreen.withValues(alpha: 0.1),
44 borderRadius: BorderRadius.circular(12.r),
45 ),
46 child: Icon(
47 FluentIcons.info_24_regular,
49 size: 24.sp,
50 ),
51 ),
52 SizedBox(width: 16.w),
53 Expanded(
55 crossAxisAlignment: CrossAxisAlignment.start,
56 children: [
57 Text(
58 timeago.format(
59 DateTime.parse(notification.createDate ?? '')),
60 style: TextStyle(
62 fontSize: 12.sp,
63 ),
64 ),
65 SizedBox(height: 4.h),
66 Text(
67 notification.name ?? '--',
68 style: Theme.of(context).textTheme.bodyMedium!.copyWith(
70 ),
71 ),
72 SizedBox(height: 8.h),
73 ],
74 ),
75 ),
76 ],
77 ),
78 ),
79 ),
80 ),
81 );
82 }
83}
static const darkGrey
static const lightGreen
static const white
static const grey
const NotificationCard({super.key, required this.notification})
final VoidCallback onTap
final NotificationEntity notification
final Widget child
override Widget build(BuildContext context)
final EdgeInsets padding
style Text( '${ 'scheduling.reference'.tr()}:${collection.internalCode}', style:Theme.of(context).textTheme.bodySmall,)
style SizedBox(height:2.h)
style Column(crossAxisAlignment:CrossAxisAlignment.end, children:[Container(padding:EdgeInsets.symmetric(horizontal:8.w, vertical:4.h), decoration:BoxDecoration(color:ColorPalette.tiffanyBlue.withValues(alpha:0.1), borderRadius:BorderRadius.circular(12),), child:Text(collection.type ?? '', style:Theme.of(context).textTheme.bodySmall?.copyWith(color:ColorPalette.tiffanyBlue, fontWeight:FontWeight.bold,),),),],)