Beispiel #1
0
        public override Widget build(BuildContext context)
        {
            Widget result = this.widget.useCachedNetworkImage
                ? new CachedNetworkImage(
                src: this.widget.url,
                placeholder: this.widget.placeholder,
                fit: BoxFit.contain,
                headers: this.widget.headers,
                onImageResolved: this._onImageResolved)
                : this._imageInfo != null
                    ? new RawImage(image: this._imageInfo.image, fit: BoxFit.contain)
                    : this.widget.placeholder;

            result = new ScaleTransition(
                scale: this._scaleAnimation, child: result);

            result = new FractionalTranslation(
                translation: this._position,
                child: result);

            result = new GestureDetector(
                onScaleStart: this._onScaleStart,
                onScaleUpdate: this._onScaleUpdate,
                onScaleEnd: this._onScaleEnd,
                onDoubleTap: this._onDoubleTap,
                child: result);

            result = new Hero(
                tag: this.widget.url,
                flightShuttleBuilder: (_1, _2, _3, _4, _5) => { return(result); },
                child: result);

            return(result);
        }
Beispiel #2
0
        public override Widget build(BuildContext context)
        {
            List <Widget> popupLikeButtons = new List <Widget>();

            for (int i = 0; i < this.widget.popupLikeButtonData.Count; i++)
            {
                var popupLikeButtonItem = this.widget.popupLikeButtonData[i];
                popupLikeButtons.Add(this._buildPopupLikeButton(
                                         popupLikeButtonItem.content,
                                         popupLikeButtonItem.selected,
                                         i == 0,
                                         i == this.widget.popupLikeButtonData.Count - 1,
                                         () => { this.widget.onTap(popupLikeButtonItem.type); }
                                         ));
            }
            Widget result = new Container(
                height: 52,
                decoration: new BoxDecoration(
                    borderRadius: BorderRadius.all(26),
                    color: CColors.White
                    ),
                child: new Container(
                    decoration: new BoxDecoration(
                        borderRadius: BorderRadius.all(26),
                        color: CColors.White.withOpacity(0.25f)
                        ),
                    padding: EdgeInsets.symmetric(4, 12),
                    child: new Row(
                        mainAxisSize: MainAxisSize.min,
                        children: popupLikeButtons))
                );

            // These two fractional translation exist to make the size animation
            // pivoted at the center
            result = new FractionalTranslation(
                translation: new Offset(0.5f, 0.5f),
                child: new Transform(
                    transform: Matrix3.makeScale(this._barSize.value),
                    child: new FractionalTranslation(
                        translation: new Offset(-0.5f, -0.5f),
                        child: result
                        )
                    )
                );
            return(result);
        }