Skip to content

fix: Fix analyzer infos #17584

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion packages/firebase_ai/firebase_ai/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class _HomeScreenState extends State<HomeScreen> {
onChanged: widget.onBackendChanged,
activeTrackColor: Colors.green.withValues(alpha: 0.5),
inactiveTrackColor: Colors.blueGrey.withValues(alpha: 0.5),
activeColor: Colors.green,
activeThumbColor: Colors.green,
inactiveThumbColor: Colors.blueGrey,
),
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ abstract class OperationRef<Data, Variables> {
Future<bool> _shouldRetry() async {
String? newToken;
try {
newToken = await this.dataConnect.auth?.currentUser?.getIdToken();
newToken = await dataConnect.auth?.currentUser?.getIdToken();
} catch (e) {
// Don't retry if there was an issue getting the ID Token.
log('There was an error attempting to retrieve the ID Token: $e');
Expand Down Expand Up @@ -152,12 +152,12 @@ class QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
Future<QueryResult<Data, Variables>> execute() async {
bool shouldRetry = await _shouldRetry();
try {
QueryResult<Data, Variables> r = await this._executeOperation(_lastToken);
QueryResult<Data, Variables> r = await _executeOperation(_lastToken);
return r;
} on DataConnectError catch (e) {
if (shouldRetry &&
e.code == DataConnectErrorCode.unauthorized.toString()) {
return this.execute();
return execute();
} else {
rethrow;
}
Expand Down Expand Up @@ -201,7 +201,7 @@ class QueryRef<Data, Variables> extends OperationRef<Data, Variables> {
.cast<QueryResult<Data, Variables>>();
if (_queryManager.containsQuery(operationName, variables, varsSerialized)) {
try {
this.execute();
execute();
} catch (_) {
// Call to `execute` should properly pass the error to the Stream.
log('Error thrown by execute. The error will propagate via onError.');
Expand Down Expand Up @@ -234,13 +234,12 @@ class MutationRef<Data, Variables> extends OperationRef<Data, Variables> {
try {
// Logic below is duplicated due to the fact that `executeOperation` returns
// an `OperationResult` here, and `QueryRef` expects a `QueryResult`.
OperationResult<Data, Variables> r =
await this._executeOperation(_lastToken);
OperationResult<Data, Variables> r = await _executeOperation(_lastToken);
return r;
} on DataConnectError catch (e) {
if (shouldRetry &&
e.code == DataConnectErrorCode.unauthorized.toString()) {
return this.execute();
return execute();
} else {
rethrow;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class _HomeScreenState extends State<HomeScreen> {
onChanged: widget.onBackendChanged,
activeTrackColor: Colors.green.withValues(alpha: 0.5),
inactiveTrackColor: Colors.blueGrey.withValues(alpha: 0.5),
activeColor: Colors.green,
activeThumbColor: Colors.green,
inactiveThumbColor: Colors.blueGrey,
),
Text(
Expand Down
15 changes: 8 additions & 7 deletions scripts/generate_versions_gradle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// ignore_for_file: avoid_print

import 'dart:io';

import 'package:cli_util/cli_logging.dart' as logging;
Expand All @@ -36,7 +38,7 @@ void main() async {

// Define files using paths
final globalConfig = File(globalConfigPath);

// Check if the files exist
if (!globalConfig.existsSync()) {
throw Exception(
Expand Down Expand Up @@ -68,7 +70,7 @@ void main() async {
print('File copied to: ${copiedConfig.path}');

final gradlePropertiesFilePath = '${package.path}/example/android/gradle.properties';
extractAndWriteProperty(
await extractAndWriteProperty(
globalConfig: globalConfig,
gradlePropertiesFile: File(gradlePropertiesFilePath),
);
Expand All @@ -80,11 +82,10 @@ void main() async {
final copiedConfig = await globalConfig.copy(
localConfigGradleFilePath,
);
// ignore: avoid_print
print('File copied to: ${copiedConfig.path}');

final gradlePropertiesFilePath = '${package.path}/example/android/gradle.properties';
extractAndWriteProperty(
await extractAndWriteProperty(
globalConfig: globalConfig,
gradlePropertiesFile: File(gradlePropertiesFilePath),
);
Expand Down Expand Up @@ -123,7 +124,7 @@ Future<void> extractAndWriteProperty({
}) async {

const String propertyName = 'androidGradlePluginVersion';
if (!await globalConfig.exists()) {
if (!globalConfig.existsSync()) {
print('Global config file not found: ${globalConfig.path}');
return;
}
Expand All @@ -141,7 +142,7 @@ Future<void> extractAndWriteProperty({

final value = match.group(1);

final lines = await gradlePropertiesFile.exists()
final lines = gradlePropertiesFile.existsSync()
? await gradlePropertiesFile.readAsLines()
: [];

Expand Down
8 changes: 7 additions & 1 deletion scripts/generate_versions_spm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: avoid_print

import 'package:melos/melos.dart' as melos;
import 'package:glob/glob.dart';
import 'dart:io';
Expand Down Expand Up @@ -131,7 +133,11 @@ void updateVersionsPackageSwift(String firebaseiOSVersion) {

void updateLibraryVersionPureSwiftPlugins() {
// Packages that require updating library versions
const packages = ['firebase_ml_model_downloader', 'firebase_app_installations', 'cloud_functions'];
const packages = [
'firebase_ml_model_downloader',
'firebase_app_installations',
'cloud_functions',
];

for (final package in packages) {
final pubspecPath = 'packages/$package/$package/pubspec.yaml';
Expand Down