I have found some codes that got me confused regarding "this" keyword and the colon after the constructor.
I want to know what the difference between the two is, and what they are for.
Using colon
class BusinessLogic {
const BusinessLogic({
required DataRepository repository,
}) : _repository = repository;
final DataRepository _repository;
}
Using this keyword
class BusinessLogic {
const BusinessLogic({
required this.repository,
});
final DataRepository repository;
}