Skip to content

Feature Request: Grid-Based Image Layout (1, 2, 3 per Row) #2430

@kaushikcrypticalinfo

Description

@kaushikcrypticalinfo

Is there an existing issue for this?

The question

Feature Request: Grid-Based Image Layout (1, 2, 3 per Row)

Description:

I'm working on a feature for the Flutter Quill editor where clicking on an inserted image should open a bottom sheet with options to set the image layout in a grid format. The options are:

  • 1 per row: A single image spans the entire width of the editor.
  • 2 per row: Two images appear side by side in the same row, equally spaced and sized.
  • 3 per row: Three images appear side by side in the same row, equally spaced and sized.

Desired Behavior:

  • Detect when an image in the editor is clicked to open a bottom sheet with these layout options.
  • Dynamically adjust the editor content to display the images in the selected grid format (e.g., multiple images per row).
  • Allow setting a specific size for single images (1 per row layout).
  • Provide an option to apply the selected layout and size to all images in the editor.

Questions:

  1. Is there a built-in mechanism in the Flutter Quill package to manage grid layouts for images or other embed blocks?
  2. If not, what's the best approach to implement this? Should I use custom embed attributes or modify the document's delta directly?
  3. How can I group images together in rows (e.g., two or three images per row) while maintaining the editor's styling and structure?
  4. Are there any examples or recommendations for implementing custom layout features like this in the Quill editor?
  5. How can I store and apply specific size settings for single images?
  6. What's the recommended way to iterate through all images in the document and apply the selected layout and size?

Example Use Case:

This feature would be useful for creating image galleries or layouts within the editor, allowing users to control how images are displayed and arranged. It would also enable setting specific sizes for individual images and applying layout changes to all images for consistency.

Additional Context:

I'm using the flutter_quill package in my Flutter application.

Screenshot 2025-01-10 at 3 38 04 PM

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions