Example #1
0
        float _pointerSignalEventDelta(PointerScrollEvent evt)
        {
            float delta = widget.axis == Axis.horizontal
                ? evt.scrollDelta.dx
                : evt.scrollDelta.dy;

            if (AxisUtils.axisDirectionIsReversed(widget.axisDirection))
            {
                delta *= -1;
            }
            return(delta);
        }
Example #2
0
        float _targetScrollOffsetForPointerScroll(PointerScrollEvent e)
        {
            float delta = widget.axis == Axis.horizontal
                ? e.scrollDelta.dx
                : e.scrollDelta.dy;

            if (AxisUtils.axisDirectionIsReversed(widget.axisDirection))
            {
                delta *= -1;
            }

            return(Mathf.Min(Mathf.Max(position.pixels + delta, position.minScrollExtent),
                             position.maxScrollExtent));
        }
Example #3
0
        public override SliverGridLayout getLayout(SliverConstraints constraints)
        {
            float tileWidth =
                (constraints.crossAxisExtent -
                 (material_._yearPickerColumnCount - 1) * material_._yearPickerRowSpacing) /
                material_._yearPickerColumnCount;

            return(new SliverGridRegularTileLayout(
                       childCrossAxisExtent: tileWidth,
                       childMainAxisExtent: material_._yearPickerRowHeight,
                       crossAxisCount: material_._yearPickerColumnCount,
                       crossAxisStride: tileWidth + material_._yearPickerRowSpacing,
                       mainAxisStride: material_._yearPickerRowHeight,
                       reverseCrossAxis: AxisUtils.axisDirectionIsReversed(constraints.crossAxisDirection)
                       ));
        }
Example #4
0
        public override SliverGridLayout getLayout(SliverConstraints constraints)
        {
            const int columnCount = daysPerWeek;
            float     tileWidth   = constraints.crossAxisExtent / columnCount;
            float     tileHeight  = Mathf.Min(material_._dayPickerRowHeight,
                                              constraints.viewportMainAxisExtent / material_._maxDayPickerRowCount);

            return(new SliverGridRegularTileLayout(
                       childCrossAxisExtent: tileWidth,
                       childMainAxisExtent: tileHeight,
                       crossAxisCount: columnCount,
                       crossAxisStride: tileWidth,
                       mainAxisStride: tileHeight,
                       reverseCrossAxis: AxisUtils.axisDirectionIsReversed(constraints.crossAxisDirection)
                       ));
        }
        public override SliverGridLayout getLayout(SliverConstraints constraints)
        {
            D.assert(this._debugAssertIsValid());
            float usableCrossAxisExtent =
                constraints.crossAxisExtent - this.crossAxisSpacing * (this.crossAxisCount - 1);
            float childCrossAxisExtent = usableCrossAxisExtent / this.crossAxisCount;
            float childMainAxisExtent  = childCrossAxisExtent / this.childAspectRatio;

            return(new SliverGridRegularTileLayout(
                       crossAxisCount: this.crossAxisCount,
                       mainAxisStride: childMainAxisExtent + this.mainAxisSpacing,
                       crossAxisStride: childCrossAxisExtent + this.crossAxisSpacing,
                       childMainAxisExtent: childMainAxisExtent,
                       childCrossAxisExtent: childCrossAxisExtent,
                       reverseCrossAxis: AxisUtils.axisDirectionIsReversed(constraints.crossAxisDirection)
                       ));
        }
Example #6
0
        public override SliverGridLayout getLayout(SliverConstraints constraints)
        {
            const int columnCount = 7; // DateTime.daysPerWeek = 7
            float     tileWidth   = constraints.crossAxisExtent / columnCount;
            float     tileHeight  = Mathf.Min(
                DatePickerUtils._kDayPickerRowHeight,
                constraints.viewportMainAxisExtent / (DatePickerUtils._kMaxDayPickerRowCount + 1)
                );

            return(new SliverGridRegularTileLayout(
                       crossAxisCount: columnCount,
                       mainAxisStride: tileHeight,
                       crossAxisStride: tileWidth,
                       childMainAxisExtent: tileHeight,
                       childCrossAxisExtent: tileWidth,
                       reverseCrossAxis: AxisUtils.axisDirectionIsReversed(constraints.crossAxisDirection)
                       ));
        }