placeholder property

Widget? placeholder
final

The widget to display when the data source of the SfDataGrid is empty.

This widget is displayed only when the data source does not contain any items. If this property is null, the SfDataGrid will remain empty with no widget to indicate the absence of data.

SfDataGrid(
  source: dataSource,
  columns: columns,
  placeholder: Center(
    child: Text('No data available'),
  ),
)

In the example above, a Center widget with a Text message is displayed when the data source is empty.

Defaults to null.

Implementation

final Widget? placeholder;