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/item_views/info_text_widget.dart

63 lines
2.1 KiB
Dart

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;
4 weeks ago
final bool copyValue;
3 months ago
final bool isMsg;
4 weeks ago
InfoTextWidget({required this.label, this.value, this.showEmptyValue = false, this.copyValue = false, this.showArrow = false, this.isMsg = false, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
Widget text;
3 months ago
String aLabel = label + (isMsg ? "" : ":");
if (showEmptyValue) {
3 months ago
text = Text('$aLabel ${value ?? ""}', style: AppTextStyles.bodyText2.copyWith(color: AppColor.lightTextColor(context)));
} else if (value?.isNotEmpty ?? false) {
3 months ago
text = Text('$aLabel $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),
],
);
4 weeks ago
} else if (!showArrow) {
// text = Row(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Flexible(child: text),
// const SizedBox(width: 4),
// Icon(Icons.copy_rounded, color: AppColor.loadingColor(context), size: 12),
// ],
// );
}
return text;
}
}
class InfoTextLabelWidget extends StatelessWidget {
final String label;
InfoTextLabelWidget({required this.label, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
Widget text;
4 weeks ago
text = Text(label, style: AppTextStyles.bodyText2.copyWith(color: AppColor.lightTextColor(context)));
return text;
}
4 weeks ago
}