Example #1
0
 Image _getImage()
 {
     return(this.widget.data == null
         ? CachedNetworkImageProvider.cachedNetworkImage(
                this.widget.isOriginalImage?this.widget.url : CImageUtils.SizeToScreenImageUrl(this.widget.url),
                fit : BoxFit.cover,
                headers : this.widget.headers)
         : Image.memory(bytes: this.widget.data));
 }
Example #2
0
        public override Widget build(BuildContext context)
        {
            Widget result = this.widget.imageData == null
                ? 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
                : Image.memory(this.widget.imageData, fit: BoxFit.contain);

            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);
        }
Example #3
0
        public override Widget build(BuildContext context)
        {
            this._context = context;
            if (!this._isShow)
            {
                return(new MainScreen());
            }

            var topPadding = 0f;

            if (Application.platform != RuntimePlatform.Android)
            {
                topPadding = MediaQuery.of(context).padding.top;
            }

            var    isShowLogo = SplashManager.getSplash().isShowLogo;
            Widget logo       = new Container();

            if (isShowLogo)
            {
                logo = new Positioned(
                    top: topPadding + 24,
                    left: 16,
                    child: new Icon(
                        Icons.LogoWithUinty,
                        size: 35,
                        color: new Color(value: this.hexColor)
                        )
                    );
            }

            return(new Container(
                       color: CColors.White,
                       child: new Stack(
                           children: new List <Widget> {
                new Column(
                    children: new List <Widget> {
                    new GestureDetector(
                        child: new Container(
                            width: MediaQuery.of(context).size.width,
                            height: MediaQuery.of(context).size.height,
                            child: Image.memory(SplashManager.readImage(), fit: BoxFit.cover)
                            ),
                        onTap: pushPage
                        )
                }
                    ),
                new Positioned(
                    top: topPadding + 24,
                    right: 16,
                    child: new GestureDetector(
                        child: new Container(
                            decoration: new BoxDecoration(
                                Color.fromRGBO(0, 0, 0, 0.5f),
                                borderRadius: BorderRadius.all(16)
                                ),
                            width: 65,
                            height: 32,
                            alignment: Alignment.center,
                            child: new Text($"跳过 {this._lastSecond}", style: new TextStyle(
                                                fontSize: 14,
                                                fontFamily: "PingFangSC-Regular",
                                                color: CColors.White
                                                ))
                            ),
                        onTap: pushCallback
                        )
                    ),
                logo
            }
                           )
                       ));
        }
Example #4
0
        public override Widget build(BuildContext context)
        {
            this._context = context;
            if (!this._isShow)
            {
                return(new MainScreen());
            }

            var topPadding = Application.platform != RuntimePlatform.Android
                ? MediaQuery.of(context: context).padding.top
                : 0f;

            var    isShowLogo = SplashManager.getSplash()?.isShowLogo ?? false;
            Widget logoWidget;

            if (isShowLogo)
            {
                logoWidget = new Positioned(
                    top: topPadding + 24,
                    left: 16,
                    child: new Icon(
                        icon: Icons.LogoWithUnity,
                        size: 35,
                        color: new Color(value: this.hexColor)
                        )
                    );
            }
            else
            {
                logoWidget = new Container();
            }

            return(new Container(
                       color: CColors.White,
                       child: new CustomSafeArea(
                           top: false,
                           child: new Stack(
                               children: new List <Widget> {
                new Column(
                    mainAxisAlignment: MainAxisAlignment.end,
                    children: new List <Widget> {
                    new GestureDetector(
                        child: new Container(
                            width: MediaQuery.of(context).size.width,
                            height: MediaQuery.of(context).size.height - 116 -
                            CCommonUtils.getSafeAreaBottomPadding(context: context),
                            child: Image.memory(SplashManager.readImage(), fit: BoxFit.cover)
                            ),
                        onTap: this.pushPage
                        ),
                    new Container(
                        width: 182,
                        height: 32,
                        margin: EdgeInsets.only(top: 36),
                        child: Image.asset("image/iOS/unityConnectBlack.imageset/unityConnectBlack")
                        ),
                    new Container(
                        width: 101,
                        height: 22,
                        margin: EdgeInsets.only(top: 6, bottom: 20),
                        child: Image.asset("image/iOS/madeWithUnity.imageset/madeWithUnity")
                        )
                }
                    ),
                new Positioned(
                    top: topPadding + 24,
                    right: 16,
                    child: new GestureDetector(
                        child: new Container(
                            decoration: new BoxDecoration(
                                Color.fromRGBO(0, 0, 0, 0.5f),
                                borderRadius: BorderRadius.all(16)
                                ),
                            width: 65,
                            height: 32,
                            alignment: Alignment.center,
                            child: new Text($"跳过 {this._lastSecond}", style: new TextStyle(
                                                fontSize: 14,
                                                fontFamily: "Roboto-Regular",
                                                color: CColors.White
                                                ))
                            ),
                        onTap: this.pushCallback
                        )
                    ),
                logoWidget
            }
                               ))
                       ));
        }
