將在某一天添加其他組件的預(yù)留框體組件。此組件經(jīng)常用于開發(fā)期間表示接口尚未完成。默認(rèn)情況下,placeholder的尺寸適合其容器。若placeholder位于無界空間中,它將根據(jù)給定的fallbackWidth和fallbackHeight自行調(diào)整大小。
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("第三列")
],
),
),
);
}
}

效果展示

屬性