flutter_code_editor
0.3.5, released a year ago by akvelon.com
A customizable code field widget supporting syntax highlighting and code folding.
What it does
Flutter Code Editor provides a multi-platform code editing widget with support for syntax highlighting across over 100 languages, code folding, autocompletion, named sections, and read-only code blocks. It also includes pluggable analyzers for error highlighting.
AI-written summary of version 0.3.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need an in-app code editor or text area with syntax highlighting.
- You want to support code block folding and read-only sections for educational apps.
- You need autocompletion and basic code analysis capabilities inside Flutter.
Skip it when
- You only need a simple, single-line text input field.
- You require a full-fledged IDE-level code editor with deep semantic analysis and multi-file project management.
Strengths
- Supports syntax highlighting for over 100 languages via the highlight package.
- Includes advanced features like code folding, named sections, and read-only blocks.
- Pluggable analyzers support local checks and DartPad integration.
Weaknesses
- Autocompletion uses an unstructured dictionary without deep syntax analysis.
- Code analysis features are considered experimental and may introduce breaking changes.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 14
not documented
import 'package:flutter/material.dart';
import 'package:flutter_code_editor/flutter_code_editor.dart';
import 'package:flutter_highlight/themes/monokai-sublime.dart';
import 'package:highlight/languages/java.dart';
final controller = CodeController(
text: '...',
language: java,
);
class CodeEditor extends StatelessWidget {
const CodeEditor();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: CodeTheme(
data: CodeThemeData(styles: monokaiSublimeTheme),
child: SingleChildScrollView(
child: CodeField(
controller: controller,
),
),
),
),
);
}
}Alternatives
Packages that do the same job and could replace flutter_code_editor.
- code_editor
A Flutter code editor widget with syntax highlighting, custom themes, and file navigation.
82Compare - code_forge
A powerful text editor widget for Flutter handling 1M+ lines with LSP and AI completion.
81Compare - val_highlight_flutter
Flutter widgets for displaying and editing syntax-highlighted code.
80Compare - re_editor
A lightweight text and code editor widget for Flutter with syntax highlighting and folding.
80Compare
Works with
Packages commonly used together with flutter_code_editor: ones it builds on, ones built on it, and its own family.
- charactersflutter_code_editor depends on itUnicode and grapheme cluster aware string manipulation operations for Dart.
- url_launcherflutter_code_editor depends on itFlutter plugin for launching URLs across mobile, desktop, and web platforms.
- equatableflutter_code_editor depends on itProvides value‑based equality for Dart objects without manual == and hashCode.
- charcodeflutter_code_editor depends on itProvides named integer constants for ASCII and HTML character codes.
- mocktailflutter_code_editor depends on itDart mock library with null safety support and no manual mocks or code generation.
- tupleflutter_code_editor depends on itProvides immutable tuple classes for grouping values.
- scrollable_positioned_listflutter_code_editor depends on itA Flutter list with helper methods to programmatically scroll to an item.
- highlightflutter_code_editor depends on itDart library that parses source code into syntax‑highlighted HTML