防采集标记:亢少军老师的课程和资料

import 'package:flutter/material.dart';
class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('FittedBox缩放布局示例'),
      ),
      body: new Container(
        color: Colors.grey,
        width: 250.0,
        height: 250.0,
        child: new FittedBox(
          fit: BoxFit.contain,
          alignment: Alignment.topLeft,
          child: new Container(
            color: Colors.deepOrange,
            child: new Text("缩放布局"),
          ),
        ),
      ),
    );
  }
}
void main() {
  runApp(
    new MaterialApp(
      title: 'FittedBox缩放布局示例',
      home: new LayoutDemo(),
    ),
  );
}

@作者: 亢少军

第7章页面布局-FillBox填充布局

相关文章:

  • 2021-10-04
  • 2021-11-02
  • 2020-06-02
  • 2021-10-31
  • 2021-09-08
  • 2022-01-01
  • 2021-11-13
  • 2022-01-01
猜你喜欢
  • 2021-09-01
  • 2021-08-06
  • 2021-09-17
  • 2021-11-13
  • 2021-10-31
  • 2021-08-08
  • 2021-08-08
  • 2021-10-31
相关资源
相似解决方案