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(),
),
)
],
)),
);
}
}
网友评论