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.
45 lines
1.5 KiB
Dart
45 lines
1.5 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';
|
|
import 'package:test_sa/new_views/app_style/app_color.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: [
|
|
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),
|
|
),
|
|
],
|
|
),
|
|
Text(
|
|
notification.text ?? "",
|
|
style: AppTextStyles.bodyText2.copyWith(color: Color(0xFF757575)),
|
|
),
|
|
],
|
|
).onPress(() {
|
|
onPressed(notification);
|
|
});
|
|
}
|
|
}
|