Skip to content

Pass ThemeData to ForgotPasswordScreen #538

@VinhPhmCng

Description

@VinhPhmCng

Is there an existing issue for this?

  • I have searched the existing issues and found no duplicates.

What plugin is this bug for?

Firebase UI Auth

What platform(s) does this bug affect?

Web

List of dependencies used.

flutter pub deps -s list
Dart SDK 3.8.1
Flutter SDK 3.32.8
project_mk 1.0.0+1

dependencies:

  • bloc 9.0.0
    • meta ^1.3.0
  • cloud_firestore 5.6.12
    • cloud_firestore_platform_interface ^6.6.12
    • cloud_firestore_web ^4.4.12
    • collection ^1.0.0
    • firebase_core ^3.15.2
    • firebase_core_platform_interface ^6.0.0
    • flutter any
    • meta ^1.8.0
  • csv 6.0.0
  • equatable 2.0.7
    • collection ^1.15.0
    • meta ^1.3.0
  • firebase_auth 5.7.0
    • firebase_auth_platform_interface ^7.7.3
    • firebase_auth_web ^5.15.3
    • firebase_core ^3.15.2
    • firebase_core_platform_interface ^6.0.0
    • flutter any
    • meta ^1.8.0
  • firebase_core 3.15.2
    • firebase_core_platform_interface ^6.0.0
    • firebase_core_web ^2.24.1
    • flutter any
    • meta ^1.8.0
  • firebase_ui_auth 2.0.0
    • app_links ^6.4.0
    • email_validator ^2.1.17
    • firebase_auth ^5.7.0
    • firebase_core ^3.15.2
    • firebase_ui_localizations ^1.14.1
    • firebase_ui_oauth ^1.7.1
    • firebase_ui_shared ^1.4.1
    • flutter any
    • flutter_localizations any
    • meta ^1.10.0
  • firebase_ui_localizations 1.14.1
    • flutter any
    • flutter_localizations any
    • path ^1.8.3
  • flutter 0.0.0
    • characters 1.4.0
    • collection 1.19.1
    • material_color_utilities 0.11.1
    • meta 1.16.0
    • vector_math 2.1.4
    • sky_engine any
  • flutter_auto_size_text 4.1.0
    • flutter any
  • flutter_bloc 9.1.1
    • bloc ^9.0.0
    • flutter any
    • provider ^6.0.0
  • flutter_localizations 0.0.0
    • flutter any
    • intl 0.20.2
    • characters 1.4.0
    • clock 1.1.2
    • collection 1.19.1
    • material_color_utilities 0.11.1
    • meta 1.16.0
    • path 1.9.1
    • vector_math 2.1.4
  • flutter_web_plugins 0.0.0
    • flutter any
    • characters 1.4.0
    • collection 1.19.1
    • material_color_utilities 0.11.1
    • meta 1.16.0
    • vector_math 2.1.4
  • formz 0.8.0
    • meta ^1.7.0
  • go_router 16.1.0
    • collection ^1.15.0
    • flutter any
    • flutter_web_plugins any
    • logging ^1.0.0
    • meta ^1.7.0
  • google_fonts 6.3.0
    • flutter any
    • http ^1.0.0
    • path_provider ^2.0.0
    • crypto ^3.0.0
  • internet_connection_checker_plus 2.7.2
    • connectivity_plus ^6.1.3
    • flutter any
    • http ^1.0.0
  • logging 1.3.0

dev dependencies:

  • bloc_lint 0.2.1
    • _fe_analyzer_shared >=75.0.0 <=86.0.0
    • checked_yaml ^2.0.0
    • collection ^1.0.0
    • glob ^2.0.0
    • json_annotation ^4.9.0
    • path ^1.0.0
    • pubspec_lock_parse ^2.0.0
  • bloc_test 10.0.0
    • bloc ^9.0.0
    • diff_match_patch ^0.4.1
    • meta ^1.3.0
    • mocktail ^1.0.0
    • test ^1.16.0
  • flutter_native_splash 2.4.6
    • args ^2.7.0
    • flutter any
    • flutter_web_plugins any
    • html ^0.15.5
    • image ^4.5.4
    • meta ^1.16.0
    • path ^1.9.1
    • universal_io ^2.2.2
    • xml ^6.5.0
    • yaml ^3.1.3
    • ansicolor ^2.0.3
  • flutter_test 0.0.0
    • flutter any
    • test_api 0.7.4
    • matcher 0.12.17
    • path 1.9.1
    • fake_async 1.3.3
    • clock 1.1.2
    • stack_trace 1.12.1
    • vector_math 2.1.4
    • leak_tracker_flutter_testing 3.0.9
    • async 2.13.0
    • boolean_selector 2.1.2
    • characters 1.4.0
    • collection 1.19.1
    • leak_tracker 10.0.9
    • leak_tracker_testing 3.0.1
    • material_color_utilities 0.11.1
    • meta 1.16.0
    • source_span 1.10.1
    • stream_channel 2.1.4
    • string_scanner 1.4.1
    • term_glyph 1.2.2
    • vm_service 15.0.0
  • mocktail 1.0.4
    • collection ^1.15.0
    • matcher ^0.12.15
    • test_api >=0.2.1 <0.8.0
  • very_good_analysis 9.0.0

