fassad_ui 0.1.0
fassad_ui: ^0.1.0 copied to clipboard
Flutter widgets and HTTP client for querying dblm fassad templates — render database results as charts and tables.
fassad_ui #
Flutter package for querying dblm fassad templates and rendering results as charts or tables.
What is fassad? #
Fassads are reusable, parameterized query templates stored in dblm. This package connects to the @dblm/middleware HTTP server and renders the results directly in your Flutter app.
Setup #
- Start the middleware:
npx @dblm/middleware
- Add to your
pubspec.yaml:
dependencies:
fassad_ui: ^0.1.0
Usage #
import 'package:fassad_ui/fassad_ui.dart';
final client = FassadClient(
baseUrl: 'http://localhost:3000',
apiKey: 'your-api-key',
);
// Run a fassad template
final result = await client.run('top-users', params: {'limit': '10'});
// Render as a chart
FassadChart(
result: result,
xColumn: 'name',
yColumn: 'count',
type: FassadChartType.bar,
)
// Render as a table
FassadTable(result: result)
Chart types #
| Type | Enum |
|---|---|
| Bar | FassadChartType.bar |
| Line | FassadChartType.line |
| Pie | FassadChartType.pie |
API #
FassadClient #
| Method | Description |
|---|---|
list() |
List all fassad templates |
show(name) |
Get template details and params |
run(name, {params}) |
Execute a template and return rows |
FassadChart #
| Property | Type | Description |
|---|---|---|
result |
FassadResult |
Data from client.run() |
xColumn |
String |
Column name for X axis / labels |
yColumn |
String |
Column name for Y axis / values |
type |
FassadChartType |
bar, line, or pie |
height |
double |
Chart height (default 300) |
License #
MIT