felangel / bloc

A predictable state management library that helps implement the BLoC design pattern
https://bloclibrary.dev
MIT License
11.8k stars 3.39k forks source link

object oriented block coding #640

Closed farrokhpey closed 4 years ago

farrokhpey commented 4 years ago

Hi @felangel i am developing a big project that contains too many blocs i ant to define some base classes such as BaseEvent, BaseState, BaseBloc i did this but now there is a problem with my code, it said: image

can u tell me how should i resolve this problem? these are my class definition and bloc usage:

image

felangel commented 4 years ago

Hi @farrokhpey 👋 Thanks for opening an issue!

Can you please share a link to a sample app which illustrates the problem? Thanks!

farrokhpey commented 4 years ago

sorry @felangel ,i cant share it, i haven't access to do this, it's on office github account and i can't change access what did you need, ask me to explain it, sorry

felangel commented 4 years ago

Can you create a simplified version just to illustrate the issue?

farrokhpey commented 4 years ago

OK, but can u explain how can i use Base Bloc Classes, i mean that we have 3 class for bloc, event and state and then extend other blocs from them, override needed methods, add additional events and states and more. I'll create a repository

felangel commented 4 years ago

It's likely because your base class isn't providing the specific generics so the types resolve to dynamic. I would be able to better assist if you provide a sample repo though, thanks!

felangel commented 4 years ago

@farrokhpey closing for now but feel free to comment with additional information and I'm happy to continue the conversation 👍