Example #1
0
        public static bool reset(BuildContext context)
        {
            _InheritedResetNotifier notifier = context.dependOnInheritedWidgetOfExactType <_InheritedResetNotifier>();

            if (notifier == null)
            {
                return(false);
            }

            return(notifier._sendReset());
        }
Example #2
0
        public static bool shouldReset(BuildContext context)
        {
            InheritedWidget widget = context.dependOnInheritedWidgetOfExactType <_InheritedResetNotifier>();

            if (widget == null)
            {
                return(false);
            }

            _InheritedResetNotifier inheritedNotifier = widget as _InheritedResetNotifier;
            bool wasCalled = inheritedNotifier.notifier._wasCalled;

            inheritedNotifier.notifier._wasCalled = false;
            return(wasCalled);
        }