Skip to content

Commit c2da6c7

Browse files
fix: allow to unlink providers only in edit mode (#10649)
Co-authored-by: Russell Wheatley <[email protected]>
1 parent 47c132c commit c2da6c7

File tree

5 files changed

+24
-32
lines changed

5 files changed

+24
-32
lines changed

Diff for: packages/firebase_ui_auth/example/test_driver/firebase_ui_auth_e2e_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @dart=2.9
21
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
32
// for details. All rights reserved. Use of this source code is governed by a
43
// BSD-style license that can be found in the LICENSE file.

Diff for: packages/firebase_ui_auth/lib/src/screens/profile_screen.dart

+22-28
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,10 @@ class _LinkedProvidersRowState extends State<_LinkedProvidersRow> {
236236
const animationDuration = Duration(milliseconds: 150);
237237
const curve = Curves.easeOut;
238238

239-
void unlink() {
240-
_unlinkProvider(context, providerId);
239+
VoidCallback? unlink;
240+
241+
if (isEditing) {
242+
unlink = () => _unlinkProvider(context, providerId);
241243
}
242244

243245
return Stack(
@@ -246,11 +248,9 @@ class _LinkedProvidersRowState extends State<_LinkedProvidersRow> {
246248
width: size,
247249
height: size,
248250
child: unlinkingProvider == providerId
249-
? Center(
250-
child: LoadingIndicator(
251-
size: size - (size / 4),
252-
borderWidth: 1,
253-
),
251+
? LoadingIndicator(
252+
size: size - (size / 4),
253+
borderWidth: 1,
254254
)
255255
: Icon(providerIcon(context, providerId)),
256256
),
@@ -259,28 +259,22 @@ class _LinkedProvidersRowState extends State<_LinkedProvidersRow> {
259259
duration: animationDuration,
260260
opacity: isEditing ? 1 : 0,
261261
curve: curve,
262-
child: GestureDetector(
263-
onTap: unlink,
264-
child: SizedBox(
265-
width: size,
266-
height: size,
267-
child: Align(
268-
alignment: Alignment.topRight,
262+
child: SizedBox(
263+
width: size,
264+
height: size,
265+
child: Align(
266+
alignment: Alignment.topRight,
267+
child: GestureDetector(
268+
behavior: HitTestBehavior.opaque,
269+
onTap: unlink,
269270
child: Transform.translate(
270-
offset: const Offset(14, -12),
271-
child: GestureDetector(
272-
behavior: HitTestBehavior.opaque,
273-
onTap: unlink,
274-
child: Padding(
275-
padding: const EdgeInsets.all(8),
276-
child: Icon(
277-
isCupertino
278-
? CupertinoIcons.minus_circle_fill
279-
: Icons.remove_circle,
280-
size: 20,
281-
color: Theme.of(context).colorScheme.error,
282-
),
283-
),
271+
offset: const Offset(6, -4),
272+
child: Icon(
273+
isCupertino
274+
? CupertinoIcons.minus_circle_fill
275+
: Icons.remove_circle,
276+
size: 20,
277+
color: Theme.of(context).colorScheme.error,
284278
),
285279
),
286280
),

Diff for: packages/firebase_ui_database/example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies:
3636
firebase_core: ^2.9.0
3737
firebase_database: ^10.1.0
3838
dev_dependencies:
39-
drive: ^0.1.0
39+
drive: ^1.0.0-1.0.nullsafety.1
4040
flutter_test:
4141
sdk: flutter
4242
integration_test:

Diff for: packages/firebase_ui_firestore/example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies:
3434
cupertino_icons: ^1.0.2
3535
firebase_core: ^2.9.0
3636
dev_dependencies:
37-
drive: ^0.1.0
37+
drive: ^1.0.0-1.0.nullsafety.1
3838
flutter_test:
3939
sdk: flutter
4040
integration_test:

Diff for: packages/firebase_ui_firestore/example/test_driver/firebase_ui_firestore_e2e_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @dart=2.9
21
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
32
// for details. All rights reserved. Use of this source code is governed by a
43
// BSD-style license that can be found in the LICENSE file.

0 commit comments

Comments
 (0)