Dart : Cascade operator

반복되는 keyword를 줄여 준다..

final addressBook = AddressBookBuilder();
addressBook.name = “kims”
addressBook.address = “kims@box.cokr”
addressBook.phone = PhoneNumberBuilder();
addressBook.phone.number = ‘111-1111-1111’
addressBook.phone.tag = “Office” ).build()
addressBook.build();

를 아래와 같이 간결하게 변경 할 수 있다.

final addressBook = ( AddressBookBuilder()
..name = “kims”
..address = “kims@box.cokr”
..phone = ( PhoneNumberBuilder()
..number = ‘111-1111-1111’
..tag = “Office” ).build())
.build();


    StringBuffer sb = new StringBuffer()     
..write(“test1”)      
..write(“test2”)      
..write(“test3”);   
 print(“text : ” + sb.toString());

이렇게 줄여 쓸수도…