Skip to content
pubscout

flutter_code_editor

0.3.5, released a year ago by akvelon.com

A customizable code field widget supporting syntax highlighting and code folding.

Quiet but busy
$ flutter pub add flutter_code_editor
Source repository

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.

  • code_forge

    A powerful text editor widget for Flutter handling 1M+ lines with LSP and AI completion.

  • val_highlight_flutter

    Flutter widgets for displaying and editing syntax-highlighted code.

  • re_editor

    A lightweight text and code editor widget for Flutter with syntax highlighting and folding.

Works with

Packages commonly used together with flutter_code_editor: ones it builds on, ones built on it, and its own family.