第二章●第十一节:Placeholder

作者: 白晓明 | 来源:发表于2019-05-08 09:04 被阅读21次
将在某一天添加其他组件的预留框体组件。此组件经常用于开发期间表示接口尚未完成。默认情况下,placeholder的尺寸适合其容器。若placeholder位于无界空间中,它将根据给定的fallbackWidth和fallbackHeight自行调整大小。
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("PlaceHolder"),
        ),
        body: Column(
          children: <Widget>[
              Placeholder(
                color: Colors.red,
                fallbackHeight: 150,
              ),
            Text("第二列"),
            Text("第三列")
          ],
        ),
      ),
    );
  }
}
效果展示
属性

总目录结构

相关文章

网友评论

    本文标题:第二章●第十一节:Placeholder

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