Skip to content
pubscout

flutter_blockly

1.6.0, released 2 years ago by an unverified publisher

A Flutter widget that embeds Google Blockly for visual programming.

WASM-ready
$ flutter pub add flutter_blockly
Source repository

What it does

It provides a Blockly editor inside a Flutter app, exposing methods to inject, update, and retrieve code in multiple languages. The editor runs in a WebView on mobile and a native iframe on web.

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

Use it when

  • You need a drag‑and‑drop coding interface for users
  • You want to support multiple target languages (Dart, JS, Python, etc.)
  • You target Android, iOS, web, and macOS with a single code base

Skip it when

  • You require native performance or low memory footprint
  • You need a fully custom block set that cannot be loaded via XML
  • You are building a lightweight app that cannot afford a WebView

Strengths

  • Cross‑platform support via WebView/Web
  • Rich API for injecting, updating, and retrieving code
  • Supports many languages out of the box

Weaknesses

  • Depends on WebView which adds overhead
  • Limited customization of the Blockly UI beyond XML
  • Requires platform‑specific setup for web and mobile

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
2

Add webview_flutter to pubspec, configure AndroidManifest and iOS Info.plist for WebView, import flutter_blockly and instantiate BlocklyEditorWidget.

```dart
import 'package:flutter_blockly/flutter_blockly.dart';

class MyEditor extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: BlocklyEditorWidget(
          workspaceConfiguration: {},
          initial: '',
          onChange: ({xml, json, dart, js, lua, php, python}) {
            // handle changes
          },
        ),
      ),
    );
  }
}
```

Alternatives

Packages that do the same job and could replace flutter_blockly.

Works with

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