Example #5
0
            public override Widget build(BuildContext context)
            {
                Future <byte[]> f         = null;
                var             completer = Completer.create();
                var             isolate   = Isolate.current;
                var             panel     = UIWidgetsPanelWrapper.current.window;

                if (panel.isActive())
                {
                    panel.startCoroutine(_loadCoroutine("https://buljan.rcsdk8.org/sites/main/files/main-images/camera_lense_0.jpeg", completer, isolate));
                    f = completer.future.to <byte[]>().then_ <byte[]>(data => {
                        if (data != null && data.Length > 0)
                        {
                            return(data);
                        }

                        throw new Exception("not loaded");
                    });
                }
                var futureBuilder = new FutureBuilder <byte[]>(
                    future: f,
                    builder: (ctx, snapshot) =>
                {
                    int width   = 200;
                    int height  = 200;
                    Color color = Colors.blue;
                    if (snapshot.connectionState == ConnectionState.done)
                    {
                        return(new Container(alignment: Alignment.center, width: width, height: height, color: color, child: Image.memory(snapshot.data)));
                    }
                    else if (snapshot.connectionState == ConnectionState.waiting)
                    {
                        return(new Container(alignment: Alignment.center, width: width, height: height, color: color, child: new Text("waiting")));
                    }
                    else
                    {
                        return(new Container(alignment: Alignment.center, width: width, height: height, color: color, child: new Text("else")));
                    }
                }
                    );
                var streamBuilder = new StreamBuilder <int>(
                    stream: myStream,
                    initialData: 1,
                    builder: (ctx, snapshot) =>
                {
                    var data = snapshot.data;
                    return(new Container(child: new Text($"stream data: {data}")));
                }
                    );

                return(new Container(
                           color: Colors.blueGrey,
                           child: new Column(
                               children: new List <Widget>
                {
                    streamBuilder,
                    futureBuilder
                }
                               )
                           ));
            }
