improvements.

main_production_RSG
Sikander Saleem 2 months ago
parent eba5552bc8
commit 14b4c3f1ba

@ -202,5 +202,5 @@ extension WidgetExtensions on Widget {
}
extension DividerExtension on Divider {
Divider defaultStyle(BuildContext context) => Divider(thickness: 1, color: context.isDarkNotListen ? AppColor.neutral20 : AppColor.neutral30);
Divider defaultStyle(BuildContext context) => Divider(thickness: 1, color: AppColor.borderColor(context));
}

@ -29,7 +29,7 @@ class NotificationsList extends StatelessWidget {
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(0),
itemCount: notifications.length,
separatorBuilder: (context, itemIndex) => const Divider().defaultStyle(context).paddingOnly(top: 16, bottom: 16),
separatorBuilder: (context, itemIndex) => const Divider().defaultStyle(context).paddingOnly(top: 4, bottom: 4),
itemBuilder: (context, itemIndex) {
return NotificationItem(
notification: notifications[itemIndex],

@ -8,16 +8,18 @@ class InfoTextWidget extends StatelessWidget {
final String label;
final bool showEmptyValue;
final bool showArrow;
final bool isMsg;
InfoTextWidget({required this.label, this.value, this.showEmptyValue = false, this.showArrow = false, Key? key}) : super(key: key);
InfoTextWidget({required this.label, this.value, this.showEmptyValue = false, this.showArrow = false, this.isMsg = false, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
Widget text;
String aLabel = label + (isMsg ? "" : ":");
if (showEmptyValue) {
text = Text('$label: ${value ?? ""}', style: AppTextStyles.bodyText2.copyWith(color: AppColor.lightTextColor(context)));
text = Text('$aLabel ${value ?? ""}', style: AppTextStyles.bodyText2.copyWith(color: AppColor.lightTextColor(context)));
} else if (value?.isNotEmpty ?? false) {
text = Text('$label: $value', style: AppTextStyles.bodyText2.copyWith(color: AppColor.lightTextColor(context)));
text = Text('$aLabel $value', style: AppTextStyles.bodyText2.copyWith(color: AppColor.lightTextColor(context)));
} else {
text = const SizedBox();
}

@ -6,15 +6,18 @@ 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';
import 'package:test_sa/views/widgets/item_views/info_date_widget.dart';
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
import 'package:test_sa/views/widgets/requests/request_status.dart';
class NotificationItem extends StatelessWidget {
final SystemNotificationModel notification;
final Function(SystemNotificationModel) onPressed;
final bool isLoading;
bool isLoading;
const NotificationItem({Key? key, required this.notification, required this.onPressed, this.isLoading = false}) : super(key: key);
NotificationItem({Key? key, required this.notification, required this.onPressed, this.isLoading = false}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -42,28 +45,12 @@ class NotificationItem extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
notification.title ?? "",
style: AppTextStyles.heading6.copyWith(
color: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
),
).toShimmer(isShow: isLoading, context: context).expanded,
InfoHeaderWidget(notification.title ?? "").toShimmer(isShow: isLoading, context: context).expanded,
8.width,
Text(
notification.createdOn?.toServiceRequestCardFormat ?? "",
textAlign: TextAlign.right,
style: AppTextStyles.tinyFont.copyWith(
color: context.isDark ? AppColor.neutral20 : AppColor.neutral50,
),
).toShimmer(isShow: isLoading, context: context),
if (notification.createdOn?.isNotEmpty ?? false) InfoDateWidget(notification.createdOn!).toShimmer(isShow: isLoading, context: context),
],
),
Text(
notification.text ?? "",
style: AppTextStyles.bodyText2.copyWith(
color: context.isDark ? AppColor.neutral10 : const Color(0xFF757575),
),
).toShimmer(isShow: isLoading, context: context),
InfoTextWidget(label: notification.text ?? "", isMsg: true, showEmptyValue: true).toShimmer(isShow: isLoading, context: context),
],
).onPress(() {
onPressed(notification);

Loading…
Cancel
Save