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!
Related
I need to show a block of code along with error in flutter.
I'm using flutter_highlight library to get highlighted code TextSpan.
Next I want to underline the errors in code, I'm able to add underline to basetext easily but. I need these text span to be combined somehow?
How can I achieve this?
I tried going through the docs, but there is no mention of such thing.
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.
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!
First of all thanks for all the previous advice.
I have come across a rather tricky little problem.
I have a string which I want to display into a Label, normally no problem, but the string is longer than the label will allow. However the similar problem with the text box was resolved with the use of the swt awt hybrid. What I would like to do is replicate this with the label.
Is there way around this? or would the workaround be to have the text area to settext to desired text and then to set the text enable to false so it is grey text.
Could anybody advise?
Your workaround to use Text is perfectly fine. You can mimic label behavior by setting appropriate background color and font and disable it. Also such "labels" are able to provide copy functionality, which is not possible for usual Labels.
Another workaround would be to calculate bounds of your String by using FontMetrics and then cut the string in the end with "..." and providing a tooltip with a full Sting length.
It is also possible to use SWT.WRAP constant for labels, thou it will be still restricted by the width of the Label.
I try to migrate our custom plugins from TinyMCE 3 to 4.
In some cases there is some text in the plugin's window to describe how to use it.
Fiddle example: http://fiddle.tinymce.com/Hndaab/1
So if the text is very long, the window width increases until some parts are out of the viewport.
How can i tell the WindowManager to use automatic word wrapping for my labels?
I already tried to define a width for the window. And in another plugin i found a param "multiline". Both didn't solve my problem.
Any ideas? Thank you
I've been trying to accomplish something similar for mobile commpability where the windows are to large for the viewport and so far the closest i've gotten is to set the css for .mce-window to
.mce-window {... max-width:100%;max-height:100%;}
maybe that will be enought to fix your specific problem, even if I still have some ways to go for it to fluidly only fill out the available viewport space on all other windows.