Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: restructure project into modular architecture for flutter_quill #2032

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

EchoEllet
Copy link
Collaborator

@EchoEllet EchoEllet commented Jul 17, 2024

Description

Use the modular structure for flutter_quill to improve maintainability.

Our current project structure almost has no architecture, which was suitable when the project first started out. This is a partial fix.

Note

Notice this is not final and we should improve it further, by moving and splitting functionalities instead of having one big file.
There might be inconsistency or some minor issues, misleading, or further improvements.
In case I have any examples I would already fix it, for example, there might be some files in a module that should be in another module for clarity. Or it might be in the wrong directory.
We will improve anything later. For now, this structure can be easier to maintain than the current one.

The new project structure (not final and might be changed):

$ tree -d ./lib/
./lib/
└── src
    ├── common
    │   ├── extensions
    │   ├── structs
    │   └── utils
    ├── controller
    ├── delta
    ├── document
    │   ├── nodes
    │   └── structs
    ├── editor
    │   ├── config
    │   │   └── elements
    │   │       └── list
    │   ├── embed
    │   ├── raw_editor
    │   │   └── config
    │   ├── style_widgets
    │   └── widgets
    │       └── text
    ├── editor_toolbar_controller_shared
    │   └── clipboard
    ├── editor_toolbar_shared
    │   └── config
    ├── l10n
    │   ├── extensions
    │   ├── generated
    │   └── widgets
    ├── packages
    │   └── quill_markdown
    ├── rules
    └── toolbar
        ├── base_button
        ├── buttons
        │   ├── alignment
        │   ├── color
        │   ├── hearder_style
        │   └── search
        │       └── legacy
        ├── config
        │   └── buttons
        ├── embed
        ├── structs
        └── theme

We're open to all feedback.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the package version in pubspec.yaml files.
  • All existing and new tests are passing.
  • I have run the commands in ./scripts/before_push.sh and it all passed successfully

Breaking Change

Does your PR require developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

This change is a breaking change if you import files directly from the src directory:

import 'package:flutter_quill/src/editor_toolbar_controller_shared/clipboard/clipboard_service_provider.dart';

By default, dart analysis will give you a warning and the IDE will not import or suggest from the src directory unless you explicitly import.

flutter_quill_extensions is no longer compatible with an older version of flutter_quill, we use the same version for all packages on this repo for automated publishing and to improve compatibility.

@EchoEllet EchoEllet mentioned this pull request Jul 17, 2024
7 tasks
@EchoEllet EchoEllet marked this pull request as ready for review July 17, 2024 23:48
@EchoEllet EchoEllet merged commit 9764f75 into master Jul 17, 2024
2 checks passed
@EchoEllet EchoEllet deleted the refactor/project-structure branch July 17, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor the project structure without breaking changes
1 participant