Пример #1
0
        public override void didUpdateWidget(StatefulWidget oldWidget)
        {
            base.didUpdateWidget(oldWidget);
            TabBar _oldWidget = (TabBar)oldWidget;

            if (this.widget.controller != _oldWidget.controller)
            {
                this._updateTabController();
                this._initIndicatorPainter();
            }
            else if (this.widget.indicatorColor != _oldWidget.indicatorColor ||
                     this.widget.indicatorWeight != _oldWidget.indicatorWeight ||
                     this.widget.indicatorSize != _oldWidget.indicatorSize ||
                     this.widget.indicator != _oldWidget.indicator)
            {
                this._initIndicatorPainter();
            }

            if (this.widget.tabs.Count > _oldWidget.tabs.Count)
            {
                int delta = this.widget.tabs.Count - _oldWidget.tabs.Count;
                for (int i = 0; i < delta; i++)
                {
                    this._tabKeys.Add(GlobalKey.key());
                }
            }
            else if (this.widget.tabs.Count < _oldWidget.tabs.Count)
            {
                int delta = _oldWidget.tabs.Count - this.widget.tabs.Count;
                this._tabKeys.RemoveRange(this.widget.tabs.Count, delta);
            }
        }
Пример #2
0
 public override void initState()
 {
     base.initState();
     this._textFieldKey = (GlobalKey)this.widget.textFieldKey ?? GlobalKey.key("textFieldKey");
     this._controller   = this.widget.controller ?? new TextEditingController("");
     this._focusNode    = this.widget.focusNode ?? new FocusNode();
     this._controller.addListener(this._onTextChanged);
 }
Пример #3
0
 public override void initState()
 {
     base.initState();
     this._tabKeys = new List <GlobalKey>();
     foreach (Widget tab in this.widget.tabs)
     {
         this._tabKeys.Add(GlobalKey.key());
     }
 }
Пример #4
0
 public override void initState()
 {
     base.initState();
     _keys = new List <GlobalKey>();
     for (int i = 0; i < widget.steps.Count; i++)
     {
         _keys.Add(GlobalKey.key());
         _oldStates[i] = widget.steps[i].state;
     }
 }
Пример #5
0
 void _attachRootWidget(Widget widget)
 {
     this.windowAdapter.attachRootWidget(() => new WidgetsApp(
                                             home: widget,
                                             navigatorKey: GlobalKey <NavigatorState> .key(),
                                             pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                                             new PageRouteBuilder(
                                                 settings: settings,
                                                 pageBuilder: (BuildContext context, Animation <float> animation,
                                                               Animation <float> secondaryAnimation) => builder(context)
                                                 )));
 }
Пример #6
0
        public override void initState()
        {
            base.initState();
            StatusBarManager.statusBarStyle(false);
            this._scrollController    = new ScrollController();
            this._contentFocusNodeKey = GlobalKey.key("_contentFocusNodeKey");
            this._nameFocusNodeKey    = GlobalKey.key("_nameFocusNodeKey");
            this._contactFocusNodeKey = GlobalKey.key("_contactFocusNodeKey");

            this._contentFocusNode.addListener(this._contentFocusNodeListener);
            this._nameFocusNode.addListener(this._nameFocusNodeListener);
            this._contactFocusNode.addListener(this._contactFocusNodeListener);
        }
 public override void initState()
 {
     base.initState();
     this.scaffoldKey = GlobalKey <ScaffoldState> .key(debugLabel : $"Shrine Order {this.widget.order}");
 }