static IconThemeData _getInheritedIconThemeData(BuildContext context)
        {
            IconTheme iconTheme = (IconTheme)context.inheritFromWidgetOfExactType(typeof(IconTheme));

            if (iconTheme != null)
            {
                return(iconTheme.data);
            }

            return(IconThemeData.fallback());
        }
示例#2
0
        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
                       ));
        }
示例#3
0
        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));
        }