Exemplo n.º 1
0
        public override bool updateShouldNotify(InheritedWidget old)
        {
            _TabControllerScope _old = (_TabControllerScope)old;

            return(enabled != _old.enabled ||
                   controller != _old.controller);
        }
Exemplo n.º 2
0
        public override bool updateShouldNotify(InheritedWidget oldWidgetRaw)
        {
            var oldWidget = (ScrollConfiguration)oldWidgetRaw;

            D.assert(this.behavior != null);
            return(this.behavior.GetType() != oldWidget.behavior.GetType() ||
                   this.behavior != oldWidget.behavior && this.behavior.shouldNotify(oldWidget.behavior));
        }
Exemplo n.º 3
0
        public override bool updateShouldNotify(InheritedWidget oldWidget)
        {
            FlexibleSpaceBarSettings _oldWidget = (FlexibleSpaceBarSettings)oldWidget;

            return(toolbarOpacity != _oldWidget.toolbarOpacity ||
                   minExtent != _oldWidget.minExtent ||
                   maxExtent != _oldWidget.maxExtent ||
                   currentExtent != _oldWidget.currentExtent);
        }
Exemplo n.º 4
0
        public override bool updateShouldNotify(InheritedWidget w)
        {
            var oldWidget = (DefaultTextStyle)w;

            return(this.style != oldWidget.style ||
                   this.textAlign != oldWidget.textAlign ||
                   this.softWrap != oldWidget.softWrap ||
                   this.overflow != oldWidget.overflow ||
                   this.maxLines != oldWidget.maxLines);
        }
Exemplo n.º 5
0
        public override bool updateShouldNotify(InheritedWidget oldWidget)
        {
            ListTileTheme _oldWidget = (ListTileTheme)oldWidget;

            return(this.dense != _oldWidget.dense ||
                   this.style != _oldWidget.style ||
                   this.selectedColor != _oldWidget.selectedColor ||
                   this.iconColor != _oldWidget.iconColor ||
                   this.textColor != _oldWidget.textColor ||
                   this.contentPadding != _oldWidget.contentPadding);
        }
Exemplo n.º 6
0
        public override bool updateShouldNotify(InheritedWidget oldWidget)
        {
            DefaultTextStyle _oldWidget = (DefaultTextStyle)oldWidget;

            return(style != _oldWidget.style ||
                   textAlign != _oldWidget.textAlign ||
                   softWrap != _oldWidget.softWrap ||
                   overflow != _oldWidget.overflow ||
                   maxLines != _oldWidget.maxLines ||
                   textWidthBasis != _oldWidget.textWidthBasis ||
                   textHeightBehavior != _oldWidget.textHeightBehavior);
        }
Exemplo n.º 7
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);
        }
        public async Task from_instance_method_in_derived_class_show_correct_CallingType()
        {
            var entries = new List<LogEntry>();

            using (Log.Events().Subscribe(entries.Add))
            {
                var widget = new InheritedWidget();
                await widget.DoStuffAsync();
            }

            Assert.That(entries.Single(e => e.EventType == TraceEventType.Start).CallingType,
                        Is.EqualTo(typeof (InheritedWidget)));
            Assert.That(entries.Single(e => e.EventType == TraceEventType.Stop).CallingType,
                        Is.EqualTo(typeof (InheritedWidget)));
        }
        public void from_instance_method_in_derived_class_show_correct_CallingMethod()
        {
            var entries = new List<LogEntry>();

            using (Log.Events().Subscribe(entries.Add))
            {
                var widget = new InheritedWidget();
                widget.DoStuff();
            }

            Assert.That(entries.Single(e => e.EventType == TraceEventType.Start).CallingMethod,
                        Is.EqualTo("DoStuff"));

            Assert.That(entries.Single(e => e.EventType == TraceEventType.Stop).CallingMethod,
                        Is.EqualTo("DoStuff"));
        }
Exemplo n.º 10
0
        public override bool updateShouldNotify(InheritedWidget oldWidget)
        {
            oldWidget = (Actions)oldWidget;
            var  dispatcherBool = ((Actions)oldWidget).dispatcher != dispatcher;
            bool actionBool     = ((Actions)oldWidget).actions == actions;

            foreach (var actionsKey in ((Actions)oldWidget).actions.Keys)
            {
                if (!actions.ContainsKey(actionsKey) ||
                    actions[actionsKey] != ((Actions)oldWidget).actions[actionsKey])
                {
                    actionBool = false;
                }
            }

            return(dispatcherBool || actionBool);
        }
