I am working through many of the tutorials out there on bloc with flutter and running into some inconsistencies.
I am using Android studio and creating the bloc code by using the plugin from Intellij v1.6.0.
For the bloc_event, I continue to see examples that look like this.
@immutable
abstract class FruitEvent extends Equatable {
FruitEvent([List props = const []]) : super(props);
}
When I generate my bloc files and look at the initial _event one that generates, it looks like this.
@immutable
abstract class SongEvent extends Equatable {
const SongEvent();
}
If I modify my code that is generated to include the following...
[List props = const []]) : super(props)
Then I get the following error "Too many positional arguments, 0 expected, 1 found" which references props at the end of the line shown above.
If I leave my code as it was generated by the bloc plugin, and then try to implement my events by adding in the following...
class AddSong extends SongEvent {}
Then I get an error of "Missing concrete implementation of 'getter Equatable.props'
Here is my current bloc/song_event.dart
import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
@immutable
abstract class SongEvent extends Equatable {
const SongEvent();
}
class AddSong extends SongEvent {}
Question Should I be using the line that has props in it as shown in the FuitEvent example?
I don't understand what it is I am missing here and why it shows with an error when I try to use the same method as shown in so many of the tutorials.