**이 페이지에서 알 수 있는 내용 このページからわかること
- Container
- alignment
- padding
- margin
- decoration: BoxDecoration()
- boxShadow
- Offset
- gradient**
main.dart
...
...
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Container( // 1
color: Colors.blue,
child: Container( // 2
width: 200,
height: 200,
color: Colors.red,
child: Text('テスト'),
alignment: Alignment.topRight,
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
),
)
),
);
}
}

alignment
위젯의 위치를 정렬하는 프로퍼티
ウイジェットの位置を整列するプロパティ
padding
위젯의 내부 여백을 설정하는 프로퍼티
ウイジェットの内部余白を設定するプロパティ
margin
위젯의 외부 여백을 설정하는 프로퍼티
ウイジェットの外部余白を設定するプロパティ
main.dart
...
...
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Container(
width: 200,
height: 200,
child: Text('テスト'),
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.only(topRight: Radius.circular(50)),
boxShadow: [
BoxShadow(
color: Colors.black,
spreadRadius: 10,
blurRadius: 10,
offset: Offset(10, 50), // 좌표값 입력
)
],
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.blue, Colors.red],
),
),
),
),
);
}
}

decoration: BoxDecoration()
Container 위젯을 꾸며주는 프로퍼티, 클래스
Containerウイジェットを装飾するプロパティ、クラス
boxShadow