Beispiel #1
0
        public Widget BulidTopSwiper(List <string> urls)
        {
            List <Widget> children = new List <Widget>();

            foreach (var item in urls)
            {
                Widget it = Image.network(item, fit: BoxFit.fill);
                children.Add(it);
            }
            TransformerPageController controller = new TransformerPageController(initialPage: 0, itemCount: urls.Count);

            return(new Container(
                       height: 270,
                       width: 375,
                       child: new Stack(

                           children: new List <Widget> {
                TransformerPageView.children(index: 0,
                                             children: children, pageController: controller
                                             ),
                new Align(
                    alignment: Alignment.bottomCenter,
                    child: new Padding(
                        padding: EdgeInsets.only(bottom: 20),
                        child: new PageIndicator(layout: PageIndicatorLayout.WARM, size: 7, activeSize: 7, controller: controller, space: 5.0f, count: urls.Count
                                                 , color: new Unity.UIWidgets.ui.Color(0xFFEAEAEA), activeColor: new Unity.UIWidgets.ui.Color(0xFF404759))

                        )
                    )
            }
                           )
                       ));
        }
Beispiel #2
0
        public override Widget build(BuildContext context)
        {
            var children = new List <Widget> {
                new Container(
                    width: 1080,
                    height: 800,
                    color: Colors.red
                    ),
                new Container(
                    width: 1080,
                    height: 800,
                    color: Colors.green
                    ),
                new Container(
                    width: 1080,
                    height: 800,
                    color: Colors.blueAccent
                    ),
                new Container(
                    width: 1080,
                    height: 800,
                    color: Colors.grey
                    )
            };

            return(new Scaffold(
                       appBar: new AppBar(
                           title: new Text(widget.title)
                           ),
                       body: new Column(
                           children: new List <Widget> {
                new Row(
                    children: new List <Widget> {
                    new Checkbox(
                        value: loop,
                        onChanged: (va) => {
                        setState(() => {
                            if (va == true)
                            {
                                //controller = new TransformerPageController(itemCount:4,loop:true);
                            }
                            else
                            {
                                //controller = new PageController(initialPage:0);
                            }
                            loop = (bool)va;
                        });
                    }
                        ),
                    new Text("loop")
                }
                    ),
                new RadioGroup(
                    titles: new List <string> {
                    "COLOR", "DROP",
                    "NONE", "SCALE", "SLIDE", "WARM"
                },
                    onIndexChanged: (index) => { setState(() => { _index = index; layout = layouts[index]; }); }

                    ),
                new Container(
                    width: 1080,
                    height: 800,
                    child:
                    new Stack(
                        children: new List <Widget> {
                    TransformerPageView.children(index: 0,
                                                 children: children, pageController: controller
                                                 ),
                    new Align(
                        alignment: Alignment.bottomCenter,
                        child: new Padding(
                            padding: EdgeInsets.only(bottom: 20),
                            child: getItem()

                            )
                        )
                }
                        )
                    )
            }
                           )

                       ));
        }