HIDI Flutter Challenge (5) Padding & Expanded Widget

hello_hidiΒ·2021λ…„ 8μ›” 29일
0

HIDI's Flutter Challenge

λͺ©λ‘ 보기
5/12
post-thumbnail

Padding & Expanded Widget

> Padding

  • μ§€μ •λœ νŒ¨λ”©μœΌλ‘œ ν•˜μœ„ ν•­λͺ©μ„ μ‚½μž…ν•˜λŠ” μœ„μ ―

const Padding({
  Key? key,
  required this.padding,
  Widget? child,
}) : assert(padding != null),
     super(key: key, child: child);
 
 

>> Padding μ£Όμš” 속성

  • padding : childλ₯Ό μ‚½μž…ν•  κ³΅κ°„μ˜ μ–‘
  • child : 단일 μœ„μ ― μ‚¬μš© κ°€λŠ₯

>> EdgeInsets : νŒ¨λ”© 치수λ₯Ό μ„€λͺ…ν•˜λŠ” 데 μ‚¬μš©λ˜λŠ” 클래슀

  • EdgeInsets.all() : 전체에 μ„€μ • κ°€λŠ₯
    ex) const EdgeInsets.all(8.0)
  • EdgeInsets.symmetric() : vertical, horizontal에 μ„€μ • κ°€λŠ₯
    ex) const EdgeInsets.symmetric(vertical: 8.0)
  • EdgeInsets.only : left, right, top, bottom에 μ„€μ • κ°€λŠ₯
    ex) const EdgeInsets.only(left: 40.0)

> Expanded

  • Column, Row λ˜λŠ” Flex의 ν•˜μœ„ ν•­λͺ©μ„ ν™•μž₯ν•˜μ—¬ ν•˜μœ„ ν•­λͺ©μ΄ μ‚¬μš© κ°€λŠ₯ν•œ 곡간을 μ±„μš°λ„λ‘ ν•˜λŠ” μœ„μ ―
  • 주좕을 따라 μ‚¬μš© κ°€λŠ₯ν•œ 곡간을 채움
  • ν™•μž₯ν•˜κ³  싢은 μœ„μ ―μ— λ‘˜λŸ¬μ‹Έλ©΄ 됨
  
  const Expanded({
  Key? key,
  int flex = 1,
  required Widget child,
}) : super(key: key, flex: flex, fit: FlexFit.tight, child: child);
  
  
profile
μ•ˆλ‡½ν¬λ””

0개의 λŒ“κΈ€