Example #6
0
        Widget _parseNode(HtmlNode node)
        {
            if (this.customRender != null)
            {
                Widget customWidget = this.customRender(node, this._parseNodeList(node.ChildNodes));
                if (customWidget != null)
                {
                    return(customWidget);
                }
            }

            if (node.NodeType is HtmlNodeType.Element)
            {
                if (!_supportedElements.Contains(node.Name))
                {
                    return(new Container());
                }

                switch (node.Name)
                {
                case "a":
                    return(new GestureDetector(
                               child: DefaultTextStyle.merge(
                                   child: new Wrap(
                                       children: this._parseNodeList(node.ChildNodes)
                                       ),
                                   style: this.linkStyle
                                   ),
                               onTap: () => {
                        if (node.Attributes.Contains("href") && this.onLinkTap != null)
                        {
                            string url = node.Attributes["href"].Value;
                            this.onLinkTap(url);
                        }
                    }));

                case "abbr":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   decoration: TextDecoration.underline,
                                   decorationStyle: TextDecorationStyle.solid
                                   )
                               ));

                case "acronym":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   decoration: TextDecoration.underline,
                                   decorationStyle: TextDecorationStyle.solid
                                   )
                               ));

                case "address":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontStyle: FontStyle.italic
                                   )
                               ));

                case "article":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "aside":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "b":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "bdi":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "bdo":
                    if (node.Attributes["dir"] != null)
                    {
                        return(new Directionality(
                                   child: new Wrap(
                                       children: this._parseNodeList(node.ChildNodes)
                                       ),
                                   textDirection: node.Attributes["dir"].Value == "rtl"
                                    ? TextDirection.rtl
                                    : TextDirection.ltr
                                   ));
                    }

                    //Direction attribute is required, just render the text normally now.
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "big":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontSize: 20.0f
                                   )
                               ));

                case "blockquote":
                    return(new Padding(
                               padding:
                               EdgeInsets.fromLTRB(40.0f, this.blockSpacing, 40.0f, this.blockSpacing),
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   )
                               ));

                case "body":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "br":
                    if (this._isNotFirstBreakTag(node))
                    {
                        return(new Container(width: this.width, height: this.blockSpacing));
                    }

                    return(new Container(width: this.width));

                case "caption":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   alignment: WrapAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "center":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes),
                                   alignment: WrapAlignment.center
                                   )));

                case "cite":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontStyle: FontStyle.italic
                                   )
                               ));

                case "code":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontFamily: "monospace"
                                   )
                               ));

                case "data":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "dd":
                    return(new Padding(
                               padding: EdgeInsets.only(left: 40.0f),
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   )));

                case "del":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   decoration: TextDecoration.lineThrough
                                   )
                               ));

                case "dfn":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontStyle: FontStyle.italic
                                   )
                               ));

                case "div":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "dl":
                    return(new Padding(
                               padding: EdgeInsets.only(top: this.blockSpacing, bottom: this.blockSpacing),
                               child: new Column(
                                   children: this._parseNodeList(node.ChildNodes),
                                   crossAxisAlignment: CrossAxisAlignment.start
                                   )));

                case "dt":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "em":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontStyle: FontStyle.italic
                                   )
                               ));

                case "figcaption":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "figure":
                    return(new Padding(
                               padding:
                               EdgeInsets.fromLTRB(40.0f, this.blockSpacing, 40.0f, this.blockSpacing),
                               child: new Column(
                                   children: this._parseNodeList(node.ChildNodes),
                                   crossAxisAlignment: CrossAxisAlignment.center
                                   )));

                case "font":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "footer":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "h1":
                    return(DefaultTextStyle.merge(
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   ),
                               style: new TextStyle(
                                   fontSize: 28.0f,
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "h2":
                    return(DefaultTextStyle.merge(
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   ),
                               style: new TextStyle(
                                   fontSize: 21.0f,
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "h3":
                    return(DefaultTextStyle.merge(
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   ),
                               style: new TextStyle(
                                   fontSize: 16.0f,
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "h4":
                    return(DefaultTextStyle.merge(
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   ),
                               style: new TextStyle(
                                   fontSize: 14.0f,
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "h5":
                    return(DefaultTextStyle.merge(
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   ),
                               style: new TextStyle(
                                   fontSize: 12.0f,
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "h6":
                    return(DefaultTextStyle.merge(
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   ),
                               style: new TextStyle(
                                   fontSize: 10.0f,
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "header":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "hr":
                    return(new Padding(
                               padding: EdgeInsets.only(top: 7.0f, bottom: 7.0f),
                               child: new Divider(height: 1.0f, color: Colors.black38)
                               ));

                case "i":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontStyle: FontStyle.italic
                                   )
                               ));

                case "img":
                    return(new Builder(
                               builder: (BuildContext context) => {
                        if (this.showImages)
                        {
                            if (node.Attributes["src"] != null)
                            {
                                if (node.Attributes["src"].Value.StartsWith("data:image") &&
                                    node.Attributes["src"].Value.Contains("base64,"))
                                {
                                    return Image.memory(Convert.FromBase64String(
                                                            node.Attributes["src"].Value.Split(new string[] { "base64," },
                                                                                               StringSplitOptions.None)[1].Trim()));
                                }

                                return Image.network(node.Attributes["src"].Value);
                            }
                            else if (node.Attributes["alt"] != null)
                            {
                                //Temp fix for https://github.com/flutter/flutter/issues/736
                                if (node.Attributes["alt"].Value.EndsWith(" "))
                                {
                                    return new Container(
                                        padding: EdgeInsets.only(right: 2.0f),
                                        child: new Text(node.Attributes["alt"].Value));
                                }
                                else
                                {
                                    return new Text(node.Attributes["alt"].Value);
                                }
                            }
                        }

                        return new Container();
                    }
                               ));

                case "ins":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   decoration: TextDecoration.underline
                                   )
                               ));

                case "kbd":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontFamily: "monospace"
                                   )
                               ));

                case "li":
                    string     type        = node.ParentNode.Name; // Parent type; usually ol or ul
                    EdgeInsets markPadding = EdgeInsets.symmetric(horizontal: 4.0f);
                    Widget     mark;
                    switch (type)
                    {
                    case "ul":
                        mark = new Container(child: new Text("•"), padding: markPadding);
                        break;

                    case "ol":
                        int index = node.ParentNode.ChildNodes.IndexOf(node) + 1;
                        mark = new Container(child: new Text($"{index}."), padding: markPadding);
                        break;

                    default:         //Fallback to middle dot
                        mark = new Container(width: 0.0f, height: 0.0f);
                        break;
                    }

                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: new List <Widget> {
                        mark,
                        new Wrap(
                            crossAxisAlignment: WrapCrossAlignment.center,
                            children: this._parseNodeList(node.ChildNodes))
                    }
                                   )
                               ));

                case "main":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "mark":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   color: Colors.black,
                                   background: this._getPaint(Colors.yellow)
                                   )
                               ));

                case "nav":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "noscript":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   alignment: WrapAlignment.start,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "ol":
                    return(new Column(
                               children: this._parseNodeList(node.ChildNodes),
                               crossAxisAlignment: CrossAxisAlignment.start
                               ));

                case "p":
                    return(new Padding(
                               padding: EdgeInsets.only(top: this.blockSpacing, bottom: this.blockSpacing),
                               child: new Container(
                                   width: this.width,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       alignment: WrapAlignment.start,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   )
                               ));

                case "pre":
                    return(new Padding(
                               padding: EdgeInsets.all(this.blockSpacing),
                               child: DefaultTextStyle.merge(
                                   child: new Text(node.InnerHtml),
                                   style: new TextStyle(
                                       fontFamily: "monospace"
                                       )
                                   )
                               ));

                case "q":
                    List <Widget> children = new List <Widget>();
                    children.Add(new Text("\""));
                    children.AddRange(this._parseNodeList(node.ChildNodes));
                    children.Add(new Text("\""));
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: children
                                   ),
                               style: new TextStyle(
                                   fontStyle: FontStyle.italic
                                   )
                               ));

                case "rp":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "rt":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "ruby":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "s":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   decoration: TextDecoration.lineThrough
                                   )
                               ));

                case "samp":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontFamily: "monospace"
                                   )
                               ));

                case "section":
                    return(new Container(
                               width: this.width,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "small":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontSize: 10.0f
                                   )
                               ));

                case "span":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "strike":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   decoration: TextDecoration.lineThrough
                                   )
                               ));

                case "strong":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "sub":
                case "sup":
                    //Use builder to capture the parent font to inherit the font styles
                    return(new Builder(builder: (BuildContext context) => {
                        DefaultTextStyle parent = DefaultTextStyle.of(context);
                        TextStyle parentStyle = parent.style;

                        var painter = new TextPainter(
                            text: new TextSpan(
                                text: node.InnerText,
                                style: parentStyle
                                ),
                            textDirection: TextDirection.ltr);
                        painter.layout();
                        //print(painter.size);

                        //Get the height from the default text
                        var height = painter.size.height *
                                     1.35f;     //compute a higher height for the text to increase the offset of the Positioned text

                        painter = new TextPainter(
                            text: new TextSpan(
                                text: node.InnerText,
                                style: parentStyle.merge(new TextStyle(
                                                             fontSize:
                                                             parentStyle.fontSize * RichTextParserUtils.OFFSET_TAGS_FONT_SIZE_FACTOR))
                                ),
                            textDirection: TextDirection.ltr);
                        painter.layout();
                        //print(painter.size);

                        //Get the width from the reduced/positioned text
                        var width = painter.size.width;

                        //print("Width: $width, Height: $height");

                        return DefaultTextStyle.merge(
                            child: new Wrap(
                                crossAxisAlignment: WrapCrossAlignment.center,
                                children: new List <Widget> {
                            new Stack(
                                fit: StackFit.loose,
                                children: new List <Widget> {
                                //The Stack needs a non-positioned object for the next widget to respect the space so we create
                                //a sized box to fill the required space
                                new SizedBox(
                                    width: width,
                                    height: height
                                    ),
                                DefaultTextStyle.merge(
                                    child: new Positioned(
                                        child: new Wrap(children: this._parseNodeList(node.ChildNodes)),
                                        bottom: node.Name == "sub" ? 0 : (int?)null,
                                        top: node.Name == "sub" ? (int?)null : 0
                                        ),
                                    style: new TextStyle(
                                        fontSize: parentStyle.fontSize *
                                        RichTextParserUtils.OFFSET_TAGS_FONT_SIZE_FACTOR)
                                    )
                            }
                                )
                        }
                                )
                            );
                    }));

                case "table":
                    return(new Column(
                               children: this._parseNodeList(node.ChildNodes),
                               crossAxisAlignment: CrossAxisAlignment.start
                               ));

                case "tbody":
                    return(new Column(
                               children: this._parseNodeList(node.ChildNodes),
                               crossAxisAlignment: CrossAxisAlignment.start
                               ));

                case "td":
                    int colspan = 1;
                    if (node.Attributes["colspan"] != null)
                    {
                        int.TryParse(node.Attributes["colspan"].Value, out colspan);
                    }

                    return(new Expanded(
                               flex: colspan,
                               child: new Wrap(
                                   crossAxisAlignment: WrapCrossAlignment.center,
                                   children: this._parseNodeList(node.ChildNodes)
                                   )
                               ));

                case "template":
                    //Not usually displayed in HTML
                    return(new Container());

                case "tfoot":
                    return(new Column(
                               children: this._parseNodeList(node.ChildNodes),
                               crossAxisAlignment: CrossAxisAlignment.start
                               ));

                case "th":
                    int _colspan = 1;
                    if (node.Attributes["colspan"] != null)
                    {
                        int.TryParse(node.Attributes["colspan"].Value, out _colspan);
                    }

                    return(DefaultTextStyle.merge(
                               child: new Expanded(
                                   flex: _colspan,
                                   child: new Wrap(
                                       crossAxisAlignment: WrapCrossAlignment.center,
                                       alignment: WrapAlignment.center,
                                       children: this._parseNodeList(node.ChildNodes)
                                       )
                                   ),
                               style: new TextStyle(
                                   fontWeight: FontWeight.bold
                                   )
                               ));

                case "thead":
                    return(new Column(
                               children: this._parseNodeList(node.ChildNodes),
                               crossAxisAlignment: CrossAxisAlignment.start
                               ));

                case "time":
                    return(new Wrap(
                               children: this._parseNodeList(node.ChildNodes)
                               ));

                case "tr":
                    return(new Row(
                               children: this._parseNodeList(node.ChildNodes),
                               crossAxisAlignment: CrossAxisAlignment.center
                               ));

                case "tt":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontFamily: "monospace"
                                   )
                               ));

                case "u":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   decoration: TextDecoration.underline
                                   )
                               ));

                case "ul":
                    return(new Column(
                               children: this._parseNodeList(node.ChildNodes),
                               crossAxisAlignment: CrossAxisAlignment.start
                               ));

                case "var":
                    return(DefaultTextStyle.merge(
                               child: new Wrap(
                                   children: this._parseNodeList(node.ChildNodes)
                                   ),
                               style: new TextStyle(
                                   fontStyle: FontStyle.italic
                                   )
                               ));
                }
            }
            else if (node.NodeType is HtmlNodeType.Text)
            {
                //We don't need to worry about rendering extra whitespace
                if (node.InnerText.Trim() == "" && node.InnerText.IndexOf(" ") == -1)
                {
                    return(new Wrap());
                }

                if (node.InnerText.Trim() == "" && node.InnerText.IndexOf(" ") != -1)
                {
                    (node as HtmlTextNode).Text = " ";
                }

                string finalText = this.trimStringHtml(node.InnerText);
                //Temp fix for https://github.com/flutter/flutter/issues/736
                if (finalText.EndsWith(" "))
                {
                    return(new Container(
                               padding: EdgeInsets.only(right: 2.0f), child: new Text(finalText)));
                }
                else
                {
                    return(new Text(finalText));
                }
            }

            return(new Wrap());
        }