KoolbaseRecordView class

One record of a collection, by id, handed to builder -- a SCOPE, not a screen: it adds no scrolling and no layout of its own. The widget builder returns is the caller's, and everything inside it reads the record it was given, as a list row's children read theirs. Loading, not-found and error are slotted.

KoolbaseRecordView(
  collection: 'songs',
  id: songId,
  builder: (context, song) => Column(children: [
    Text(song.data['title'] as String),
  ]),
)

A changed id or collection starts a new load: the same detail route opened for another record shows that record, never the previous one.

Inheritance

Constructors

KoolbaseRecordView({Key? key, required String collection, required String? id, required Widget builder(BuildContext context, KoolbaseRecord record), WidgetBuilder? loading, WidgetBuilder? notFound, Widget error(BuildContext context, Object error, Future<void> retry())?, bool live = false, @visibleForTesting Future<KoolbaseRecord> fetch(String id)?, @visibleForTesting Stream<RealtimeEvent> liveEvents(String collection)?})
const

Properties

builder → Widget Function(BuildContext context, KoolbaseRecord record)
Builds what shows the record. Appearance is entirely the caller's.
final
collection → String
The collection the record must belong to.
final
error → Widget Function(BuildContext context, Object error, Future<void> retry())?
Shown when the first load failed. Receives the error and a retry.
final
fetch → Future<KoolbaseRecord> Function(String id)?
Test seam only: fetch a record by id instead of calling the SDK.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String?
The record's id. Null or empty shows notFound without a request.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
live → bool
Follow the record through Koolbase realtime: changes re-read it silently; a delete shows notFound. Signed out: public collections only.
final
liveEvents → Stream<RealtimeEvent> Function(String collection)?
Test seam only: the collection's realtime events.
final
loading → WidgetBuilder?
Shown during the first load. Defaults to a centered spinner.
final
notFound → WidgetBuilder?
Shown when there is no record to show. Defaults to "Not available."
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<KoolbaseRecordView>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited