firebase / FirebaseUI-Flutter

Apache License 2.0
90 stars 79 forks source link

🐛 [firebase_ui_auth] problems with LoginView layout #335

Open Shiru99 opened 2 months ago

Shiru99 commented 2 months ago

Is there an existing issue for this?

What plugin is this bug for?

Firebase UI Auth

What platform(s) does this bug affect?

Android

List of dependencies used.

flutter pub deps -s list
Dart SDK 3.3.3
Flutter SDK 3.19.5
ad 1.0.0
dependencies:
- flutter 0.0.0
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.8.0
  - meta 1.11.0
  - vector_math 2.1.4
  - sky_engine any
- cupertino_icons 1.0.6
- firebase_core 2.29.0
  - firebase_core_platform_interface ^5.0.0
  - firebase_core_web ^2.15.0
  - flutter any
  - meta ^1.8.0
- firebase_auth 4.19.1
  - firebase_auth_platform_interface ^7.2.2
  - firebase_auth_web ^5.11.1
  - firebase_core ^2.29.0
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - meta ^1.8.0
- firebase_ui_auth 1.13.1
  - email_validator ^2.1.17
  - firebase_auth ^4.17.5
  - firebase_core ^2.25.4
  - firebase_dynamic_links ^5.4.14
  - firebase_ui_localizations ^1.10.2
  - firebase_ui_oauth ^1.5.1
  - firebase_ui_shared ^1.4.1
  - flutter any
  - flutter_localizations any
  - meta ^1.10.0
- firebase_ui_oauth_google 1.3.1
  - firebase_auth ^4.17.5
  - firebase_ui_oauth ^1.5.1
  - flutter any
  - google_sign_in ^6.2.1
- google_sign_in 6.2.1
  - flutter any
  - google_sign_in_android ^6.1.0
  - google_sign_in_ios ^5.7.0
  - google_sign_in_platform_interface ^2.4.0
  - google_sign_in_web ^0.12.0
dev dependencies:
- flutter_test 0.0.0
  - flutter any
  - test_api 0.6.1
  - matcher 0.12.16+1
  - path 1.9.0
  - fake_async 1.3.1
  - clock 1.1.1
  - stack_trace 1.11.1
  - vector_math 2.1.4
  - leak_tracker_flutter_testing 2.0.1
  - async 2.11.0
  - boolean_selector 2.1.1
  - characters 1.3.0
  - collection 1.18.0
  - leak_tracker 10.0.0
  - leak_tracker_testing 2.0.1
  - material_color_utilities 0.8.0
  - meta 1.11.0
  - source_span 1.10.0
  - stream_channel 2.1.2
  - string_scanner 1.2.0
  - term_glyph 1.2.1
  - vm_service 13.0.0
- flutter_lints 3.0.2
  - lints ^3.0.0
transitive dependencies:
- _flutterfire_internals 1.3.29
  - collection ^1.0.0
  - firebase_core ^2.29.0
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - meta ^1.8.0
- args 2.5.0
- async 2.11.0
  - collection ^1.15.0
  - meta ^1.1.7
- boolean_selector 2.1.1
  - source_span ^1.8.0
  - string_scanner ^1.1.0
- characters 1.3.0
- clock 1.1.1
- collection 1.18.0
- crypto 3.0.3
  - typed_data ^1.3.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
- email_validator 2.1.17
- fake_async 1.3.1
  - clock ^1.1.0
  - collection ^1.15.0
- firebase_auth_platform_interface 7.2.2
  - _flutterfire_internals ^1.3.29
  - collection ^1.16.0
  - firebase_core ^2.29.0
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_auth_web 5.11.1
  - firebase_auth_platform_interface ^7.2.2
  - firebase_core ^2.29.0
  - firebase_core_web ^2.15.0
  - flutter any
  - flutter_web_plugins any
  - http_parser ^4.0.0
  - meta ^1.8.0
  - web ^0.5.1
- firebase_core_platform_interface 5.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.15.0
  - firebase_core_platform_interface ^5.0.0
  - flutter any
  - flutter_web_plugins any
  - meta ^1.8.0
  - web ^0.5.1
- firebase_dynamic_links 5.5.1
  - firebase_core ^2.29.0
  - firebase_core_platform_interface ^5.0.0
  - firebase_dynamic_links_platform_interface ^0.2.6+29
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_dynamic_links_platform_interface 0.2.6+29
  - _flutterfire_internals ^1.3.29
  - firebase_core ^2.29.0
  - flutter any
  - meta ^1.8.0
  - plugin_platform_interface ^2.1.3
- firebase_ui_localizations 1.10.2
  - flutter any
  - flutter_localizations any
  - path ^1.8.3
- firebase_ui_oauth 1.5.1
  - desktop_webview_auth ^0.0.14
  - firebase_auth ^4.17.5
  - firebase_ui_auth ^1.13.1
  - firebase_ui_shared ^1.4.1
  - flutter_svg ^2.0.9
  - flutter any
- firebase_ui_shared 1.4.1
  - flutter any
