Fair-Online: An Integrated Cloud Development Platform for Flutter with Online Code Editing, Real‑time Compilation, and Dynamic Updates
Fair-Online is a cloud‑based development platform for Flutter that combines an online code editor, visual project/component creation, real‑time compilation preview, hot‑reload style updates, and a custom syntax‑analysis service, enabling developers to build, test, and deploy Flutter applications without local environment setup.
Introduction Fair‑Online is a cloud development platform aimed at Flutter developers, offering online code editing, instant compilation preview, packaging, and dynamic hot‑update capabilities, allowing developers to work without configuring a local Flutter environment.
Flutter Low‑Code Comparison While tools like FlutterFlow provide drag‑and‑drop UI building for beginners, they become cumbersome for complex UI hierarchies and advanced business logic. Fair‑Online instead offers an online code editor supplemented by visual project, page, and component creation, reducing learning overhead while retaining full code control.
Architecture Overview The platform follows a three‑layer architecture, all built on the Dart stack. The front‑end (Flutter Web + JavaScript) handles UI rendering, the middle service layer provides a Code Editor (based on CodeMirror) and a Preview component (implemented with Flutter and the Fair SDK), and the back‑end runs on a Dart server offering compilation, analysis, and packaging services.
Online Code Editor The editor UI is powered by CodeMirror, a mature web‑based code editor. A Dart wrapper calls CodeMirror APIs via dart:js or packages:js . The editor is embedded in Flutter Web using HtmlElementView after registering the view factory:
/// Construct the HTML element that hosts CodeMirror and register it
final html.HtmlElement element = html.DivElement();
ui.platformViewRegistry.registerViewFactory(
getCodeMirrorViewType(), (int viewId) => element);
/// Initialize CodeMirror
editor = (editorFactory..paramsProvider = this)
.createFromElement(element, options: codeMirrorOptions)
..theme = 'darkpad'
..mode = 'dart'
..showLineNumbers = true;Flutter Web Runtime Flutter Web shares the same framework layer as mobile Flutter but replaces the Skia rendering engine with standard HTML elements and Canvas. The Dart compiler (dart2js or the newer dartdevc) converts Dart intermediate files into JavaScript that runs in the browser.
JS Interoperability Flutter Web can call JavaScript functions and vice‑versa using dart:js or packages:js , enabling seamless integration with third‑party web libraries.
Syntax Analysis Fair‑Online leverages the official Dart Analysis Server for standard Flutter syntax checking and extends it with custom Fair plugins to detect annotations like @FairPatch . The analysis pipeline parses the abstract syntax tree, visits annotated classes, and applies custom visitors to enforce Fair‑specific syntax sugar.
Compilation and Preview For fast online preview, the backend uses the Dart Development Compiler (dartdevc) to compile user code into JavaScript, which is then injected into an isolated iframe on the front‑end, avoiding resource conflicts and providing a near‑instant preview experience.
Conclusion Fair‑Online combines a full‑stack Dart ecosystem, a powerful web‑based code editor, custom syntax analysis, and efficient compilation pipelines to deliver a low‑code yet code‑centric development experience for Flutter applications, eliminating the need for local setup while supporting advanced features such as hot updates and dynamic UI generation.
58 Tech
Official tech channel of 58, a platform for tech innovation, sharing, and communication.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.