import 'package:flutter/material.dart'; import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/new_views/app_style/app_color.dart'; class InfoTextWidget extends StatelessWidget { String? value; final String label; final bool showEmptyValue; final bool showArrow; InfoTextWidget({required this.label, this.value, this.showEmptyValue = false, this.showArrow = false, Key? key}) : super(key: key); @override Widget build(BuildContext context) { Widget text; if (showEmptyValue) { text = Text('$label: ${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))); } else { text = const SizedBox(); } if (showArrow) { text = Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.end, children: [ text.expanded, const SizedBox(width: 4), "arrow_right".toSvgAsset(width: 17, color: AppColor.primary10), ], ); } return text; } }