of static method

包含给定上下文的此类的最近实例的 data 属性。

如果没有祖先,则返回 ThemeData.extension<TxCellThemeData>()。 如果它也为null,则返回默认TxCellThemeData

Implementation

static TxCellThemeData of(BuildContext context) {
  final TxCellTheme? txCellTheme =
      context.dependOnInheritedWidgetOfExactType<TxCellTheme>();
  return txCellTheme?.data ??
      Theme.of(context).extension<TxCellThemeData>() ??
      const TxCellThemeData();
}