Exemplo n.º 11
0
            public void ToDisplayString_uses_actual_type_formatter_and_not_compiled_type()
            {
                Widget widget = new InheritedWidget();
                var    widgetFormatterCalled          = false;
                var    inheritedWidgetFormatterCalled = false;

                Formatter.Register <Widget>(w =>
                {
                    widgetFormatterCalled = true;
                    return("");
                });
                Formatter.Register <InheritedWidget>(w =>
                {
                    inheritedWidgetFormatterCalled = true;
                    return("");
                });

                widget.ToDisplayString();

                widgetFormatterCalled.Should().BeFalse();
                inheritedWidgetFormatterCalled.Should().BeTrue();
            }
Exemplo n.º 12
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     oldWidget = (_EffectiveTickerMode)oldWidget;
     return(enabled != ((_EffectiveTickerMode)oldWidget).enabled);
 }
Exemplo n.º 13
0
        public override bool updateShouldNotify(InheritedWidget oldWidget)
        {
            var _oldWidget = (_InheritedModel <T>)oldWidget;

            return(_oldWidget.version != version);
        }
Exemplo n.º 14
0
 public override bool updateShouldNotify(InheritedWidget oldWidget) =>
 oldWidget is PopupMenuTheme popupMenuTheme && data != popupMenuTheme.data;
Exemplo n.º 15
0
 public override bool updateShouldNotify(InheritedWidget oldWidget) => false;
Exemplo n.º 16
0
 public override bool updateShouldNotify(InheritedWidget oldWidgetRaw)
 {
     return(true);
 }
Exemplo n.º 17
0
 public override bool updateShouldNotify(InheritedWidget old)
 {
     return(this.typeToResources != ((_LocalizationsScope)old).typeToResources);
 }
Exemplo n.º 18
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     D.assert(this.window == ((WindowProvider)oldWidget).window);
     return(false);
 }
Exemplo n.º 19
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return this.enabled != ((TickerMode) oldWidget).enabled;
 }
Exemplo n.º 20
0
 public override bool updateShouldNotify(InheritedWidget old)
 {
     return(position != ((_ScrollableScope)old).position);
 }
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     oldWidget = (InheritedNotifier <T>)oldWidget;
     return(ReferenceEquals(oldWidget, notifier));
 }
Exemplo n.º 22
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return(this.data != ((MediaQuery)oldWidget).data);
 }
Exemplo n.º 23
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return(data != ((IconTheme)oldWidget).data);
 }
Exemplo n.º 24
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     D.assert(oldWidget is ToggleButtonsTheme);
     return(data != ((ToggleButtonsTheme)oldWidget).data);
 }
Exemplo n.º 25
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return(oldWidget is ButtonBarTheme buttonBarTheme && !data.Equals(buttonBarTheme.data));
 }
Exemplo n.º 26
0
 public override bool updateShouldNotify(InheritedWidget old)
 {
     return(!Equals(this._store, ((StoreProvider <State>)old)._store));
 }
Exemplo n.º 27
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return(false);
 }
Exemplo n.º 28
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     oldWidget = (CupertinoUserInterfaceLevel)oldWidget;
     return(((CupertinoUserInterfaceLevel)oldWidget)._data != _data);
 }
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return(this.controller != ((PrimaryScrollController)oldWidget).controller);
 }
Exemplo n.º 30
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return(this.isCurrent != ((_ModalScopeStatus)oldWidget).isCurrent ||
            this.canPop != ((_ModalScopeStatus)oldWidget).canPop ||
            this.route != ((_ModalScopeStatus)oldWidget).route);
 }
Exemplo n.º 31
0
 public override bool updateShouldNotify(InheritedWidget old)
 {
     return(theme.data != ((_InheritedCupertinoTheme)old).theme.data);
 }
Exemplo n.º 32
0
 public override bool updateShouldNotify(InheritedWidget oldWidget)
 {
     return(this.node != ((_FocusScopeMarker)oldWidget).node);
 }
Exemplo n.º 33
0
        public void Parameter_logging_can_be_disabled_per_class()
        {
            var log = new StringWriter();

            Extension<Boundaries>.DisableFor<InheritedWidget>();
            using (Log.Events().Subscribe(e => log.Write(e.ToLogString())))
            {
                var w = new Widget();
                var iw = new InheritedWidget();
                w.DoStuff("should be in log");
                iw.DoStuff("should not be in log");
            }

            StringAssert.Contains("should be in log", log.ToString());
            StringAssert.DoesNotContain("should not be in log", log.ToString());
        }
Exemplo n.º 34
0
        public void ToLogString_uses_actual_type_formatter_and_not_compiled_type()
        {
            Widget widget = new InheritedWidget();
            bool widgetFormatterCalled = false;
            bool inheritedWidgetFormatterCalled = false;

            Formatter<Widget>.Register(w =>
            {
                widgetFormatterCalled = true;
                return "";
            });
            Formatter<InheritedWidget>.Register(w =>
            {
                inheritedWidgetFormatterCalled = true;
                return "";
            });

            widget.ToLogString();

            Assert.That(!widgetFormatterCalled);
            Assert.That(inheritedWidgetFormatterCalled);
        }