Skip to content

🐛 [firebase_ui] ProfileScreen won't rebuild their children in a StatefulWidget #9682

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

Closed
guplem opened this issue Oct 5, 2022 · 1 comment · Fixed by #11160
Closed
Assignees
Labels
plugin: ui type: bug Something isn't working

Comments

@guplem
Copy link

guplem commented Oct 5, 2022

Bug report

Describe the bug
If you use the ProfileScreen in a StatefulWidget, after calling SetState, the "children" of the widget ProfileScreen won't be rebuilt.

Steps to reproduce

  1. Create an empty StatefulWidget.
  2. In the build method add the ProfileScreen
  3. Add a Text widget as the children (displaying the text of a variable in the state).
  4. Additionally, as another child, add an ElevatedButton widget that calls the setState method and alters the String variable that the Text widget is displaying.
  5. Test the app, you will see how that child won't be rebuilt. If you add more widgets (outside the ProfileScreen) you will see how those are rebuilt (even the ProfileScreen itself gets rebuilt).

Expected behavior

The children of the ProfileScreen should be rebuilt to display/work accordingly to the updated data.


Additional context

I have checked the code of ProfileScreen, and it looks to me that the issue occurs due to the constant list it is given by default in the children parameter:
image

Additionally, I do believe that the ProfileScreen widget might need some rework as mentioned here and in #9229.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.3, on Microsoft Windows [Version 10.0.22621.521], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.19)
[√] Android Studio (version 2021.3)
[√] Connected device (3 available)
[√] HTTP Host Availability

• No issues found!

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 2.18.2
Flutter SDK 3.3.3
things 1.0.0+1

dependencies:
- cloud_firestore 3.4.9 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.5
- firebase_auth 3.10.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 1.23.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]
- flutterfire_ui 0.4.3+10 [cloud_firestore collection crypto desktop_webview_auth email_validator firebase_auth firebase_core firebase_database firebase_dynamic_links flutter flutter_facebook_auth flutter_localizations flutter_svg google_sign_in sign_in_with_apple twitter_login]
- freezed 2.1.1 [analyzer build build_config collection meta source_gen freezed_annotation json_annotation]
- google_sign_in 5.4.2 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web]
- json_annotation 4.7.0 [meta]

dev dependencies:
- build_runner 2.2.1 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml]
- flutter_lints 2.0.1 [lints]
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph]
- json_serializable 6.4.0 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper]

