flutter_mcp_ui_runtime 0.5.0 copy "flutter_mcp_ui_runtime: ^0.5.0" to clipboard
flutter_mcp_ui_runtime: ^0.5.0 copied to clipboard

Runtime for building dynamic Flutter UIs from JSON with lifecycle management, state handling, and MCP protocol support.

flutter_mcp_ui_runtime #

Comprehensive runtime for building dynamic, reactive Flutter UIs from JSON specifications. Implements the MCP UI DSL 1.3 specification with Material 3 theming, responsive form factors, lifecycle management, state handling, and MCP protocol integration.

Features #

  • Dynamic UI rendering — 77+ widgets across layout, display, input, list, navigation, scroll, animation, interaction, dialog categories.
  • Material 3 themingThemeManager + McpUiThemeBuilder map a strongly-typed ThemeDefinition (28-role color, 15-role typography, 7-family shape, 6-level elevation, density, surface containers) onto Flutter's ThemeData.
  • HCT seed palettes — single seed color drives the full M3 light/dark palette.
  • Page-level theme overridesapplyOverride(Map) deep-merges 14-domain JSON with a restore callback.
  • Responsive form factorsFormFactor (compact / medium / expanded / large / embedded) with FormFactorScope, ViewModeResolver priority chain, and four scaled token sets (AppSpacing, AppIconSizes, AppTypography, AppDensity).
  • Auto-adaptive navigation — drawer auto-swaps to modal drawer (compact) / NavigationRail (medium) / permanent drawer (expanded+).
  • Expression binding{{theme.color.<slot>}}, {{theme.typography.<role>}}, {{theme.spacing.<token>}}, {{theme.shape.<family>}}, {{theme.elevation.<level>.shadow}}, {{theme.motion.duration.<key>}} plus state and bundle bindings.
  • Action system — state, tool, batch, conditional actions.
  • State management — page-level + application-level with persistence via SharedPreferences.
  • MCP integration — multiple-server orchestration, tool executor wiring, resource subscription with proper cleanup.
  • Editor inspection hookMCPUIRuntime.withInspector(widgetWrapper:) pairs each rendered widget with its source JSON node so visual editors can hit-test from the rendered tree back to the canonical document. The standard constructor is unaffected — no per-node overhead.

Quick Start #

import 'package:flutter_mcp_ui_runtime/flutter_mcp_ui_runtime.dart';

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MCPUIRenderer(
        definition: myUiDefinition,
        toolExecutors: {'incrementCounter': () { /* ... */ }},
      ),
    );
  }
}

Build Note: Dynamic Icons #

Apps using dynamic icon names must build with --no-tree-shake-icons:

flutter build apk --no-tree-shake-icons

Support #

License #

MIT — see LICENSE.

0
likes
140
points
437
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Runtime for building dynamic Flutter UIs from JSON with lifecycle management, state handling, and MCP protocol support.

Homepage
Repository (GitHub)
View/report issues

Topics

#ui #json #mcp #flutter #runtime

License

MIT (license)

Dependencies

collection, crypto, device_info_plus, file_picker, flutter, flutter_mcp_ui_core, http, mcp_bundle, path, provider, shared_preferences, watcher

More

Packages that depend on flutter_mcp_ui_runtime