|
|
|
|
@ -6,6 +6,8 @@ import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/models/device/asset.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.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';
|
|
|
|
|
|
|
|
|
|
class AssetItemListView extends StatelessWidget {
|
|
|
|
|
final Asset device;
|
|
|
|
|
@ -24,14 +26,14 @@ class AssetItemListView extends StatelessWidget {
|
|
|
|
|
width: 95,
|
|
|
|
|
height: 95,
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
color: context.isDark ? AppColor.neutral50 : AppColor.neutral30,
|
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
|
|
|
color: AppColor.dropDownBackground(context),
|
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10), side: BorderSide(color: AppColor.border2Color(context))),
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
image: NetworkImage(device.assetPhoto != null ? URLs.getFileUrl(device.assetPhoto!)! : "https://www.lasteelcraft.com/images/no-image-available.png"),
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
15.width,
|
|
|
|
|
12.width,
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
@ -40,38 +42,33 @@ class AssetItemListView extends StatelessWidget {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
device.modelDefinition!.assetName!.cleanupWhitespace.capitalizeFirstOfEach.heading6(context),
|
|
|
|
|
8.height,
|
|
|
|
|
"${context.translation.assetNumber} : ${device.assetNumber}".bodyText(context),
|
|
|
|
|
"${context.translation.modelName} : ${device.modelDefinition!.modelName}".cleanupWhitespace.capitalizeFirstOfEach.bodyText(context),
|
|
|
|
|
InfoHeaderWidget(device.modelDefinition!.assetName!.cleanupWhitespace),
|
|
|
|
|
// device.modelDefinition!.assetName!.cleanupWhitespace.capitalizeFirstOfEach.heading6(context),
|
|
|
|
|
4.height,
|
|
|
|
|
InfoTextWidget(label: context.translation.assetNumber, value: device.assetNumber),
|
|
|
|
|
InfoTextWidget(label: context.translation.modelName, value: device.modelDefinition!.modelName),
|
|
|
|
|
InfoTextWidget(label: context.translation.serialNo, value: device.assetSerialNo),
|
|
|
|
|
// "${context.translation.assetNumber} : ${device.assetNumber}".bodyText(context),
|
|
|
|
|
// "${context.translation.modelName} : ${device.modelDefinition!.modelName}".cleanupWhitespace.capitalizeFirstOfEach.bodyText(context),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"${context.translation.serialNo} : ${device.assetSerialNo}".bodyText(context).expanded,
|
|
|
|
|
4.width,
|
|
|
|
|
selectButton ??
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.bottomRight,
|
|
|
|
|
child: selectButton ??
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
context.translation.viewDetails,
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(color: AppColor.blueStatus(context)),
|
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.blueStatus(context)),
|
|
|
|
|
),
|
|
|
|
|
4.width,
|
|
|
|
|
Icon(
|
|
|
|
|
Icons.arrow_forward,
|
|
|
|
|
color: AppColor.blueStatus(context),
|
|
|
|
|
size: 14,
|
|
|
|
|
)
|
|
|
|
|
const Icon(Icons.arrow_forward, color: AppColor.primary10, size: 14)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
).expanded
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context, padding: 12, borderColor: isSelected ? AppColor.blueStatus(context) : Colors.transparent).onPress(() => onPressed(device));
|
|
|
|
|
).toShadowContainer(context, borderColor: isSelected ? AppColor.primary10 : Colors.transparent).onPress(() => onPressed(device));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|