I have been struggling with this for a couple of days. I want to display a few university lessons in a flutter app. I used the Text widget, but it's not sufficiently customizable. If I want to make one single word bold in the entire paragraph, I can't do that. I tried the RichText widget, but that was a pain in the neck, I would have to create a new TextSpan everytime I want to customize a piece of the paragraph somehow.
Before you say markdown, I gave that a try too. But I can't change the font size, it's small and not so easy on the eyes. I did check the docs on Github, but there doesn't seem to be enough flexibility, you can't resize or align text.
I am left with one option, which is to use an HTML view plugin. I tried importing that, but now it's giving me an error.
If you know any tricks on how to customize text, hopefully within flutter, not using HTML/markdown, I would really appreciate it. Any suggestions on how to make my life easier are welcome!
Related
I am planning to create a rich text editor in Flutter for a personal application. I know there are already some options like zefyr. However, it is still in dev preview and I want to build something a bit different.
The features of the text editor will be that users can add images, bolden text, add lists, italicize text, etc. Just basic text editor things.
Where I am having issues is in the text input side of things. The flutter default text input only allows one style of text per text field. So that would pose a great challenge when it comes to inline styling. Also, a text field cannot have an image inside it, so that is another problem.
If anyone has any ideas on how to go about this, it will be great for a start.
So, I am really asking for the approach to create the editor because it is not as simple as creating one in html
I'm new to flutter and I need an editor that can format certain words (e.g., automatic URL detection and formatting it to blue inside the editor). So far, I have not found a plugin for that so I decided to write my own plugin.
The question here is: where do I start?
I've tried using a Rich.text() with TextSpan as children but I can't edit those children. I've tried using a SizedBox with inside of it an EditableText but I encountered 2 problems.
The fontSize of EditableText always differs from the fontSize of a TextSpan, no matter if I apply the same TextStyle (this really frustrates me)
The whole Rich.text() doesn't work as a single editor, which is what I'm trying to achieve.
Could someone point me into the right direction? Thanks in advance!
I know about html plugins which can be used to add pages of long paragraphs
I also know about flutter codes which can be used to add long paras of texts
But I am not satisfied with both methods..
I am creating a lesson app and want to insert tons of texts and images in a beautifully way...
Can you suggest me any way [better way] to add long texts with keeping eye on the size of the app
I have added screenshots for reference
I'd recommend checking out Zefyr. It's a WYSIWYG that can embed images, display lists and even has collaborative editing capabilities. If you only wanted it for presentation you could make it view only by changing the mode to ZefyrMode.view on the ZefyrEditor constructor.
Edit:
Another more lightweight solution is to use flutter_markdown. It also supports images, lists and so on and doesn't require the special delta format that Zefyr does when storing your strings of text.
I've looked through every single widget on glade trying to replicate this "box/table" style seen here on Settings:
But I haven't found anything like it anywhere on Glade or on the official docs :(
The closest I've come to replicating it is through a frame without a label and with separators and custom css that changes the background color to #base-color, and although it kinda works alright in some themes:
In others it just plain doesn't work:
And I'd imagine that with more elaborate or complex themes it will look even worse.
So my questions are: What is the name of this Widget shown in these pictures? And if it does not exist or is not available in Glade, is there a way to replicate it more reliably than what I've shown here?
It is called a GtkListBox. As you can see, it takes any other widget as a child. So you have to add rows to the ListBox and then add widgets to each row.
Here is an example in Python.
Ok im struggling to find anything on this as im probably searching the wrong keywords.
I have a backed form thats use to display content on a page. When entering the details i want to be able to use a basic text editor to style the text, like bold, bullets, underline.
On top of that i would also like to allow them to wrap section in paragraph tabs, apply a certain style i.e style id="x".
Its more for backend so it doesnt have to be really user friendly but if there was an uncomplicated way of showing the styles in the form as i apply them, basically a WYSIWYG view. If not i will settle for applying the styles without having to see all the hmtl and css tags in the editor but when the information is passed via the INSERT query it will show pass all the relevant code like My Style and so on.
Now im quite happy to spend the time learning how to do this if you point me in the right direction but i have no idea what keywords to search. Ideally if there is a script out there i can just edit to my needs would be great too rather than starting from scratch.
Finally since im learning php and mysql still keeping it dumbed down will help and also since my values im passing is going to be full of characters the code wont like what functions should i look up to pass the code and content into the database to avoid breaking the code
I'm not entirely sure what you mean, but it seems you can achieve what you want using an editor like for example TinyMCE in combination with JQuery?
With JQuery you can show/hide items and ander your css like
$("p").mouseover(function () {
$(this).css("color","red");
});