const AspectRatio({
Key key,
@required this.aspectRatio,
Widget child,
})

void
main() {  runApp(    new MaterialApp(      title: 'Demo',      home: new Scaffold(        appBar: new AppBar(          title: new Text('Demo'),       ),        body: new Center(          child: new Container(            child: new AspectRatio(              aspectRatio:3/2, //横纵比 长宽比 3:2              child: new Image(image: new AssetImage('images/demo.jpg')),//项目资源文件           ),         ),       ),     ),   ), ); }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
猜你喜欢
  • 2021-04-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-08-25
  • 2022-12-23
  • 2021-12-12
相关资源
相似解决方案