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

import 'package:flutter/material.dart';
class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          title: new Text('LimitedBox限定宽高布局示例'),
        ),
        body: Row(
          children: [
            Container(
              color: Colors.grey,
              width: 100.0,
            ),
            LimitedBox(
              maxWidth: 150.0,//设置最大宽度 限定child在此范围内
              child: Container(
                color: Colors.lightGreen,
                width: 250.0,
              ),
            ),
          ],

        )
    );
  }
}
void main() {
  runApp(
    new MaterialApp(
      title: 'LimitedBox限定宽高布局示例',
      home: new LayoutDemo(),
    ),
  );
}

@作者: 亢少军

第7章页面布局-LimitedBox限定宽高布局

相关文章:

  • 2021-06-18
  • 2021-05-03
  • 2021-12-04
  • 2021-11-01
  • 2021-10-31
  • 2021-08-01
  • 2021-09-04
  • 2021-07-19
猜你喜欢
  • 2021-07-02
  • 2021-08-10
  • 2022-01-09
  • 2021-04-13
  • 2021-07-24
  • 2021-05-27
  • 2022-01-03
相关资源
相似解决方案