Open Arpit1496 opened 1 month ago
Please share your provider definition. The generated code isn't useful to me without seeing the code that generated this.
BASE:
import 'package:astra_ui/state/list_state.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart';
part 'test.g.dart';
typedef ListDataGetter<Model, Sort, Cursor> = Future<(IList
@riverpod
class ListBloc<Model, Sort, Cursor> extends _$ListBloc<Model, Sort, Cursor> {
@override
ListState<Model, Sort, Cursor> build({
required String type,
required ListDataGetter<Model, Sort, Cursor> getData,
String? parentId,
}) {
return ListState<Model, Sort, Cursor>(
data:
II am on latest dev branch of riverpod generator and yet I am facing issues for generics. The code builder leaves "Generics" in 2 functions:
1). _copyWith: The create Function parameter does not consider Generics and generates a compile time error.
ListBlocProvider _copyWith( ListBloc Function() create, )
2). == override: The first condition of == does not consider generics and hence 2 objects are never equal and generate a compile time error.
@override bool operator ==(Object other) { return other is ListBlocProvider && other.runtimeType == runtimeType && other.getData == getData; }
A sample error message is added for better understanding.
THIS IS WHAT "SHOULD" BE GENERATED:
BUT THIS IS WHAT IS GENERATED: