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

60 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:test_sa/models/system_notification_model.dart';
import 'package:test_sa/views/app_style/colors.dart';
import 'package:test_sa/views/app_style/sizing.dart';
class NotificationItem extends StatelessWidget {
final SystemNotificationModel notification;
final Function(SystemNotificationModel) 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.createdOn ?? "complaint not available",
style: Theme.of(context).textTheme.subtitle1.copyWith(color: AColors.white, fontSize: 12, fontWeight: FontWeight.bold),
),
],
),
Divider(
color: AColors.white,
),
Text(
notification.text ?? "complaint not available",
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: AColors.white,
fontSize: 14,
),
),
],
),
),
);
}
}