1)
import 'package:flutter/material.dart';
class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
bottom: false,
child: Container(
color: Colors.black,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
// Expanded / Flexible
Flexible(
child: Container(
color: Colors.red,
width: 50.0,
height: 50.0,
),
),
Expanded(
child: Container(
color: Colors.orange,
width: 50.0,
height: 50.0,
),
),
Expanded(
child: Container(
color: Colors.yellow,
width: 50.0,
height: 50.0,
),
),
Expanded(
child: Container(
color: Colors.green,
width: 50.0,
height: 50.0,
),
),
],
),
),
),
);
}
}

'개발이 좋아서 > Flutter가 좋아서' 카테고리의 다른 글
| [flutter] webview (2) | 2022.12.27 |
|---|---|
| [flutter] row and column_실습1 (0) | 2022.12.26 |
| [flutter] row and column_mainAxisAlignment, crossAxisAlignment, mainAxisSize (0) | 2022.12.22 |
| [flutter] splash_screen (0) | 2022.12.22 |
| [flutter] HelloWorld 만들기 (0) | 2022.12.22 |