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

State management in page #142

Closed
tayfunuyar opened this issue May 13, 2024 · 5 comments
Closed

State management in page #142

tayfunuyar opened this issue May 13, 2024 · 5 comments

Comments

@tayfunuyar
Copy link

Hi guys,
How to update current state in page.
stateUpdate not working in the page

I give sample code update currency in current page state with setState why isn't working.

class ItemDetailPage
    extends NyStatefulWidget<ItemDetailController> {
  static const path = '/item-detail-page';
  static const stateName = "item-page-state";

  ItemDetailPage({super.key})
      : super(path, child: ItemDetailPageState());
}
class ItemDetailPageState
    extends NyState<ItemDetailPage> {
 String currency= 'EUR';

  ItemDetailPageState() {
    stateName = ItemDetailPage.stateName;
  }
  @override
  Widget view(BuildContext context) {
}
}
@agordn52
Copy link
Contributor

Hi @tayfunuyar,

In your pubspec.yaml file, which version of nylo_framework are you using?

@tayfunuyar
Copy link
Author

Hi @agordn52
nylo_framework: ^5.27.2

@agordn52
Copy link
Contributor

Ok great, try this https://nylo.dev/docs/5.20.0/state-management#updating-a-state

You can check out the full docs on https://nylo.dev or you can watch this video on state management in Nylo https://www.youtube.com/watch?v=X5EVh1KooFk

@agordn52
Copy link
Contributor

Hi @tayfunuyar,

Try using the latest version of the nylo_framework and follow our documentation to help you understand how State Management works in Nylo.

@tayfunuyar
Copy link
Author

Thanks @agordn52

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