You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/views/widgets/notifications/notification_item.dart

70 lines
2.2 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:test_sa/models/app_notification.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class NotificationItem extends StatelessWidget {
final AppNotification notification;
final Function(AppNotification) onPressed;
const NotificationItem({Key key, this.notification, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.symmetric(vertical: 8,horizontal: 8),
primary: AColors.primaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
AppStyle.getBorderRadius(context)
),
),
),
onPressed: (){
onPressed(notification);
},
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Text(
notification.title ?? "No Hospital Found",
style: Theme.of(context).textTheme.headline6.copyWith(
color: AColors.white,
fontSize: 16,
fontWeight: FontWeight.bold
),
),
),
Text(
notification.date ?? "complaint not available",
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: AColors.white,
fontSize: 12,
fontWeight: FontWeight.bold
),
),
],
),
Divider(color: AColors.white,),
Text(
notification.description ?? "complaint not available",
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: AColors.white,
fontSize: 14,
),
),
],
),
),
);
}
}