美文网首页
flutter AspectRatio调整宽高比示例

flutter AspectRatio调整宽高比示例

作者: 喜剧收尾_XWX | 来源:发表于2020-08-27 16:36 被阅读0次
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,
                  )),
            )));
  }
}

相关文章

网友评论

      本文标题:flutter AspectRatio调整宽高比示例

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