From d782a0e8dca92979b9fee478c44b6b37c29dece5 Mon Sep 17 00:00:00 2001 From: puneetkukreja98 Date: Fri, 20 Feb 2026 19:10:48 +0530 Subject: [PATCH 1/3] Fix FutureBuilder to use connectionState.done for renderButton --- .../google_sign_in_web/lib/google_sign_in_web.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart index ab0b9b5ea5c0..acb35ead4a11 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart @@ -280,7 +280,7 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { key: Key(config.hashCode.toString()), future: initialized, builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasData) { + if (snapshot.connectionState == ConnectionState.done) { return FlexHtmlElementView( viewType: 'gsi_login_button', onElementCreated: (Object element) { From 8c9a06285eacf3676c79e47e4db4264215666028 Mon Sep 17 00:00:00 2001 From: puneetkukreja98 Date: Fri, 20 Feb 2026 21:54:00 +0530 Subject: [PATCH 2/3] [google_sign_in_web] Bump version to 1.1.3 and update CHANGELOG --- packages/google_sign_in/google_sign_in_web/CHANGELOG.md | 5 +++++ packages/google_sign_in/google_sign_in_web/pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md index fdbfe4ac60ad..5c0b4abc0298 100644 --- a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.3 + +* Fix `renderButton` being stuck on "Getting ready" on web due to incorrect `FutureBuilder` state check. + ## 1.1.2 * Reverts "Throws a more actionable error when init is called more than once." @@ -253,3 +257,4 @@ ## 0.8.0 * Flutter for web initial release + diff --git a/packages/google_sign_in/google_sign_in_web/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/pubspec.yaml index 30ff5db731af..c824fbdc9fa5 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 1.1.2 +version: 1.1.3 environment: sdk: ^3.9.0 From af83e31c600b69b30ea4825fb3567f9c2a858b0f Mon Sep 17 00:00:00 2001 From: puneetkukreja98 Date: Sun, 22 Feb 2026 14:36:54 +0530 Subject: [PATCH 3/3] [google_sign_in_web] Add integration test for renderButton --- .../integration_test/web_only_test.dart | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.dart index dd86cd8cbe5c..5e0260e23d5e 100644 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.dart +++ b/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.dart @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; import 'package:google_sign_in_web/google_sign_in_web.dart' show GoogleSignInPlugin; +import 'package:google_sign_in_web/src/flexible_size_html_element_view.dart'; import 'package:google_sign_in_web/src/gis_client.dart'; import 'package:google_sign_in_web/web_only.dart' as web; import 'package:integration_test/integration_test.dart'; @@ -60,6 +61,22 @@ void main() { expect(button, isNotNull); }); + + testWidgets('renderButton shows loading then renders button', ( + WidgetTester tester, + ) async { + await tester.pumpWidget( + MaterialApp(home: Scaffold(body: web.renderButton())), + ); + + expect(find.text('Getting ready'), findsOneWidget); + + await tester.pumpAndSettle(const Duration(seconds: 3)); + + expect(find.text('Getting ready'), findsNothing); + + expect(find.byType(FlexHtmlElementView), findsOneWidget); + }); }); }