• Flutter -- iOS -- Stack


     1 import 'package:flutter/material.dart';
     2 import 'package:my/dart_01.dart';
     3 
     4 void main(){
     5   runApp(new MaterialApp(
     6     title: 'Stack 布局示例Alignment',
     7     home: new MyApp(),
     8   ));
     9 }
    10 
    11 
    12 class MyApp extends StatelessWidget{
    13   @override
    14   Widget build(BuildContext context) {
    15     // TODO: implement build
    16     var stack = new Stack(
    17       alignment: Alignment.topLeft,
    18       children: <Widget>[
    19         new CircleAvatar(
    20           backgroundImage: new AssetImage('images/750-1334-1.png'),
    21           radius: 100.0,
    22         ),
    23         new Container(
    24           decoration:  new BoxDecoration(
    25             color: Colors.black38,
    26           ),
    27           child: new Text(
    28             '我这里是文字显示',
    29             style: new TextStyle(
    30               fontSize: 22.0,
    31               fontWeight: FontWeight.bold,
    32               color: Colors.white,
    33             ),
    34           ),
    35         ),
    36       ],
    37     );
    38 
    39     return new Scaffold(
    40       appBar: new AppBar(
    41         title: new Text('Stack 层叠布局示例'),
    42       ),
    43       body: new Center(
    44         child: stack,
    45       ),
    46     );
    47   }
    48 }

  • 相关阅读:
    Java数据库小项目02--管家婆项目
    Java数据库小项目01--实现用户登录注册
    Java数据库小项目00---基础知识
    MySQL基础练习02---牛客网
    ICMP
    语法糖
    双绞线
    telnet 时代的 bbs
    ARPA
    IEEE802是一个局域网标准系列
  • 原文地址:https://www.cnblogs.com/tom2015010203/p/11969194.html
Copyright © 2020-2023  润新知