of static method

Retrieves the nearest TabContainerData from the widget tree.

Throws an assertion error if no TabContainer is found in the ancestor chain, as tab children must be descendants of a tab container.

Parameters:

  • context: Build context to search from

Returns the container data.

Implementation

static TabContainerData of(BuildContext context) {
  var data = Data.maybeOf<TabContainerData>(context);
  assert(data != null, 'TabChild must be a descendant of TabContainer');
  return data!;
}