美文网首页
flutter Stack

flutter Stack

作者: CaptainRoy | 来源:发表于2019-10-11 14:30 被阅读0次
    Stack
    class StackWidget extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        // TODO: implement build
        return Stack(
          children: <Widget>[
            Container(color: Colors.purple,width: 200,height: 200,),
            Positioned(
              left: 20,
              top: 20,
              child: Icon(Icons.pets,size: 50,color: Colors.red,),
            ),
            Positioned(
              bottom: 20,
              right: 20,
              child: Text("你好 Roy",style: TextStyle(fontSize: 20,color: Colors.blue),),
            ),
          ],
        );
      }
    }
    

    相关文章

      网友评论

          本文标题:flutter Stack

          本文链接:https://www.haomeiwen.com/subject/blwtmctx.html