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.
41 lines
1.4 KiB
Dart
41 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
import 'package:test_sa/extensions/string_extensions.dart';
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
import 'package:test_sa/models/system_notification_model.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 Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
(notification.title ?? "No Hospital Found").heading6(context),
|
|
8.height,
|
|
(notification.text ?? "complaint not available").bodyText2(context),
|
|
],
|
|
),
|
|
),
|
|
(notification.createdOn.toServiceRequestCardFormat ?? "complaint not available").tinyFont(context),
|
|
],
|
|
).onPress(() {
|
|
onPressed(notification);
|
|
}),
|
|
],
|
|
).paddingAll(16);
|
|
}
|
|
}
|