Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Created February 15, 2020 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanlid/7d0b882600aa2e1c7f73028788b468db to your computer and use it in GitHub Desktop.
Save ryanlid/7d0b882600aa2e1c7f73028788b468db to your computer and use it in GitHub Desktop.
Row 水平布局
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