[Flutter] Using this in a constructor ์— ๋Œ€ํ•˜์—ฌ
ยท
๐Ÿ’ง flutter
about using this in a constructor this.propertyName ์€ ์งง๊ณ  ๊ฐ„๋‹จํ•˜๊ฒŒ constructor์˜ values์— ๊ฐ’์„ ํ• ๋‹นํ•  ๋•Œ ์‚ฌ์šฉํ•œ๋‹ค. class MyColor { int red; int green; int blue; MyColor(this.red, this.green, this.blue); } final color = MyColor(80, 80, 128); ์ œ์‹œ๋œ ์ฝ”๋“œ์—์„œ this.์€ class ๋ณ€์ˆ˜์— ๊ฐ’์„ ๋„ฃ๊ฒ ๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•œ๋‹ค. ์ด๋Ÿฌํ•œ ๋ฐฉ์‹์€ named parameters์—์„œ๋„ ์‚ฌ์šฉ๋œ๋‹ค. using this in named parameters class MyColor { ... MyColor({required this.red, required this.gree..