美文网首页
Flutter row布局

Flutter row布局

作者: 喜剧收尾_XWX | 来源:发表于2020-09-03 08:13 被阅读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: "Row布局",
      home: Scaffold(
          appBar: AppBar(
            title: Text('Row布局'),
          ),
          body: Row(
            children: <Widget>[
              Expanded(
                child: Text(
                  '左侧文本',
                  textAlign: TextAlign.center,
                ),
              ),
              Expanded(
                child: Text(
                  '右侧文本',
                  textAlign: TextAlign.center,
                ),
              ),
              Expanded(
                child: FittedBox(
                  fit: BoxFit.contain,
                  child: FlutterLogo(),
                ),
              )
            ],
          )),
    );
  }
}

相关文章

网友评论

      本文标题:Flutter row布局

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