diff --git a/packages/cloud_firestore/cloud_firestore/test/aggregate_query_test.dart b/packages/cloud_firestore/cloud_firestore/test/aggregate_query_test.dart index f33ee993ef3a..7798468da9f6 100644 --- a/packages/cloud_firestore/cloud_firestore/test/aggregate_query_test.dart +++ b/packages/cloud_firestore/cloud_firestore/test/aggregate_query_test.dart @@ -21,7 +21,7 @@ void main() { StandardMethodCodec(AggregateQueryMessageCodec()), ); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseFirestore.channel, (call) async { if (call.method == 'AggregateQuery#count') { diff --git a/packages/cloud_firestore/cloud_firestore/test/document_reference_test.dart b/packages/cloud_firestore/cloud_firestore/test/document_reference_test.dart index 15d2bc0c3b40..2294b8ff97f8 100644 --- a/packages/cloud_firestore/cloud_firestore/test/document_reference_test.dart +++ b/packages/cloud_firestore/cloud_firestore/test/document_reference_test.dart @@ -18,7 +18,7 @@ void main() { StandardMethodCodec(TestFirestoreMessageCodec()), ); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseFirestore.channel, (call) async { return null; diff --git a/packages/cloud_firestore/cloud_firestore/test/document_snapshot_test.dart b/packages/cloud_firestore/cloud_firestore/test/document_snapshot_test.dart index 89c24ebd524a..4984f060dbd8 100644 --- a/packages/cloud_firestore/cloud_firestore/test/document_snapshot_test.dart +++ b/packages/cloud_firestore/cloud_firestore/test/document_snapshot_test.dart @@ -19,7 +19,7 @@ void main() { StandardMethodCodec(TestFirestoreMessageCodec()), ); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseFirestore.channel, (call) async { DocumentReferencePlatform ref = call.arguments['reference']; diff --git a/packages/cloud_firestore/cloud_firestore/test/write_batch_test.dart b/packages/cloud_firestore/cloud_firestore/test/write_batch_test.dart index ad701bcdf001..6c4ef687f5e1 100644 --- a/packages/cloud_firestore/cloud_firestore/test/write_batch_test.dart +++ b/packages/cloud_firestore/cloud_firestore/test/write_batch_test.dart @@ -14,7 +14,7 @@ void main() { FirebaseFirestore? firestore; FirebaseFirestore? firestoreSecondary; - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseFirestore.channel, (call) async { String path = call.arguments['path']; diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_query_test.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_query_test.dart index a973f201b9b7..ca6c4424c87e 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_query_test.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/test/method_channel_tests/method_channel_query_test.dart @@ -122,7 +122,7 @@ void main() { }); group('get()', () { setUp(() async { - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseFirestore.channel, (MethodCall methodCall) async { switch (methodCall.method) { diff --git a/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_common.dart b/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_common.dart index c23b7d952458..a2fa8bd67475 100644 --- a/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_common.dart +++ b/packages/cloud_firestore/cloud_firestore_platform_interface/test/utils/test_common.dart @@ -40,7 +40,7 @@ void initializeMethodChannel() { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseFirestore.channel, (call) async { return await methodCallCallback(call); @@ -51,13 +51,13 @@ void handleDocumentSnapshotsEventChannel( final name = 'plugins.flutter.io/firebase_firestore/document/$id'; const codec = StandardMethodCodec(TestFirestoreMessageCodec()); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannel(name, codec), (MethodCall methodCall) async { log.add(methodCall); switch (methodCall.method) { case 'listen': - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( name, codec.encodeSuccessEnvelope( @@ -84,13 +84,13 @@ void handleQuerySnapshotsEventChannel(final String id, List log) { final name = 'plugins.flutter.io/firebase_firestore/query/$id'; const codec = StandardMethodCodec(TestFirestoreMessageCodec()); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannel(name, codec), (MethodCall methodCall) async { log.add(methodCall); switch (methodCall.method) { case 'listen': - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( name, codec.encodeSuccessEnvelope( @@ -117,12 +117,12 @@ void handleSnapshotsInSyncEventChannel(final String id) { final name = 'plugins.flutter.io/firebase_firestore/snapshotsInSync/$id'; const codec = StandardMethodCodec(TestFirestoreMessageCodec()); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannel(name, codec), (MethodCall methodCall) async { switch (methodCall.method) { case 'listen': - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( name, codec.encodeSuccessEnvelope({}), (_) {}); break; @@ -142,12 +142,12 @@ void handleTransactionEventChannel( final name = 'plugins.flutter.io/firebase_firestore/transaction/$id'; const codec = StandardMethodCodec(TestFirestoreMessageCodec()); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannel(name, codec), (MethodCall methodCall) async { switch (methodCall.method) { case 'listen': - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( name, codec.encodeSuccessEnvelope({ @@ -158,11 +158,11 @@ void handleTransactionEventChannel( if (throwException!) { await TestDefaultBinaryMessengerBinding - .instance?.defaultBinaryMessenger + .instance.defaultBinaryMessenger .handlePlatformMessage( name, codec.encodeSuccessEnvelope({ - 'appName': app?.name, + 'appName': app.name, 'error': { 'code': 'unknown', }, @@ -170,7 +170,7 @@ void handleTransactionEventChannel( (_) {}, ); } - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( name, codec.encodeSuccessEnvelope({ diff --git a/packages/cloud_functions/cloud_functions_platform_interface/test/mock.dart b/packages/cloud_functions/cloud_functions_platform_interface/test/mock.dart index 5bf97bb76c4c..8403dd979278 100644 --- a/packages/cloud_functions/cloud_functions_platform_interface/test/mock.dart +++ b/packages/cloud_functions/cloud_functions_platform_interface/test/mock.dart @@ -22,7 +22,7 @@ void setupFirebaseFunctionsMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseFunctions.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_analytics/firebase_analytics/test/mock.dart b/packages/firebase_analytics/firebase_analytics/test/mock.dart index 71ee6723ace5..887fa9160055 100644 --- a/packages/firebase_analytics/firebase_analytics/test/mock.dart +++ b/packages/firebase_analytics/firebase_analytics/test/mock.dart @@ -16,7 +16,7 @@ void setupFirebaseAnalyticsMocks([Callback? customHandlers]) { setupFirebaseCoreMocks(); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAnalytics.channel, (MethodCall methodCall) async { methodCallLog.add(methodCall); diff --git a/packages/firebase_analytics/firebase_analytics_platform_interface/test/mock.dart b/packages/firebase_analytics/firebase_analytics_platform_interface/test/mock.dart index 5a5150d3bd11..ddbc5b4a424a 100644 --- a/packages/firebase_analytics/firebase_analytics_platform_interface/test/mock.dart +++ b/packages/firebase_analytics/firebase_analytics_platform_interface/test/mock.dart @@ -17,7 +17,7 @@ void setupFirebaseAnalyticsMocks([Callback? customHandlers]) { setupFirebaseCoreMocks(); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAnalytics.channel, (MethodCall methodCall) async { methodCallLog.add(methodCall); @@ -32,7 +32,7 @@ void setupFirebaseAnalyticsMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAnalytics.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_app_check/firebase_app_check/test/mock.dart b/packages/firebase_app_check/firebase_app_check/test/mock.dart index ecb308fa5bd3..90cb5851b3fe 100644 --- a/packages/firebase_app_check/firebase_app_check/test/mock.dart +++ b/packages/firebase_app_check/firebase_app_check/test/mock.dart @@ -16,7 +16,7 @@ void setupFirebaseAppCheckMocks([Callback? customHandlers]) { setupFirebaseCoreMocks(); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAppCheck.channel, (MethodCall methodCall) async { if (methodCall.method != 'FirebaseAppCheck#registerTokenListener') { diff --git a/packages/firebase_app_check/firebase_app_check_platform_interface/test/mock.dart b/packages/firebase_app_check/firebase_app_check_platform_interface/test/mock.dart index 836e5ac40f8b..d8cb3f127115 100644 --- a/packages/firebase_app_check/firebase_app_check_platform_interface/test/mock.dart +++ b/packages/firebase_app_check/firebase_app_check_platform_interface/test/mock.dart @@ -18,7 +18,7 @@ void setupFirebaseAppCheckMocks([Callback? customHandlers]) { setupFirebaseCoreMocks(); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAppCheck.channel, (MethodCall methodCall) async { methodCallLog.add(methodCall); @@ -30,7 +30,7 @@ void setupFirebaseAppCheckMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAppCheck.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart b/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart index b242dac2c1ce..e54a246fb37f 100644 --- a/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart +++ b/packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart @@ -171,7 +171,7 @@ void main() { when(mockAuthPlatform.userChanges()).thenAnswer((_) => Stream.fromIterable([mockUserPlatform!])); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAuth.channel, (call) async { return {'user': user}; diff --git a/packages/firebase_auth/firebase_auth/test/user_test.dart b/packages/firebase_auth/firebase_auth/test/user_test.dart index def2c50a235b..9aca8c0e3fe9 100644 --- a/packages/firebase_auth/firebase_auth/test/user_test.dart +++ b/packages/firebase_auth/firebase_auth/test/user_test.dart @@ -130,7 +130,7 @@ void main() { languageCode: anyNamed('languageCode'), )).thenAnswer((_) => mockAuthPlatform); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAuth.channel, (call) async { switch (call.method) { diff --git a/packages/firebase_auth/firebase_auth_platform_interface/test/mock.dart b/packages/firebase_auth/firebase_auth_platform_interface/test/mock.dart index ff92d05760a8..755548e45d33 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/test/mock.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/test/mock.dart @@ -27,7 +27,7 @@ void handleEventChannel( final String name, [ List? log, ]) { - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannel(name), (MethodCall methodCall) async { log?.add(methodCall); @@ -46,7 +46,7 @@ Future injectEventChannelResponse( String channelName, Map event, ) async { - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( channelName, MethodChannelFirebaseAuth.channel.codec.encodeSuccessEnvelope(event), @@ -55,14 +55,14 @@ Future injectEventChannelResponse( } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseAuth.channel, (call) async { return await methodCallCallback(call); }); Future simulateEvent(String name, Map? user) async { - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( MethodChannelFirebaseAuth.channel.name, MethodChannelFirebaseAuth.channel.codec.encodeMethodCall( diff --git a/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart b/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart index 1447da715b6a..b071b1167171 100644 --- a/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart +++ b/packages/firebase_auth/firebase_auth_web/lib/src/firebase_auth_web_user.dart @@ -4,18 +4,15 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:js'; import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart'; import 'package:firebase_auth_web/src/firebase_auth_web_user_credential.dart'; -import 'package:intl/intl.dart'; import 'firebase_auth_web_confirmation_result.dart'; import 'interop/auth.dart' as auth_interop; import 'utils/web_utils.dart'; -/// The format of an incoming metadata string timestamp from the firebase-dart library -final DateFormat _dateFormat = DateFormat('EEE, d MMM yyyy HH:mm:ss', 'en_US'); - /// Web delegate implementation of [UserPlatform]. class UserWeb extends UserPlatform { /// Creates a new [UserWeb] instance. @@ -31,14 +28,12 @@ class UserWeb extends UserPlatform { 'isAnonymous': _webUser.isAnonymous, 'metadata': { 'creationTime': _webUser.metadata.creationTime != null - ? _dateFormat - .parse(_webUser.metadata.creationTime!, true) - .millisecondsSinceEpoch + ? context['Date'] + .callMethod('parse', [_webUser.metadata.creationTime]) : null, 'lastSignInTime': _webUser.metadata.lastSignInTime != null - ? _dateFormat - .parse(_webUser.metadata.lastSignInTime!, true) - .millisecondsSinceEpoch + ? context['Date'] + .callMethod('parse', [_webUser.metadata.lastSignInTime]) : null, }, 'phoneNumber': _webUser.phoneNumber, diff --git a/packages/firebase_auth/firebase_auth_web/pubspec.yaml b/packages/firebase_auth/firebase_auth_web/pubspec.yaml index 0f56e81fa3ef..3233ed8238f8 100644 --- a/packages/firebase_auth/firebase_auth_web/pubspec.yaml +++ b/packages/firebase_auth/firebase_auth_web/pubspec.yaml @@ -17,7 +17,6 @@ dependencies: flutter_web_plugins: sdk: flutter http_parser: ^4.0.0 - intl: ^0.17.0 js: ^0.6.3 meta: ^1.8.0 diff --git a/packages/firebase_crashlytics/firebase_crashlytics/test/mock.dart b/packages/firebase_crashlytics/firebase_crashlytics/test/mock.dart index f6b82ed91a83..41c859bfad16 100644 --- a/packages/firebase_crashlytics/firebase_crashlytics/test/mock.dart +++ b/packages/firebase_crashlytics/firebase_crashlytics/test/mock.dart @@ -70,7 +70,7 @@ void setupFirebaseCrashlyticsMocks([Callback? customHandlers]) { TestFirebaseCoreHostApi.setup(MockFirebaseAppWithCollectionEnabled()); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseCrashlytics.channel, (MethodCall methodCall) async { methodCallLog.add(methodCall); diff --git a/packages/firebase_crashlytics/firebase_crashlytics_platform_interface/test/mock.dart b/packages/firebase_crashlytics/firebase_crashlytics_platform_interface/test/mock.dart index af68cf454d38..ded98e2a711d 100644 --- a/packages/firebase_crashlytics/firebase_crashlytics_platform_interface/test/mock.dart +++ b/packages/firebase_crashlytics/firebase_crashlytics_platform_interface/test/mock.dart @@ -18,7 +18,7 @@ void setupFirebaseCrashlyticsMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseCrashlytics.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_database/firebase_database_platform_interface/test/method_channel_test.dart b/packages/firebase_database/firebase_database_platform_interface/test/method_channel_test.dart index 8a517dcd56fa..621d87853a4d 100755 --- a/packages/firebase_database/firebase_database_platform_interface/test/method_channel_test.dart +++ b/packages/firebase_database/firebase_database_platform_interface/test/method_channel_test.dart @@ -30,7 +30,7 @@ void main() { ); messenger = - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger; + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger; }); group('MethodChannelDatabase', () { @@ -45,7 +45,7 @@ void main() { setUp(() async { database = MethodChannelDatabase(app: app, databaseURL: databaseURL); - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(channel, (MethodCall methodCall) async { log.add(methodCall); @@ -454,7 +454,7 @@ void main() { Future simulateError(String errorMessage) async { await TestDefaultBinaryMessengerBinding - .instance?.defaultBinaryMessenger + .instance.defaultBinaryMessenger .handlePlatformMessage( eventChannel.name, eventChannel.codec.encodeErrorEnvelope( @@ -502,7 +502,7 @@ void main() { Future simulateEvent(Map event) async { await TestDefaultBinaryMessengerBinding - .instance?.defaultBinaryMessenger + .instance.defaultBinaryMessenger .handlePlatformMessage( eventChannel.name, eventChannel.codec.encodeSuccessEnvelope(event), diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/main.dart b/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/main.dart index 8d2adf2abb49..170ab3364d7e 100644 --- a/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/main.dart +++ b/packages/firebase_dynamic_links/firebase_dynamic_links/example/lib/main.dart @@ -165,7 +165,7 @@ class _MainScreenState extends State<_MainScreen> { }, onLongPress: () { if (_linkMessage != null) { - Clipboard.setData(ClipboardData(text: _linkMessage)); + Clipboard.setData(ClipboardData(text: _linkMessage!)); ScaffoldMessenger.of(context).showSnackBar( const SnackBar(content: Text('Copied Link!')), ); diff --git a/packages/firebase_dynamic_links/firebase_dynamic_links_platform_interface/test/mock.dart b/packages/firebase_dynamic_links/firebase_dynamic_links_platform_interface/test/mock.dart index 11329979e0e6..9a8e959ef2e1 100644 --- a/packages/firebase_dynamic_links/firebase_dynamic_links_platform_interface/test/mock.dart +++ b/packages/firebase_dynamic_links/firebase_dynamic_links_platform_interface/test/mock.dart @@ -21,7 +21,7 @@ void setupFirebaseDynamicLinksMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseDynamicLinks.channel, (call) async { return await methodCallCallback(call); @@ -31,7 +31,7 @@ void handleEventChannel( final String name, [ List? log, ]) { - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannel(name), (MethodCall methodCall) async { log?.add(methodCall); @@ -50,7 +50,7 @@ Future injectEventChannelResponse( String channelName, Map event, ) async { - await TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + await TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .handlePlatformMessage( channelName, MethodChannelFirebaseDynamicLinks.channel.codec diff --git a/packages/firebase_in_app_messaging/firebase_in_app_messaging_platform_interface/test/mock.dart b/packages/firebase_in_app_messaging/firebase_in_app_messaging_platform_interface/test/mock.dart index ddbcf4213655..e8697c4e1e8f 100644 --- a/packages/firebase_in_app_messaging/firebase_in_app_messaging_platform_interface/test/mock.dart +++ b/packages/firebase_in_app_messaging/firebase_in_app_messaging_platform_interface/test/mock.dart @@ -21,7 +21,7 @@ void setupFirebaseInAppMessagingMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseInAppMessaging.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_messaging/firebase_messaging_platform_interface/test/mock.dart b/packages/firebase_messaging/firebase_messaging_platform_interface/test/mock.dart index dff5f9b979da..c98de46f49ae 100644 --- a/packages/firebase_messaging/firebase_messaging_platform_interface/test/mock.dart +++ b/packages/firebase_messaging/firebase_messaging_platform_interface/test/mock.dart @@ -17,7 +17,7 @@ void setupFirebaseMessagingMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseMessaging.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_ml_model_downloader/firebase_ml_model_downloader_platform_interface/test/mock.dart b/packages/firebase_ml_model_downloader/firebase_ml_model_downloader_platform_interface/test/mock.dart index 306353f0eed4..dc23b2dedc71 100644 --- a/packages/firebase_ml_model_downloader/firebase_ml_model_downloader_platform_interface/test/mock.dart +++ b/packages/firebase_ml_model_downloader/firebase_ml_model_downloader_platform_interface/test/mock.dart @@ -16,7 +16,7 @@ void setupFirebaseModelDownloaderMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseModelDownloader.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_performance/firebase_performance_platform_interface/test/mock.dart b/packages/firebase_performance/firebase_performance_platform_interface/test/mock.dart index aa1c0b628824..d87388549f46 100644 --- a/packages/firebase_performance/firebase_performance_platform_interface/test/mock.dart +++ b/packages/firebase_performance/firebase_performance_platform_interface/test/mock.dart @@ -20,7 +20,7 @@ void setupFirebasePerformanceMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebasePerformance.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_storage/firebase_storage_platform_interface/test/mock.dart b/packages/firebase_storage/firebase_storage_platform_interface/test/mock.dart index 0e3785b2c710..ce0ffd1907de 100644 --- a/packages/firebase_storage/firebase_storage_platform_interface/test/mock.dart +++ b/packages/firebase_storage/firebase_storage_platform_interface/test/mock.dart @@ -21,7 +21,7 @@ void setupFirebaseStorageMocks([Callback? customHandlers]) { } void handleMethodCall(MethodCallCallback methodCallCallback) => - TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler(MethodChannelFirebaseStorage.channel, (call) async { return await methodCallCallback(call); diff --git a/packages/firebase_ui_auth/example/pubspec_overrides.yaml b/packages/firebase_ui_auth/example/pubspec_overrides.yaml index ff349579c709..618ce3ecc843 100644 --- a/packages/firebase_ui_auth/example/pubspec_overrides.yaml +++ b/packages/firebase_ui_auth/example/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_oauth_apple,firebase_ui_oauth_facebook,firebase_ui_oauth_google,firebase_ui_oauth_twitter,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_auth/lib/src/screens/profile_screen.dart b/packages/firebase_ui_auth/lib/src/screens/profile_screen.dart index 4c22778b42cb..32d6e44b33c7 100644 --- a/packages/firebase_ui_auth/lib/src/screens/profile_screen.dart +++ b/packages/firebase_ui_auth/lib/src/screens/profile_screen.dart @@ -390,9 +390,9 @@ class _EmailVerificationBadgeState extends State<_EmailVerificationBadge> { ), const SizedBox(height: 16), if (state == EmailVerificationState.pending) - Row( + const Row( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ LoadingIndicator(size: 16, borderWidth: 0.5), SizedBox(width: 16), Text('Waiting for email verification'), diff --git a/packages/firebase_ui_auth/pubspec_overrides.yaml b/packages/firebase_ui_auth/pubspec_overrides.yaml index c3215450bb2f..32bd9f4a104c 100644 --- a/packages/firebase_ui_auth/pubspec_overrides.yaml +++ b/packages/firebase_ui_auth/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_database/example/pubspec_overrides.yaml b/packages/firebase_ui_database/example/pubspec_overrides.yaml index 79b900dcce76..0d33f7615490 100644 --- a/packages/firebase_ui_database/example/pubspec_overrides.yaml +++ b/packages/firebase_ui_database/example/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_database,firebase_database_platform_interface,firebase_database_web,firebase_ui_database,firebase_ui_localizations dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../../_flutterfire_internals firebase_core: diff --git a/packages/firebase_ui_database/lib/src/table_builder.dart b/packages/firebase_ui_database/lib/src/table_builder.dart index c871dd329284..04151989fbda 100644 --- a/packages/firebase_ui_database/lib/src/table_builder.dart +++ b/packages/firebase_ui_database/lib/src/table_builder.dart @@ -51,7 +51,10 @@ class FirebaseDatabaseDataTable extends StatefulWidget { this.actions, this.sortColumnIndex, this.sortAscending = true, - this.dataRowHeight = kMinInteractiveDimension, + @Deprecated('Migrate to use dataRowMinHeight and dataRowMaxHeight instead.') + double? dataRowHeight, + double? dataRowMinHeight, + double? dataRowMaxHeight, this.headingRowHeight = 56.0, this.horizontalMargin = 24.0, this.columnSpacing = 56.0, @@ -62,10 +65,14 @@ class FirebaseDatabaseDataTable extends StatefulWidget { this.dragStartBehavior = DragStartBehavior.start, this.arrowHeadColor, this.checkboxHorizontalMargin, - }) : assert( + }) : assert( columnLabels is LinkedHashMap, 'only LinkedHashMap are supported as header', - ); // using an assert instead of a type because `{}` types as `Map` but is an instance of `LinkedHashMap` + ), // using an assert instead of a type because `{}` types as `Map` but is an instance of `LinkedHashMap` + dataRowMinHeight = + dataRowHeight ?? dataRowMinHeight ?? kMinInteractiveDimension, + dataRowMaxHeight = + dataRowHeight ?? dataRowMaxHeight ?? kMinInteractiveDimension; /// The firestore query that will be displayed final Query query; @@ -105,11 +112,17 @@ class FirebaseDatabaseDataTable extends StatefulWidget { /// The value is the index of the first row on the currently displayed page. final void Function(int page)? onPageChanged; - /// The height of each row (excluding the row that contains column headings). + /// The minimum height of each row (excluding the row that contains column headings). /// /// This value is optional and defaults to kMinInteractiveDimension if not /// specified. - final double dataRowHeight; + final double dataRowMinHeight; + + /// The maximum height of each row (excluding the row that contains column headings). + /// + /// This value is optional and defaults to kMinInteractiveDimension if not + /// specified. + final double dataRowMaxHeight; /// The current primary sort key's column. /// @@ -213,7 +226,8 @@ class _FirestoreTableState extends State { arrowHeadColor: widget.arrowHeadColor, checkboxHorizontalMargin: widget.checkboxHorizontalMargin, columnSpacing: widget.columnSpacing, - dataRowHeight: widget.dataRowHeight, + dataRowMaxHeight: widget.dataRowMaxHeight, + dataRowMinHeight: widget.dataRowMinHeight, dragStartBehavior: widget.dragStartBehavior, headingRowHeight: widget.headingRowHeight, horizontalMargin: widget.horizontalMargin, diff --git a/packages/firebase_ui_database/pubspec_overrides.yaml b/packages/firebase_ui_database/pubspec_overrides.yaml index 18ea4e26746d..575791c10f57 100644 --- a/packages/firebase_ui_database/pubspec_overrides.yaml +++ b/packages/firebase_ui_database/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_database,firebase_database_platform_interface,firebase_database_web,firebase_ui_localizations dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals firebase_core: diff --git a/packages/firebase_ui_firestore/example/pubspec_overrides.yaml b/packages/firebase_ui_firestore/example/pubspec_overrides.yaml index b80d2c43555d..620f7ceeb5c4 100644 --- a/packages/firebase_ui_firestore/example/pubspec_overrides.yaml +++ b/packages/firebase_ui_firestore/example/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,cloud_firestore,cloud_firestore_platform_interface,cloud_firestore_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_ui_firestore,firebase_ui_localizations dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../../_flutterfire_internals cloud_firestore: diff --git a/packages/firebase_ui_firestore/lib/src/table_builder.dart b/packages/firebase_ui_firestore/lib/src/table_builder.dart index df44c4598aa6..2c9636bbbbd8 100644 --- a/packages/firebase_ui_firestore/lib/src/table_builder.dart +++ b/packages/firebase_ui_firestore/lib/src/table_builder.dart @@ -68,7 +68,13 @@ class FirestoreDataTable extends StatefulWidget { this.actions, this.sortColumnIndex, this.sortAscending = true, - this.dataRowHeight = kMinInteractiveDimension, + @Deprecated( + 'Migrate to use dataRowMinHeight and dataRowMaxHeight instead. ' + 'This feature was deprecated after v3.7.0-5.0.pre.', + ) + double? dataRowHeight, + double? dataRowMinHeight, + double? dataRowMaxHeight, this.headingRowHeight = 56.0, this.horizontalMargin = 24.0, this.columnSpacing = 56.0, @@ -83,10 +89,14 @@ class FirestoreDataTable extends StatefulWidget { this.enableDefaultCellEditor = true, this.onTapCell, this.onSelectedRows, - }) : assert( + }) : assert( columnLabels is LinkedHashMap, 'only LinkedHashMap are supported as header', - ); + ), + dataRowMinHeight = + dataRowHeight ?? dataRowMinHeight ?? kMinInteractiveDimension, + dataRowMaxHeight = + dataRowHeight ?? dataRowMaxHeight ?? kMinInteractiveDimension; /// When specified, the builder will be used to display your own widget for the cell final CellBuilder? cellBuilder; @@ -137,11 +147,17 @@ class FirestoreDataTable extends StatefulWidget { /// The value is the index of the first row on the currently displayed page. final void Function(int page)? onPageChanged; - /// The height of each row (excluding the row that contains column headings). + /// The minimum height of each row (excluding the row that contains column headings). + /// + /// This value is optional and defaults to kMinInteractiveDimension if not + /// specified. + final double dataRowMinHeight; + + /// The maximum height of each row (excluding the row that contains column headings). /// /// This value is optional and defaults to kMinInteractiveDimension if not /// specified. - final double dataRowHeight; + final double dataRowMaxHeight; /// The current primary sort key's column. /// @@ -282,7 +298,8 @@ class _FirestoreTableState extends State { arrowHeadColor: widget.arrowHeadColor, checkboxHorizontalMargin: widget.checkboxHorizontalMargin, columnSpacing: widget.columnSpacing, - dataRowHeight: widget.dataRowHeight, + dataRowMaxHeight: widget.dataRowMaxHeight, + dataRowMinHeight: widget.dataRowMinHeight, dragStartBehavior: widget.dragStartBehavior, headingRowHeight: widget.headingRowHeight, horizontalMargin: widget.horizontalMargin, diff --git a/packages/firebase_ui_firestore/pubspec_overrides.yaml b/packages/firebase_ui_firestore/pubspec_overrides.yaml index 08eb93a5c1f1..e94937e66e70 100644 --- a/packages/firebase_ui_firestore/pubspec_overrides.yaml +++ b/packages/firebase_ui_firestore/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,cloud_firestore,cloud_firestore_platform_interface,cloud_firestore_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_ui_localizations dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals cloud_firestore: diff --git a/packages/firebase_ui_firestore/test/table_builder_test.dart b/packages/firebase_ui_firestore/test/table_builder_test.dart index ef4e9fc63787..7805e1c31fc5 100644 --- a/packages/firebase_ui_firestore/test/table_builder_test.dart +++ b/packages/firebase_ui_firestore/test/table_builder_test.dart @@ -117,7 +117,7 @@ Future main() async { expect(firstNameFinder, findsOneWidget); //For some reason, we have a renderflex issue when tapping - tester.binding.window.physicalSizeTestValue = const Size(1000, 2000); + tester.view.physicalSize = const Size(1000, 2000); await tester.tap(firstNameFinder); await tester.pumpAndSettle(); @@ -155,7 +155,7 @@ Future main() async { expect(firstNameFinder, findsOneWidget); //For some reason, we have a renderflex issue when tapping - tester.binding.window.physicalSizeTestValue = const Size(1000, 2000); + tester.view.physicalSize = const Size(1000, 2000); await tester.tap(firstNameFinder); await tester.pumpAndSettle(); @@ -171,7 +171,7 @@ Future main() async { 'FirestoreDataTable row selection is capture', (WidgetTester tester) async { //For some reason, we have a renderflex issue when tapping - tester.binding.window.physicalSizeTestValue = const Size(1000, 2000); + tester.view.physicalSize = const Size(1000, 2000); var nbItemSelected = 0; diff --git a/packages/firebase_ui_localizations/example/pubspec_overrides.yaml b/packages/firebase_ui_localizations/example/pubspec_overrides.yaml index 1b9e9ef39029..843121e3c968 100644 --- a/packages/firebase_ui_localizations/example/pubspec_overrides.yaml +++ b/packages/firebase_ui_localizations/example/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_oauth/example/pubspec_overrides.yaml b/packages/firebase_ui_oauth/example/pubspec_overrides.yaml index 1595940124bc..a8c1c3805292 100644 --- a/packages/firebase_ui_oauth/example/pubspec_overrides.yaml +++ b/packages/firebase_ui_oauth/example/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_oauth_apple,firebase_ui_oauth_facebook,firebase_ui_oauth_google,firebase_ui_oauth_twitter,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_oauth/pubspec_overrides.yaml b/packages/firebase_ui_oauth/pubspec_overrides.yaml index a2fae9955eb1..749a85d686ca 100644 --- a/packages/firebase_ui_oauth/pubspec_overrides.yaml +++ b/packages/firebase_ui_oauth/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth_google,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_oauth_apple/pubspec_overrides.yaml b/packages/firebase_ui_oauth_apple/pubspec_overrides.yaml index 1f4bacf75191..ccef32f48121 100644 --- a/packages/firebase_ui_oauth_apple/pubspec_overrides.yaml +++ b/packages/firebase_ui_oauth_apple/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_oauth_facebook/pubspec_overrides.yaml b/packages/firebase_ui_oauth_facebook/pubspec_overrides.yaml index 1f4bacf75191..ccef32f48121 100644 --- a/packages/firebase_ui_oauth_facebook/pubspec_overrides.yaml +++ b/packages/firebase_ui_oauth_facebook/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_oauth_google/pubspec_overrides.yaml b/packages/firebase_ui_oauth_google/pubspec_overrides.yaml index 1f4bacf75191..ccef32f48121 100644 --- a/packages/firebase_ui_oauth_google/pubspec_overrides.yaml +++ b/packages/firebase_ui_oauth_google/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals firebase_auth: diff --git a/packages/firebase_ui_oauth_twitter/pubspec_overrides.yaml b/packages/firebase_ui_oauth_twitter/pubspec_overrides.yaml index 1f4bacf75191..ccef32f48121 100644 --- a/packages/firebase_ui_oauth_twitter/pubspec_overrides.yaml +++ b/packages/firebase_ui_oauth_twitter/pubspec_overrides.yaml @@ -1,6 +1,5 @@ # melos_managed_dependency_overrides: _flutterfire_internals,firebase_auth,firebase_auth_platform_interface,firebase_auth_web,firebase_core,firebase_core_platform_interface,firebase_core_web,firebase_dynamic_links,firebase_dynamic_links_platform_interface,firebase_ui_auth,firebase_ui_localizations,firebase_ui_oauth,firebase_ui_shared dependency_overrides: - intl: ^0.18.0 _flutterfire_internals: path: ../_flutterfire_internals firebase_auth: