|
|
|
@ -39,6 +39,7 @@ class _AssetDetailPageState extends State<AssetDetailPage> with SingleTickerProv
|
|
|
|
late AnimationController _animationController;
|
|
|
|
late AnimationController _animationController;
|
|
|
|
int? assetId;
|
|
|
|
int? assetId;
|
|
|
|
AssetProvider? _assetProvider;
|
|
|
|
AssetProvider? _assetProvider;
|
|
|
|
|
|
|
|
AssetByIdModel? assetModel;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
@ -55,10 +56,6 @@ class _AssetDetailPageState extends State<AssetDetailPage> with SingleTickerProv
|
|
|
|
super.dispose();
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int? assetId;
|
|
|
|
|
|
|
|
AssetProvider? _assetProvider;
|
|
|
|
|
|
|
|
AssetByIdModel? assetModel;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<GenericAttachmentModel> attachments = [];
|
|
|
|
List<GenericAttachmentModel> attachments = [];
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -200,7 +197,26 @@ class _AssetDetailPageState extends State<AssetDetailPage> with SingleTickerProv
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return SingleChildScrollView(
|
|
|
|
final attachmentAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
|
|
|
|
|
|
|
CurvedAnimation(
|
|
|
|
|
|
|
|
parent: _animationController,
|
|
|
|
|
|
|
|
curve: const Interval(0.80, 1.0, curve: Curves.easeOut),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final attachmentSlideAnimation = Tween<Offset>(
|
|
|
|
|
|
|
|
begin: const Offset(0.0, 0.1),
|
|
|
|
|
|
|
|
end: Offset.zero,
|
|
|
|
|
|
|
|
).animate(
|
|
|
|
|
|
|
|
CurvedAnimation(
|
|
|
|
|
|
|
|
parent: _animationController,
|
|
|
|
|
|
|
|
curve: const Interval(0.80, 1.0, curve: Curves.easeOutCubic),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
@ -254,18 +270,22 @@ class _AssetDetailPageState extends State<AssetDetailPage> with SingleTickerProv
|
|
|
|
opacity: headerAnimation,
|
|
|
|
opacity: headerAnimation,
|
|
|
|
child: SlideTransition(
|
|
|
|
child: SlideTransition(
|
|
|
|
position: headerSlideAnimation,
|
|
|
|
position: headerSlideAnimation,
|
|
|
|
child: InfoHeader16Widget(assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"),
|
|
|
|
child: Column(
|
|
|
|
),
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
8.height,
|
|
|
|
spacing: 2,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
if (context.userProvider.isEngineer && !(assetModel!.hasTrainingImageData ?? true)) ...[
|
|
|
|
InfoHeader16Widget(assetModel.modelDefinition?.assetName?.cleanupWhitespace.capitalizeFirstOfEach ?? "-"),
|
|
|
|
|
|
|
|
if (context.userProvider.isEngineer && !(assetModel.hasTrainingImageData ?? true))
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'*Upload Images for this asset',
|
|
|
|
'*Upload Images for this asset',
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.red30),
|
|
|
|
style: AppTextStyles.bodyText2.copyWith(color: AppColor.red30),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
4.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
|
|
|
|
// Details row with animation
|
|
|
|
// Details row with animation
|
|
|
|
FadeTransition(
|
|
|
|
FadeTransition(
|
|
|
|
@ -339,13 +359,28 @@ class _AssetDetailPageState extends State<AssetDetailPage> with SingleTickerProv
|
|
|
|
child: InfoTextWidget(label: assetModel.modelDefinition!.assetDescription!, showEmptyValue: true, isMsg: true),
|
|
|
|
child: InfoTextWidget(label: assetModel.modelDefinition!.assetDescription!, showEmptyValue: true, isMsg: true),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (attachments.isNotEmpty) ...[
|
|
|
|
|
|
|
|
8.height,
|
|
|
|
|
|
|
|
FadeTransition(
|
|
|
|
|
|
|
|
opacity: attachmentAnimation,
|
|
|
|
|
|
|
|
child: const Divider().defaultStyle(context),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
FadeTransition(
|
|
|
|
|
|
|
|
opacity: attachmentAnimation,
|
|
|
|
|
|
|
|
child: SlideTransition(
|
|
|
|
|
|
|
|
position: attachmentSlideAnimation,
|
|
|
|
|
|
|
|
child: FilesList(images: attachments.map((toElement) => URLs.getFileUrl(toElement.name!) ?? '').toList()),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
]
|
|
|
|
]
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
FilesList(images: attachments.map((toElement) => URLs.getFileUrl(toElement.name!) ?? '').toList()),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).toShadowContainer(context),
|
|
|
|
).toShadowContainer(context),
|
|
|
|
if (context.userProvider.isEngineer && !(assetModel!.hasTrainingImageData ?? true))
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
if (context.userProvider.isEngineer && !(assetModel.hasTrainingImageData ?? true))
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
child: AppFilledButton(
|
|
|
|
child: AppFilledButton(
|
|
|
|
@ -354,6 +389,7 @@ class _AssetDetailPageState extends State<AssetDetailPage> with SingleTickerProv
|
|
|
|
onPressed: _upload,
|
|
|
|
onPressed: _upload,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return const Center(child: ALoading());
|
|
|
|
return const Center(child: ALoading());
|
|
|
|
|