flutter stack布局实例Alignment

2020-08-31  本文已影响0人  喜剧收尾_XWX
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      title: "stack布局实例Alignment",
      home: Scaffold(
          appBar: AppBar(
            title: Text('stack布局实例Alignment'),
          ),
          body: Stack(
            //子组件:右下角对齐
            alignment: Alignment.bottomRight,

            children: <Widget>[
              CircleAvatar(
                backgroundImage: AssetImage('images/1.jpeg'),
                radius: 100,
              ),
              Container(
                decoration: BoxDecoration(color: Colors.deepOrange),
                child: Text(
                  '我是超级飞侠',
                  style: TextStyle(fontSize: 22),
                ),
              )
            ],
          )),
    );
  }
}
上一篇 下一篇

猜你喜欢

热点阅读