Flutter
박스에 여백을 주는 방법
=> margin : 박스 바깥 테두리에 여백을 줌
=> padding : 박스 안쪽에 여백을 줌
박스에 테두리를 주는 방법
=> decoration
박스의 위치를 정렬하는 방법
=> Container 를 Align으로 감싼다.
example
import 'package:flutter/material.dart';
void main() {
// 앱을 구동시켜달라는 뜻
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('앱임'),
),
body: Align(
alignment: Alignment.centerLeft,
child: Container(
width: 50,
height: double.infinity,
color: Colors.blue,
),
),
),
);
}
}