Fix bug translation FR
This commit is contained in:
parent
57c7d56306
commit
0f325605e5
28
analysis_options.yaml
Normal file
28
analysis_options.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||
# invoked from the command line by running `flutter analyze`.
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||
# included above or to enable additional rules. A list of all available lints
|
||||
# and their documentation is published at https://dart.dev/lints.
|
||||
#
|
||||
# Instead of disabling a lint rule for the entire project in the
|
||||
# section below, it can also be suppressed for a single line of code
|
||||
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||
# producing the lint.
|
||||
rules:
|
||||
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
@ -13,13 +13,25 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
|
||||
TabController? _tabController;
|
||||
QuillEditorController controllerQuill = QuillEditorController();
|
||||
ValueNotifier<String?>? currentLanguage;
|
||||
bool isInit = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = new TabController(length: widget.newValues.length, vsync: this);
|
||||
currentLanguage = ValueNotifier<String>(widget.newValues.first.language!);
|
||||
controllerQuill.insertText(widget.newValues[_tabController!.index].value!);
|
||||
|
||||
controllerQuill.onEditorLoaded(() {
|
||||
print("onEditorLoaded");
|
||||
isInit = true;
|
||||
});
|
||||
|
||||
Future.delayed(Duration(milliseconds: 500), () {
|
||||
print("Future.delayed");
|
||||
controllerQuill.clear();
|
||||
controllerQuill.insertText(widget.newValues[_tabController!.index].value!);
|
||||
isInit = true;
|
||||
});
|
||||
|
||||
controllerQuill.onTextChanged((p0) async {
|
||||
var plainText = await controllerQuill.getPlainText();
|
||||
@ -41,6 +53,8 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
|
||||
setState(() {
|
||||
currentLanguage!.value = widget.newValues[_tabController!.index].language;
|
||||
if(!widget.isAudio) {
|
||||
print("insert try without ress");
|
||||
print(widget.newValues[_tabController!.index].value!);
|
||||
controllerQuill.clear();
|
||||
controllerQuill.insertText(widget.newValues[_tabController!.index].value!);
|
||||
}
|
||||
@ -145,7 +159,9 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
|
||||
//onFocusChanged: (hasFocus) => debugPrint('has focus $hasFocus'),
|
||||
//onTextChanged: (text) => debugPrint('widget text change $text'),
|
||||
onTextChanged: (value) {
|
||||
newValues.where((element) => element.language! == currentLanguage.value).first.value = value;
|
||||
if(isInit) {
|
||||
newValues.where((element) => element.language! == currentLanguage.value).first.value = value;
|
||||
}
|
||||
},
|
||||
onEditorCreated: () => debugPrint('Editor has been loaded'),
|
||||
onEditorResized: (height) =>
|
||||
|
||||
@ -12,13 +12,25 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
TabController? _tabController;
|
||||
QuillEditorController controllerQuill = QuillEditorController();
|
||||
ValueNotifier<String?>? currentLanguage;
|
||||
bool isInit = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_tabController = new TabController(length: widget.newValues.length, vsync: this);
|
||||
currentLanguage = ValueNotifier<String>(widget.newValues.first.language!);
|
||||
controllerQuill.insertText(widget.newValues[_tabController!.index].value!);
|
||||
|
||||
controllerQuill.onEditorLoaded(() {
|
||||
print("onEditorLoaded");
|
||||
isInit = true;
|
||||
});
|
||||
|
||||
Future.delayed(Duration(milliseconds: 500), () {
|
||||
print("Future.delayed");
|
||||
controllerQuill.clear();
|
||||
controllerQuill.insertText(widget.newValues[_tabController!.index].value!);
|
||||
isInit = true;
|
||||
});
|
||||
|
||||
controllerQuill.onTextChanged((p0) async {
|
||||
var plainText = await controllerQuill.getPlainText();
|
||||
@ -40,6 +52,8 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
setState(() {
|
||||
currentLanguage!.value = widget.newValues[_tabController!.index].language;
|
||||
if(!widget.isAudio) {
|
||||
print("insert try without ress");
|
||||
print(widget.newValues[_tabController!.index].value!);
|
||||
controllerQuill.clear();
|
||||
controllerQuill.insertText(widget.newValues[_tabController!.index].value!);
|
||||
}
|
||||
@ -82,7 +96,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
child: Container(
|
||||
height: widget.isTitle ? MediaQuery.of(context).size.height *0.13 : MediaQuery.of(context).size.height *0.35,
|
||||
child: QuillHtmlEditor(
|
||||
text: newValues.where((element) => element.language! == currentLanguage.value).first.value!,
|
||||
//text: newValues.where((element) => element.language! == currentLanguage.value).first.value!,
|
||||
hintText: '',
|
||||
controller: controllerQuill,
|
||||
minHeight: widget.isTitle ? 80 : 240,
|
||||
@ -97,7 +111,9 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
//onFocusChanged: (hasFocus) => debugPrint('has focus $hasFocus'),
|
||||
//onTextChanged: (text) => debugPrint('widget text change $text'),
|
||||
onTextChanged: (value) {
|
||||
newValues.where((element) => element.language! == currentLanguage.value).first.value = value;
|
||||
if(isInit) {
|
||||
newValues.where((element) => element.language! == currentLanguage.value).first.value = value;
|
||||
}
|
||||
},
|
||||
onEditorCreated: () => debugPrint('Editor has been loaded'),
|
||||
onEditorResized: (height) =>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user