ExtractedWidgetForLst({
Key key,
@required List<Expense> expensesData,
}) : _expensesData = expensesData, super(key: key);
If we need any argument to be passed to the class, we use parameterized constructor and in that we use super() to call parent constructor inside the body if needed. and if we don't need calling super then just we use this keyword in the parameter itself, e.g:
class MyClass{
String name;
String surname;
MyClass({this.name,this.surname});
}
but what does operator ' : ' and super means over this scenario.
question from:
https://stackoverflow.com/questions/65644964/how-does-below-constructor-work-in-dart-i-have-extracted-widget-and-flutter-has 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…