diff --git a/packages/firebase_ai/firebase_ai/example/lib/main.dart b/packages/firebase_ai/firebase_ai/example/lib/main.dart index b8dbdaaec19c..425aceb9cd88 100644 --- a/packages/firebase_ai/firebase_ai/example/lib/main.dart +++ b/packages/firebase_ai/firebase_ai/example/lib/main.dart @@ -230,6 +230,8 @@ class _HomeScreenState extends State { onChanged: widget.onBackendChanged, activeTrackColor: Colors.green.withValues(alpha: 0.5), inactiveTrackColor: Colors.blueGrey.withValues(alpha: 0.5), + // Ignore until activeThumbColor is availble on stable channel. + // ignore: deprecated_member_use activeColor: Colors.green, inactiveThumbColor: Colors.blueGrey, ), diff --git a/packages/firebase_app_installations/firebase_app_installations/example/lib/main.dart b/packages/firebase_app_installations/firebase_app_installations/example/lib/main.dart index 56332b8cbe82..4f2a3ff00150 100644 --- a/packages/firebase_app_installations/firebase_app_installations/example/lib/main.dart +++ b/packages/firebase_app_installations/firebase_app_installations/example/lib/main.dart @@ -72,7 +72,7 @@ class _InstallationsCardState extends State { String id = 'None'; String authToken = 'None'; - init() async { + void init() async { await getId(); await getAuthToken(); } @@ -101,7 +101,7 @@ class _InstallationsCardState extends State { } } - Future getAuthToken([forceRefresh = false]) async { + Future getAuthToken([bool forceRefresh = false]) async { try { final token = await FirebaseInstallations.instance.getToken(forceRefresh); setState(() { diff --git a/packages/firebase_app_installations/firebase_app_installations_platform_interface/lib/firebase_app_installations_platform_interface.dart b/packages/firebase_app_installations/firebase_app_installations_platform_interface/lib/firebase_app_installations_platform_interface.dart index 1c0e99358cfb..f8119c5ad438 100644 --- a/packages/firebase_app_installations/firebase_app_installations_platform_interface/lib/firebase_app_installations_platform_interface.dart +++ b/packages/firebase_app_installations/firebase_app_installations_platform_interface/lib/firebase_app_installations_platform_interface.dart @@ -2,6 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -library firebase_app_installations_platform_interface; +library; export 'src/platform_interface/firebase_app_installations_platform_interface.dart'; diff --git a/packages/firebase_app_installations/firebase_app_installations_web/lib/src/interop/installations_interop.dart b/packages/firebase_app_installations/firebase_app_installations_web/lib/src/interop/installations_interop.dart index 0bc32d68b4ea..806671777d14 100644 --- a/packages/firebase_app_installations/firebase_app_installations_web/lib/src/interop/installations_interop.dart +++ b/packages/firebase_app_installations/firebase_app_installations_web/lib/src/interop/installations_interop.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. @JS('firebase_installations') -library firebase_interop.installations; +library; import 'dart:js_interop'; diff --git a/packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart b/packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart index 3bfb50cf1e64..2565521caaf8 100644 --- a/packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart +++ b/packages/firebase_data_connect/firebase_data_connect/lib/src/core/ref.dart @@ -56,7 +56,7 @@ abstract class OperationRef { Future _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'); @@ -152,12 +152,12 @@ class QueryRef extends OperationRef { Future> execute() async { bool shouldRetry = await _shouldRetry(); try { - QueryResult r = await this._executeOperation(_lastToken); + QueryResult r = await _executeOperation(_lastToken); return r; } on DataConnectError catch (e) { if (shouldRetry && e.code == DataConnectErrorCode.unauthorized.toString()) { - return this.execute(); + return execute(); } else { rethrow; } @@ -201,7 +201,7 @@ class QueryRef extends OperationRef { .cast>(); 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.'); @@ -234,13 +234,12 @@ class MutationRef extends OperationRef { try { // Logic below is duplicated due to the fact that `executeOperation` returns // an `OperationResult` here, and `QueryRef` expects a `QueryResult`. - OperationResult r = - await this._executeOperation(_lastToken); + OperationResult r = await _executeOperation(_lastToken); return r; } on DataConnectError catch (e) { if (shouldRetry && e.code == DataConnectErrorCode.unauthorized.toString()) { - return this.execute(); + return execute(); } else { rethrow; } diff --git a/packages/firebase_database/firebase_database_web/lib/src/database_reference_web.dart b/packages/firebase_database/firebase_database_web/lib/src/database_reference_web.dart index e74f1530c5f3..b75fd7d7edfe 100755 --- a/packages/firebase_database/firebase_database_web/lib/src/database_reference_web.dart +++ b/packages/firebase_database/firebase_database_web/lib/src/database_reference_web.dart @@ -73,7 +73,7 @@ class DatabaseReferenceWeb extends QueryWeb } @override - Future setPriority(priority) async { + Future setPriority(Object? priority) async { try { await _delegate.setPriority(priority); } catch (e, s) { diff --git a/packages/firebase_database/firebase_database_web/lib/src/interop/database.dart b/packages/firebase_database/firebase_database_web/lib/src/interop/database.dart index f616f00b1852..16eb7159fcbd 100755 --- a/packages/firebase_database/firebase_database_web/lib/src/interop/database.dart +++ b/packages/firebase_database/firebase_database_web/lib/src/interop/database.dart @@ -126,7 +126,7 @@ class DatabaseReference /// /// This method returns [ThenableReference], [DatabaseReference] /// with a [Future] property. - ThenableReference push([value]) => ThenableReference.fromJsObject( + ThenableReference push([Object? value]) => ThenableReference.fromJsObject( database_interop.push(jsObject, value?.jsify())); /// Removes data from actual database location. @@ -149,8 +149,8 @@ class DatabaseReference /// Sets a priority for data at actual database location. /// /// The [priority] must be a [String], [num] or `null`, or the error is thrown. - Future setPriority(priority) => - database_interop.setPriority(jsObject, priority).toDart; + Future setPriority(Object? priority) => + database_interop.setPriority(jsObject, priority?.jsify()).toDart; /// Sets data [newVal] at actual database location with provided priority /// [newPriority]. @@ -676,12 +676,11 @@ class OnDisconnect /// See: . class ThenableReference extends DatabaseReference { - late final Future _future = jsObject - .then(((database_interop.ReferenceJsImpl reference) { - DatabaseReference.getInstance(reference); - }).toJS) + late final Future _future = (jsObject as JSPromise) .toDart - .then((value) => value as DatabaseReference); + .then((value) => DatabaseReference.getInstance( + value as database_interop.ReferenceJsImpl, + )); /// Creates a new ThenableReference from a [jsObject]. ThenableReference.fromJsObject( diff --git a/packages/firebase_ml_model_downloader/firebase_ml_model_downloader/example/lib/main.dart b/packages/firebase_ml_model_downloader/firebase_ml_model_downloader/example/lib/main.dart index d8bd1bca91c1..0be5cb6fae50 100644 --- a/packages/firebase_ml_model_downloader/firebase_ml_model_downloader/example/lib/main.dart +++ b/packages/firebase_ml_model_downloader/firebase_ml_model_downloader/example/lib/main.dart @@ -35,7 +35,7 @@ class _MyAppState extends State { FirebaseCustomModel? model; /// Initially get the lcoal model if found, and asynchronously get the latest one in background. - initWithLocalModel() async { + void initWithLocalModel() async { final newModel = await FirebaseModelDownloader.instance.getModel( kModelName, FirebaseModelDownloadType.localModelUpdateInBackground); diff --git a/packages/firebase_vertexai/firebase_vertexai/example/lib/main.dart b/packages/firebase_vertexai/firebase_vertexai/example/lib/main.dart index 4cef5dd9643d..4619ba60de29 100644 --- a/packages/firebase_vertexai/firebase_vertexai/example/lib/main.dart +++ b/packages/firebase_vertexai/firebase_vertexai/example/lib/main.dart @@ -232,6 +232,8 @@ class _HomeScreenState extends State { onChanged: widget.onBackendChanged, activeTrackColor: Colors.green.withValues(alpha: 0.5), inactiveTrackColor: Colors.blueGrey.withValues(alpha: 0.5), + // Ignore until activeThumbColor is availble on stable channel. + // ignore: deprecated_member_use activeColor: Colors.green, inactiveThumbColor: Colors.blueGrey, ), diff --git a/scripts/generate_versions_gradle.dart b/scripts/generate_versions_gradle.dart index 072e984952b3..89892e2fc97e 100644 --- a/scripts/generate_versions_gradle.dart +++ b/scripts/generate_versions_gradle.dart @@ -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; @@ -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( @@ -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), ); @@ -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), ); @@ -123,7 +124,7 @@ Future extractAndWriteProperty({ }) async { const String propertyName = 'androidGradlePluginVersion'; - if (!await globalConfig.exists()) { + if (!globalConfig.existsSync()) { print('Global config file not found: ${globalConfig.path}'); return; } @@ -141,7 +142,7 @@ Future extractAndWriteProperty({ final value = match.group(1); - final lines = await gradlePropertiesFile.exists() + final lines = gradlePropertiesFile.existsSync() ? await gradlePropertiesFile.readAsLines() : []; diff --git a/scripts/generate_versions_spm.dart b/scripts/generate_versions_spm.dart index 7977465ce2d9..d0f3b8a8ce1b 100644 --- a/scripts/generate_versions_spm.dart +++ b/scripts/generate_versions_spm.dart @@ -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'; @@ -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';