diff --git a/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart b/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart index 2727174..f20d069 100644 --- a/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Article/article_config.dart @@ -148,7 +148,9 @@ class _ArticleConfigState extends State { articleToSend.qrCode = articleDTO.qrCode; widget.onChanged(jsonEncode(articleToSend).toString()); }); - } + }, + true, // don't show titles + false // show description ); }, ), @@ -168,7 +170,7 @@ class _ArticleConfigState extends State { right: 15, child: InkWell( onTap: () async { - var result = await showNewOrUpdateImageSlider(null, appContext, context, false, false); + var result = await showNewOrUpdateImageSlider(null, appContext, context, false, true); if (result != null) { setState(() { diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart index 72fe299..17c82c6 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart @@ -11,13 +11,17 @@ class ListViewCardImage extends StatefulWidget { final List listItems; final AppContext appContext; final ValueChanged> onChanged; + final bool showTitleTranslations; + final bool showDescriptionTranslations; ListViewCardImage( this.listItems, this.index, this.key, this.appContext, - this.onChanged + this.onChanged, + this.showTitleTranslations, + this.showDescriptionTranslations ); @override @@ -78,8 +82,8 @@ class _ListViewCard extends State { widget.listItems[widget.index], widget.appContext, context, - true, - true + widget.showTitleTranslations, + widget.showDescriptionTranslations ); if (result != null) { diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart index cd73d33..d0a44f3 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart @@ -89,7 +89,9 @@ class _SliderConfigState extends State { sliderToSend.images = testToSend; widget.onChanged(jsonEncode(sliderToSend).toString()); }); - } + }, + true, // show titles + true // show descriptions ); }, ), diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index 48e0fca..6f5d42f 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -162,7 +162,7 @@ class _SectionDetailScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ StringInputContainer( - label: "Nom :", + label: "Identifiant :", initialValue: sectionDTO != null ? sectionDTO.label : "", onChanged: (value) { sectionDTO.label = value; diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index f75f9db..5e05a22 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -164,7 +164,7 @@ class _ConfigurationDetailScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ StringInputContainer( - label: "Nom :", + label: "Identifiant :", fontSize: 20, initialValue: configurationDTO.label, onChanged: (value) { diff --git a/lib/Screens/Resources/resource_body_grid.dart b/lib/Screens/Resources/resource_body_grid.dart index e013d8c..383128f 100644 --- a/lib/Screens/Resources/resource_body_grid.dart +++ b/lib/Screens/Resources/resource_body_grid.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:manager_app/Components/fetch_resource_icon.dart'; import 'package:manager_app/Components/multi_select_container.dart'; import 'package:manager_app/Components/string_input_container.dart'; -import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:managerapi/api.dart'; @@ -234,10 +233,10 @@ boxDecoration(dynamic resourceDetailDTO, appContext) { } -Future> getResources(Function onGetResult, bool isImage, AppContext appContext) async { +/*Future> getResources(Function onGetResult, bool isImage, AppContext appContext) async { List resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId:(appContext.getContext() as ManagerAppContext).instanceId); if (onGetResult != null && isImage) { resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList(); } return resources; -} +}*/ diff --git a/lib/Screens/Resources/resources_screen.dart b/lib/Screens/Resources/resources_screen.dart index 99417d7..0826645 100644 --- a/lib/Screens/Resources/resources_screen.dart +++ b/lib/Screens/Resources/resources_screen.dart @@ -42,26 +42,30 @@ class _ResourcesScreenState extends State { future: getResources(widget.onGetResult, widget.isImage, appContext), builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.done) { - var tempOutput = new List.from(snapshot.data); - // tempOutput.add(ResourceDTO(id: null)); - return ResourceBodyGrid(resources: tempOutput, isImage: widget.isImage, isAddButton: widget.isAddButton, onSelect: (value) async { - if (widget.onGetResult == null) { - // Main screen - if (value.id == null) { - var result = await showNewResource(appContext, context); - if (result != null) - { - await create(result[0], result[1], result[2], appContext, context); - setState(() {}); // For refresh + if(snapshot.data != null) { + var tempOutput = new List.from(snapshot.data); + // tempOutput.add(ResourceDTO(id: null)); + return ResourceBodyGrid(resources: tempOutput, isImage: widget.isImage, isAddButton: widget.isAddButton, onSelect: (value) async { + if (widget.onGetResult == null) { + // Main screen + if (value.id == null) { + var result = await showNewResource(appContext, context); + if (result != null) + { + await create(result[0], result[1], result[2], appContext, context); + setState(() {}); // For refresh + } + } else { + showResource(value, appContext, context, size); } } else { - showResource(value, appContext, context, size); - } - } else { // Result for select modal widget.onGetResult(value); - } - },);//bodyGrid(tempOutput, size, appContext); + } + },);//bodyGrid(tempOutput, size, appContext); + } else { + return Text("No data"); + } } else if (snapshot.connectionState == ConnectionState.none) { return Text("No data"); } else { @@ -80,7 +84,7 @@ class _ResourcesScreenState extends State { Future getResources(Function onGetResult, bool isImage, AppContext appContext) async { List resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId); if (onGetResult != null && isImage) { - resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList(); + resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl || element.type == ResourceType.audio).toList(); } return resources; } @@ -128,7 +132,7 @@ Future create(ResourceDTO resourceDTO, List files, List[ @@ -33,6 +34,7 @@ class ResourceType { video, imageUrl, videoUrl, + audio ]; static ResourceType fromJson(dynamic value) => @@ -69,6 +71,7 @@ class ResourceTypeTypeTransformer { case r'Video': return ResourceType.video; case r'ImageUrl': return ResourceType.imageUrl; case r'VideoUrl': return ResourceType.videoUrl; + case r'Audio': return ResourceType.audio; default: if (allowNull == false) { throw ArgumentError('Unknown enum value to decode: $data');