Skip to content

Commit 9b8f3bd

Browse files
Copilotmaurovanetti
andcommitted
Apply final dart format
Co-authored-by: maurovanetti <402070+maurovanetti@users.noreply.github.com>
1 parent 97963d3 commit 9b8f3bd

File tree

3 files changed

+70
-73
lines changed

3 files changed

+70
-73
lines changed

lib/src/components/supa_email_auth.dart

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ class BooleanMetaDataField extends MetaDataField {
119119
this.isRequired = false,
120120
this.checkboxPosition = ListTileControlAffinity.platform,
121121
required super.key,
122-
}) : assert(
123-
label != null || richLabelSpans != null,
124-
'Either label or richLabelSpans must be provided',
125-
),
126-
super(label: label ?? '');
122+
}) : assert(
123+
label != null || richLabelSpans != null,
124+
'Either label or richLabelSpans must be provided',
125+
),
126+
super(label: label ?? '');
127127

128128
Widget getLabelWidget(BuildContext context) {
129129
// This matches the default style of [TextField], to match the other fields
@@ -358,8 +358,7 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
358358
textInputAction: widget.metadataFields != null && !_isSigningIn
359359
? TextInputAction.next
360360
: TextInputAction.done,
361-
validator:
362-
widget.passwordValidator ??
361+
validator: widget.passwordValidator ??
363362
(value) {
364363
if (value == null || value.isEmpty || value.length < 6) {
365364
return localization.passwordLengthError;
@@ -429,9 +428,8 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
429428
as bool,
430429
onChanged: (bool? value) {
431430
setState(() {
432-
_metadataControllers[metadataField
433-
.key] =
434-
value ?? false;
431+
_metadataControllers[
432+
metadataField.key] = value ?? false;
435433
});
436434
field.didChange(value);
437435
},
@@ -453,8 +451,8 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
453451
field.errorText!,
454452
style: theme.textTheme.labelSmall
455453
?.copyWith(
456-
color: theme.colorScheme.error,
457-
),
454+
color: theme.colorScheme.error,
455+
),
458456
),
459457
),
460458
],
@@ -465,13 +463,12 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
465463
// Otherwise render a normal TextFormField matching
466464
// the style of the other fields in the form.
467465
TextFormField(
468-
controller:
469-
_metadataControllers[metadataField.key]
470-
as TextEditingController,
466+
controller: _metadataControllers[metadataField.key]
467+
as TextEditingController,
471468
textInputAction:
472469
widget.metadataFields!.last == metadataField
473-
? TextInputAction.done
474-
: TextInputAction.next,
470+
? TextInputAction.done
471+
: TextInputAction.next,
475472
decoration: InputDecoration(
476473
label: Text(metadataField.label),
477474
prefixIcon: metadataField.prefixIcon,

lib/src/components/supa_magic_auth.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ class _SupaMagicAuthState extends State<SupaMagicAuth> {
5454
@override
5555
void initState() {
5656
super.initState();
57-
_gotrueSubscription = Supabase.instance.client.auth.onAuthStateChange
58-
.listen((data) {
59-
final session = data.session;
60-
if (session != null && mounted) {
61-
widget.onSuccess(session);
62-
}
63-
});
57+
_gotrueSubscription =
58+
Supabase.instance.client.auth.onAuthStateChange.listen((data) {
59+
final session = data.session;
60+
if (session != null && mounted) {
61+
widget.onSuccess(session);
62+
}
63+
});
6464
}
6565

6666
@override

lib/src/components/supa_socials_auth.dart

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,45 @@ import 'package:supabase_flutter/supabase_flutter.dart';
1414

1515
extension on OAuthProvider {
1616
IconData get iconData => switch (this) {
17-
OAuthProvider.apple => FontAwesomeIcons.apple,
18-
OAuthProvider.azure => FontAwesomeIcons.microsoft,
19-
OAuthProvider.bitbucket => FontAwesomeIcons.bitbucket,
20-
OAuthProvider.discord => FontAwesomeIcons.discord,
21-
OAuthProvider.facebook => FontAwesomeIcons.facebook,
22-
OAuthProvider.figma => FontAwesomeIcons.figma,
23-
OAuthProvider.github => FontAwesomeIcons.github,
24-
OAuthProvider.gitlab => FontAwesomeIcons.gitlab,
25-
OAuthProvider.google => FontAwesomeIcons.google,
26-
OAuthProvider.linkedin => FontAwesomeIcons.linkedin,
27-
OAuthProvider.slack => FontAwesomeIcons.slack,
28-
OAuthProvider.spotify => FontAwesomeIcons.spotify,
29-
OAuthProvider.twitch => FontAwesomeIcons.twitch,
30-
OAuthProvider.twitter => FontAwesomeIcons.xTwitter,
31-
_ => Icons.close,
32-
};
17+
OAuthProvider.apple => FontAwesomeIcons.apple,
18+
OAuthProvider.azure => FontAwesomeIcons.microsoft,
19+
OAuthProvider.bitbucket => FontAwesomeIcons.bitbucket,
20+
OAuthProvider.discord => FontAwesomeIcons.discord,
21+
OAuthProvider.facebook => FontAwesomeIcons.facebook,
22+
OAuthProvider.figma => FontAwesomeIcons.figma,
23+
OAuthProvider.github => FontAwesomeIcons.github,
24+
OAuthProvider.gitlab => FontAwesomeIcons.gitlab,
25+
OAuthProvider.google => FontAwesomeIcons.google,
26+
OAuthProvider.linkedin => FontAwesomeIcons.linkedin,
27+
OAuthProvider.slack => FontAwesomeIcons.slack,
28+
OAuthProvider.spotify => FontAwesomeIcons.spotify,
29+
OAuthProvider.twitch => FontAwesomeIcons.twitch,
30+
OAuthProvider.twitter => FontAwesomeIcons.xTwitter,
31+
_ => Icons.close,
32+
};
3333

3434
Color get btnBgColor => switch (this) {
35-
OAuthProvider.apple => Colors.black,
36-
OAuthProvider.azure => Colors.blueAccent,
37-
OAuthProvider.bitbucket => Colors.blue,
38-
OAuthProvider.discord => Colors.purple,
39-
OAuthProvider.facebook => const Color(0xFF3b5998),
40-
OAuthProvider.figma => const Color.fromRGBO(241, 77, 27, 1),
41-
OAuthProvider.github => Colors.black,
42-
OAuthProvider.gitlab => Colors.deepOrange,
43-
OAuthProvider.google => Colors.white,
44-
OAuthProvider.kakao => const Color(0xFFFFE812),
45-
OAuthProvider.keycloak => const Color.fromRGBO(0, 138, 170, 1),
46-
OAuthProvider.linkedin => const Color.fromRGBO(0, 136, 209, 1),
47-
OAuthProvider.notion => const Color.fromRGBO(69, 75, 78, 1),
48-
OAuthProvider.slack => const Color.fromRGBO(74, 21, 75, 1),
49-
OAuthProvider.spotify => Colors.green,
50-
OAuthProvider.twitch => Colors.purpleAccent,
51-
OAuthProvider.twitter => Colors.black,
52-
OAuthProvider.workos => const Color.fromRGBO(99, 99, 241, 1),
53-
// ignore: unreachable_switch_case
54-
_ => Colors.black,
55-
};
35+
OAuthProvider.apple => Colors.black,
36+
OAuthProvider.azure => Colors.blueAccent,
37+
OAuthProvider.bitbucket => Colors.blue,
38+
OAuthProvider.discord => Colors.purple,
39+
OAuthProvider.facebook => const Color(0xFF3b5998),
40+
OAuthProvider.figma => const Color.fromRGBO(241, 77, 27, 1),
41+
OAuthProvider.github => Colors.black,
42+
OAuthProvider.gitlab => Colors.deepOrange,
43+
OAuthProvider.google => Colors.white,
44+
OAuthProvider.kakao => const Color(0xFFFFE812),
45+
OAuthProvider.keycloak => const Color.fromRGBO(0, 138, 170, 1),
46+
OAuthProvider.linkedin => const Color.fromRGBO(0, 136, 209, 1),
47+
OAuthProvider.notion => const Color.fromRGBO(69, 75, 78, 1),
48+
OAuthProvider.slack => const Color.fromRGBO(74, 21, 75, 1),
49+
OAuthProvider.spotify => Colors.green,
50+
OAuthProvider.twitch => Colors.purpleAccent,
51+
OAuthProvider.twitter => Colors.black,
52+
OAuthProvider.workos => const Color.fromRGBO(99, 99, 241, 1),
53+
// ignore: unreachable_switch_case
54+
_ => Colors.black,
55+
};
5656

5757
String get labelText =>
5858
'Continue with ${name[0].toUpperCase()}${name.substring(1)}';
@@ -214,16 +214,16 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
214214
void initState() {
215215
super.initState();
216216
localization = widget.localization;
217-
_gotrueSubscription = Supabase.instance.client.auth.onAuthStateChange
218-
.listen((data) {
219-
final session = data.session;
220-
if (session != null && mounted) {
221-
widget.onSuccess.call(session);
222-
if (widget.showSuccessSnackBar) {
223-
context.showSnackBar(localization.successSignInMessage);
224-
}
225-
}
226-
});
217+
_gotrueSubscription =
218+
Supabase.instance.client.auth.onAuthStateChange.listen((data) {
219+
final session = data.session;
220+
if (session != null && mounted) {
221+
widget.onSuccess.call(session);
222+
if (widget.showSuccessSnackBar) {
223+
context.showSnackBar(localization.successSignInMessage);
224+
}
225+
}
226+
});
227227
}
228228

229229
@override
@@ -315,7 +315,7 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
315315
final iosClientId = googleAuthConfig?.iosClientId;
316316
final shouldPerformNativeGoogleSignIn =
317317
(webClientId != null && !kIsWeb && Platform.isAndroid) ||
318-
(iosClientId != null && !kIsWeb && Platform.isIOS);
318+
(iosClientId != null && !kIsWeb && Platform.isIOS);
319319
if (shouldPerformNativeGoogleSignIn) {
320320
await _nativeGoogleSignIn(
321321
webClientId: webClientId,
@@ -329,7 +329,7 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
329329
if (socialProvider == OAuthProvider.apple) {
330330
final shouldPerformNativeAppleSignIn =
331331
(isNativeAppleAuthEnabled && !kIsWeb && Platform.isIOS) ||
332-
(isNativeAppleAuthEnabled && !kIsWeb && Platform.isMacOS);
332+
(isNativeAppleAuthEnabled && !kIsWeb && Platform.isMacOS);
333333
if (shouldPerformNativeAppleSignIn) {
334334
await _nativeAppleSignIn();
335335
return;

0 commit comments

Comments
 (0)