Giter Club home page Giter Club logo

Comments (3)

werainkhatri avatar werainkhatri commented on August 18, 2024

Its better to move it to splash screen. In there, if the user is logged in, we can call the get_user_details api then and there. We can use provider to convey the User model object. But then cubit for profile will be useless.
Think what you can do and lemme know.

from ecellapp2021.

Hard-Coder05 avatar Hard-Coder05 commented on August 18, 2024

I guess as the user logs in we should call the getUserProfile that's a better approach according to me? What say?

from ecellapp2021.

werainkhatri avatar werainkhatri commented on August 18, 2024

I guess as the user logs in we should call the getUserProfile that's a better approach according to me? What say?

That should be the case when he's not logged in already. See, do this

in splash screen:
    If user is logged in
        get_user_details
        redirect to homescreen
    else
        redirect to loginscreen:
            when user logs in:
                get_user_details
                redirect to homescreen

ToDo:

  1. Remove ProfileCubit
  2. In SplashScreen, handle the api call directly and in LoginScreen, add it to the cubit
  3. add a Provider with User model just before the HomeScreen (whenever you redirect to homescreen, as you did for cubits)
  4. Get the User model using Provider.of<User>(context, listener: false) in the ProfileScreen

from ecellapp2021.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.