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

45 lines
1.5 KiB
Dart

3 years ago
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';
import 'package:test_sa/new_views/app_style/app_color.dart';
3 years ago
class NotificationItem extends StatelessWidget {
final SystemNotificationModel notification;
final Function(SystemNotificationModel) onPressed;
2 years ago
3 years ago
const NotificationItem({Key key, this.notification, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
3 years ago
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
notification.title ?? "",
style: AppTextStyles.heading6.copyWith(color: AppColor.neutral50),
).expanded,
8.width,
Text(
notification.createdOn.toServiceRequestCardFormat ?? "",
textAlign: TextAlign.right,
style: AppTextStyles.tinyFont.copyWith(color: AppColor.neutral50),
3 years ago
),
],
),
Text(
notification.text ?? "",
style: AppTextStyles.bodyText2.copyWith(color: Color(0xFF757575)),
),
],
).onPress(() {
onPressed(notification);
});
3 years ago
}
}