markdown_editor | flutter markdown editor | Plugin library
kandi X-RAY | markdown_editor Summary
kandi X-RAY | markdown_editor Summary
A new flutter plugin project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of markdown_editor
markdown_editor Key Features
markdown_editor Examples and Code Snippets
Community Discussions
Trending Discussions on markdown_editor
QUESTION
I have a TextField
inside an OrientationBuilder
in Flutter.
Now what happens, when I change the orientation of my App, is that the current value of the TextField (e.g. the text the user has put into into it) is lost, but I want to preserve the value of the TextField.
I need to rebuild the TextField
, because the layout is different in landscape mode.
Can this be done?
EDIT:
This is what I have tried so far:
Both times I used the following model (located at -> models -> markdownModel.dart):
...ANSWER
Answered 2019-May-20 at 10:00Why this happens: OrientationBuilder
rebuilds itself on orientation change, possibly resetting the state of all the widgets inside of it.
Solution: Assign a TextEditingController
to your TextField
, with the controller being declared outside of OrientationBuilder
context. This will prevent the textfield from losing its value.
e.g.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install markdown_editor
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page