Fix images on languages update + add Beacon handling
This commit is contained in:
parent
509d7b6adf
commit
21b38052cc
@ -128,6 +128,23 @@ getTranslations(BuildContext context, AppContext appContext, ImageDTO imageDTO,
|
|||||||
List<Widget> translations = <Widget>[];
|
List<Widget> translations = <Widget>[];
|
||||||
ManagerAppContext managerAppContext = appContext.getContext();
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
for(var language in managerAppContext.selectedConfiguration.languages) {
|
for(var language in managerAppContext.selectedConfiguration.languages) {
|
||||||
|
|
||||||
|
if(imageDTO.title.where((element) => element.language == language).length == 0) {
|
||||||
|
imageDTO.title = <TranslationDTO>[];
|
||||||
|
var translationTitleDTO = new TranslationDTO();
|
||||||
|
translationTitleDTO.language = language;
|
||||||
|
translationTitleDTO.value = "";
|
||||||
|
imageDTO.title.add(translationTitleDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(imageDTO.description.where((element) => element.language == language).length == 0) {
|
||||||
|
imageDTO.description = <TranslationDTO>[];
|
||||||
|
var translationDescriptionDTO = new TranslationDTO();
|
||||||
|
translationDescriptionDTO.language = language;
|
||||||
|
translationDescriptionDTO.value = "";
|
||||||
|
imageDTO.description.add(translationDescriptionDTO);
|
||||||
|
}
|
||||||
|
|
||||||
translations.add(
|
translations.add(
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:manager_app/Components/audio_input_container.dart';
|
import 'package:manager_app/Components/check_input_container.dart';
|
||||||
import 'package:manager_app/Components/confirmation_dialog.dart';
|
import 'package:manager_app/Components/confirmation_dialog.dart';
|
||||||
import 'package:manager_app/Components/fetch_section_icon.dart';
|
import 'package:manager_app/Components/fetch_section_icon.dart';
|
||||||
import 'package:manager_app/Components/image_input_container.dart';
|
import 'package:manager_app/Components/image_input_container.dart';
|
||||||
@ -149,14 +149,46 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
if(sectionDTO.type == SectionType.Article)
|
if(sectionDTO.type == SectionType.Article)
|
||||||
Container(
|
Column(
|
||||||
width: size.width *0.1,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
height: 125,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: QrImage(
|
children: [
|
||||||
data: sectionDTO.id,
|
Row(
|
||||||
version: QrVersions.auto,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
size: 50.0,
|
children: [
|
||||||
),
|
Container(
|
||||||
|
width: size.width *0.1,
|
||||||
|
height: 125,
|
||||||
|
child: QrImage(
|
||||||
|
padding: EdgeInsets.only(left: 0.0, top: 5.0, bottom: 5.0),
|
||||||
|
data: sectionDTO.id,
|
||||||
|
version: QrVersions.auto,
|
||||||
|
size: 50.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SelectableText(sectionDTO.id, style: new TextStyle(fontSize: 15))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
CheckInputContainer(
|
||||||
|
label: "Beacon :",
|
||||||
|
isChecked: sectionDTO.isBeacon,
|
||||||
|
fontSize: 25,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
sectionDTO.isBeacon = value;
|
||||||
|
save(true, sectionDTO, appContext);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if(sectionDTO.isBeacon)
|
||||||
|
StringInputContainer(
|
||||||
|
label: "Identifiant Beacon :",
|
||||||
|
initialValue: sectionDTO != null ? sectionDTO.beaconId : "",
|
||||||
|
onChanged: (value) {
|
||||||
|
sectionDTO.beaconId = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user