Skip to content
pubscout

code_forge

11.8.0, released 7 days ago by an unverified publisher

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

Uses material_ui
$ flutter pub add code_forge
Source repository

What it does

Provides a high-performance, VS Code-level text and code editor widget built using rope data structures and low-level rendering. It features 180+ syntax highlighting languages, code folding, multi-cursor support, Language Server Protocol (LSP) integration, and AI-powered ghost text code completion.

AI-written summary of version 11.7.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to embed a code editor or IDE-like interface inside a Flutter application.
  • You require handling large text files with 1M+ lines smoothly.
  • You need built-in LSP integration or AI code completion inside an editor widget.

Skip it when

  • You only need a simple, single-line text input field.
  • You are building a standard form and just need basic text wrapping or formatting.

Strengths

  • Optimized rope data structure handles massive files efficiently without dropping frames.
  • Built-in Language Server Protocol (LSP) client support over WebSockets and stdio.
  • Extensive feature set including multi-cursor, syntax highlighting, and AI completion.

Weaknesses

  • Complex setup required if configuring custom LSP servers or WebSocket proxies.
  • Heavy package size due to numerous advanced dependencies and feature sets.

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
8

Requires importing language and theme definitions from re_highlight. LSP servers require external binaries or WebSocket proxies (like lsp-ws-proxy) configured.

import 'package:flutter/material.dart';
import 'package:code_forge/code_forge.dart';
import 'package:re_highlight/languages/python.dart';
import 'package:re_highlight/styles/atom-one-dark.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: CodeForge(
          language: langPython,
          editorTheme: atomOneDarkTheme,
        ),
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace code_forge.

  • re_editor

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

  • code_editor

    A Flutter code editor widget with syntax highlighting, custom themes, and file navigation.

  • val_highlight_flutter

    Flutter widgets for displaying and editing syntax-highlighted code.

  • flutter_md

    Fast Markdown parser and canvas renderer for Flutter with text selection and streaming.

Works with

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