- flutter_localizations 0.0.0
  - flutter any
  - intl 0.18.1
  - characters 1.3.0
  - clock 1.1.1
  - collection 1.18.0
  - material_color_utilities 0.8.0
  - meta 1.11.0
  - path 1.9.0
  - vector_math 2.1.4
- flutter_svg 2.0.10+1
  - flutter any
  - http ^1.0.0
  - vector_graphics ^1.1.11
  - vector_graphics_codec ^1.1.11
  - vector_graphics_compiler ^1.1.11
- flutter_web_plugins 0.0.0
  - flutter any
  - characters 1.3.0
  - collection 1.18.0
  - material_color_utilities 0.8.0
  - meta 1.11.0
  - vector_math 2.1.4
- google_identity_services_web 0.3.1+1
  - meta ^1.3.0
  - web ^0.5.1
- google_sign_in_android 6.1.23
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_ios 5.7.6
  - flutter any
  - google_sign_in_platform_interface ^2.2.0
- google_sign_in_platform_interface 2.4.5
  - flutter any
  - plugin_platform_interface ^2.1.7
- google_sign_in_web 0.12.4
  - flutter any
  - flutter_web_plugins any
  - google_identity_services_web ^0.3.1
  - google_sign_in_platform_interface ^2.4.0
  - http >=0.13.0 <2.0.0
  - web ^0.5.0
- http 1.2.1
  - async ^2.5.0
  - http_parser ^4.0.0
  - meta ^1.3.0
  - web ^0.5.0
- http_parser 4.0.2
  - collection ^1.15.0
  - source_span ^1.8.0
  - string_scanner ^1.1.0
  - typed_data ^1.3.0
- intl 0.18.1
  - clock ^1.1.0
  - meta ^1.0.2
  - path ^1.8.0
- leak_tracker 10.0.0
  - clock ^1.1.1
  - collection ^1.15.0
  - meta ^1.8.0
  - path ^1.8.3
  - vm_service >=11.10.0 <15.0.0
- leak_tracker_flutter_testing 2.0.1
  - flutter any
  - leak_tracker >=10.0.0 <11.0.0
  - leak_tracker_testing >=2.0.1 <3.0.0
  - matcher ^0.12.16
  - meta ^1.8.0
- leak_tracker_testing 2.0.1
  - leak_tracker >=9.0.0 <11.0.0
  - matcher ^0.12.16
  - meta ^1.11.0
- lints 3.0.0
- matcher 0.12.16+1
  - 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.8.0
  - collection ^1.15.0
- meta 1.11.0
- path 1.9.0
- path_parsing 1.0.1
  - vector_math ^2.1.0
  - meta ^1.3.0
- petitparser 6.0.2
  - meta ^1.9.0
- plugin_platform_interface 2.1.8
  - meta ^1.3.0
- sky_engine 0.0.99
- source_span 1.10.0
  - collection ^1.15.0
  - path ^1.8.0
  - term_glyph ^1.2.0
- stack_trace 1.11.1
  - path ^1.8.0
- stream_channel 2.1.2
  - async ^2.5.0
- string_scanner 1.2.0
  - source_span ^1.8.0
- term_glyph 1.2.1
- test_api 0.6.1
  - async ^2.5.0
  - boolean_selector ^2.1.0
  - collection ^1.15.0
  - meta ^1.3.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
- typed_data 1.3.2
  - collection ^1.15.0
- vector_graphics 1.1.11+1
  - flutter any
  - http ^1.0.0
  - vector_graphics_codec 1.1.11+1
- vector_graphics_codec 1.1.11+1
- vector_graphics_compiler 1.1.11+1
  - args ^2.3.0
  - meta ^1.7.0
  - path_parsing ^1.0.1
  - xml ^6.3.0
  - vector_graphics_codec 1.1.11+1
  - path ^1.8.0
- vector_math 2.1.4
- vm_service 13.0.0
- web 0.5.1
- xml 6.5.0
  - collection ^1.18.0
  - meta ^1.9.0
  - petitparser ^6.0.0

Steps to reproduce

Just switch showAuthActionSwitch: true to showAuthActionSwitch: false

SignInScreen(
            providers: [
              GoogleProvider(clientId: GOOGLE_CLIENT_ID),
            ],
            showAuthActionSwitch: false,
            ...
)

Expected Behavior

Expected it to hide all Title & AuthAction, but it hides only 'AuthAction'

Actual Behavior

Only hides 'AuthAction' & not Title - "Sing in/ Register"

Before After (expected to hide text - "Sign in")
Before After (expected to hide text - "Register")

Additional Information

Can be corrected by-

In Class _LoginViewState : var _showTitle can be set to widget.showAuthActionSwitch instead of widget.showTitle which has default value of true and no option to set any other value

class _LoginViewState extends State<LoginView> {
  late AuthAction _action = widget.action;

  // bool get _showTitle => widget.showTitle ?? true;
  bool get _showTitle => widget.showAuthActionSwitch ?? true;   //      <<<---  Change suggestion --->>>

  bool get _showAuthActionSwitch => widget.showAuthActionSwitch ?? true;
  bool _buttonsBuilt = false;

  void setAction(AuthAction action) {
    setState(() {
      _action = action;
    });
  }
...
}