defaultChildBuilder<T extends ParseObject> static method
Widget
defaultChildBuilder<T extends ParseObject>(
- BuildContext context,
- ParseLiveListElementSnapshot<
T> snapshot
The default child builder function used to display a ParseLiveList element.
Implementation
static Widget defaultChildBuilder<T extends sdk.ParseObject>(
BuildContext context, sdk.ParseLiveListElementSnapshot<T> snapshot) {
Widget child;
if (snapshot.failed) {
child = const Text('something went wrong!');
} else if (snapshot.hasData) {
child = ListTile(
title: Text(
snapshot.loadedData?.get<String>(sdk.keyVarObjectId) ??
'Missing Data!',
),
);
} else {
child = const ListTile(
leading: CircularProgressIndicator(),
);
}
return child;
}