Skip to content

google_sign_in_web renderButton broken in v 1.1.1 #182633

Description

@reabbotted

Steps to reproduce

In the renderButton method in the google_sign_in_web.dart, it depends on a FutureBuilder:

   return FutureBuilder<void>(
      future: _initialized,
      builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
        if (snapshot.hasData) {
            ...
        }
        return const Text('Getting ready');
      },
    );
  }

However, the future it depends on changed from:

  Future<void> get initialized {
    _assertIsInitCalled();
    return Future.wait<void>(<Future<void>>[
      _jsSdkLoadedFuture,
      _initCalled!.future,
    ]);
  }

to

Future<void> get _initialized => _initCalled.future;

The if (snapshot.hasData) check never succeeds. Previously it would return an array of two null values. Now it just returns a null value, which is always false for hasData

Expected results

Instead of checking for hasData, check the connection state to see if it's done.

Actual results

It displays "Getting ready" all the time

Metadata

Metadata

Labels

p: google_sign_inThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.platform-webWeb applications specificallyteam-webOwned by Web platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions