{"id":5403,"date":"2022-06-29T14:35:11","date_gmt":"2022-06-29T05:35:11","guid":{"rendered":"\/blog\/?p=5403"},"modified":"2023-09-21T09:26:25","modified_gmt":"2023-09-21T00:26:25","slug":"dart-%ea%b8%b0%eb%b3%b8-%eb%ac%b8%eb%b2%95-2","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=5403","title":{"rendered":"Dart \uae30\ubcf8 \ubb38\ubc95"},"content":{"rendered":"\n<p>\ucd9c\ucc98: <a href=\"https:\/\/at0z.tistory.com\/155\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/at0z.tistory.com\/155<\/a><\/p>\n\n\n\n<h3><span style=\"font-family: 'monospace';\">\uae30\ubcf8 \ubb38\ubc95<\/span><\/h3>\n<p><span style=\"font-family: 'monospace';\">(\ud2f0\uc2a4\ud1a0\ub9ac \ucf54\ub4dc\ube14\ub7ed\uc740 Dart\ub97c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc544 \uc6b0\uc120 java\ub85c \ud45c\uae30\ud569\ub2c8\ub2e4)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc8fc\uc11d<\/b><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/\uc8fc\uc11d\n\n\/**\n* \uc8fc\uc11d\n**\/\n\n\/\/\/ \ubb38\uc11c\uc8fc\uc11d<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ubb38\uc7a5<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uba85\ub839 \ub2e8\uc704. \uc138\ubbf8\ucf5c\ub860 ;\uc73c\ub85c \ub05d\ub09c\ub2e4.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ubcc0\uc218<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">data\ub97c \ub2f4\ub294 \uc0c1\uc790. \uc885\ub958\ub294 type, \uc790\ub8cc\ud615\uc774\ub77c\uace0 \ud568.dart\ub294 int, double, String, bool\uc744 \uae30\ubcf8 \uc81c\uacf5.\uc0ac\uc6a9\uc790\uac00 \uc9c1\uc811 \ud0c0\uc785\uc744 \uc815\uc758\ud560 \uc218 \uc788\uc74c.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">String name;\nname = \"\ud64d\uae38\ub3d9\";\nname = '\ud64d\uae38\ub3d9';\n\/\/\ub530\uc634\ud45c \uc885\ub958 \uc0c1\uad00\uc5c6\uc774 \uac00\ub2a5<\/pre>\n<p><span style=\"font-family: 'monospace';\">int, double\uc740 num type\uc758 \ud558\uc704 \uc9d1\ud569\uc774\ub77c int, double \ub300\uc2e0 num\uc73c\ub85c \uc120\uc5b8 \uac00\ub2a5.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">num \ud0c0\uc785\uc5d0\ub294 int, double \ub300\uc785 \uac00\ub2a5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int a = 1;\ndouble b = 2.0;\n\nnum c = a;\nc = b;<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ud0c0\uc785 \ucd94\ub860<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc704\uc640 \uac19\uc774 type\uc744 \uc9c1\uc811 \uba85\uc2dc\ud558\uc9c0 \uc54a\uace0, var\ub85c \ub300\uccb4\ud560 \uc218 \uc788\uc74c. (JS\uac19\uc774)<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc77c\ubc18\uc801\uc73c\ub85c \ub9ce\uc774 \uc0ac\uc6a9.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">var i = 10; \/\/int\nvar d = 10.0 \/\/double\nvar s = \"hello\"; \/\/String\nvar b = true; \/\/boolean\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc0c1\uc218 final, const<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uac12\uc774 \ubcc0\ud558\uc9c0 \uc54a\ub294 \uacbd\uc6b0\ub294 \uc0c1\uc218 \uc0ac\uc6a9. \uc120\uc5b8\uc2dc final\uc744 \uc81c\uc77c \uc55e\uc5d0 \ubd99\uc774\uba74 \uac12\uc774 \uc218\uc815\ub418\uc9c0 \uc54a\uc74c. \ud0c0\uc785 \uc0dd\ub7b5 \uac00\ub2a5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">final String name = \"\ud64d\uae38\ub3d9\";\nfinal name = \"\ud64d\uae38\ub3d9\";<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc0b0\uc220 \uc5f0\uc0b0\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">+, -, *, \/(\ub098\ub204\uae30 - double), ~\/(\ubaab - int), %(\ub098\uba38\uc9c0 - int) \uc0ac\uc6a9 \uac00\ub2a5.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">+\uc758 \uacbd\uc6b0 string concat\uc5d0\uc11c\ub3c4 \uc0ac\uc6a9.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc99d\uac10 \uc5f0\uc0b0\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">1\uc529 \uc99d\uac00(++) \ub610\ub294 1\uc529 \uac10\uc18c(--). \ud6c4\uc704(\uc2dd++)\/\uc804\uc704(++\uc2dd) \uc5f0\uc0b0 \ubaa8\ub450 \uac00\ub2a5.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ube44\uad50 \uc5f0\uc0b0\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">==, !=, &gt;, &lt;, &gt;=, &lt;= \uc0ac\uc6a9 \uac00\ub2a5.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ub17c\ub9ac\uc5f0\uc0b0\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">boolean \ud0c0\uc785\uc73c\ub85c \uacb0\uacfc \ubc18\ud658.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">&amp;&amp;, ||, ==, !, != \uc0ac\uc6a9 \uac00\ub2a5.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ud0c0\uc785 \uac80\uc0ac<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">is\ub97c \uc0ac\uc6a9.&nbsp;<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">[\ubcc0\uc218] is [type] =&gt; \uac19\uc740 \ud0c0\uc785\uc778\uc9c0<span style=\"color: #333333;\">[\ubcc0\uc218] is! [type] =&gt; \ub2e4\ub978 \ud0c0\uc785\uc778\uc9c0<\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int a = 1;\n\nif (a is int){~}\nif (a is! int){~}<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ud615\ubcc0\ud658 (as)<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">type casting. as\ub97c \uc0ac\uc6a9. \ub2e4\ub978 \ud0c0\uc785\ub07c\ub9ac\ub294 \ubcc0\ud658 \ubd88\uac00. \uc0c1\uc704 \uac1c\ub150\uc73c\ub85c\ub9cc \ubcc0\ud658 \uac00\ub2a5.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ud2b9\ud788, int, double\uc740 num\uc73c\ub85c \ubb36\uc5ec\uc788\uc9c0\ub9cc \uac01\uc790\ub294 \uad00\uacc4\uac00 \uc5c6\uc5b4 \ud615\ubcc0\ud654 \ubd88\uac00.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">var c = 10.0\nnum n = c as num;\nnum n = c \/\/as num \uc0dd\ub7b5 \uac00\ub2a5\nint d = c as int; \/\/error<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: 'monospace';\">\ud568\uc218<\/span><\/h3>\n<p><span style=\"font-family: 'monospace';\">function. \ucf54\ub4dc \ubb36\uc74c \ub2e8\uc704.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ud568\uc218 \ud615\ud0dc<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc785\ub825 \ubc1b\ub294 \ubb38\uc790 : \ub9e4\uac1c\ubcc0\uc218 parameter\uc2e4\uc81c\ub85c \uc785\ub825\ubc1b\ub294 \uac12 : \uc778\uc218 argument\ubc18\ud658\ub418\ub294 \uac12 : \ubc18\ud658\uac12 Return<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">=&gt; \uc77c\ubc18\uc801\uc778 C\ubb38\ubc95\uacfc \ub3d9\uc77c\ud558\ub2e4.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\">\ubcc0\uc218 \uc55e\uc5d0 $\ub97c \ubd99\uc5ec \ubb38\uc790\uc5f4 \ub0b4\uc5d0 \ubcc0\uc218 \uc0bd\uc785 \uac00\ub2a5. (\ud30c\uc774\uc36c\uc5d0\uc11c {}\uc0ac\uc6a9\ud558\ub294 \uac83\uacfc \uac19\ub2e4)<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ub610\ud55c, ${~~}\ubd80\ubd84\uc5d0 \ud45c\ud604\uc2dd \uc0ac\uc6a9 \uac00\ub2a5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">String name = \"\uc774\uc21c\uc2e0\";\nint age = 20;\n\nvoid main(){\n    print('$name\uc740 $age\uc0b4 \uc785\ub2c8\ub2e4.');\n  print(\"$name\uc740 ${name.length}\uae00\uc790 \uc785\ub2c8\ub2e4.\");\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ud568\uc218\uc640 \uba54\uc11c\ub4dc<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ucd5c\uc0c1\uc704 \ud568\uc218 : class \ubc16\uc5d0 \uc791\uc131\ud558\ub294 \ud568\uc218. \uc77c\ubc18\uc801\uc73c\ub85c \ub9d0\ud558\ub294 \ud568\uc218\ub4e4. (main method\ucc98\ub7fc \uac00\uc7a5 \ubc16\uc5d0 \uc791\uc131). \uc5b4\ub514\uc5d0\uc11c\ub098 \ud638\ucd9c \uac00\ub2a5.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">method : class \ub0b4\ubd80\uc5d0 \uc791\uc131\ud558\ub294 \ud568\uc218. \uc815\uc758\ub41c class\uc5d0 \uad00\uacc4\ub41c \uae30\ub2a5\uc744 \uc218\ud589. Static\uc774 \ubd99\uc740 method\ub294 \uc815\uc801 \uba54\uc11c\ub4dc\uac00 \ub418\uc5b4 \ucd5c\uc0c1\uc704 \ud568\uc218\ucc98\ub7fc \uc0ac\uc6a9 \uac00\ub2a5.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc775\uba85 \ud568\uc218<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">anonymouse function.&nbsp;<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">([\uc778\uc218\uba85]) { [\ub3d9\uc791 or Return \uac12] }<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">(number) {\n    return number % 2 == 0;\n};<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ub78c\ub2e4\uc2dd<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">([\uc778\uc218\uba85]) =&gt; [\ub3d9\uc791 or Return \uac12]<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">(number) =&gt; number%2 == 0;<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc120\ud0dd \ub9e4\uac1c\ubcc0\uc218<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc815\uc758\uc5d0\uc11c {}\ub85c \uac10\uc2fc \ub9e4\uac1c\ubcc0\uc218\ub294 \uc120\ud0dd\uc801\uc73c\ub85c \uc0ac\uc6a9 \uac00\ub2a5. Named parameter.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void f(String name, {int age}) {}<\/pre>\n<p><span style=\"font-family: 'monospace';\">{}\ub85c \uac10\uc2f8\uc9c0 \uc54a\uc740 \ub9e4\uac1c\ubcc0\uc218\ub97c \ud544\uc218\uc801\uc73c\ub85c \ub118\uaca8\uc8fc\uc5b4\uc57c \ud558\uace0, {}\ub85c \uac10\uc2fc \ub9e4\uac1c\ubcc0\uc218\uc5d0 \uac12\uc744 \uc8fc\uace0 \uc2f6\ub2e4\uba74 \ubc18\ub4dc\uc2dc \ub9e4\uac1c\ubcc0\uc218\uc758 \uc774\ub984\uc744 \ubd99\uc5ec\uc11c age : 5\ub85c \ub118\uaca8\uc8fc\uc5b4\uc57c \ud55c\ub2e4.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc120\ud0dd \ub9e4\uac1c\ubcc0\uc218\ub294 \uae30\ubcf8\uac12 \uc9c0\uc815\uc774 \uac00\ub2a5\ud558\ub2e4.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void f(String name, {int age = 5}) {}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: 'monospace';\">\ubd84\uae30\uc640 \ubc18\ubcf5<\/span><\/h3>\n<p><span style=\"font-family: 'monospace';\"><b>if else<\/b><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int a = 10;\n\nif (a % 2 == 0) {~}\nelse if (a % 3 == 0) {~}\nelse {~}<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc0bc\ud56d \uc5f0\uc0b0<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">[\uc870\uac74] ? [\ucc38\uc77c \ub54c] : [\uac70\uc9d3\uc77c \ub54c]<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">var number = a%2 ? a++ : a--<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>switch case<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc870\uac74\uc5d0 \ub9de\ub294 \uac12\uc774 \uc5ec\ub7ec \uac1c\uc77c \ub54c \uc720\uc6a9. enum\uacfc \ud568\uaed8 \uc0ac\uc6a9\ud560 \ub550 \ubaa8\ub4e0 \ucf00\uc774\uc2a4\ub97c \uac80\uc0ac\ud574\uc57c \ud558\ub294 \uac15\uc81c\uc131\uc774 \uc0dd\uae40.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">Switch - case - break\ub85c \ubb38\ubc95\uc740 C\uc640 \ub3d9\uc77c<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>for<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc694\uc18c\ub97c \ubc18\ubcf5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">for (var i = 0; i &lt; 10 ; i++){\n    print(i);\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: 'monospace';\">\uac1d\uccb4 \uc9c0\ud5a5 \ud504\ub85c\uadf8\ub798\ubc0d<\/span><\/h3>\n<p><span style=\"font-family: 'monospace';\">dart\ub294 \uac1d\uccb4\uc9c0\ud5a5 \ud504\ub85c\uadf8\ub798\ubc0d \uc5b8\uc5b4!<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ud074\ub798\uc2a4<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uac1d\uccb4 object : \uc800\uc7a5 \uacf5\uac04\uc5d0 \ud560\ub2f9\ub418\uc5b4 \uac12\uc744 \uac00\uc9c0\uac70\ub098 \uc2dd\ubcc4\uc790\uc5d0 \uc758\ud574 \ucc38\uc870\ub418\ub294 \uacf5\uac04. (\ubcc0\uc218, \ud568\uc218, \uba54\uc11c\ub4dc)<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc778\uc2a4\ud134\uc2a4 instance : \uac1d\uccb4\ub97c \uba54\ubaa8\ub9ac\uc5d0 \uc791\uc131\ud558\ub294 \uac83.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ud074\ub798\uc2a4 class : \uc778\uc2a4\ud134\uc2a4\uc758 \uc124\uacc4\ub3c4.&nbsp;<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc18d\uc131 property : \ud074\ub798\uc2a4 \uc548\uc5d0 \ud45c\ud604\ub418\ub294 \uc18d\uc131.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\">\ud074\ub798\uc2a4\ub294 \uc77c\uc885\uc758 \uc0ac\uc6a9\uc790 \uc815\uc758 \ud0c0\uc785!<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Person{\n    String name;\n  int age;\n}\n\nvar person = new Person();\nvar person2 = Person(); \/\/new \uc0dd\ub7b5 \uac00\ub2a5<\/pre>\n<p><span style=\"font-family: 'monospace';\">\ubcc0\uc218\uba85 \ub4a4\uc5d0 . \uc5f0\uc0b0\uc790\ub97c \uc785\ub825, \uac1d\uccb4\uc758 property\uc5d0 \uc811\uadfc \uac00\ub2a5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">print(person.name);\nprint(person.age);<\/pre>\n<p><span style=\"font-family: 'monospace';\">\uba54\uc11c\ub4dc : \ud074\ub798\uc2a4 \uc548\uc5d0 \uc791\uc131\ud558\ub294 \ud568\uc218. \uba54\uc11c\ub4dc\ub294 class\uc758 \ud504\ub85c\ud37c\ud2f0\ub97c \uc870\uc791\ud558\ub294 \ub4f1\uc758 \uc6a9\ub3c4\ub85c \uc0ac\uc6a9. \uc774 \uc5ed\uc2dc .\uc5f0\uc0b0\uc790\ub97c \ubd99\uc5ec \uc811\uadfc \uac00\ub2a5.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc811\uadfc \uc9c0\uc815\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">java\uc5d0\uc11c\uc758 public, private\uc640 \uac19\uc740 \uc5ed\ud560. \uc5ec\uae30\uc11c\ub294 _ \uc744 \ubd99\uc5ec \uad6c\ubd84\ud55c\ub2e4. (\ubd99\uc774\uba74 private)<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Person{\n  String name;\n  int _age;\n\n  void addOneYear(){\n    _age++;\n  }\n}\n\n\/\/=====\ub2e4\ub978 Dart file\nimport 'person.dart';\n\nvoid main(){\n    var person = Person();\n  person._age = 10; \/\/error!\n}<\/pre>\n<p><span style=\"font-family: 'monospace';\">\uc774\ub54c, private\uc758 \uc601\uc5ed\uc740 \uc815\uc758\ub41c \ud30c\uc77c \ub0b4! \uc989, _\uc774 \ubd99\uc5b4 \uc788\uc5b4\ub3c4 \uac19\uc740 \ud30c\uc77c \ub0b4\ub77c\uba74 class\uc758 \ubc16\uc5d0 \uc788\uc5b4\ub3c4 \uc790\uc720\ub86d\uac8c \uc811\uadfc\uc774 \uac00\ub2a5\ud558\ub2e4.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc0dd\uc131\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc778\uc2a4\ud134\uc2a4\ud654 \ud558\ub294 \ubc29\ubc95\uc744 \uc81c\uacf5\ud558\ub294 \uc77c\uc885\uc758 \uba54\uc11c\ub4dc. \uc778\uc2a4\ud134\uc2a4\uac00 \uc0dd\uc131\ub420 \ub54c \uac00\uc7a5 \uba3c\uc800 \uc0dd\uc131\ub428. \uba54\uc11c\ub4dc \uc774\ub984\uc740 \ud074\ub798\uc2a4\uba85\uacfc \uac19\ub2e4.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Person{\n    String name;\n  int _age;\n\n  Person({this.name, this._age}); \/\/constructor\n}\n\nvar person = Person();\nvar person2 = Person(name : '\ud64d\uae38\ub3d9', _age : 20);<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>getter, setter<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">_\uc744 \ubd99\uc778 private \ubcc0\uc218\uc5d0 \uc678\ubd80\uc5d0\uc11c \uc811\uadfc\ud558\uae30 \uc704\ud574 \ub9cc\ub4e4\uc5b4\uc8fc\ub294 \ud1b5\ub85c\uac19\uc740 \uba54\uc11c\ub4dc.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/person.dart\n\nclass Person{\n    String name;\n  int _age = 10;\n\n  int get age =&gt; _age; \/\/getter\n  set setAge(num value) =&gt; _age = value; \/\/setter\n}\n\n\/\/main.dart\n\nvoid main(){\n    var person = Person();\n  print(person.age); \/\/10\n  person.setAge = 5;\n  print(person.age); \/\/5\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc0c1\uc18d<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">implement. \uc8fc\ub294 \ucabd\uc774 super class (\ubd80\ubaa8), \ubc1b\ub294 \ucabd\uc774 sub class(\uc790\uc2dd)<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/\ubd80\ubaa8 class\nclass Hero{\n    String name = 'hero';\n\n  void run() {}\n}\n\n\/\/\uc704\ub97c \uc0c1\uc18d\ubc1b\uc740 \uc790\uc2dd \ud074\ub798\uc2a4\nclass SuperHero extend Hero{\n    @override \/\/\uc7ac\uc815\uc758\n  void run(){\n    super.run(); \/\/\ubd80\ubaa8\uc758 run\uc2e4\ud589\n    this.fly(); \/\/\ucd94\uac00\ub85c \uc790\uc2dd\uc774 \ub530\ub85c \uc815\uc758\ud55c fly\ub3c4 \uc2e4\ud589.\n  }\n\n  void fly() {}\n}\n\n\nvoid main(){\n    var hero = SuperHero();\n  hero.run();\n  hero.fly();\n  print(hero.name); \/\/hero \ucd9c\ub825\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ucd94\uc0c1 \ud074\ub798\uc2a4<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">abstract class. \ucd94\uc0c1 \uba54\uc11c\ub4dc\ub97c \ud3ec\ud568\ud558\ub294 \ud074\ub798\uc2a4. <\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ucd94\uc0c1 \uba54\uc11c\ub4dc : \uc120\uc5b8\ub9cc\ub418\uace0 \uc815\uc758\uac00 \uc5c6\ub294 \uba54\uc11c\ub4dc.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ucd94\uc0c1 \ud074\ub798\uc2a4\ub294 \ub2e4\ub978 \ud074\ub798\uc2a4\uc5d0\uc11c implement\ud574\uc11c \uc644\uc131\ud558\ub294 \uc0c1\uc18d \uc7ac\ub8cc\ub85c \uc0ac\uc6a9\ub41c\ub2e4. (\ud2c0\uac19\uc740 \ub290\ub08c? \ud15c\ud50c\ub9bf?)<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc774\ub54c \ub300\uc0c1 \ud074\ub798\uc2a4\uc5d0\ub294 implements, \uba54\uc11c\ub4dc\uc5d0\ub294 @override \ud0a4\uc6cc\ub4dc \uc0ac\uc6a9(<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc5ec\ub7ec \ucd94\uc0c1 \ud074\ub798\uc2a4\ub97c \ud55c\ubc88\uc5d0 implement\ud560 \uc218\ub3c4 \uc788\uace0, \ucd94\uc0c1 \ud074\ub798\uc2a4\ub97c \uad6c\ud604\ud560 \ub54c\ub294 \ubaa8\ub4e0 \ucd94\uc0c1 \uba54\uc11c\ub4dc\ub97c \uc7ac\uc815\uc758 \ud574\uc57c \ud55c\ub2e4.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">abstract class Monster{\n    void attack();\n}\n\nabstract class Flyable{\n    void fly();\n}\n\nclass Bat implements Monster, Flyable(\n    @override\n  void attack(){\n    print('\ud560\ud034\uae30!');\n  }\n\n  @override\n  void fly(){\n    print('\ud384\ub7ed\ud384\ub7ed');\n  }\n}<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\ubbf9\uc2a4\uc778<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">mixin. with\ub97c \uc0ac\uc6a9\ud558\uba74 \uc0c1\uc18d\ud558\uc9c0 \uc54a\uace0 \ub2e4\ub978 \ud074\ub798\uc2a4 \uae30\ub2a5 overwritte\uac00\ub2a5.&nbsp;<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">class Goblin implements Monster{\n    @override\n  void attack(){\n    print('\uace0\ube14\ub9b0 \uacf5\uaca9');\n  }\n}\n\nclass DarkGoblin extends Goblin with Hero{\n\n} \/\/\ub2e4\ud06c \uace0\ube14\ub9b0\uc740 \uace0\ube14\ub9b0\uc774\uae30\ub3c4 \ud558\uba70, \ud788\uc5b4\ub85c\uc774\uae30\ub3c4 \ud558\uba70, \ubaac\uc2a4\ud130\uc774\uae30\ub3c4 \ud568. =&gt; \ub2e4\ud615\uc131!<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc5f4\uac70\ud615<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">enum type. \uc0c1\uc218\ub97c \uc815\uc758\ud558\ub294 \ud2b9\uc218\ud55c \ud615\ud0dc\uc758 \ud074\ub798\uc2a4. \uc0c1\uc218\ucc98\ub7fc \uc0ac\uc6a9\uc774 \uac00\ub2a5\ud558\ub2e4.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">enum Status { login, logout }\n\nvar authStatus = Status.logout;\n\nswitch(authStatus){\n    case Status.login:\n    print('login');\n    break;\n  case Status.logout:\n    print('logout');\n    break;\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-family: 'monospace';\">\uceec\ub809\uc158<\/span><\/h2>\n<p><span style=\"font-family: 'monospace';\">list, map, set\ub4f1\uc758 collection\uc744 \uae30\ubcf8 \uc81c\uacf5\ud568.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>List<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc21c\uc11c\uac00 \uc788\ub294 \uc790\ub8cc\ub97c \ub2f4\uc74c. Dart\ub294 \ubc30\uc5f4 (Array)\ub97c \ubcc4\ub3c4\ub85c \uc81c\uacf5\ud558\uc9c0 \uc54a\ub294\ub2e4.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">List&lt;String&gt; items = ['a', 'b', 'c'];\nvar items = ['a', 'b', 'c'];\n\nitems[0] = 'd'; \/\/0\ubd80\ud130 \uc2dc\uc791\ud558\ub294 index.\n\nprint(items.length); \/\/3<\/pre>\n<blockquote><span style=\"font-family: 'monospace';\">\u203b dynamic<br>\ubaa8\ub4e0 \ud0c0\uc785\uc744 \ub300\ubcc0\ud558\ub294 \ud2b9\uc218 \ud0c0\uc785! \uc5ec\ub7ec \ud0c0\uc785\uc744 \ud55c \ub9ac\uc2a4\ud2b8\uc5d0 \ub123\uac70\ub098 \uc77c\ubc18 \ubcc0\uc218\ub97c \uc120\uc5b8\ud560 \ub54c\ub3c4 \uc0ac\uc6a9 \uac00\ub2a5.<br><br>List&lt;dynamic&gt; list = [1, 2, 'a'];<br><span style=\"color: #666666;\">var list = [1, 2, 'a'];<\/span><br><\/span><\/blockquote>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc2a4\ud504\ub808\ub4dc \uc5f0\uc0b0\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">spread. '...' \uc5f0\uc0b0\uc790. \uceec\ub809\uc158\uc744 \ud3bc\uccd0\uc900\ub2e4. \ub2e4\ub978 \uceec\ub809\uc158 \uc548\uc5d0 \uceec\ub809\uc158\uc744 \uc0bd\uc785\ud560 \ub54c \uc0ac\uc6a9.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">var items = ['a', 'b', 'c'];\n\nvar items2 = ['d', ...items, 'e']; \/\/d, a, b, c, e<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>Map<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc21c\uc11c \uc5c6\uc74c. \ud0d0\uc0c9 \ube60\ub978 \uc790\ub8cc\uad6c\uc870. key-value\uc758 \uc30d.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/Map&lt;String, String&gt; cityMap = {...} \uacfc \uac19\uc74c.\nvar cityMap = {\n    'korea': 'busan',\n  'japan': 'tokyo',\n  'china': 'Beijing'\n};\n\ncityMap['korea'] = 'seoul';\n\nprint(cityMap.length); \/\/3\n\ncityMap['America'] = 'Washington'; \/\/\uc0c8 \uac12 \ucd94\uac00<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>Set<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc9d1\ud569 \ud45c\ud604. =&gt; \uc911\ubcf5 \ubd88\ud5c8\uc6a9<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">add(), remove()\ub85c \ucd94\uac00\/\uc0ad\uc81c \uac00\ub2a5.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">contains() : \ucc3e\ub294 \uc790\ub8cc\uac00 \uc9d1\ud569\uc5d0 \uc788\ub294\uc9c0 \uc5c6\ub294\uc9c0 bool\ub85c \ubc18\ud658.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Set&lt;String&gt; citySet = {}\uacfc \uac19\uc74c\nvar citySet = {'\uc11c\uc6b8', '\ubd80\uc0b0', '\uad11\uc8fc', '\ub300\uc804', '\uc6b8\uc0b0'}\n\ncitySet.add('\ub300\uad6c');\ncitySet.remove('\uc11c\uc6b8');\n\nprint(citySet.contatins('\uc6b8\uc0b0'); \/\/ true<\/pre>\n<p><span style=\"font-family: 'monospace';\">\ube44\uc5b4\uc788\ub294 Set\uc774\ub098 map\uc744 \uc791\uc131\ud560 \ub54c\ub294 \uc8fc\uc758! \uadf8\ub0e5 {}\ub9cc \uc4f0\uba74 Map\uc73c\ub85c \uc778\uc2dd\ud574\ubc84\ub9bc.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">var mySet = &lt;String&gt;{}; \/\/set\uc73c\ub85c \uc778\uc2dd\nvar mySet2 = {}; \/\/dynamic, dynamic\uc778 map\uc73c\ub85c \uc778\uc2dd<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: 'monospace';\">\ud568\uc218\ud615 \ud504\ub85c\uadf8\ub798\ubc0d<\/span><\/h3>\n<p><span style=\"font-family: 'monospace';\">Dart\ub294 \uac1d\uccb4\uc9c0\ud5a5 \ud504\ub85c\uadf8\ub798\ubc0d\uacfc \ud568\uc218\ud615 \ud504\ub85c\uadf8\ub798\ubc0d\uc758 \ud2b9\uc9d5\uc744 \ubaa8\ub450 \uc81c\uacf5 (\ubb50\uc9c0....)<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ud568\uc218\ud615 \ud504\ub85c\uadf8\ub798\ubc0d : \uc790\ub8cc \ucc98\ub9ac\ub97c \uc218\ud559\uc801 \ud558\uc218\uc758 \uacc4\uc0b0\uc73c\ub85c \ucde8\uae09\ud558\ub294 \ud328\ub7ec\ub2e4\uc784. (\uc0c1\ud0dc\uc640 \uac00\ubcc0 \ub370\uc774\ud130 X)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uc77c\uae09 \uac1d\uccb4<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ud568\uc218\ub97c \uac12\uc73c\ub85c \ucde8\uae09. \uc989, \ub2e4\ub978 \ubcc0\uc218\uc5d0 \ud568\uc218\ub97c \ub300\uc785\ud560 \uc218 \uc788\uc74c.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void greeting(String text){\n    print(text);\n}\n\nvoid main(){ \/\/ \ud568\uc218\ub97c \ub2e4\ub978 \ubcc0\uc218\uc5d0 \ub300\uc785\ud560 \uc218 \uc788\uc74c\n    var f = greeting;\n  f('hello');\n}<\/pre>\n<p><span style=\"font-family: 'monospace';\">\ub2e4\ub978 \ud568\uc218\uc758 \uc778\uc218\ub85c \ud568\uc218 \uc790\uccb4\ub97c \uc804\ub2ec\ud558\uac70\ub098 \ud568\uc218\ub97c \ubc18\ud658\ubc1b\uc744 \uc218\ub3c4 \uc788\uc74c.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ud568\uc218\ub97c \ub9e4\uac1c\ubcc0\uc218\ub85c \uc804\ub2ec, \uc218\uc815, \ubcc0\uc218\uc5d0 \ub300\uc785\ud558\uae30\uac00 \uac00\ub2a5\ud55c \uac1d\uccb4\ub97c '\uc77c\uae09 \uac1d\uccb4', first-class object\ub77c\uace0 \ud568.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>for\ubb38\uacfc forEach()\ud568\uc218<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">for : \uc678\ubd80 \ubc18\ubcf5<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">forEach() : \ub0b4\ubd80\ubc18\ubcf5 =&gt;(E element) {} \ud615\ud0dc\uc758 \ud568\uc218\ub97c \uc778\uc218\ub85c \ubc1b\uc74c.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">items.forEach(print); \/\/ 1, 2, 3, 4, 5\n\nitems.forEach((e) {\n    print(e);\n});\n\nitmes.forEach((e) =&gt; print(e));\n\nitems.forEach(print);<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>where<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc870\uac74\uc744 \ud544\ud130\ub9c1 \ud560 \ub54c \uc0ac\uc6a9. \ud568\uc218\ud615 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\ub294 \ud568\uc218\ub4e4\uc740 \uacb0\uacfc\ub97c \ubc18\ubcf5 \uac00\ub2a5\ud55c \ud0c0\uc785\uc73c\ub85c \ubc18\ud658\ud558\uc5ec \uba54\uc11c\ub4dc \uccb4\uc778\uc73c\ub85c \uc5f0\uacb0\ud574\uc11c \uc0ac\uc6a9 \uac00\ub2a5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">items.where((e) =&gt; e % 2 == 0).forEach(print); \/\/2, 4<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>map<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ubc18\ubcf5\ub418\ub294 \uac12\uc744 \ub2e4\ub978 \ud615\ud0dc\ub85c \ubcc0\ud658\ud558\ub294 \ubc29\ubc95\uc744 \uc81c\uacf5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">items.where((e) =&gt; e % 2 == 0).map((e) =&gt; '\uc22b\uc790 $e').forEach(print);<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>toList<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ud568\uc218\ud615 \ud504\ub85c\uadf8\ub798\ubc0d\uc744 \uc9c0\uc6d0\ud558\ub294 \ud568\uc218 \ub300\ubd80\ubd84\uc740 Iterable&lt;T&gt; \uc778\ud130\ud398\uc774\uc2a4 \ud0c0\uc785 \uc778\uc2a4\ud134\uc2a4\ub97c \ubc18\ud658.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ud558\uc9c0\ub9cc \uc2e4\uc81c \uc0ac\uc6a9\ud560 \ub54c\ub294 \ub300\ubd80\ubd84 \ub9ac\uc2a4\ud2b8 \ud615\ud0dc\ub85c \ubcc0\ud658\ud574\uc57c \ud558\ub294 \uacbd\uc6b0\uac00 \ub9ce\uc74c. =&gt; \uacb0\uacfc\ub97c \ub9ac\uc2a4\ud2b8\ub85c \ubc14\uafd4\uc57c\ud568.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">final result = itmes.where((e) =&gt; e % 2 == 0).toList();<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>toSet<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ub9ac\uc2a4\ud2b8\uc5d0 \uc911\ubcf5\ub41c \ub370\uc774\ud130\uac00 \uc788\uc744 \uacbd\uc6b0, \uc911\ubcf5\uc744 \uc81c\uac70\ud55c \ub9ac\uc2a4\ud2b8\ub97c \uc5bb\uace0 \uc2f6\uc744 \ub54c \uc9d1\ud569\uc778 set\uc744 \uc0ac\uc6a9.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">final result = itmes.where((e) =&gt; e % 2 == 0).toSet().toList();<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>any<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ub9ac\uc2a4\ud2b8\uc5d0 \ud2b9\uc815 \uc870\uac74\uc744 \ucda9\uc871\ud558\ub294 \uc694\uc18c\uac00 \uc788\ub294\uc9c0 \uc5c6\ub294\uc9c0 \uac80\uc0ac\ud560 \ub54c \uc0ac\uc6a9\ud558\ub294 \ud568\uc218.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">print(items.any((e) =&gt; e % 2 == 0));<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>reduce<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ubc18\ubcf5 \uc694\uc18c\ub97c \uc904\uc5ec\uac00\uba74\uc11c \uacb0\uacfc\ub97c \ub9cc\ub4e4 \ub54c \uc0ac\uc6a9\ud558\ub294 \ud568\uc218.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \ucd5c\ub313\uac12\uc744 \uad6c\ud560 \ub54c, \uc21c\ucc28\uc801\uc73c\ub85c \ube44\uad50\ud558\ub294 \ub85c\uc9c1\n\nfinal result = items.reduce(max); \/\/5<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-family: 'monospace';\">\uae30\ud0c0<\/span><\/h3>\n<p><span style=\"font-family: 'monospace';\"><b>\uacc4\ub2e8\uc2dd \ud45c\uae30\ubc95 .. \uc5f0\uc0b0\uc790<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">cascade notation .. \uc5f0\uc0b0\uc790. \ub3d9\uc77c \uac1d\uccb4\uc5d0\uc11c \uc77c\ub828\uc758 \uc791\uc5c5\uc744 \uc218\ud589 \uac00\ub2a5.<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">.. \uc5f0\uc0b0\uc790\ub97c \uc0ac\uc6a9\ud558\uba74 \uba54\uc11c\ub4dc\ub97c \uc218\ud589\ud55c \uac1d\uccb4\uc758 \ucc38\uc870\ub97c \ubc18\ud658.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">print(items\n    ..add(6)\n  ..remove(2)); \/\/1, 3, 4, 5, 6<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uceec\ub809\uc158 if<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uc870\uac74\uc5d0 \uc758\ud574 \uceec\ub809\uc158\uc758 \uac12\uc744 \uc870\uc815\ud558\uac70\ub098 \ub2e4\ub974\uac8c \uc0ac\uc6a9\ud558\uace0 \uc2f6\uc744 \ub54c \uc0ac\uc6a9.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">bool promoActive = true;\n\nprint([1, 2, 3, 4, 5, if (promoActive) 6]); \/\/ true\uc77c \ub54c\ub9cc 6\uc774 \ucd94\uac00\ub428<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>\uceec\ub809\uc158 for<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\uceec\ub809\uc158 \ubb38\ubc95 \uc548\uc5d0\uc11c for \ubb38\uc744 \uc0ac\uc6a9 \uac00\ub2a5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">var listOfInts = [1, 2, 3];\nvar listOfStrings = [\n    '#0',\n  for (var i in listOfInts) '#$i'\n];\n\/\/#0, #1, #2, #3\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\"><b>null \ucc98\ub9ac<\/b><\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">\ub2e4\ud2b8\ub294 null\uc744 \ucc98\ub9ac\ud560 \uc218 \uc788\ub294 \uc5ec\ub7ec\uac00\uc9c0 \ubc29\ubc95\uc744 \uc81c\uacf5. (Dart\uc5d0\uc11c\ub294 \ubaa8\ub4e0 \uac83\uc774 \uac1d\uccb4. int, double, bool \uac19\uc740 \ud0c0\uc785\ub4e4\ub3c4 \ubaa8\ub450 \uac1d\uccb4\ub77c null\uac12\uc744 \uac00\uc9c8 \uc218\ub3c4 \uc788\uc74c.)<\/span><\/p>\n<p><span style=\"font-family: 'monospace';\">?. \uc5f0\uc0b0\uc790\ub97c \uc0ac\uc6a9\ud558\uba74 null \uc5ec\ubd80 \ud30c\uc545 \uac00\ub2a5.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">print(name?.lentgh); \/\/null\ucd9c\ub825<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'monospace';\">??\uc5f0\uc0b0\uc790\ub294 \uac1d\uccb4\uac00 null\uc77c \ub54c \uc791\ub3d9\uc744 \uac04\ub2e8\ud788 \uad6c\ud604\ud558\ub294\ub370 \uc0ac\uc6a9.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"dart\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">print(name?.length ?? 0); \/\/name\uc774 null\uc774\uba74 0\uc744 \ucd9c\ub825<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\ucd9c\ucc98: https:\/\/at0z.tistory.com\/155 \uae30\ubcf8 \ubb38\ubc95 (\ud2f0\uc2a4\ud1a0\ub9ac \ucf54\ub4dc\ube14\ub7ed\uc740 Dart\ub97c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc544 \uc6b0\uc120 java\ub85c \ud45c\uae30\ud569\ub2c8\ub2e4) &nbsp; \uc8fc\uc11d \/\/\uc8fc\uc11d \/** * \uc8fc\uc11d **\/ \/\/\/ \ubb38\uc11c\uc8fc\uc11d &nbsp; \ubb38\uc7a5 \uba85\ub839 \ub2e8\uc704. \uc138\ubbf8\ucf5c\ub860 ;\uc73c\ub85c \ub05d\ub09c\ub2e4. &nbsp; \ubcc0\uc218 data\ub97c \ub2f4\ub294 \uc0c1\uc790. \uc885\ub958\ub294 type, \uc790\ub8cc\ud615\uc774\ub77c\uace0 \ud568.dart\ub294 int, double, String, bool\uc744 \uae30\ubcf8 \uc81c\uacf5.\uc0ac\uc6a9\uc790\uac00 \uc9c1\uc811 \ud0c0\uc785\uc744 \uc815\uc758\ud560 \uc218 \uc788\uc74c. String name; name = &#8220;\ud64d\uae38\ub3d9&#8221;; name = [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[],"class_list":["post-5403","post","type-post","status-publish","format-standard","hentry","category-development_language"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5403"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5403\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}