backend_driven_ui library

Backend-Driven UI Framework for Flutter

Server-Driven UI framework with ApiWidget - build data-driven interfaces without FutureBuilder boilerplate.

Features

  • 🎯 Update UIs from your backend
  • âš¡ Instant app updates without app store reviews
  • 🔓 100% open source, MIT licensed
  • 📦 Built-in caching, retry, and error handling
  • 🚀 ApiWidget - FutureBuilder's better alternative

Quick Start

ApiWidget(
  endpoint: '/api/products',
  loading: ShimmerLoader(),
  success: (data) => ProductList(data),
  error: (e) => ErrorCard(e),
)

Classes

ActionHandler
Centralized action executor for backend-driven UI
ActionSchema
Action schema for user interactions
ApiClient
Lightweight HTTP client with retry and caching
ApiRequest
Encapsulates all parameters for a single API call.
ApiResponse
API Response Model
ApiWidget
Declarative API widget - FutureBuilder's better alternative
BackendDrivenScreen
A screen that renders UI from backend JSON schema
BduiConfig
Centralized configuration for Backend-Driven UI package
BduiHttpClient
Abstract HTTP client interface consumed by ApiWidget.
BduiStateManager
Reactive key-value store for backend-driven UI state binding.
BduiValidatorMessages
Localizable validation error messages for backend-driven form fields.
CacheControl
Cache control settings from API response
DefaultBduiHttpClient
Default BduiHttpClient implementation backed by ApiClient.
SchemaParser
Parser for converting widget schemas to Flutter widgets
SchemaWidget
Widget that renders a WidgetSchema
WidgetRegistry
Registry for widget builders
WidgetSchema
Widget schema from backend JSON

Enums

CachePolicy
Cache policy from backend response
HttpMethod
HTTP methods supported by ApiWidget and BackendDrivenScreen.

Typedefs

ApiCallback = void Function(String endpoint, dynamic data)
Callback invoked after a successful api action.
ApiErrorCallback = void Function(String endpoint, String error)
Callback invoked when an api action fails.
CustomActionCallback = Future<void> Function(String name, Map<String, dynamic>? params)
Callback for custom action handling.
LaunchUrlCallback = Future<void> Function(String url)
Callback for URL launching — wire in url_launcher or any custom handler.
Callback for navigation — allows the app to override default Navigator behaviour.
SetStateCallback = void Function(String key, dynamic value)
Callback for setState actions — sets a key in BduiStateManager.
SubmitFormCallback = bool Function(String formKey)
Callback for submitForm actions — validates and saves the named form. Returns true if the form validated successfully.
WidgetBuilder = Widget Function(WidgetSchema schema, BuildContext context)
Widget builder function signature

Exceptions / Errors

ApiException
API Exception