transitive dependencies:

  • _fe_analyzer_shared 85.0.0
    • meta ^1.9.0
  • _flutterfire_internals 1.3.59
    • collection ^1.0.0
    • firebase_core ^3.15.2
    • firebase_core_platform_interface ^6.0.0
    • flutter any
    • meta ^1.8.0
  • analyzer 7.7.1
    • _fe_analyzer_shared ^85.0.0
    • collection ^1.19.0
    • convert ^3.0.0
    • crypto ^3.0.0
    • glob ^2.0.0
    • meta ^1.15.0
    • package_config ^2.0.0
    • path ^1.9.0
    • pub_semver ^2.1.4
    • source_span ^1.8.0
    • watcher ^1.1.0
    • yaml ^3.0.0
  • ansicolor 2.0.3
  • app_links 6.4.0
    • flutter any
    • app_links_linux ^1.0.3
    • app_links_platform_interface ^2.0.2
    • app_links_web ^1.0.4
  • app_links_linux 1.0.3
    • flutter any
    • app_links_platform_interface ^2.0.0
    • gtk ^2.1.0
  • app_links_platform_interface 2.0.2
    • flutter any
    • plugin_platform_interface ^2.1.7
  • app_links_web 1.0.4
    • flutter any
    • flutter_web_plugins any
    • app_links_platform_interface ^2.0.0
    • web >=0.3.0 <2.0.0
  • archive 4.0.7
    • crypto ^3.0.3
    • path ^1.8.0
    • posix ^6.0.2
  • args 2.7.0
  • async 2.13.0
    • collection ^1.15.0
    • meta ^1.3.0
  • boolean_selector 2.1.2
    • source_span ^1.8.0
    • string_scanner ^1.1.0
  • characters 1.4.0
  • checked_yaml 2.0.4
    • json_annotation ^4.3.0
    • source_span ^1.8.0
    • yaml ^3.0.0
  • cli_config 0.2.0
    • args ^2.4.0
    • yaml ^3.1.1
  • clock 1.1.2
  • cloud_firestore_platform_interface 6.6.12
    • _flutterfire_internals ^1.3.59
    • collection ^1.15.0
    • firebase_core ^3.15.2
    • flutter any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • cloud_firestore_web 4.4.12
    • _flutterfire_internals ^1.3.59
    • cloud_firestore_platform_interface ^6.6.12
    • collection ^1.0.0
    • firebase_core ^3.15.2
    • firebase_core_web ^2.24.1
    • flutter any
    • flutter_web_plugins any
  • collection 1.19.1
  • connectivity_plus 6.1.4
    • flutter any
    • flutter_web_plugins any
    • connectivity_plus_platform_interface ^2.0.1
    • web >=0.5.0 <2.0.0
    • meta ^1.8.0
    • nm ^0.5.0
    • collection ^1.18.0
  • connectivity_plus_platform_interface 2.0.1
    • flutter any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.4
  • convert 3.1.2
    • typed_data ^1.3.0
  • coverage 1.15.0
    • args ^2.0.0
    • cli_config ^0.2.0
    • glob ^2.1.2
    • logging ^1.0.0
    • meta ^1.0.2
    • package_config ^2.0.0
    • path ^1.8.0
    • source_maps ^0.10.10
    • stack_trace ^1.10.0
    • vm_service >=12.0.0 <16.0.0
    • yaml ^3.1.3
  • crypto 3.0.6
    • typed_data ^1.3.0
  • csslib 1.0.2
    • source_span ^1.8.0
  • dbus 0.7.11
    • args ^2.0.0
    • ffi ^2.0.0
    • meta ^1.3.0
    • xml ^6.1.0
  • desktop_webview_auth 0.0.15
    • crypto ^3.0.3
    • flutter any
    • http ^1.0.0
    • flutter_web_plugins any
    • plugin_platform_interface ^2.1.4
  • diff_match_patch 0.4.1
  • email_validator 2.1.17
  • fake_async 1.3.3
    • clock ^1.1.0
    • collection ^1.15.0
  • ffi 2.1.4
  • file 7.0.1
    • meta ^1.9.1
    • path ^1.8.3
  • firebase_auth_platform_interface 7.7.3
    • _flutterfire_internals ^1.3.59
    • collection ^1.16.0
    • firebase_core ^3.15.2
    • flutter any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_auth_web 5.15.3
    • firebase_auth_platform_interface ^7.7.3
    • firebase_core ^3.15.2
    • firebase_core_web ^2.24.1
    • flutter any
    • flutter_web_plugins any
    • http_parser ^4.0.0
    • meta ^1.8.0
    • web ^1.0.0
  • firebase_core_platform_interface 6.0.0
    • collection ^1.0.0
    • flutter any
    • flutter_test any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_core_web 2.24.1
    • firebase_core_platform_interface ^6.0.0
    • flutter any
    • flutter_web_plugins any
    • meta ^1.8.0
    • web ^1.0.0
  • firebase_ui_oauth 1.7.1
    • desktop_webview_auth ^0.0.14
    • firebase_auth ^5.7.0
    • firebase_ui_auth ^2.0.0
    • firebase_ui_shared ^1.4.1
    • flutter_svg ^2.0.9
    • flutter any
  • firebase_ui_shared 1.4.1
    • flutter any
  • flutter_svg 2.2.0
    • flutter any
    • http ^1.0.0
    • vector_graphics ^1.1.13
    • vector_graphics_codec ^1.1.11+1
    • vector_graphics_compiler ^1.1.14
  • frontend_server_client 4.0.0
    • async ^2.5.0
    • path ^1.8.0
  • glob 2.1.3
    • async ^2.5.0
    • collection ^1.15.0
    • file >=6.1.3 <8.0.0
    • path ^1.8.0
    • string_scanner ^1.1.0
  • gtk 2.1.0
    • ffi ^2.0.1
    • flutter any
    • meta ^1.8.0
  • html 0.15.6
    • csslib ^1.0.0
    • source_span ^1.8.0
  • http 1.5.0
    • async ^2.5.0
    • http_parser ^4.0.0
    • meta ^1.3.0
    • web >=0.5.0 <2.0.0
  • http_multi_server 3.2.2
    • async ^2.5.0
  • http_parser 4.1.2
    • collection ^1.19.0
    • source_span ^1.8.0
    • string_scanner ^1.1.0
    • typed_data ^1.3.0
  • image 4.5.4
    • archive ^4.0.2
    • meta ^1.3.0
    • xml ^6.0.1
  • intl 0.20.2
    • clock ^1.1.0
    • meta ^1.3.0
    • path ^1.8.0
  • io 1.0.5
    • meta ^1.3.0
    • path ^1.8.0
    • string_scanner ^1.1.0
  • js 0.7.2
  • json_annotation 4.9.0
    • meta ^1.4.0
  • leak_tracker 10.0.9
    • clock ^1.1.1
    • collection ^1.15.0
    • meta ^1.8.0
    • path ^1.8.3
    • vm_service >=11.10.0 <16.0.0
  • leak_tracker_flutter_testing 3.0.9
    • flutter any
    • leak_tracker >=10.0.8 <11.0.0
    • leak_tracker_testing >=3.0.1 <4.0.0
    • matcher ^0.12.16
    • meta ^1.8.0
  • leak_tracker_testing 3.0.1
    • leak_tracker >=9.0.0 <11.0.0
    • matcher ^0.12.16
    • meta ^1.11.0
  • matcher 0.12.17
    • async ^2.10.0
    • meta ^1.8.0
    • stack_trace ^1.10.0
    • term_glyph ^1.2.0
    • test_api >=0.5.0 <0.8.0
  • material_color_utilities 0.11.1
    • collection ^1.15.0
  • meta 1.16.0
  • mime 2.0.0
  • nested 1.0.0
    • flutter any
  • nm 0.5.0
    • dbus ^0.7.0
  • node_preamble 2.0.2
  • package_config 2.2.0
    • path ^1.8.0
  • path 1.9.1
  • path_parsing 1.1.0
    • meta ^1.3.0
    • vector_math ^2.1.0
  • path_provider 2.1.5
    • flutter any
    • path_provider_android ^2.2.5
    • path_provider_foundation ^2.3.2
    • path_provider_linux ^2.2.0
    • path_provider_platform_interface ^2.1.0
    • path_provider_windows ^2.2.0
  • path_provider_android 2.2.17
    • flutter any
    • path_provider_platform_interface ^2.1.0
  • path_provider_foundation 2.4.1
    • flutter any
    • path_provider_platform_interface ^2.1.0
  • path_provider_linux 2.2.1
    • ffi >=1.1.2 <3.0.0
    • flutter any
    • path ^1.8.0
    • path_provider_platform_interface ^2.1.0
    • xdg_directories >=0.2.0 <2.0.0
  • path_provider_platform_interface 2.1.2
    • flutter any
    • platform ^3.0.0
    • plugin_platform_interface ^2.1.7
  • path_provider_windows 2.3.0
    • ffi ^2.0.0
    • flutter any
    • path ^1.8.0
    • path_provider_platform_interface ^2.1.0
  • petitparser 6.1.0
    • meta ^1.16.0
    • collection ^1.19.0
  • platform 3.1.6
  • plugin_platform_interface 2.1.8
    • meta ^1.3.0
  • pool 1.5.1
    • async ^2.5.0
    • stack_trace ^1.10.0
  • posix 6.0.3
    • ffi ^2.0.1
    • meta ^1.7.0
    • path ^1.8.3
  • provider 6.1.5
    • collection ^1.15.0
    • flutter any
    • nested ^1.0.0
  • pub_semver 2.2.0
    • collection ^1.15.0
  • pubspec_lock_parse 2.2.0
    • args ^2.3.1
    • json_annotation ^4.6.0
    • pub_semver ^2.1.1
    • checked_yaml ^2.0.1
  • shelf 1.4.2
    • async ^2.5.0
    • collection ^1.15.0
    • http_parser ^4.1.0
    • path ^1.8.0
    • stack_trace ^1.10.0
    • stream_channel ^2.1.0
  • shelf_packages_handler 3.0.2
    • path ^1.8.0
    • shelf ^1.0.0
    • shelf_static ^1.0.0
  • shelf_static 1.1.3
    • convert ^3.0.0
    • http_parser ^4.0.0
    • mime >=1.0.0 <3.0.0
    • path ^1.8.0
    • shelf ^1.1.2
  • shelf_web_socket 3.0.0
    • shelf ^1.1.0
    • stream_channel ^2.1.0
    • web_socket_channel >=2.0.0 <4.0.0
  • sky_engine 0.0.0
  • source_map_stack_trace 2.1.2
    • path ^1.8.0
    • source_maps ^0.10.10
    • stack_trace ^1.10.0
  • source_maps 0.10.13
    • source_span ^1.8.0
  • source_span 1.10.1
    • collection ^1.15.0
    • path ^1.8.0
    • term_glyph ^1.2.0
  • stack_trace 1.12.1
    • path ^1.8.0
  • stream_channel 2.1.4
    • async ^2.5.0
  • string_scanner 1.4.1
    • source_span ^1.8.0
  • term_glyph 1.2.2
  • test 1.25.15
    • analyzer >=6.0.0 <8.0.0
    • async ^2.5.0
    • boolean_selector ^2.1.0
    • collection ^1.15.0
    • coverage ^1.0.1
    • http_multi_server ^3.0.0
    • io ^1.0.0
    • js >=0.6.4 <0.8.0
    • matcher >=0.12.16 <0.12.18
    • node_preamble ^2.0.0
    • package_config ^2.0.0
    • path ^1.8.0
    • pool ^1.5.0
    • shelf ^1.0.0
    • shelf_packages_handler ^3.0.0
    • shelf_static ^1.0.0
    • shelf_web_socket >=1.0.0 <4.0.0
    • source_span ^1.8.0
    • stack_trace ^1.10.0
    • stream_channel ^2.1.0
    • test_api 0.7.4
    • test_core 0.6.8
    • typed_data ^1.3.0
    • web_socket_channel >=2.0.0 <4.0.0
    • webkit_inspection_protocol ^1.0.0
    • yaml ^3.0.0
  • test_api 0.7.4
    • async ^2.5.0
    • boolean_selector ^2.1.0
    • collection ^1.15.0
    • meta ^1.14.0
    • source_span ^1.8.0
    • stack_trace ^1.10.0
    • stream_channel ^2.1.0
    • string_scanner ^1.1.0
    • term_glyph ^1.2.0
  • test_core 0.6.8
    • analyzer >=6.0.0 <8.0.0
    • args ^2.0.0
    • async ^2.5.0
    • boolean_selector ^2.1.0
    • collection ^1.15.0
    • coverage ^1.0.0
    • frontend_server_client >=3.2.0 <5.0.0
    • glob ^2.0.0
    • io ^1.0.0
    • meta ^1.3.0
    • package_config ^2.0.0
    • path ^1.8.0
    • pool ^1.5.0
    • source_map_stack_trace ^2.1.0
    • source_maps ^0.10.10
    • source_span ^1.8.0
    • stack_trace ^1.10.0
    • stream_channel ^2.1.0
    • test_api 0.7.4
    • vm_service >=6.0.0 <16.0.0
    • yaml ^3.0.0
  • typed_data 1.4.0
    • collection ^1.15.0
  • universal_io 2.2.2
    • collection ^1.17.0
    • meta ^1.9.0
    • typed_data ^1.3.0
  • vector_graphics 1.1.19
    • flutter any
    • http ^1.0.0
    • vector_graphics_codec ^1.1.11+1
  • vector_graphics_codec 1.1.13
  • vector_graphics_compiler 1.1.17
    • args ^2.3.0
    • meta ^1.7.0
    • path ^1.8.0
    • path_parsing ^1.0.1
    • vector_graphics_codec ^1.1.11+1
    • xml >=6.3.0 <=6.5.0
  • vector_math 2.1.4
  • vm_service 15.0.0
  • watcher 1.1.2
    • async ^2.5.0
    • path ^1.8.0
  • web 1.1.1
  • web_socket 1.0.1
    • web >=0.5.0 <2.0.0
  • web_socket_channel 3.0.3
    • async ^2.5.0
    • crypto ^3.0.0
    • stream_channel ^2.1.0
    • web >=0.5.0 <2.0.0
    • web_socket >=0.1.5 <2.0.0
  • webkit_inspection_protocol 1.2.1
    • logging ^1.0.0
  • xdg_directories 1.1.0
    • meta ^1.3.0
    • path ^1.8.0
  • xml 6.5.0
    • collection ^1.18.0
    • meta ^1.9.0
    • petitparser ^6.0.0
  • yaml 3.1.3
    • collection ^1.15.0
    • source_span ^1.8.0
    • string_scanner ^1.2.0

