import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget
{
Widget build(BuildContext context)
{
return MaterialApp
(
title: "flutter Demo",
theme: ThemeData
(
primarySwatch: Colors.deepOrange,
),
home: Scaffold
(
appBar: AppBar
(
title: Text("这是APP的标题"),
),
body: Container
(
child: Flex
(
// 水平方向
direction: Axis.horizontal,
children:
[
Container
(
width: 100,
height: 100,
color: Colors.green,
),
Container
(
width: 100,
height: 100,
color: Colors.orange,
),
Container
(
width: 100,
height: 100,
color: Colors.red,
)
],
)
),
),
);
}
}