Example #1
0
        public static CupertinoThemeData of(BuildContext context)
        {
            _InheritedCupertinoTheme inheritedTheme = context.dependOnInheritedWidgetOfExactType <_InheritedCupertinoTheme>();
            var result = (inheritedTheme?.theme?.data ?? new CupertinoThemeData()).resolveFrom(context, nullOk: true);

            return(result);
        }
Example #2
0
        public static CupertinoThemeData of(BuildContext context)
        {
            _InheritedCupertinoTheme inheritedTheme =
                (_InheritedCupertinoTheme)context.inheritFromWidgetOfExactType(typeof(_InheritedCupertinoTheme));

            return(inheritedTheme?.theme?.data ?? new CupertinoThemeData());
        }
Example #3
0
        public static Brightness?brightnessOf(BuildContext context, bool nullOk = false)
        {
            _InheritedCupertinoTheme inheritedTheme = context.dependOnInheritedWidgetOfExactType <_InheritedCupertinoTheme>();

            return((inheritedTheme?.theme?.data?.brightness) ?? MediaQuery.of(context, nullOk: nullOk)?.platformBrightness);
        }