본문 바로가기

안드로이드/Flutter

Dart - What is < > in dart language?

 

If you build a flutter project on android studio, you will get codes like below

 

in this code, you can see some codes like

WTF is the <MyHomePage> and What do the <> do??

 

It is a class named 'State' that contains a class named 'MyHomePage'

So, it's a class. and it contains a class.

Do you understand? I don't lol

 

If you Ctrl + click State, you can go to

here.

it measn T is a class, you can use class T in the class State.

 

Lets see an example

 

In Dart, everything is class.

Even int, String are classes too!

So, you can put String int <>

this code, class Obj uses class String

So, you can print 'String' by using the class String

 

it's end

 

byebye