Created
February 15, 2020 16:45
-
-
Save ryanlid/7d0b882600aa2e1c7f73028788b468db to your computer and use it in GitHub Desktop.
Row 水平布局
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(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(), | |
), | |
) | |
], | |
)), | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment