I dont understand me what happen in this part of code
AuthenticationEvent([List props = const []]) : super(props);
cold you help me to know about that?
thanks
Hi @MahdiPishguy 馃憢
Thanks for opening an issue!
Regarding your question, since AuthenticationEvent extends Equatable it needs to pass the properties to the superclass.
Equatable uses these properties to override == and hashCode in order to allow you to compare different instances of the same type. You can read more about equatable here.
With that in mind, all this line is doing is making it so you can extend AuthenticationEvent and pass custom properties to the super class (AuthenticationEvent) which will then pass them to the Equatable super class.
class SomeEvent extends AuthenticationEvent {
final String someProperty;
final String someOtherProperty;
SomeEvent(this.someProperty, this.someOtherProperty)
: super([someProperty, someOtherProperty]);
}
This would not be possible without the line you are referencing.
Hope that makes sense 馃憤
Most helpful comment
Hi @MahdiPishguy 馃憢
Thanks for opening an issue!
Regarding your question, since
AuthenticationEventextendsEquatableit needs to pass the properties to the superclass.Equatable uses these properties to override
==andhashCodein order to allow you to compare different instances of the same type. You can read more about equatable here.With that in mind, all this line is doing is making it so you can extend
AuthenticationEventand pass custom properties to the super class (AuthenticationEvent) which will then pass them to theEquatablesuper class.This would not be possible without the line you are referencing.
Hope that makes sense 馃憤