From e64977f95e8d204d4c3e2cb2a241daecff4ae3c9 Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Wed, 31 Aug 2022 17:58:13 +0200 Subject: [PATCH] Add Image select for article type + change icon for qr code download --- .../SubSection/Article/download_pdf.dart | 2 +- .../Section/section_detail_screen.dart | 37 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/lib/Screens/Configurations/Section/SubSection/Article/download_pdf.dart b/lib/Screens/Configurations/Section/SubSection/Article/download_pdf.dart index 4b6b8ef..ba4a250 100644 --- a/lib/Screens/Configurations/Section/SubSection/Article/download_pdf.dart +++ b/lib/Screens/Configurations/Section/SubSection/Article/download_pdf.dart @@ -40,7 +40,7 @@ class _DownloadPDFState extends State { }, child: Padding( padding: const EdgeInsets.only(left: 5.0), - child: Icon(Icons.cloud_download, color: kPrimaryColor) + child: Icon(Icons.qr_code, color: kPrimaryColor) ), ); } diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 0e30732..37c0876 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -146,6 +146,16 @@ class _SectionDetailScreenState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + if(sectionDTO.type == SectionType.article) + Container( + width: size.width *0.1, + height: 125, + child: QrImage( + data: sectionDTO.id, + version: QrVersions.auto, + size: 50.0, + ), + ), Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, @@ -188,25 +198,18 @@ class _SectionDetailScreenState extends State { ], ), Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(sectionDTO.type != SectionType.article) - ImageInputContainer( - label: "Image :", - initialValue: sectionDTO != null ? sectionDTO.imageId : "", - color: kPrimaryColor, - onChanged: (ResourceDTO resource) { - sectionDTO.imageId = resource.id; - sectionDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id; - }, - ) - else - QrImage( - data: sectionDTO.id, - version: QrVersions.auto, - size: 200.0, - ), + ImageInputContainer( + label: "Image :", + initialValue: sectionDTO != null ? sectionDTO.imageId : "", + color: kPrimaryColor, + onChanged: (ResourceDTO resource) { + sectionDTO.imageId = resource.id; + sectionDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id; + }, + ), ], ) ],