Skip to content
pubscout

stac_framework

1.0.0, released a year ago by stac.dev

Enables easy creation of custom parsers for widgets and actions in server-driven UI implementations.

WASM-ready
$ flutter pub add stac_framework
Source repository

What it does

Provides abstract classes like StacParser and StacActionParser to help developers build custom widget and action parsers for server-driven UI. It allows extending Stac functionality to support custom widgets, user inputs, and server actions.

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

Use it when

  • You are implementing server-driven UI using Stac and need custom widgets.
  • You need to parse custom action types such as sending messages to a remote server.

Skip it when

  • You are building a standard Flutter application without server-driven UI requirements.
  • You do not use the Stac framework in your architecture.

Strengths

  • Simplifies creating custom parsers for widgets and actions.
  • Extends Stac framework functionality seamlessly.

Weaknesses

  • Strictly tied to the Stac ecosystem and has limited utility outside of it.
  • Documentation for advanced edge cases is minimal.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Add the package to pubspec.yaml and import stac_framework.dart.

import 'package:stac_framework/stac_framework.dart';

class StacWidgetParser extends StacParser<MyCustomWidget> {
  @override
  MyCustomWidget getModel(Map<String, dynamic> json) => MyCustomWidget.fromJson(json);

  @override
  Widget parse(BuildContext context, MyCustomWidget model) => Text(model.text);

  @override
  String get type => 'customWidget';
}

Alternatives

Packages that do the same job and could replace stac_framework.

  • divkit

    Open source Server-Driven UI (SDUI) framework for cross-platform layouts from JSON

  • page_flip_builder

    Interactive page-flip widget for Flutter with drag, fling, and programmatic control

  • flutter_custom_tab_bar

    Custom tab bar widget with multiple indicator styles including vertical round, standard, linear, and round.

  • card_actions

    Flutter package to add hover actions and enhancements to cards.

Works with

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