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

Question: Imperative prog #5

Closed
adrianvintu opened this issue Apr 1, 2020 · 2 comments
Closed

Question: Imperative prog #5

adrianvintu opened this issue Apr 1, 2020 · 2 comments

Comments

@adrianvintu
Copy link

I noticed the ProgressDialog has methods to call from outside, which delegate to internal state.

  void hide() {
    progressDialogState.hide();
  }

This looks like imperative programming. Is this ok by the Flutter rules? Isn't Flutter declarative programming?

  • Newbee here
@harsh159357
Copy link
Owner

@adrianvintu Yes it is okay to use (There is no specific rule in flutter for state management).
Even if you have seen source for progressDialogState.hide() it is just changing the opacity property using setState()
void hide() { setState(() { opacity = false; }); }
Also note that this is the basic state management approach we do in flutter. Also you are good to follow any strategy you want.

I am sharing some links with you do check them out -
https://flutter.dev/docs/development/data-and-backend/state-mgmt/options

https://flutterx.com/ (if you want explore flutter further )

@adrianvintu
Copy link
Author

Thank you @harsh159357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants