만들어 보기
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return Column(children: [
Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(color: Colors.red, width: 50, height: 50),
Container(color: Colors.blue, width: 50, height: 50),
Container(color: Colors.yellow, width: 50, height: 50),
],
),
Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(color: Colors.red, width: 50, height: 50),
Container(color: Colors.blue, width: 50, height: 50),
Container(color: Colors.yellow, width: 50, height: 50),
],
),
Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(color: Colors.red, width: 50, height: 50),
Container(color: Colors.blue, width: 50, height: 50),
Container(color: Colors.yellow, width: 50, height: 50),
],
),
Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(color: Colors.red, width: 50, height: 50),
Container(color: Colors.blue, width: 50, height: 50),
Container(color: Colors.yellow, width: 50, height: 50),
],
),
Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(color: Colors.red, width: 50, height: 50),
Container(color: Colors.blue, width: 50, height: 50),
Container(color: Colors.yellow, width: 50, height: 50),
],
),
Row(
textDirection: TextDirection.ltr,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(color: Colors.red, width: 50, height: 50),
Container(color: Colors.blue, width: 50, height: 50),
Container(color: Colors.yellow, width: 50, height: 50),
],
),
]);
}
}
'Flutter' 카테고리의 다른 글
[Flutter] MaterialApp의 주요 property와 사용법 (0) | 2024.11.06 |
---|---|
[Flutter] 기초적인 Flutter 화면을 구성하는 패턴 (0) | 2024.11.06 |
[Flutter] Basic Widget 살펴 보기 (1) | 2024.11.05 |
[Flutter] Flutter 프로젝트 구조 이해하기 (1) | 2024.11.05 |
[Flutter] 나만의 Flutter 위젯 분류 (0) | 2024.11.05 |