himanshusharma89 / relic_bazaar

A Retro Theme-based e-commerce app for antiques. #Hack20
https://relic-bazaar.himanshusharma.tech/
Creative Commons Zero v1.0 Universal
85 stars 92 forks source link

Adding provider package and managing state correctly and cleaning up data sharing between widgets #98

Closed D-Ajay-Kumar closed 3 years ago

D-Ajay-Kumar commented 3 years ago

Feature Request ✨

Introducing provider package and managing state correctly and passing data following good practices.

Use Case

When real data would be added, the provider package and the products provider class would help managing the state easily.

Possible Solution

Adding the provider package for state management. Cleaning the code by passing objects between widgets and not attributes of the model.

Context

The current code doesn't have any state management solution and adding it now would make things very easy in the future else a lot of code would be needed to change and replace for state management.

Detailed Description

Currently the products list is in the constants file and is accessed from there. I want to introduce the provider package, create a new products provider class with change notifier and shift the dummy products list there and manage the state of the app using this products provider class.

Apart from that, currently all the attributes of a product are individually passed to widgets like products card and product screen, which renders the product model moot. I want to clear that code and make the widgets share objects instead of all attributes individually.

I would like to start working on this issue if it gets approved. I am also a participant in GSSOC'21.

AnshMishra2001 commented 3 years ago

Can I work on this issue?

D-Ajay-Kumar commented 3 years ago

Umm... I created the issue so I guess I should be assigned to it if it gets accepted. Maybe you can find some other issue to work on?

himanshusharma89 commented 3 years ago

Sure @D-Ajay-Kumar, this issue will be assigned to you, but before that, we need to cover up the UI and API part. I'll create an issue for API soon.

Rishabh510 commented 3 years ago

Sure @D-Ajay-Kumar, this issue will be assigned to you, but before that, we need to cover up the UI and API part. I'll create an issue for API soon.

Also, we need to discuss that we will be using Provider only for the architecture. As there numerous other state management techniques like BLoC, Redux, get_it or a flavor of Provider like Stacked, my personal favorite.

himanshusharma89 commented 3 years ago

@Rishabh510 I prefer provider as of now, because we don't have much complex features in the app.

himanshusharma89 commented 3 years ago

@D-Ajay-Kumar would you like to work on this? If so, let me know. we'll discuss the issue in details