Application/medcify/lib/pages/main/notification/notification_card.dart
2022-09-26 12:03:52 +05:30

53 lines
1.8 KiB
Dart

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:medcify/components/button.dart';
import 'package:medcify/constants.dart';
import 'package:medcify/models/medicine_item.dart';
import 'package:medcify/models/notification_item.dart';
import 'package:medcify/models/order_item.dart';
import '../../../components/alert.dart';
import '../../../navigation/navigation.dart';
class NotificationCard extends StatelessWidget {
NotificationItem item;
Function(int) removeNotification;
NotificationCard({required this.item,required this.removeNotification});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.white,
border: Border.all(color: Colors.grey.shade200)
),
margin: const EdgeInsets.only(bottom: 12),
padding: const EdgeInsets.symmetric(horizontal: 16,vertical: 16),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(item.message ?? "",style: const TextStyle(color: Colors.black, fontSize: 13,height: 1.8),)
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
removeNotification(item.id ?? 0);
},
child: Container(
decoration: BoxDecoration(
color: Colors.red.shade50,
borderRadius: BorderRadius.circular(30)
),
padding: const EdgeInsets.all(8),
child: const Icon(Icons.close_rounded,color: Colors.red, size: 16,),
),
)
],
),
);
}
}