Ejemplo n.º 1
0
 public _Editable(TextSpan textSpan                  = null, TextEditingValue value          = null,
                  Color cursorColor                  = null, ValueNotifier <bool> showCursor = null, bool hasFocus = false,
                  int?maxLines                       = null, Color selectionColor   = null, float textScaleFactor  = 1.0f,
                  TextDirection?textDirection        = null, bool obscureText       = false, TextAlign textAlign   = TextAlign.left,
                  bool autocorrect                   = false, ViewportOffset offset = null, SelectionChangedHandler onSelectionChanged = null,
                  CaretChangedHandler onCaretChanged = null, bool rendererIgnoresPointer = false,
                  Key key = null) : base(key)
 {
     this.textSpan               = textSpan;
     this.value                  = value;
     this.cursorColor            = cursorColor;
     this.showCursor             = showCursor;
     this.hasFocus               = hasFocus;
     this.maxLines               = maxLines;
     this.selectionColor         = selectionColor;
     this.textScaleFactor        = textScaleFactor;
     this.textAlign              = textAlign;
     this.textDirection          = textDirection;
     this.obscureText            = obscureText;
     this.autocorrect            = autocorrect;
     this.offset                 = offset;
     this.onSelectionChanged     = onSelectionChanged;
     this.onCaretChanged         = onCaretChanged;
     this.rendererIgnoresPointer = rendererIgnoresPointer;
 }
Ejemplo n.º 2
0
 public Viewport(
     Key key = null,
     AxisDirection axisDirection      = AxisDirection.down,
     AxisDirection?crossAxisDirection = null,
     float anchor                      = 0.0f,
     ViewportOffset offset             = null,
     Key center                        = null,
     float?cacheExtent                 = null,
     CacheExtentStyle cacheExtentStyle = CacheExtentStyle.pixel,
     List <Widget> slivers             = null
     ) : base(key: key, children: slivers)
 {
     D.assert(offset != null);
     D.assert(slivers != null);
     D.assert(center == null || LinqUtils <Widget> .WhereList(slivers, ((Widget child) => child.key == center)).Count() == 1);
     D.assert(cacheExtentStyle != null);
     D.assert(cacheExtentStyle != CacheExtentStyle.viewport || cacheExtent != null);
     this.axisDirection      = axisDirection;
     this.crossAxisDirection = crossAxisDirection;
     this.anchor             = anchor;
     this.offset             = offset;
     this.center             = center;
     this.cacheExtent        = cacheExtent;
     this.cacheExtentStyle   = cacheExtentStyle;
 }
Ejemplo n.º 3
0
 public ListWheelViewport(
     Key key                              = null,
     float diameterRatio                  = RenderListWheelViewport.defaultDiameterRatio,
     float perspective                    = RenderListWheelViewport.defaultPerspective,
     float offAxisFraction                = 0.0f,
     bool useMagnifier                    = false,
     float magnification                  = 1.0f,
     float overAndUnderCenterOpacity      = 1.0f,
     float?itemExtent                     = null,
     float squeeze                        = 1.0f,
     bool clipToSize                      = true,
     bool renderChildrenOutsideViewport   = false,
     ViewportOffset offset                = null,
     ListWheelChildDelegate childDelegate = null
     ) : base(key: key)
 {
     D.assert(childDelegate != null);
     D.assert(offset != null);
     D.assert(diameterRatio > 0, () => RenderListWheelViewport.diameterRatioZeroMessage);
     D.assert(perspective > 0);
     D.assert(perspective <= 0.01, () => RenderListWheelViewport.perspectiveTooHighMessage);
     D.assert(overAndUnderCenterOpacity >= 0 && overAndUnderCenterOpacity <= 1);
     D.assert(itemExtent != null);
     D.assert(itemExtent > 0);
     D.assert(
         !renderChildrenOutsideViewport || !clipToSize,
         () => RenderListWheelViewport.clipToSizeAndRenderChildrenOutsideViewportConflict
         );
     this.diameterRatio             = diameterRatio;
     this.perspective               = perspective;
     this.offAxisFraction           = offAxisFraction;
     this.useMagnifier              = useMagnifier;
     this.magnification             = magnification;
     this.overAndUnderCenterOpacity = overAndUnderCenterOpacity;
     this.itemExtent = itemExtent;
     this.squeeze    = squeeze;
     this.clipToSize = clipToSize;
     this.renderChildrenOutsideViewport = renderChildrenOutsideViewport;
     this.offset        = offset;
     this.childDelegate = childDelegate;
 }
Ejemplo n.º 4
0
        public Viewport(
            Key key = null,
            AxisDirection axisDirection      = AxisDirection.down,
            AxisDirection?crossAxisDirection = null,
            float anchor          = 0.0f,
            ViewportOffset offset = null,
            Key center            = null,
            float?cacheExtent     = null,
            List <Widget> slivers = null
            ) : base(key: key, children: slivers)
        {
            D.assert(offset != null);
            D.assert(center == null || this.children.Count(child => child.key == center) == 1);

            this.axisDirection      = axisDirection;
            this.crossAxisDirection = crossAxisDirection;
            this.anchor             = anchor;
            this.offset             = offset;
            this.center             = center;
            this.cacheExtent        = cacheExtent;
        }