• Latest
  • Hot
  • Ask
  • Full Apps
  • Ui
  • Packages
Ask August 30,2018

Set State of parent Widget

Let's say, I have a custom button widget and I want to set the state of it's parent using setState. How exactly can I access the parent widget's state from my custom button? Is it even possibile?


Solution 1: Dinesh Balasubramanian

You can use callbacks functions to achieve this. You can refer here.

In the link

  • FeedPage is similar to CustomButton(ChildWiget)
  • RootPage is similar to ParentWiget


Twitter Facebook Reddit Hacker News LinkedIn Email

Most Viewed

Netflix UI Clone Build with Flutter and BloC

GitJournal - Markdown Notes Build with Fluter

How to debug multiple widgets used the same GlobalKey

Sign in up takes so long time to load from firebase

Featured Articles

Catagories

  • Ask63292
  • Full Apps40
  • Ui5
  • Packages2
  • Game2
  • Template0
  • flutter
  • firebase-authentication
  • dart
  • flutter-layout
  • datetime
  • flutter-bloc
  • cubit
  • image
  • byte
  • mobile
  • flutter-getx
  • flame
  • bloc
  • flutter-web
  • tooltip
  • sfcartesianchart
  • google-signin
  • android-studio
  • iot
  • android
  • listview
  • flutter-listview
  • flutter-state
  • rxdart
  • global-variables
  • firebase
  • google-cloud-firestore
  • persistent
  • sqflite
  • visual-studio-code
  • user-interface
  • flutter-animation
  • drag-and-drop
  • sql
  • sqlite
  • flutter-moor
  • ios
  • xcode
  • flutter-dependencies
  • mobile-development
  • authentication
  • app-store
  • recaptcha
  • Privacy Policy
  • Submit Project
© Copyright © All rights reserved
Licensed under cc by-sa 3.0 with attribution required.

Catagories

  • Ask
  • Full Apps
  • Ui
  • Packages

Join our Newsletter