예제 #1
0
 public _CupertinoSwitchRenderObjectWidget(
     Key key                       = null,
     bool value                    = false,
     Color activeColor             = null,
     Color trackColor              = null,
     ValueChanged <bool> onChanged = null,
     TextDirection?textDirection   = null,
     _CupertinoSwitchState state   = null
     ) : base(key: key)
 {
     this.value         = value;
     this.activeColor   = activeColor;
     this.trackColor    = trackColor;
     this.onChanged     = onChanged;
     this.state         = state;
     this.textDirection = textDirection;
 }
예제 #2
0
 public _RenderCupertinoSwitch(
     bool value,
     Color activeColor,
     Color trackColor              = null,
     TextDirection?textDirection   = null,
     ValueChanged <bool> onChanged = null,
     _CupertinoSwitchState state   = null
     ) : base(additionalConstraints: BoxConstraints.tightFor(
                  width: CupertinoSwitchUtils._kSwitchWidth,
                  height: CupertinoSwitchUtils._kSwitchHeight)
              )
 {
     D.assert(state != null);
     _value         = value;
     _activeColor   = activeColor;
     _trackColor    = trackColor;
     _onChanged     = onChanged;
     _textDirection = textDirection;
     _state         = state;
     state.position.addListener(markNeedsPaint);
     state._reaction.addListener(markNeedsPaint);
 }