0

When, for example, I want to create a button with the text "button" in it I create a RaisedButton with a Text widget as its child. Wheter or not I use the 'new' keyword before this Text does not seem to make a difference in the end result of the button. Therefore I was wondering in what situation the new keyword would be necessary when making use of the regular widget like RaisedButton and Text. I am, off course, familiar with the 'new' keyword and its uses to create a new object but in the situation that I just described I do not understand how the keyword makes a difference and wheter or not I should use it.

Teun K
  • 73
  • 8

1 Answers1

3

The new keyword is totally optional from Dart 2.0. It's not mandatory to use it.

onosecond
  • 548
  • 6
  • 10