Skip to content

Commit f81db63

Browse files
authored
chore: fix warnings after latest flutter version (#17640)
1 parent bf55f1e commit f81db63

File tree

4 files changed

+24
-25
lines changed
  • packages
    • firebase_ai/firebase_ai/example/lib
    • firebase_auth/firebase_auth/example/lib
    • firebase_data_connect/firebase_data_connect/lib/src/core
    • firebase_vertexai/firebase_vertexai/example/lib

4 files changed

+24
-25
lines changed

packages/firebase_ai/firebase_ai/example/lib/main.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import 'package:firebase_core/firebase_core.dart';
16-
import 'package:firebase_auth/firebase_auth.dart';
1715
import 'package:firebase_ai/firebase_ai.dart';
16+
import 'package:firebase_auth/firebase_auth.dart';
17+
import 'package:firebase_core/firebase_core.dart';
1818
import 'package:flutter/material.dart';
1919

20+
import 'pages/audio_page.dart';
21+
import 'pages/bidi_page.dart';
2022
// Import after file is generated through flutterfire_cli.
2123
// import 'package:firebase_ai_example/firebase_options.dart';
2224

2325
import 'pages/chat_page.dart';
24-
import 'pages/audio_page.dart';
26+
import 'pages/document.dart';
2527
import 'pages/function_calling_page.dart';
2628
import 'pages/image_prompt_page.dart';
27-
import 'pages/token_count_page.dart';
28-
import 'pages/schema_page.dart';
2929
import 'pages/imagen_page.dart';
30-
import 'pages/document.dart';
30+
import 'pages/schema_page.dart';
31+
import 'pages/token_count_page.dart';
3132
import 'pages/video_page.dart';
32-
import 'pages/bidi_page.dart';
3333

3434
void main() async {
3535
WidgetsFlutterBinding.ensureInitialized();
@@ -230,7 +230,7 @@ class _HomeScreenState extends State<HomeScreen> {
230230
onChanged: widget.onBackendChanged,
231231
activeTrackColor: Colors.green.withValues(alpha: 0.5),
232232
inactiveTrackColor: Colors.blueGrey.withValues(alpha: 0.5),
233-
activeColor: Colors.green,
233+
activeThumbColor: Colors.green,
234234
inactiveThumbColor: Colors.blueGrey,
235235
),
236236
Text(

packages/firebase_auth/firebase_auth/example/lib/auth.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import 'package:firebase_messaging/firebase_messaging.dart';
1212
import 'package:flutter/foundation.dart';
1313
import 'package:flutter/gestures.dart';
1414
import 'package:flutter/material.dart';
15+
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
1516
import 'package:flutter_signin_button/flutter_signin_button.dart';
1617
import 'package:google_sign_in/google_sign_in.dart';
17-
import 'package:flutter_facebook_auth/flutter_facebook_auth.dart';
1818

1919
typedef OAuthSignIn = void Function();
2020

@@ -256,7 +256,7 @@ class _AuthGateState extends State<AuthGate> {
256256
height: 50,
257257
child: SignInButton(
258258
button,
259-
onPressed: authButtons[button]!,
259+
onPressed: authButtons[button],
260260
),
261261
),
262262
),

packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ abstract class OperationRef<Data, Variables> {
5656
Future<bool> _shouldRetry() async {
5757
String? newToken;
5858
try {
59-
newToken = await this.dataConnect.auth?.currentUser?.getIdToken();
59+
newToken = await dataConnect.auth?.currentUser?.getIdToken();
6060
} catch (e) {
6161
// Don't retry if there was an issue getting the ID Token.
6262
log('There was an error attempting to retrieve the ID Token: $e');
@@ -152,12 +152,12 @@ class QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
152152
Future<QueryResult<Data, Variables>> execute() async {
153153
bool shouldRetry = await _shouldRetry();
154154
try {
155-
QueryResult<Data, Variables> r = await this._executeOperation(_lastToken);
155+
QueryResult<Data, Variables> r = await _executeOperation(_lastToken);
156156
return r;
157157
} on DataConnectError catch (e) {
158158
if (shouldRetry &&
159159
e.code == DataConnectErrorCode.unauthorized.toString()) {
160-
return this.execute();
160+
return execute();
161161
} else {
162162
rethrow;
163163
}
@@ -201,7 +201,7 @@ class QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
201201
.cast<QueryResult<Data, Variables>>();
202202
if (_queryManager.containsQuery(operationName, variables, varsSerialized)) {
203203
try {
204-
this.execute();
204+
execute();
205205
} catch (_) {
206206
// Call to `execute` should properly pass the error to the Stream.
207207
log('Error thrown by execute. The error will propagate via onError.');
@@ -234,13 +234,12 @@ class MutationRef<Data, Variables> extends OperationRef<Data, Variables> {
234234
try {
235235
// Logic below is duplicated due to the fact that `executeOperation` returns
236236
// an `OperationResult` here, and `QueryRef` expects a `QueryResult`.
237-
OperationResult<Data, Variables> r =
238-
await this._executeOperation(_lastToken);
237+
OperationResult<Data, Variables> r = await _executeOperation(_lastToken);
239238
return r;
240239
} on DataConnectError catch (e) {
241240
if (shouldRetry &&
242241
e.code == DataConnectErrorCode.unauthorized.toString()) {
243-
return this.execute();
242+
return execute();
244243
} else {
245244
rethrow;
246245
}

packages/firebase_vertexai/firebase_vertexai/example/lib/main.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import 'package:firebase_core/firebase_core.dart';
16-
import 'package:firebase_auth/firebase_auth.dart';
1715
import 'package:firebase_ai/firebase_ai.dart';
16+
import 'package:firebase_auth/firebase_auth.dart';
17+
import 'package:firebase_core/firebase_core.dart';
1818
import 'package:firebase_vertexai/firebase_vertexai.dart';
1919
import 'package:flutter/material.dart';
2020

21+
import 'pages/audio_page.dart';
22+
import 'pages/bidi_page.dart';
2123
// Import after file is generated through flutterfire_cli.
2224
// import 'package:vertex_ai_example/firebase_options.dart';
2325

2426
import 'pages/chat_page.dart';
25-
import 'pages/audio_page.dart';
27+
import 'pages/document.dart';
2628
import 'pages/function_calling_page.dart';
2729
import 'pages/image_prompt_page.dart';
28-
import 'pages/token_count_page.dart';
29-
import 'pages/schema_page.dart';
3030
import 'pages/imagen_page.dart';
31-
import 'pages/document.dart';
31+
import 'pages/schema_page.dart';
32+
import 'pages/token_count_page.dart';
3233
import 'pages/video_page.dart';
33-
import 'pages/bidi_page.dart';
3434

3535
void main() async {
3636
WidgetsFlutterBinding.ensureInitialized();
@@ -232,7 +232,7 @@ class _HomeScreenState extends State<HomeScreen> {
232232
onChanged: widget.onBackendChanged,
233233
activeTrackColor: Colors.green.withValues(alpha: 0.5),
234234
inactiveTrackColor: Colors.blueGrey.withValues(alpha: 0.5),
235-
activeColor: Colors.green,
235+
activeThumbColor: Colors.green,
236236
inactiveThumbColor: Colors.blueGrey,
237237
),
238238
Text(

0 commit comments

Comments
 (0)