Overview.
만약 이미지나 등등을 부모 컨테이너에 꽉 차게 또는 맞추고 싶다면 쓰면 될 얘인것 같다.
0. 문서
https://api.flutter.dev/flutter/widgets/FittedBox-class.html
FittedBox class - widgets library - Dart API
Scales and positions its child within itself according to fit. In this example, the Placeholder is stretched to fill the entire Container. Try changing the fit types to see the effect on the layout of the Placeholder. link To create a local project with th
api.flutter.dev
1. FittedBox
단순하다 진짜 ㅋㅋ.. 사진 만 보고 skip!!

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: _Home(),
);
}
}
class _Home extends StatelessWidget {
const _Home({super.key});
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Column(
children: [
Container(
height: 500,
width: 500,
color: Colors.red,
child: FittedBox(
fit: BoxFit.fill, // 이 부분 조정
child: Image.asset('assets/image.jpeg'),
),
),
Spacer(),
Image.asset('assets/image.jpeg'),
],
),
),
);
}
}
Overview.
만약 이미지나 등등을 부모 컨테이너에 꽉 차게 또는 맞추고 싶다면 쓰면 될 얘인것 같다.
0. 문서
https://api.flutter.dev/flutter/widgets/FittedBox-class.html
FittedBox class - widgets library - Dart API
Scales and positions its child within itself according to fit. In this example, the Placeholder is stretched to fill the entire Container. Try changing the fit types to see the effect on the layout of the Placeholder. link To create a local project with th
api.flutter.dev
1. FittedBox
단순하다 진짜 ㅋㅋ.. 사진 만 보고 skip!!

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: _Home(),
);
}
}
class _Home extends StatelessWidget {
const _Home({super.key});
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: Column(
children: [
Container(
height: 500,
width: 500,
color: Colors.red,
child: FittedBox(
fit: BoxFit.fill, // 이 부분 조정
child: Image.asset('assets/image.jpeg'),
),
),
Spacer(),
Image.asset('assets/image.jpeg'),
],
),
),
);
}
}