Skip to content

Commit c9364bb

Browse files
Lyokonelesnitsky
authored andcommitted
refactor: upgrade project to remove warnings from Flutter 3.7 (#10344)
* refactor: remove deprecated lints in Flutter 3.7 * refactor: remove deprecated lints in Flutter 3.7 * refactor: remove deprecated lints in Flutter 3.7 * refactor: remove deprecated lints in Flutter 3.7 * refactor: remove deprecated lints in Flutter 3.7 * refactor: remove deprecated lints in Flutter 3.7 * refactor: remove deprecated lints in Flutter 3.7 * refactor: remove deprecated lints in Flutter 3.7
1 parent 8bfb084 commit c9364bb

File tree

17 files changed

+108
-121
lines changed

17 files changed

+108
-121
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
include: package:flutter_lints/flutter.yaml
22

3-
# Additional information about this file can be found at
4-
# https://dart.dev/guides/language/analysis-options
3+
4+
linter:
5+
rules:
6+
use_build_context_synchronously: false

packages/firebase_ui_auth/example/macos/Runner.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@
403403
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
404404
GCC_WARN_UNUSED_FUNCTION = YES;
405405
GCC_WARN_UNUSED_VARIABLE = YES;
406-
MACOSX_DEPLOYMENT_TARGET = 10.11;
406+
MACOSX_DEPLOYMENT_TARGET = 10.14;
407407
MTL_ENABLE_DEBUG_INFO = NO;
408408
SDKROOT = macosx;
409409
SWIFT_COMPILATION_MODE = wholemodule;
@@ -484,7 +484,7 @@
484484
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
485485
GCC_WARN_UNUSED_FUNCTION = YES;
486486
GCC_WARN_UNUSED_VARIABLE = YES;
487-
MACOSX_DEPLOYMENT_TARGET = 10.11;
487+
MACOSX_DEPLOYMENT_TARGET = 10.14;
488488
MTL_ENABLE_DEBUG_INFO = YES;
489489
ONLY_ACTIVE_ARCH = YES;
490490
SDKROOT = macosx;
@@ -531,7 +531,7 @@
531531
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
532532
GCC_WARN_UNUSED_FUNCTION = YES;
533533
GCC_WARN_UNUSED_VARIABLE = YES;
534-
MACOSX_DEPLOYMENT_TARGET = 10.11;
534+
MACOSX_DEPLOYMENT_TARGET = 10.14;
535535
MTL_ENABLE_DEBUG_INFO = NO;
536536
SDKROOT = macosx;
537537
SWIFT_COMPILATION_MODE = wholemodule;

packages/firebase_ui_auth/lib/firebase_ui_auth.dart

+61-76
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// ignore_for_file: use_build_context_synchronously
5+
import 'package:firebase_auth/firebase_auth.dart' hide OAuthProvider;
6+
import 'package:firebase_core/firebase_core.dart';
7+
import 'package:firebase_ui_oauth/firebase_ui_oauth.dart';
8+
import 'package:flutter/widgets.dart';
69

7-
export 'src/loading_indicator.dart';
8-
export 'src/widgets/auth_flow_builder.dart';
10+
import 'src/actions.dart';
11+
import 'src/oauth_providers.dart';
12+
import 'src/providers/auth_provider.dart';
13+
14+
export 'src/actions.dart';
915
export 'src/auth_controller.dart' show AuthAction, AuthController;
16+
export 'src/auth_flow.dart';
1017
export 'src/auth_state.dart'
1118
show
1219
Uninitialized,
@@ -22,93 +29,71 @@ export 'src/auth_state.dart'
2229
AuthFailed,
2330
DifferentSignInMethodsFound,
2431
MFARequired;
32+
export 'src/email_verification.dart';
33+
export 'src/flows/email_flow.dart';
34+
export 'src/flows/email_link_flow.dart';
35+
export 'src/flows/oauth_flow.dart' show OAuthController, OAuthFlow;
36+
export 'src/flows/phone_auth_flow.dart';
37+
export 'src/flows/universal_email_sign_in_flow.dart';
38+
// ignore_for_file: use_build_context_synchronously
2539

40+
export 'src/loading_indicator.dart';
41+
export 'src/mfa.dart' show startMFAVerification;
42+
export 'src/navigation/authentication.dart';
43+
export 'src/navigation/forgot_password.dart';
44+
export 'src/navigation/phone_verification.dart';
45+
export 'src/oauth/provider_resolvers.dart' show providerIcon;
46+
export 'src/oauth/social_icons.dart' show SocialIcons;
47+
export 'src/oauth_providers.dart' show OAuthHelpers;
2648
export 'src/providers/auth_provider.dart';
2749
export 'src/providers/email_auth_provider.dart';
2850
export 'src/providers/email_link_auth_provider.dart';
2951
export 'src/providers/phone_auth_provider.dart';
3052
export 'src/providers/universal_email_sign_in_provider.dart';
31-
32-
export 'src/flows/phone_auth_flow.dart';
33-
export 'src/flows/email_link_flow.dart';
34-
export 'src/flows/universal_email_sign_in_flow.dart';
35-
36-
export 'src/widgets/phone_input.dart' show PhoneInputState, PhoneInput;
37-
38-
export 'src/widgets/sms_code_input.dart' show SMSCodeInputState, SMSCodeInput;
39-
40-
export 'src/auth_flow.dart';
41-
export 'src/flows/email_flow.dart';
42-
export 'src/flows/oauth_flow.dart' show OAuthController, OAuthFlow;
43-
44-
export 'src/oauth/social_icons.dart' show SocialIcons;
45-
export 'src/oauth/provider_resolvers.dart' show providerIcon;
46-
export 'src/oauth_providers.dart' show OAuthHelpers;
47-
53+
export 'src/screens/email_link_sign_in_screen.dart';
54+
export 'src/screens/email_verification_screen.dart';
55+
export 'src/screens/forgot_password_screen.dart';
56+
export 'src/screens/internal/responsive_page.dart'
57+
show HeaderBuilder, SideBuilder;
58+
export 'src/screens/phone_input_screen.dart';
59+
export 'src/screens/profile_screen.dart' show ProfileScreen;
60+
export 'src/screens/register_screen.dart';
61+
export 'src/screens/sign_in_screen.dart';
62+
export 'src/screens/sms_code_input_screen.dart';
63+
export 'src/screens/universal_email_sign_in_screen.dart';
64+
export 'src/styling/style.dart' show FirebaseUIStyle;
65+
export 'src/styling/theme.dart' show FirebaseUITheme;
66+
export 'src/views/different_method_sign_in_view.dart';
67+
export 'src/views/email_link_sign_in_view.dart';
68+
export 'src/views/find_providers_for_email_view.dart';
69+
export 'src/views/forgot_password_view.dart';
70+
export 'src/views/login_view.dart';
71+
export 'src/views/phone_input_view.dart';
72+
export 'src/views/reauthenticate_view.dart';
73+
export 'src/views/sms_code_input_view.dart';
4874
export 'src/widgets/auth_flow_builder.dart';
75+
export 'src/widgets/delete_account_button.dart';
76+
export 'src/widgets/different_method_sign_in_dialog.dart';
77+
export 'src/widgets/editable_user_display_name.dart';
4978
export 'src/widgets/email_form.dart'
5079
show EmailForm, ForgotPasswordAction, EmailFormStyle;
80+
export 'src/widgets/email_input.dart';
81+
export 'src/widgets/email_link_sign_in_button.dart';
82+
export 'src/widgets/email_sign_up_dialog.dart';
5183
export 'src/widgets/error_text.dart' show ErrorText;
52-
export 'src/widgets/phone_verification_button.dart'
53-
show PhoneVerificationButton;
54-
84+
export 'src/widgets/forgot_password_button.dart';
5585
export 'src/widgets/internal/oauth_provider_button.dart'
5686
show OAuthProviderButton, OAuthButtonVariant;
57-
58-
export 'src/widgets/sign_out_button.dart';
59-
export 'src/widgets/user_avatar.dart';
60-
export 'src/widgets/editable_user_display_name.dart';
61-
export 'src/widgets/delete_account_button.dart';
62-
export 'src/widgets/email_input.dart';
87+
export 'src/widgets/internal/universal_button.dart' show ButtonVariant;
88+
export 'src/widgets/layout_flow_aware_padding.dart';
6389
export 'src/widgets/password_input.dart';
64-
export 'src/widgets/forgot_password_button.dart';
90+
export 'src/widgets/phone_input.dart' show PhoneInputState, PhoneInput;
91+
export 'src/widgets/phone_verification_button.dart'
92+
show PhoneVerificationButton;
6593
export 'src/widgets/reauthenticate_dialog.dart';
66-
export 'src/widgets/different_method_sign_in_dialog.dart';
67-
export 'src/widgets/email_sign_up_dialog.dart';
68-
export 'src/widgets/email_link_sign_in_button.dart';
69-
export 'src/widgets/layout_flow_aware_padding.dart';
70-
71-
export 'src/views/login_view.dart';
72-
export 'src/views/phone_input_view.dart';
73-
export 'src/views/sms_code_input_view.dart';
74-
export 'src/views/reauthenticate_view.dart';
75-
export 'src/views/forgot_password_view.dart';
76-
export 'src/views/different_method_sign_in_view.dart';
77-
export 'src/views/find_providers_for_email_view.dart';
78-
export 'src/views/email_link_sign_in_view.dart';
79-
80-
export 'src/screens/internal/responsive_page.dart'
81-
show HeaderBuilder, SideBuilder;
82-
export 'src/screens/phone_input_screen.dart';
83-
export 'src/screens/sms_code_input_screen.dart';
84-
export 'src/screens/sign_in_screen.dart';
85-
export 'src/screens/register_screen.dart';
86-
export 'src/screens/profile_screen.dart' show ProfileScreen;
87-
export 'src/screens/forgot_password_screen.dart';
88-
export 'src/screens/universal_email_sign_in_screen.dart';
89-
export 'src/screens/email_link_sign_in_screen.dart';
90-
export 'src/screens/email_verification_screen.dart';
91-
92-
export 'src/navigation/phone_verification.dart';
93-
export 'src/navigation/forgot_password.dart';
94-
export 'src/navigation/authentication.dart';
95-
export 'src/actions.dart';
96-
export 'src/email_verification.dart';
97-
98-
export 'src/styling/theme.dart' show FirebaseUITheme;
99-
export 'src/styling/style.dart' show FirebaseUIStyle;
100-
export 'src/widgets/internal/universal_button.dart' show ButtonVariant;
101-
102-
export 'src/mfa.dart' show startMFAVerification;
103-
104-
import 'package:firebase_auth/firebase_auth.dart' hide OAuthProvider;
105-
import 'package:firebase_core/firebase_core.dart';
106-
import 'package:flutter/widgets.dart';
107-
import 'package:firebase_ui_oauth/firebase_ui_oauth.dart';
108-
109-
import 'src/actions.dart';
110-
import 'src/oauth_providers.dart';
111-
import 'src/providers/auth_provider.dart';
94+
export 'src/widgets/sign_out_button.dart';
95+
export 'src/widgets/sms_code_input.dart' show SMSCodeInputState, SMSCodeInput;
96+
export 'src/widgets/user_avatar.dart';
11297

11398
class FirebaseUIAuth {
11499
static final _providers = <FirebaseApp, List<AuthProvider>>{};

packages/firebase_ui_auth/lib/src/views/login_view.dart

+5-7
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:flutter/cupertino.dart' hide Title;
6-
import 'package:flutter/gestures.dart';
7-
import 'package:flutter/material.dart' hide Title;
8-
95
import 'package:firebase_auth/firebase_auth.dart' show FirebaseAuth;
10-
116
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
127
import 'package:firebase_ui_localizations/firebase_ui_localizations.dart';
138
import 'package:firebase_ui_oauth/firebase_ui_oauth.dart'
149
hide OAuthProviderButtonBase;
10+
import 'package:flutter/cupertino.dart' hide Title;
11+
import 'package:flutter/gestures.dart';
12+
import 'package:flutter/material.dart' hide Title;
1513

1614
import '../widgets/internal/title.dart';
1715

@@ -157,7 +155,7 @@ class _LoginViewState extends State<LoginView> {
157155
hintStyle = theme.textTheme.textStyle.copyWith(fontSize: 12);
158156
} else {
159157
final theme = Theme.of(context);
160-
hintStyle = Theme.of(context).textTheme.caption;
158+
hintStyle = Theme.of(context).textTheme.bodySmall;
161159
registerTextColor = theme.colorScheme.primary;
162160
}
163161

@@ -179,7 +177,7 @@ class _LoginViewState extends State<LoginView> {
179177
),
180178
TextSpan(
181179
text: actionText,
182-
style: Theme.of(context).textTheme.button?.copyWith(
180+
style: Theme.of(context).textTheme.labelLarge?.copyWith(
183181
color: registerTextColor,
184182
),
185183
mouseCursor: SystemMouseCursors.click,

packages/firebase_ui_auth/lib/src/widgets/delete_account_button.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:flutter/material.dart';
65
import 'package:firebase_auth/firebase_auth.dart'
76
show FirebaseAuth, FirebaseAuthException;
8-
import 'package:flutter/cupertino.dart';
97
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
108
import 'package:firebase_ui_localizations/firebase_ui_localizations.dart';
9+
import 'package:flutter/cupertino.dart';
10+
import 'package:flutter/material.dart';
11+
1112
import '../widgets/internal/loading_button.dart';
1213

1314
typedef DeleteFailedCallback = void Function(Exception exception);

packages/firebase_ui_auth/lib/src/widgets/error_text.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:flutter/cupertino.dart';
6-
import 'package:flutter/material.dart';
75
import 'package:firebase_auth/firebase_auth.dart' show FirebaseAuthException;
8-
96
import 'package:firebase_ui_localizations/firebase_ui_localizations.dart';
7+
import 'package:flutter/cupertino.dart';
8+
import 'package:flutter/material.dart';
109

1110
import '../flows/phone_auth_flow.dart';
1211

@@ -57,7 +56,7 @@ class ErrorText extends StatelessWidget {
5756
if (isCupertino) {
5857
color = CupertinoColors.destructiveRed;
5958
} else {
60-
color = Theme.of(context).errorColor;
59+
color = Theme.of(context).colorScheme.error;
6160
}
6261

6362
final l = FirebaseUILocalizations.labelsOf(context);

packages/firebase_ui_auth/lib/src/widgets/internal/loading_button.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
56
import 'package:flutter/cupertino.dart';
67
import 'package:flutter/material.dart';
7-
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
88

99
import 'universal_button.dart';
1010

@@ -25,7 +25,7 @@ class _LoadingButtonContent extends StatelessWidget {
2525
Widget child;
2626

2727
if (color != null) {
28-
final theme = Theme.of(context).textTheme.button;
28+
final theme = Theme.of(context).textTheme.labelLarge;
2929
child = Text(
3030
label,
3131
style: theme?.copyWith(color: color),

packages/firebase_ui_auth/lib/src/widgets/internal/subtitle.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import 'package:flutter/cupertino.dart';
66
import 'package:flutter/material.dart';
7+
78
import 'platform_widget.dart';
89

910
class Subtitle extends PlatformWidget {
@@ -30,7 +31,7 @@ class Subtitle extends PlatformWidget {
3031
text,
3132
style: Theme.of(context)
3233
.textTheme
33-
.subtitle1!
34+
.titleMedium!
3435
.copyWith(fontWeight: fontWeight),
3536
);
3637
}

packages/firebase_ui_auth/lib/src/widgets/internal/title.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Title extends PlatformWidget {
2323
Widget buildMaterial(BuildContext context) {
2424
return Text(
2525
text,
26-
style: Theme.of(context).textTheme.headline5,
26+
style: Theme.of(context).textTheme.headlineSmall,
2727
);
2828
}
2929
}

packages/firebase_ui_auth/lib/src/widgets/sms_code_input.dart

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:flutter/material.dart';
6-
import 'package:flutter/services.dart';
75
import 'package:firebase_auth/firebase_auth.dart' show PhoneAuthCredential;
86
import 'package:firebase_ui_auth/firebase_ui_auth.dart';
97
import 'package:firebase_ui_localizations/firebase_ui_localizations.dart';
8+
import 'package:flutter/material.dart';
9+
import 'package:flutter/services.dart';
10+
1011
import '../widgets/internal/universal_text_form_field.dart';
1112

1213
class _NumberDecorationPainter extends BoxPainter {
@@ -90,7 +91,7 @@ class _NumberSlotState extends State<_NumberSlot>
9091
Widget build(BuildContext context) {
9192
final inputBorder = Theme.of(context).inputDecorationTheme.border;
9293
final primaryColor = Theme.of(context).colorScheme.primary;
93-
final errorColor = Theme.of(context).errorColor;
94+
final errorColor = Theme.of(context).colorScheme.error;
9495

9596
final color = hasError ? errorColor : primaryColor;
9697

packages/firebase_ui_database/example/macos/Runner.xcodeproj/project.pbxproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@
406406
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
407407
GCC_WARN_UNUSED_FUNCTION = YES;
408408
GCC_WARN_UNUSED_VARIABLE = YES;
409-
MACOSX_DEPLOYMENT_TARGET = 10.11;
409+
MACOSX_DEPLOYMENT_TARGET = 10.14;
410410
MTL_ENABLE_DEBUG_INFO = NO;
411411
SDKROOT = macosx;
412412
SWIFT_COMPILATION_MODE = wholemodule;
@@ -485,7 +485,7 @@
485485
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
486486
GCC_WARN_UNUSED_FUNCTION = YES;
487487
GCC_WARN_UNUSED_VARIABLE = YES;
488-
MACOSX_DEPLOYMENT_TARGET = 10.11;
488+
MACOSX_DEPLOYMENT_TARGET = 10.14;
489489
MTL_ENABLE_DEBUG_INFO = YES;
490490
ONLY_ACTIVE_ARCH = YES;
491491
SDKROOT = macosx;
@@ -532,7 +532,7 @@
532532
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
533533
GCC_WARN_UNUSED_FUNCTION = YES;
534534
GCC_WARN_UNUSED_VARIABLE = YES;
535-
MACOSX_DEPLOYMENT_TARGET = 10.11;
535+
MACOSX_DEPLOYMENT_TARGET = 10.14;
536536
MTL_ENABLE_DEBUG_INFO = NO;
537537
SDKROOT = macosx;
538538
SWIFT_COMPILATION_MODE = wholemodule;

packages/firebase_ui_database/lib/src/table_builder.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ class _ValueView extends StatelessWidget {
694694
Widget build(BuildContext context) {
695695
final value = this.value;
696696
if (value == null) {
697-
return Text('null', style: Theme.of(context).textTheme.caption);
697+
return Text('null', style: Theme.of(context).textTheme.bodySmall);
698698
} else {
699699
return Text(value.toString());
700700
}

packages/firebase_ui_firestore/example/lib/main.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ class UserTile extends StatelessWidget {
7272
children: [
7373
Text(
7474
'${user.firstName} ${user.lastName}',
75-
style: Theme.of(context).textTheme.subtitle1,
75+
style: Theme.of(context).textTheme.titleMedium,
7676
),
7777
Text(
7878
user.number,
79-
style: Theme.of(context).textTheme.caption,
79+
style: Theme.of(context).textTheme.bodySmall,
8080
),
8181
],
8282
),

0 commit comments

Comments
 (0)