Add isTitle to 2000 char
This commit is contained in:
parent
e3beb6c7f8
commit
025338ae9f
@ -9,7 +9,7 @@ import 'package:managerapi/api.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
showMultiStringInput (String label, String modalLabel, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, BuildContext context) { /*Function onSelect,*/
|
||||
showMultiStringInput (String label, String modalLabel, bool isTitle, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, BuildContext context) { /*Function onSelect,*/
|
||||
showDialog(
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
@ -23,7 +23,7 @@ showMultiStringInput (String label, String modalLabel, List<TranslationDTO> valu
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: getTranslations(context, Provider.of<AppContext>(context), label, newValues),
|
||||
children: getTranslations(context, Provider.of<AppContext>(context), label, isTitle, newValues),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -84,7 +84,7 @@ showMultiStringInput (String label, String modalLabel, List<TranslationDTO> valu
|
||||
);
|
||||
}
|
||||
|
||||
getTranslations(BuildContext context, AppContext appContext, String label, List<TranslationDTO> newValues) {
|
||||
getTranslations(BuildContext context, AppContext appContext, String label, bool isTitle, List<TranslationDTO> newValues) {
|
||||
List<Widget> translations = <Widget>[];
|
||||
ManagerAppContext managerAppContext = appContext.getContext();
|
||||
for(var language in managerAppContext.selectedConfiguration.languages) {
|
||||
@ -114,7 +114,7 @@ getTranslations(BuildContext context, AppContext appContext, String label, List<
|
||||
TextFormInputContainer(
|
||||
label: label,
|
||||
color: kWhite,
|
||||
isTitle: true,
|
||||
isTitle: isTitle,
|
||||
initialValue: newValues.where((element) => element.language == language).first.value,
|
||||
onChanged: (value) {
|
||||
newValues.where((element) => element.language == language).first.value = value;
|
||||
|
||||
@ -13,6 +13,7 @@ class MultiStringContainer extends StatelessWidget {
|
||||
final List<TranslationDTO> initialValue;
|
||||
final Function onGetResult;
|
||||
final int maxLines;
|
||||
final bool isTitle;
|
||||
const MultiStringContainer({
|
||||
Key key,
|
||||
this.color = kSecond,
|
||||
@ -21,6 +22,7 @@ class MultiStringContainer extends StatelessWidget {
|
||||
this.initialValue,
|
||||
this.onGetResult,
|
||||
this.maxLines,
|
||||
this.isTitle,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -45,7 +47,7 @@ class MultiStringContainer extends StatelessWidget {
|
||||
initialValue.forEach((value) {
|
||||
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value))));
|
||||
});
|
||||
showMultiStringInput(label, modalLabel, initialValue, newValues, onGetResult, maxLines, context);
|
||||
showMultiStringInput(label, modalLabel, isTitle, initialValue, newValues, onGetResult, maxLines, context);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/check_input_container.dart';
|
||||
import 'package:manager_app/Components/multi_string_input_container.dart';
|
||||
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||
import 'package:manager_app/Models/managerContext.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
@ -77,12 +80,12 @@ class _ArticleConfigState extends State<ArticleConfig> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
// Bad
|
||||
MultiStringContainer(
|
||||
label: "Contenu affiché:",
|
||||
modalLabel: "Contenu",
|
||||
color: kPrimaryColor,
|
||||
initialValue: articleDTO != null ? articleDTO.content : [],
|
||||
isTitle: false,
|
||||
onGetResult: (value) {
|
||||
setState(() {
|
||||
if (articleDTO.content != value) {
|
||||
@ -205,4 +208,4 @@ class _ArticleConfigState extends State<ArticleConfig> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,6 +169,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
||||
}
|
||||
},
|
||||
maxLines: 1,
|
||||
isTitle: true,
|
||||
),
|
||||
MultiStringContainer(
|
||||
label: "Description affichée:",
|
||||
@ -182,6 +183,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
||||
}
|
||||
},
|
||||
maxLines: 2,
|
||||
isTitle: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@ -5,6 +5,9 @@
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
|
||||
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||
endforeach(plugin)
|
||||
|
||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||
endforeach(ffi_plugin)
|
||||
|
||||
18
pubspec.lock
18
pubspec.lock
@ -77,7 +77,7 @@ packages:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
convert:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -126,7 +126,7 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.0"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -218,7 +218,7 @@ packages:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.3"
|
||||
version: "0.6.4"
|
||||
managerapi:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -239,7 +239,7 @@ packages:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "0.1.4"
|
||||
material_segmented_control:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -281,7 +281,7 @@ packages:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.8.1"
|
||||
path_parsing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -363,7 +363,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.8.2"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -398,7 +398,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.8"
|
||||
version: "0.4.9"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -412,7 +412,7 @@ packages:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
video_player:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -463,5 +463,5 @@ packages:
|
||||
source: hosted
|
||||
version: "5.3.1"
|
||||
sdks:
|
||||
dart: ">=2.15.0 <3.0.0"
|
||||
dart: ">=2.17.0-0 <3.0.0"
|
||||
flutter: ">=2.10.0"
|
||||
|
||||
@ -5,6 +5,9 @@
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
|
||||
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
@ -13,3 +16,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||
endforeach(plugin)
|
||||
|
||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||
endforeach(ffi_plugin)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user