SingleChildScrollView相当于安卓的ScrollView,SizedBox是一个能指定宽高的盒子,一般默认占据主轴空间
import 'package:flutter/material.dart';
class Demo1 extends StatelessWidget{
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
elevation: 0.0,
backgroundColor: Colors.transparent,
title: Text('sdafas',style: TextStyle(fontSize: 14,color: Colors.red),),
),
//类似安卓中的ScrollView
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
//可以确定控制盒子大小的widget
SizedBox(height: 36,child:
Container(
decoration: BoxDecoration(
color: Colors.red
),
),),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
Text('asdfdsaf'),
],
),
),
);
}
}