rfw_preview

A dev preview widget for rfw_gen. Renders generated rfwtxt with automatic Runtime setup and custom widget support.

Features

  • RfwPreview — drop-in widget that renders rfwtxt from strings, binary assets, or raw bytes
  • RfwEditorApp — standalone editor with live preview, snippet storage, and device frames
  • RfwEditor — embeddable editor widget for integration into existing apps
  • RfwEditorController — state management for editor instances

Installation

dev_dependencies:
  rfw_preview: ^0.4.0

Quick Start

RfwPreview Widget

import 'package:rfw_preview/rfw_preview.dart';

RfwPreview(
  source: RfwSource.text(
    '''
    import core.widgets;
    widget root = Center(child: Text(text: "Hello, RFW!"));
    ''',
    library: LibraryName(['main']),
  ),
  widget: 'root',
)

Load from a .rfw binary asset:

RfwPreview(
  source: RfwSource.asset(
    'assets/greeting.rfw',
    library: LibraryName(['main']),
  ),
  widget: 'greeting',
  data: {'user': {'name': 'Alice'}},
  localWidgetLibraries: myCustomWidgetLibraries,
)

RfwEditorApp

Launch a full-screen editor with live preview:

RfwEditorApp(
  localWidgetLibraries: myCustomWidgetLibraries,
)

RfwEditor (Embeddable)

RfwEditor(
  localWidgetLibraries: myCustomWidgetLibraries,
)

Libraries

rfw_preview
Dev preview widget for rfw_gen.