Skip to content

Conversation

@FeodorFitsner
Copy link
Contributor

@FeodorFitsner FeodorFitsner commented Feb 12, 2026

Summary by Sourcery

Add a new extensible CodeEditor control and integrate it into the Python SDK, Flutter client, build, and documentation.

New Features:

  • Introduce a flet-code-editor Python package providing a CodeEditor control with syntax highlighting, autocompletion, gutter styling, folding APIs, and related data types.
  • Expose a Flutter extension and widget implementation for the CodeEditor control based on flutter_code_editor, including theming and gutter customization.
  • Add example apps demonstrating basic usage, theming, autocompletion, selection handling, and folding features of the CodeEditor control.

Enhancements:

  • Wire the new flet-code-editor extension into the Flutter client startup and Python SDK dependency graph so it is available to Flet apps.
  • Extend the documentation site navigation and pages to cover the CodeEditor control and its associated types.

Build:

  • Register the flet-code-editor package in the workspace, client dependencies, and CI workflow so it is built and tested with the rest of the project.

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.
@cloudflare-workers-and-pages
Copy link

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

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

View logs

@cloudflare-workers-and-pages
Copy link

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2ecd10f
Status:🚫  Build failed.

View logs

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.

1 participant