olmps / memo

Memo is an open-source, programming-oriented spaced repetition software (SRS) written in Flutter.
BSD 3-Clause "New" or "Revised" License
1.82k stars 158 forks source link

`RichTextField` component #229

Closed ggirotto closed 2 years ago

ggirotto commented 2 years ago

This false shrink behavior to some buttons but true for others is really confusing. I think it's expected for all buttons to work the same (meaning all shrink, which is flutter's default if I'm not mistaken) and, if there are specific stretch scenarios, use shrink to false.

I tested the scenarios using ElevatedButton and TextButton and the TLDR is that the elevated expands to the maximum available space, while the text uses the minimum space as necessary:

Screenshot ![CleanShot 2021-11-09 at 11 13 16@2x](https://user-images.githubusercontent.com/11745745/140939969-e12a32bd-4546-4c61-8069-8eb55e95665c.png)

Given these tests it makes sense to use this internal shrink behavior, since all buttons share from the same _CustomButton structure.


Also, I think that the "editor" behavior should be all comprised within a provider and separated from the UI

Couldn't understand what you suggested here. I mean, the editor is an UI component. You mean the editor controller?


I've ended up adding a custom hook to QuillEditor, let me know what do you think.