flutter_artist_2d_scrollables 0.9.0
flutter_artist_2d_scrollables: ^0.9.0 copied to clipboard
An identity-driven, strictly stateless 2D scrolling layout engine built on top of Google's two_dimensional_scrollables for the FlutterArtist ecosystem.
flutter_artist_2d_scrollables #
A high-performance, enterprise-grade 2D scrolling layout engine built on top of Google's official two_dimensional_scrollables package. Specifically tailored for the FlutterArtist ecosystem, it introduces a clean, identity-driven, strictly stateless wrapper to govern massive bi-directional spreadsheets and complex hierarchical trees.
The Core Vision #
Standard data table implementations often lock mutations behind heavy stateful gesture interception loops, creating deep synchronization hazards when paired with reactive architecture stores.
flutter_artist_2d_scrollables eliminates these conflicts by implementing Strict Stateless Architecture Delegation:
- Identity-Driven Reactive Pipelines: Rows and node structures are driven explicitly by immutable domain identifiers (
Set<ID>), isolating tracking mechanics from unstable viewport metrics. - Bi-Directional Lazy Loading: Inherits Google's core
RenderTwoDimensionalViewportengine, memory-virtualizing cells horizontally and vertically simultaneously. It seamlessly renders grids spanning millions of cells at a constant 60/120 FPS. - Zero Stateful Conflict: Eradicates rogue internal widget cache states. Interface updates register via clean unidirectional state ticks, preventing color bleeding or visual layout alignment de-synchronization.
Architecture Matrix #
The package exports a unified orchestration blueprint split cleanly into two structural enterprise layouts:
1. Flat Matrix Grid (TableView Layout) #
Designed for multi-column accounting books, dense matrix settings, or enterprise dashboards requiring strict independent cell layout authority.
import 'package:flutter/material.dart';
import 'package:two_dimensional_scrollables/two_dimensional_scrollables.dart';
import 'package:flutter_artist_2d_scrollables/fa_two_dimensional_table.dart';
class InventoryAsset {
final int id;
final String sku;
final double warehouseStock;
const InventoryAsset({required this.id, required this.sku, required this.warehouseStock});
}
// ... Inside your presentation view pass layer
@override
Widget build(BuildContext context) {
return FaTwoDimensionalTable<int, InventoryAsset>(
items: block.items,
getItemId: (item) => item.id,
currentItemId: block.activeFocusedId,
selectedItemIds: Set<int>.from(block.selectedItemIds),
columns: const [
Fa2DColumn(columnName: 'id', extent: FixedSpanExtent(60.0)),
Fa2DColumn(columnName: 'sku', extent: FixedSpanExtent(160.0)),
],
themeData: FaTwoDimensionalTableThemeData<InventoryAsset>(
gridLineColor: Colors.black12,
headerDecoration: const BoxDecoration(color: Colors.blueHex),
rowColorBuilder: (item, {required isCurrent, required isSelected, required isChecked}) {
if (isCurrent) return Colors.indigo.withAlpha(45);
if (isSelected) return Colors.blue.withAlpha(20);
return null;
},
),
onRowTap: (asset) => block.toggleSelection(asset),
cellBuilder: (context, column, asset, isCurrent, isSelected) {
return Container(
padding: const EdgeInsets.all(8.0),
child: Text(column.columnName == 'id' ? asset.id.toString() : asset.sku),
);
},
);
}
2. Hierarchical Tree Matrix (TreeView Layout) #
Engineered for deep multi-level categories, recursive charts of accounts, or organizational structures (e.g., CompanyTreeView nodes) requiring declarative toggle animations and lifecycle stability.
️ API Extension Strategy #
Unlike traditional components that restrict rendering overrides, this wrapper preserves 100% of the native engine's custom space parameters:
- Ecosystem Theme Harmony: Integrates natively with
flutter_artist_stylesconstants. - Layout Interception Protection: Automatically converts standard, straightforward view parameters (
BoxDecoration) into matrix-pure layout representations (SpanDecoration) seamlessly behind the scenes. - Pure Cell Layout Freedom: The signature
cellBuilderacts as a pure presentation canvas. You retain full control to mount any widget structure, inputs, or interactive anchors inside individual cell boundary limits.
Installation Manifest #
Inject this dependency parameters blueprint straight into your local project's pubspec.yaml layout manifest:
dependencies:
flutter:
sdk: flutter
two_dimensional_scrollables: ^latest_version
flutter_artist_2d_scrollables: ^latest_version