static IconThemeData _getInheritedIconThemeData(BuildContext context) { IconTheme iconTheme = (IconTheme)context.inheritFromWidgetOfExactType(typeof(IconTheme)); if (iconTheme != null) { return(iconTheme.data); } return(IconThemeData.fallback()); }
public static IconThemeData of(BuildContext context) { IconThemeData iconThemeData = _getInheritedIconThemeData(context).resolve(context); return(iconThemeData.isConcrete ? iconThemeData : iconThemeData.copyWith( size: iconThemeData.size ?? IconThemeData.fallback().size, color: iconThemeData.color ?? IconThemeData.fallback().color, opacity: iconThemeData.opacity ?? IconThemeData.fallback().opacity )); }
static IconThemeData _getInheritedIconThemeData(BuildContext context) { IconTheme iconTheme = (IconTheme)context.dependOnInheritedWidgetOfExactType <IconTheme>(); return(iconTheme?.data ?? IconThemeData.fallback()); }
public static IconThemeData of(BuildContext context) { IconThemeData iconThemeData = _getInheritedIconThemeData(context); return(iconThemeData.isConcrete ? iconThemeData : IconThemeData.fallback().merge(iconThemeData)); }