Steps to reproduce

  • Wrap SignInScreen in Theme, for example
return Theme(
  data: ThemeData(
    outlinedButtonTheme: const OutlinedButtonThemeData(
      style: ButtonStyle(
        shape: WidgetStatePropertyAll(RoundedRectangleBorder()),
      ),
    ),
  ),
  child: const SignInScreen(...),
);

Expected Behavior

Custom theming applies to all views of SignInScreen. 'Sign in', 'Register' and 'Reset password' buttons all have rectangular borders.

Actual Behavior

  • 'Sign in' & 'Register' buttons are as expected.
  • 'Reset password' button still has rounded borders.

Additional Information

final localTheme = ThemeData(
  outlinedButtonTheme: OutlinedButtonThemeData(
    style: ButtonStyle(
      shape: const WidgetStatePropertyAll(RoundedRectangleBorder()),
    ),
  ),
);

return Theme(
  data: localTheme,
  child: SignInScreen(
    actions: [
      AuthStateChangeAction<UserCreated>(...),
      AuthStateChangeAction<SignedIn>(...),
      ForgotPasswordAction((context, email) {
        Navigator.of(context).push(
          MaterialPageRoute<ForgotPasswordScreen>(
            builder: (context) => Theme(
              data: localTheme,
              child: ForgotPasswordScreen(email: email),
            ),
          ),
        );
      }),
    ],
  ),
);

Overriding ForgotPasswordAction and pushing the ForgotPasswordScreen wrapped in the Theme fixed this problem. Theming is properly applied to the forgot-password view.

So I feel like this is either not a bug and there's something slightly wrong with my setup, or it's a really small oversight that can be fixed by adding a line or two to the source code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs AttentionOP created or responded to issue and it needs attention.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions