improvements

main_production
Sikander Saleem 2 months ago
parent 2304700fb8
commit f3722e3671

@ -317,19 +317,25 @@ class _AssetDetailsViewState extends State<AssetDetailsView> with SingleTickerPr
opacity: attachmentAnimation, opacity: attachmentAnimation,
child: const Divider().defaultStyle(context), child: const Divider().defaultStyle(context),
), ),
InfoHeader16Widget("Attachments".addTranslation), FadeTransition(
opacity: attachmentAnimation,
child: SlideTransition(
position: attachmentSlideAnimation,
child: InfoHeader16Widget("Attachments".addTranslation),
),
),
4.height, 4.height,
FadeTransition( FadeTransition(
opacity: attachmentAnimation, opacity: attachmentAnimation,
child: SlideTransition( child: SlideTransition(
position: attachmentSlideAnimation, position: attachmentSlideAnimation,
child: FilesList( child: FilesList(
showAsListView: true, showAsListView: true,
types: attachments types: attachments
.whereType<GenericAttachmentModel>() .whereType<GenericAttachmentModel>()
.where((e) => e.documentType != null && e.documentType!.name!.isNotEmpty) .where((e) => e.documentType != null && e.documentType!.name!.isNotEmpty)
.map((toElement) => toElement.documentType!.name!) .map((toElement) => toElement.documentType!.name!)
.toList(), .toList(),
images: attachments.map((toElement) => URLs.getFileUrl(toElement.name!) ?? '').toList()), images: attachments.map((toElement) => URLs.getFileUrl(toElement.name!) ?? '').toList()),
), ),
), ),
@ -351,5 +357,4 @@ class _AssetDetailsViewState extends State<AssetDetailsView> with SingleTickerPr
], ],
); );
} }
} }

@ -115,24 +115,25 @@ class _AssetDocumentHistoryViewState extends State<AssetDocumentHistoryView> {
onRefresh: _onRefresh, onRefresh: _onRefresh,
child: ListView( child: ListView(
controller: _scrollController, controller: _scrollController,
padding: EdgeInsets.symmetric( padding: const EdgeInsets.only(right: 16, left: 16, bottom: 16),
horizontal: 16.toScreenWidth,
),
children: [ children: [
FilesList( FilesList(
showAsListView: true, showAsListView: true,
showDownloadButton: true, showDownloadButton: true,
itemGap: 12.toScreenHeight, itemGap: 12.toScreenHeight,
separator: const Divider().defaultStyle(context),
images: _documents images: _documents
.map((doc) { .map((doc) {
return URLs.getFileUrl(doc.name) ?? ''; return URLs.getFileUrl(doc.name) ?? '';
}).where((url) => url.isNotEmpty).toList(), })
.where((url) => url.isNotEmpty)
.toList(),
types: _documents.map((doc) { types: _documents.map((doc) {
final attachmentType = doc.documentType?.name ?? ''; final attachmentType = doc.documentType?.name ?? '';
return attachmentType.isNotEmpty ? attachmentType : 'Asset Guide'; return attachmentType.isNotEmpty ? attachmentType : 'Asset Guide';
}).toList(), }).toList(),
).toShadowContainer(context), ).toShadowContainer(context),
if (_isLoading && _documents.isNotEmpty&&_hasMore) ...[ if (_isLoading && _documents.isNotEmpty && _hasMore) ...[
16.height, 16.height,
Center( Center(
child: Padding( child: Padding(

@ -82,7 +82,7 @@ class FilesList extends StatelessWidget {
RichText( RichText(
text: TextSpan( text: TextSpan(
text: '${types.isEmpty ? "Asset Guide" : types[itemIndex]} | ', text: '${types.isEmpty ? "Asset Guide" : types[itemIndex]} | ',
style: AppTextStyles.tinyFont.copyWith(color: AppColor.labelTextStyleColor(context)), style: AppTextStyles.tinyFont.copyWith(color: AppColor.lightTextColor(context)),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: 'View', text: 'View',

Loading…
Cancel
Save