transitive dependencies:
- _fe_analyzer_shared 49.0.0 [meta]
- analyzer 5.1.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml]
- args 2.3.1
- async 2.9.0 [collection meta]
- boolean_selector 2.1.0 [source_span string_scanner]
- build 2.3.1 [analyzer async convert crypto glob logging meta path]
- build_config 1.1.0 [checked_yaml json_annotation path pubspec_parse yaml]
- build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel]
- build_resolvers 2.0.10 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml]
- build_runner_core 7.2.4 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml]    
- built_collection 5.1.1
- built_value 8.4.1 [built_collection collection fixnum meta]
- characters 1.2.1
- checked_yaml 2.0.1 [json_annotation source_span yaml]
- clock 1.1.1
- cloud_firestore_platform_interface 5.7.5 [collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 2.8.8 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- code_builder 4.3.0 [built_collection built_value collection matcher meta]
- collection 1.16.0
- convert 3.0.2 [typed_data]
- crypto 3.0.2 [typed_data]
- dart_style 2.2.4 [analyzer args path pub_semver source_span]
- desktop_webview_auth 0.0.9 [crypto flutter http]
- email_validator 2.1.17
- fake_async 1.3.1 [clock collection]
- file 6.1.4 [meta path]
- firebase_auth_platform_interface 6.9.0 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 4.5.0 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta]
- firebase_core_platform_interface 4.5.1 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 1.7.2 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_database 9.1.5 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter]
- firebase_database_platform_interface 0.2.2+5 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_database_web 0.2.1+7 [firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins js]
- firebase_dynamic_links 4.3.8 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface]
- firebase_dynamic_links_platform_interface 0.2.3+13 [firebase_core flutter meta plugin_platform_interface]
- fixnum 1.0.1
- flutter_facebook_auth 4.4.1+1 [flutter flutter_facebook_auth_platform_interface flutter_facebook_auth_web]
- flutter_facebook_auth_platform_interface 3.2.0 [flutter plugin_platform_interface]
- flutter_facebook_auth_web 3.2.0 [flutter flutter_web_plugins js flutter_facebook_auth_platform_interface]
- flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math]
- flutter_svg 1.1.5 [flutter meta path_drawing vector_math xml]
- flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math]
- freezed_annotation 2.1.0 [collection json_annotation meta]
- frontend_server_client 2.1.3 [async path]
- glob 2.1.0 [async collection file path string_scanner]
- google_sign_in_android 6.1.1 [flutter google_sign_in_platform_interface]
- google_sign_in_ios 5.5.0 [flutter google_sign_in_platform_interface]
- google_sign_in_platform_interface 2.3.0 [flutter plugin_platform_interface quiver]
- google_sign_in_web 0.10.2 [flutter flutter_web_plugins google_sign_in_platform_interface js]
- graphs 2.1.0 [collection]
- http 0.13.5 [async http_parser meta path]
- http_multi_server 3.2.1 [async]
- http_parser 4.0.1 [collection source_span string_scanner typed_data]
- intl 0.17.0 [clock path]
- io 1.0.3 [meta path string_scanner]
- js 0.6.4
- lints 2.0.0
- logging 1.0.2
- matcher 0.12.12 [stack_trace]
- material_color_utilities 0.1.5
- meta 1.8.0
- mime 1.0.2
- package_config 2.1.0 [path]
- path 1.8.2
- path_drawing 1.0.1 [vector_math meta path_parsing flutter]
- path_parsing 1.0.1 [vector_math meta]
- petitparser 5.0.0 [meta]
- plugin_platform_interface 2.1.3 [meta]
- pool 1.5.1 [async stack_trace]
- pub_semver 2.1.1 [collection meta]
- pubspec_parse 1.2.1 [checked_yaml collection json_annotation pub_semver yaml]
- quiver 3.1.0 [matcher]
- shelf 1.4.0 [async collection http_parser path stack_trace stream_channel]
- shelf_web_socket 1.0.2 [shelf stream_channel web_socket_channel]
- sign_in_with_apple 3.3.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web]
- sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta]
- sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js]
- sky_engine 0.0.99
- source_gen 1.2.5 [analyzer async build dart_style glob meta path source_span yaml]
- source_helper 1.3.3 [analyzer collection source_gen]
- source_span 1.9.0 [collection path term_glyph]
- stack_trace 1.10.0 [path]
- stream_channel 2.1.0 [async]
- stream_transform 2.0.0
- string_scanner 1.1.1 [source_span]
- term_glyph 1.2.1
- test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher]
- timing 1.0.0 [json_annotation]
- twitter_login 4.2.3 [flutter crypto http]
- typed_data 1.3.1 [collection]
- vector_math 2.1.2
- watcher 1.0.1 [async path]
- web_socket_channel 2.2.0 [async crypto stream_channel]
- xml 6.1.0 [collection meta petitparser]
- yaml 3.1.1 [collection source_span string_scanner]

@guplem guplem added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 5, 2022
@darshankawar darshankawar added the triage Issue is currently being triaged. label Oct 6, 2022
@darshankawar
Copy link

Thanks for the report. There's a similar issue open when the profile screen doesn't rebuild after coming back from email verification : #8683 and there seems to be work going on to fix these that you can track for reference:

https://github.com/firebase/flutterfire/milestone/9

/cc @lesnitsky

@darshankawar darshankawar added plugin: ui and removed Needs Attention This issue needs maintainer attention. triage Issue is currently being triaged. labels Oct 6, 2022
@lesnitsky lesnitsky self-assigned this Oct 12, 2022
@lesnitsky lesnitsky modified the milestone: [UI] Stable release Oct 12, 2022
@firebase firebase locked and limited conversation to collaborators Jul 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin: ui type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants