In chapter 6.9, I’m getting lost … probably because of my limited understanding of Dart and no real experience with OO programming … can someone help me determine how to interpret these 2 lines?
Also, at what point should I decide to stop learning Flutter and start a Dart tutorial instead and come back to Flutter afterwards?
class GroceryItemScreen extends StatefulWidget {
// 1
final Function(GroceryItem) onCreate;
// 2
final Function(GroceryItem) onUpdate;
@funkyboy … @jomoka … My confusion is over the (GroceryItem). Is that simply the type of data that will be operated on? In some other example, it might have been (String).
Just like a property of type String we can assign a String value, final Function(GroceryItem) onCreate; means that onCreate is a property that we can assign a function that takes GroceryItem as parameter.