Пример #1
0
        public _RenderSlider(
            float?value   = null,
            int?divisions = null,
            string label  = null,
            SliderThemeData sliderTheme        = null,
            MediaQueryData mediaQueryData      = null,
            RuntimePlatform?platform           = null,
            ValueChanged <float> onChanged     = null,
            ValueChanged <float> onChangeStart = null,
            ValueChanged <float> onChangeEnd   = null,
            _SliderState state          = null,
            TextDirection?textDirection = null
            )
        {
            D.assert(value != null && value >= 0.0 && value <= 1.0);
            D.assert(state != null);
            D.assert(textDirection != null);

            this.onChangeStart = onChangeStart;
            this.onChangeEnd   = onChangeEnd;
            _platform          = platform;
            _label             = label;
            _value             = value.Value;
            _divisions         = divisions;
            _sliderTheme       = sliderTheme;
            _mediaQueryData    = mediaQueryData;
            _onChanged         = onChanged;
            _state             = state;
            _textDirection     = textDirection.Value;

            _updateLabelPainter();
            GestureArenaTeam team = new GestureArenaTeam();

            _drag = new HorizontalDragGestureRecognizer {
                team     = team,
                onStart  = _handleDragStart,
                onUpdate = _handleDragUpdate,
                onEnd    = _handleDragEnd,
                onCancel = _endInteraction
            };

            _tap = new TapGestureRecognizer {
                team        = team,
                onTapDown   = _handleTapDown,
                onTapUp     = _handleTapUp,
                onTapCancel = _endInteraction
            };

            _overlayAnimation = new CurvedAnimation(
                parent: _state.overlayController,
                curve: Curves.fastOutSlowIn);

            _valueIndicatorAnimation = new CurvedAnimation(
                parent: _state.valueIndicatorController,
                curve: Curves.fastOutSlowIn);

            _enableAnimation = new CurvedAnimation(
                parent: _state.enableController,
                curve: Curves.easeInOut);
        }
Пример #2
0
 public _SliderRenderObjectWidget(
     Key key       = null,
     float?value   = null,
     int?divisions = null,
     string label  = null,
     SliderThemeData sliderTheme        = null,
     MediaQueryData mediaQueryData      = null,
     ValueChanged <float> onChanged     = null,
     ValueChanged <float> onChangeStart = null,
     ValueChanged <float> onChangeEnd   = null,
     _SliderState state = null
     ) : base(key: key)
 {
     this.value          = value.Value;
     this.divisions      = divisions;
     this.label          = label;
     this.sliderTheme    = sliderTheme;
     this.mediaQueryData = mediaQueryData;
     this.onChanged      = onChanged;
     this.onChangeStart  = onChangeStart;
     this.onChangeEnd    = onChangeEnd;
     this.state          = state;
 }