superlistapp / super_editor

A Flutter toolkit for building document editors and readers
https://superlist.com/SuperEditor/
MIT License
1.65k stars 239 forks source link

Toolbar builders for desktop and web #398

Open miguelcmedeiros opened 2 years ago

miguelcmedeiros commented 2 years ago

In SuperEditor's constructors it is possible for developers to pass widget builders for the selection toolbar on iOS and Android (2 separate fields).

Although the current solution allows the developer to ignore all the complexity of showing/hiding the toolbar on mobile, it is also common to have selection toolbars in other platforms (desktop and web).

Not sure what would the best way forward, but it could be either:

In the second option the developer will have more freedom and can either pass a different builder per target platform (platform fidelity), or it will use a single one (e.g. app has a strong branded design).

matthew-carroll commented 1 year ago

@miguelcmedeiros based on your current understanding of SuperEditor, including the document overlay support we recently added, as well as the need for some things to appear in the overall application overlay, can you take another look at this ticket and see if you'd change anything about the desired capabilities?

miguelcmedeiros commented 1 year ago

@matthew-carroll with the document overlay builders we can now build the toolbars for other platforms 👍

Should we the existing toolbars for mobile become document overlays as well, or is it not possible to decouple them from the gesture interactors? In terms of API, it would be cleaner to not have those 2 toolbar builders (androidToolbarBuilder and iOSToolbarBuilder) if it can be implemented as a document overlay.

matthew-carroll commented 1 year ago

@miguelcmedeiros I think the first question is whether these overlays, with handles, magnifiers, and toolbars, should be in a document overlay, or a global app overlay?

I suppose we could provide both versions, if we wanted to. We could have a version that runs as a document overlay and positions its content directly based on the document layout. We could also have a version that runs in the app overlay, which uses Followers to position content based on invisible trackers in another document overlay.