-
Notifications
You must be signed in to change notification settings - Fork 615
CodeEditor control
#6162
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
Draft
FeodorFitsner
wants to merge
10
commits into
main
Choose a base branch
from
flet-code-editor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
CodeEditor control
#6162
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduces the flet-code-editor extension for editing and highlighting source code in Flet apps. Adds Python and Flutter package files, example usage scripts, documentation, and integrates the extension into the client and docs navigation. Updates dependencies in pubspec files and pyproject.toml to include flet-code-editor.
Renamed the 'theme' property to 'code_theme' in CodeEditor and updated all references in examples and documentation. Removed legacy 'line_number_style' in favor of 'gutter_style' for consistency. Updated the Flutter implementation to match the new property names and removed related legacy code.
Moved autocompletion logic from _CodeEditorControlState to a new _FletCodeController class, enabling better encapsulation and control. The editor now manages autocompletion state and suggestions directly through the controller, removing the previous RawAutocomplete-based implementation.
Refactored Python code editor examples for clarity and updated usage, including code samples and UI elements. In the Flutter code editor widget, wrapped the code field in a SingleChildScrollView to improve scrolling behavior. Also updated dependencies in pubspec.lock and made minor code cleanups.
Eliminated support for read-only and visible section names in the code editor, including related properties, methods, and controller logic in both Python and Dart implementations. This simplifies the code editor API and internal logic by removing unused or deprecated section-based features.
Simplified language name resolution in the code editor by directly accessing the control property instead of using a helper method. Removed the 'on_selection_change' flag check, so selection change events are always triggered when the selection is valid. Updated the Python example to adjust the selection range and event handler output.
Moved theme and gutter style parsing logic to a new utils/code_editor.dart file and extracted the custom code controller to utils/flet_code_controller.dart. Updated CodeEditorControl to use the new FletCodeController and utility functions, improving code organization and maintainability. Also registered flet-code-editor in the CI workflow.
Introduces a new 'padding' property to the CodeEditor in both Python and Dart implementations, allowing customization of padding around the editor content.
Deploying flet-examples with
|
| Latest commit: |
2ecd10f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a1fd09d6.flet-examples.pages.dev |
| Branch Preview URL: | https://flet-code-editor.flet-examples.pages.dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add a new extensible CodeEditor control and integrate it into the Python SDK, Flutter client, build, and documentation.
New Features:
Enhancements:
Build: