Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow to unlink providers only in edit mode #10649

Merged
merged 3 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Expand Down
50 changes: 22 additions & 28 deletions packages/firebase_ui_auth/lib/src/screens/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ class _LinkedProvidersRowState extends State<_LinkedProvidersRow> {
const animationDuration = Duration(milliseconds: 150);
const curve = Curves.easeOut;

void unlink() {
_unlinkProvider(context, providerId);
VoidCallback? unlink;

if (isEditing) {
unlink = () => _unlinkProvider(context, providerId);
}

return Stack(
Expand All @@ -246,11 +248,9 @@ class _LinkedProvidersRowState extends State<_LinkedProvidersRow> {
width: size,
height: size,
child: unlinkingProvider == providerId
? Center(
child: LoadingIndicator(
size: size - (size / 4),
borderWidth: 1,
),
? LoadingIndicator(
size: size - (size / 4),
borderWidth: 1,
)
: Icon(providerIcon(context, providerId)),
),
Expand All @@ -259,28 +259,22 @@ class _LinkedProvidersRowState extends State<_LinkedProvidersRow> {
duration: animationDuration,
opacity: isEditing ? 1 : 0,
curve: curve,
child: GestureDetector(
onTap: unlink,
child: SizedBox(
width: size,
height: size,
child: Align(
alignment: Alignment.topRight,
child: SizedBox(
width: size,
height: size,
child: Align(
alignment: Alignment.topRight,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: unlink,
child: Transform.translate(
offset: const Offset(14, -12),
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: unlink,
child: Padding(
padding: const EdgeInsets.all(8),
child: Icon(
isCupertino
? CupertinoIcons.minus_circle_fill
: Icons.remove_circle,
size: 20,
color: Theme.of(context).colorScheme.error,
),
),
offset: const Offset(6, -4),
child: Icon(
isCupertino
? CupertinoIcons.minus_circle_fill
: Icons.remove_circle,
size: 20,
color: Theme.of(context).colorScheme.error,
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_database/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies:
firebase_core: ^2.9.0
firebase_database: ^10.1.0
dev_dependencies:
drive: ^0.1.0
drive: ^1.0.0-1.0.nullsafety.1
flutter_test:
sdk: flutter
integration_test:
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_firestore/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
cupertino_icons: ^1.0.2
firebase_core: ^2.9.0
dev_dependencies:
drive: ^0.1.0
drive: ^1.0.0-1.0.nullsafety.1
flutter_test:
sdk: flutter
integration_test:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
// Copyright 2020, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Expand Down