import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return MaterialApp(
title: "AspectRatio调整宽高比示例",
home: Scaffold(
appBar: AppBar(
title: Text('AspectRatio调整宽高比示例'),
),
body: Container(
height: 200,
child: AspectRatio(
aspectRatio: 1.5,
child: Container(
color: Colors.yellow,
)),
)));
}
}
网友评论