Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth/sign in/sign up/ forget password bloc stuff #94

Merged
merged 12 commits into from
Mar 25, 2020

Conversation

exlo89
Copy link

@exlo89 exlo89 commented Mar 11, 2020

1. separate bloc files

Ok, first of all, what do you think about to separate the bloc files in a different folder.
I put the auth bloc, sign in bloc, sign up bloc and forget password bloc in a separate folder.

Let me know what do you think about it?

2. token for the user

I started with the user repository and added a token variable to the user.
The idea is to save the token to get all the data from the web.

3. summary of little changes

  • create an auth bloc instance in the main

  • create a user repository instance in the main
    reason: to have only one single instance in the whole app

  • sign in or sign up trigger the auth bloc
    reason: I think it is cleaner to trigger the auth bloc indirectly

I think that's it for now. It is my first open-source project so I hope you find some helpful changes here. 😃

@4seer
Copy link
Owner

4seer commented Mar 11, 2020

  1. The idea of separating the bloc for sing in / sign up / forgot password is good. Let`s keep it.
  2. We need to stay within flutter clean architecture therefore repositories should be located in lib/data/local or remote folder (you can have a fake repo to take data from local json file for now). Take a look at this commit to get an example of repository location.
  3. Let`s have separate use-cases for sign in / sign up / forgot password for the clean architecture.
  4. There is a connected task with list of use-cases 8. Sign In / Sign Up Screens #82. (Tasks 8.2, 8.4, 8.5). I will assign it to you.
  5. We are integrating our app into WooCommerce and we need to make remote requests to their REST API. Take a look at this discussion at stackoverflow about sign in / sign up. We are making it using mock requests so you can make a local json file for response instead of remote request for now.

@4seer 4seer added the sign in / sign up Sign In / Sign up functionality label Mar 11, 2020
@4seer 4seer added this to the Backend API milestone Mar 11, 2020
@4seer 4seer linked an issue Mar 11, 2020 that may be closed by this pull request
@exlo89
Copy link
Author

exlo89 commented Mar 14, 2020

I use flutter_secure_storage to store the token. If somebody knows something better let me know.

I create a storage file for data during runtime. For example, it saves the token for API calls. Is there another way to save data during runtime? Or did somebody better plans to save data?

@4seer 4seer assigned 4seer and unassigned exlo89 and 4seer Mar 24, 2020
@4seer
Copy link
Owner

4seer commented Mar 24, 2020

Please, merge with development branch first.

@exlo89
Copy link
Author

exlo89 commented Mar 24, 2020

ok merge done

@4seer 4seer merged commit 829885d into 4seer:development Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sign in / sign up Sign In / Sign up functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8. Sign In / Sign Up Screens
2 participants