From 972855cc64fabb78757638b26dc657c4593d51a6 Mon Sep 17 00:00:00 2001 From: Sardar1208 Date: Thu, 21 Dec 2023 14:45:45 +0530 Subject: [PATCH 01/17] fix: fixed profile picture fetch methods --- .../Flutter/GeneratedPluginRegistrant.swift | 2 +- .../lib/services/contact_service.dart | 53 ++++++++++++++++++- 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/packages/at_contacts_flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift b/packages/at_contacts_flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift index 508252dd..591d027b 100644 --- a/packages/at_contacts_flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/packages/at_contacts_flutter/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -20,7 +20,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { BiometricStorageMacOSPlugin.register(with: registry.registrar(forPlugin: "BiometricStorageMacOSPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) - FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) diff --git a/packages/at_contacts_flutter/lib/services/contact_service.dart b/packages/at_contacts_flutter/lib/services/contact_service.dart index 106fa834..d5fe7fe3 100644 --- a/packages/at_contacts_flutter/lib/services/contact_service.dart +++ b/packages/at_contacts_flutter/lib/services/contact_service.dart @@ -574,7 +574,11 @@ class ContactService { key.metadata?.isBinary = true; key.key = contactFields[2]; Uint8List? image; - var result = await atClientManager.atClient.get(key); + + GetRequestOptions options = GetRequestOptions(); + options.bypassCache = true; + var result = + await atClientManager.atClient.get(key, getRequestOptions: options); if (result.value != null) { try { @@ -595,6 +599,53 @@ class ContactService { return contactDetails; } + getProfilePicture(String atsign) async { + var contactDetails = {}; + + var metadata = Metadata(); + metadata.isPublic = true; + metadata.namespaceAware = false; + var key = AtKey(); + key.sharedBy = atsign; + key.metadata = metadata; + // making isPublic true (as get method changes it to false) + key.metadata?.isBinary = true; + key.key = "image.wavi"; + + GetRequestOptions options = GetRequestOptions(); + options.bypassCache = true; + var result = + await atClientManager.atClient.get(key, getRequestOptions: options); + + if (result.value != null) { + try { + List intList = result.value.cast(); + var image = Uint8List.fromList(intList); + contactDetails['image'] = image; + return contactDetails; + } catch (e) { + print('invalid iamge data: $e'); + contactDetails['image'] = null; + return contactDetails; + } + } + } + + fetchProfilePictureMetaData(String atsign) async { + var metadata = Metadata(); + metadata.isPublic = true; + metadata.namespaceAware = false; + var key = AtKey(); + key.sharedBy = atsign; + key.metadata = metadata; + // making isPublic true (as get method changes it to false) + key.metadata?.isBinary = true; + key.key = "image.wavi"; + + var result = await atClientManager.atClient.getMeta(key); + return result; + } + /// updates status of contacts for [baseContactList] and [baseBlockedList] void updateState(STATE_UPDATE stateToUpdate, AtContact contact, bool state) { int indexToUpdate; From 0122544bb900a40d1e48e783eb038e532265e152 Mon Sep 17 00:00:00 2001 From: Sardar1208 Date: Fri, 22 Dec 2023 12:28:32 +0530 Subject: [PATCH 02/17] chore: added return type to functions --- .../at_contacts_flutter/lib/services/contact_service.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/at_contacts_flutter/lib/services/contact_service.dart b/packages/at_contacts_flutter/lib/services/contact_service.dart index d5fe7fe3..b22e4ada 100644 --- a/packages/at_contacts_flutter/lib/services/contact_service.dart +++ b/packages/at_contacts_flutter/lib/services/contact_service.dart @@ -599,7 +599,7 @@ class ContactService { return contactDetails; } - getProfilePicture(String atsign) async { + Future?> getProfilePicture(String atsign) async { var contactDetails = {}; var metadata = Metadata(); @@ -628,10 +628,12 @@ class ContactService { contactDetails['image'] = null; return contactDetails; } + }else { + return null; } } - fetchProfilePictureMetaData(String atsign) async { + Future fetchProfilePictureMetaData(String atsign) async { var metadata = Metadata(); metadata.isPublic = true; metadata.namespaceAware = false; From 91a1605cb2b829140fb3c3660072d0bb793eba84 Mon Sep 17 00:00:00 2001 From: Sardar1208 Date: Fri, 22 Dec 2023 13:47:25 +0530 Subject: [PATCH 03/17] feat: release changes for version 4.0.13 --- packages/at_contacts_flutter/CHANGELOG.md | 3 +++ packages/at_contacts_flutter/pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/at_contacts_flutter/CHANGELOG.md b/packages/at_contacts_flutter/CHANGELOG.md index 4f529cd6..64791c8e 100644 --- a/packages/at_contacts_flutter/CHANGELOG.md +++ b/packages/at_contacts_flutter/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.0.13 + +- **FIX**: Fixed methods for fetching profile picture ## 4.0.12 - **CHORE**: Bumped all dependency versions diff --git a/packages/at_contacts_flutter/pubspec.yaml b/packages/at_contacts_flutter/pubspec.yaml index 1dd26c64..eb7db78f 100644 --- a/packages/at_contacts_flutter/pubspec.yaml +++ b/packages/at_contacts_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: at_contacts_flutter description: A Flutter plugin project to provide ease of managing contacts for an atSign using atPlatform. -version: 4.0.12 +version: 4.0.13 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets/tree/trunk/packages/at_contacts_flutter issue_tracker: https://github.com/atsign-foundation/at_widgets/issues From ad5cb66ed2ae5949493675ffd8490ecbc89dc1c8 Mon Sep 17 00:00:00 2001 From: Sardar1208 Date: Wed, 27 Dec 2023 15:55:46 +0530 Subject: [PATCH 04/17] fix: fixed passing on flag fetchContacts --- .../lib/utils/init_contacts_service.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/at_contacts_flutter/lib/utils/init_contacts_service.dart b/packages/at_contacts_flutter/lib/utils/init_contacts_service.dart index 9ccc0124..bfe6279c 100644 --- a/packages/at_contacts_flutter/lib/utils/init_contacts_service.dart +++ b/packages/at_contacts_flutter/lib/utils/init_contacts_service.dart @@ -5,8 +5,11 @@ import 'package:at_contacts_flutter/services/contact_service.dart'; /// Function to initialise contacts Service Future initializeContactsService( - {rootDomain = 'root.atsign.org', rootPort = 64}) async { - await ContactService().initContactsService(rootDomain, rootPort); + {rootDomain = 'root.atsign.org', + rootPort = 64, + bool fetchContacts = true}) async { + await ContactService() + .initContactsService(rootDomain, rootPort, fetchContacts: fetchContacts); } /// Function call from app to dispose stream controllers used in the package From 53c62f484e11cb7848ac56e7b321b48f9960bfb9 Mon Sep 17 00:00:00 2001 From: sonle Date: Thu, 4 Jan 2024 18:13:59 +0700 Subject: [PATCH 05/17] fix: resolve noted issues --- .../example/lib/main.dart | 11 +-- .../at_backupkey_flutter/example/pubspec.yaml | 6 +- .../test/at_backupkey_flutter_test.dart | 16 +++- .../test/backupkey_service_test.dart | 31 ++++--- .../widgets_test/backup_key_widget_test.dart | 12 +-- .../at_chat_flutter/example/lib/main.dart | 85 ++++++++++--------- .../example/lib/second_screen.dart | 11 +-- .../example/lib/third_screen.dart | 8 +- packages/at_chat_flutter/example/pubspec.yaml | 5 ++ .../lib/screens/chat_screen.dart | 18 ++-- .../lib/services/chat_service.dart | 3 +- .../at_chat_flutter/lib/utils/colors.dart | 2 +- .../lib/widgets/bottom_sheet_dialog.dart | 2 +- .../lib/widgets/incoming_message_bubble.dart | 4 +- .../lib/widgets/outgoing_message_bubble.dart | 2 +- .../lib/widgets/send_message.dart | 4 +- .../bottom_sheet_dialog_test.dart | 6 +- .../test/widget_tests/button_widget_test.dart | 12 +-- .../widget_tests/contacts_intials_test.dart | 41 +++++---- .../incoming_message_bubble_test.dart | 10 +-- .../outgoing_message_bubble_test.dart | 10 +-- .../at_follows_flutter/example/lib/main.dart | 1 - .../example/lib/screens/follows_screen.dart | 1 - .../example/lib/services/at_service.dart | 7 +- .../lib/services/connections_service.dart | 5 +- .../lib/services/sdk_service.dart | 3 +- .../lib/widgets/web_view_screen.dart | 6 +- .../unit_tests/connections_service_test.dart | 26 +++--- .../example/lib/main.dart | 6 +- .../example/lib/second_screen.dart | 12 +-- .../example/pubspec.yaml | 7 +- .../lib/services/invitation_service.dart | 1 - .../lib/widgets/otp_dialog.dart | 2 +- .../lib/widgets/share_dialog.dart | 33 +++---- .../test/at_invitation_flutter_test.dart | 16 +++- .../test/widgets_test/otp_dialog_test.dart | 32 +++---- .../test/widgets_test/share_dialog_test.dart | 31 ++++--- .../test/at_location_flutter_test.dart | 25 +++--- .../lib/services/at_login_service.dart | 21 ++--- .../lib/services/custom_nav.dart | 2 +- .../lib/utils/at_login_utils.dart | 5 +- .../widgets/at_login_dashboard_widget.dart | 1 - .../lib/widgets/at_login_widget.dart | 11 +-- packages/at_login_flutter/pubspec.yaml | 1 + .../test/at_login_flutter_test.dart | 17 ++-- .../at_sync_ui_flutter/example/lib/main.dart | 4 +- .../example/lib/second_screen.dart | 6 ++ .../at_sync_ui_flutter/example/pubspec.yaml | 8 +- .../lib/services/at_sync_ui_services.dart | 7 +- 49 files changed, 346 insertions(+), 250 deletions(-) diff --git a/packages/at_backupkey_flutter/example/lib/main.dart b/packages/at_backupkey_flutter/example/lib/main.dart index 6191edd5..f7d61f6e 100644 --- a/packages/at_backupkey_flutter/example/lib/main.dart +++ b/packages/at_backupkey_flutter/example/lib/main.dart @@ -40,7 +40,6 @@ class _MyAppState extends State { Future futurePreference = loadAtClientPreference(); AtClientPreference? atClientPreference; - @override Widget build(BuildContext context) { return StreamBuilder( @@ -55,8 +54,8 @@ class _MyAppState extends State { primaryColor: const Color(0xFFf4533d), colorScheme: ThemeData.light().colorScheme.copyWith( primary: const Color(0xFFf4533d), + background: Colors.white, ), - backgroundColor: Colors.white, scaffoldBackgroundColor: Colors.white, ), darkTheme: ThemeData().copyWith( @@ -64,8 +63,8 @@ class _MyAppState extends State { primaryColor: Colors.blue, colorScheme: ThemeData.dark().colorScheme.copyWith( primary: Colors.blue, + background: Colors.grey[850], ), - backgroundColor: Colors.grey[850], scaffoldBackgroundColor: Colors.grey[850], ), themeMode: themeMode, @@ -188,7 +187,7 @@ class _HomeScreenState extends State { /// Use the AtClientManager instance to get the current atsign Text( 'Current @sign: ${atClientManager.atClient.getCurrentAtSign()}'), - + ElevatedButton.icon( icon: const Icon( Icons.file_copy, @@ -196,7 +195,9 @@ class _HomeScreenState extends State { ), label: const Text('Backup your key'), onPressed: () async { - BackupKeyWidget(atsign: atClientManager.atClient.getCurrentAtSign() ?? '') + BackupKeyWidget( + atsign: + atClientManager.atClient.getCurrentAtSign() ?? '') .showBackupDialog(context); }, ), diff --git a/packages/at_backupkey_flutter/example/pubspec.yaml b/packages/at_backupkey_flutter/example/pubspec.yaml index 76912166..b298a24a 100644 --- a/packages/at_backupkey_flutter/example/pubspec.yaml +++ b/packages/at_backupkey_flutter/example/pubspec.yaml @@ -11,8 +11,6 @@ environment: dependencies: at_app_flutter: ^5.2.0 - at_backupkey_flutter: - path: ../ at_client_mobile: ^3.2.12 at_onboarding_flutter: ^6.1.3 cupertino_icons: ^1.0.6 @@ -24,6 +22,10 @@ dependencies: dev_dependencies: flutter_lints: ^2.0.3 +dependency_overrides: + at_backupkey_flutter: + path: ../ + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. diff --git a/packages/at_backupkey_flutter/test/at_backupkey_flutter_test.dart b/packages/at_backupkey_flutter/test/at_backupkey_flutter_test.dart index 8db536ad..930d3d28 100644 --- a/packages/at_backupkey_flutter/test/at_backupkey_flutter_test.dart +++ b/packages/at_backupkey_flutter/test/at_backupkey_flutter_test.dart @@ -7,12 +7,20 @@ void main() { TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { - channel.setMockMethodCallHandler((MethodCall methodCall) async { - return '42'; - }); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + channel, + (MethodCall methodCall) async { + return '42'; + }, + ); }); tearDown(() { - channel.setMockMethodCallHandler(null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + channel, + null, + ); }); } diff --git a/packages/at_backupkey_flutter/test/backupkey_service_test.dart b/packages/at_backupkey_flutter/test/backupkey_service_test.dart index cd16b58a..7b6d3797 100644 --- a/packages/at_backupkey_flutter/test/backupkey_service_test.dart +++ b/packages/at_backupkey_flutter/test/backupkey_service_test.dart @@ -13,36 +13,36 @@ void main() { group('Fetching AESKey', () { test('for registered @sign', () async { - MockDataService _mockDataService = MockDataService(atsign); - String aesKey = _mockDataService.getAESKey; + MockDataService mockDataService = MockDataService(atsign); + String aesKey = mockDataService.getAESKey; expect(aesKey.length == 44, true); }); test('for unregistered @sign', () async { - MockDataService _mockDataService = MockDataService(atsign + '123'); - String? aesKey = _mockDataService.getAESKey; + MockDataService mockDataService = MockDataService('${atsign}123'); + String? aesKey = mockDataService.getAESKey; expect(aesKey, null); }); }); group('Fetch EncryptedKeys', () { test('for registerd @sign', () async { - MockDataService _mockDataService = MockDataService(atsign); - var map = _mockDataService.getEncryptedKeys(); + MockDataService mockDataService = MockDataService(atsign); + var map = mockDataService.getEncryptedKeys(); expect(map.length, greaterThan(0)); }); test('for unregisterd @sign', () async { - MockDataService _mockDataService = MockDataService(atsign + '123'); - var map = _mockDataService.getEncryptedKeys(); + MockDataService mockDataService = MockDataService('${atsign}123'); + var map = mockDataService.getEncryptedKeys(); expect(map, {}); }); }); group('generate backupkey file', () { test('for registered @sign', () async { - MockDataService _mockDataService = MockDataService(atsign); - var aesEncryptedKeys = _mockDataService.getEncryptedKeys(); + MockDataService mockDataService = MockDataService(atsign); + var aesEncryptedKeys = mockDataService.getEncryptedKeys(); expect(aesEncryptedKeys.isNotEmpty, true); var result = await _generateFile(atsign, aesEncryptedKeys); expect(result, true); @@ -50,9 +50,9 @@ void main() { }); test('for unregistered @sign', () async { - String atSign = atsign + '123'; - MockDataService _mockDataService = MockDataService(atSign); - var aesEncryptedKeys = _mockDataService.getEncryptedKeys(); + String atSign = '${atsign}123'; + MockDataService mockDataService = MockDataService(atSign); + var aesEncryptedKeys = mockDataService.getEncryptedKeys(); expect(aesEncryptedKeys.isNotEmpty, false); var result = await _generateFile(atSign, aesEncryptedKeys); expect(result, false); @@ -82,7 +82,9 @@ Future setUpFunc(String atsign) async { // To setup encryption keys await atClient.getLocalSecondary()!.putValue( - AT_ENCRYPTION_PRIVATE_KEY, demo_data.encryptionPrivateKeyMap[atsign]!); + AtConstants.atEncryptionPrivateKey, + demo_data.encryptionPrivateKeyMap[atsign]!, + ); } AtClientPreference getAtSignPreference(String atsign) { @@ -113,6 +115,7 @@ class MockDataService { late String atsign; MockDataService(this.atsign); + get getAESKey => demo_data.aesKeyMap[atsign]; Map getEncryptedKeys() { diff --git a/packages/at_backupkey_flutter/test/widgets_test/backup_key_widget_test.dart b/packages/at_backupkey_flutter/test/widgets_test/backup_key_widget_test.dart index 43eb1f9f..83ab3117 100644 --- a/packages/at_backupkey_flutter/test/widgets_test/backup_key_widget_test.dart +++ b/packages/at_backupkey_flutter/test/widgets_test/backup_key_widget_test.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget backupKeyWidget}) { + Widget wrapWidgetWithMaterialApp({required Widget backupKeyWidget}) { return TestMaterialApp( home: Builder( builder: (BuildContext context) { @@ -28,31 +28,31 @@ void main() { // Test case to check backupkey widget is displayed testWidgets('BackupKey widget is used', (WidgetTester tester) async { await tester.pumpWidget( - _wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); + wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); expect(find.byType(BackupKeyWidget), findsOneWidget); }); // Test case to identify atsign text testWidgets("Identify atsign text", (WidgetTester tester) async { await tester.pumpWidget( - _wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); + wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); expect(backupKeyWidget.atsign, 'bluebellrelated86'); }); // Test case to identify button text testWidgets("Identify button text", (WidgetTester tester) async { await tester.pumpWidget( - _wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); + wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); expect(backupKeyWidget.buttonText, 'Click here'); }); // Test case to check icon Color testWidgets('Test case to check icon color', (WidgetTester tester) async { await tester.pumpWidget( - _wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); + wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); expect(backupKeyWidget.iconColor, Colors.purple); }); // Test case to check button Color testWidgets('Test case to check button color', (WidgetTester tester) async { await tester.pumpWidget( - _wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); + wrapWidgetWithMaterialApp(backupKeyWidget: backupKeyWidget)); expect(backupKeyWidget.buttonColor, Colors.white); }); }); diff --git a/packages/at_chat_flutter/example/lib/main.dart b/packages/at_chat_flutter/example/lib/main.dart index dbf5a9dd..f9567ba3 100644 --- a/packages/at_chat_flutter/example/lib/main.dart +++ b/packages/at_chat_flutter/example/lib/main.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:at_chat_flutter_example/second_screen.dart'; import 'package:flutter/material.dart'; -import 'package:at_client_mobile/at_client_mobile.dart'; import 'package:at_onboarding_flutter/at_onboarding_flutter.dart'; import 'package:at_utils/at_logger.dart' show AtSignLogger; import 'package:path_provider/path_provider.dart' @@ -27,8 +26,9 @@ Future loadAtClientPreference() async { class MyApp extends StatefulWidget { const MyApp({Key? key}) : super(key: key); + @override - _MyAppState createState() => _MyAppState(); + State createState() => _MyAppState(); } class _MyAppState extends State { @@ -70,44 +70,51 @@ class _MyAppState extends State { setState(() { atClientPreference = preference; }); - final result = await AtOnboarding.onboard( - context: context, - config: AtOnboardingConfig( - atClientPreference: atClientPreference!, - domain: AtEnv.rootDomain, - appAPIKey: '477b-876u-bcez-c42z-6a3d', - rootEnvironment: AtEnv.rootEnvironment, - ), - ); - switch (result.status) { - case AtOnboardingResultStatus.success: - await Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (context) => const SecondScreen(), - )); - break; - case AtOnboardingResultStatus.error: - _logger.severe( - 'Onboarding throws ${result.errorCode} error'); - await showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - content: const Text('Something went wrong'), - actions: [ - TextButton( - onPressed: () { - Navigator.of(context).pop(); - }, - child: const Text('ok')) - ], + if (mounted) { + final result = await AtOnboarding.onboard( + context: context, + config: AtOnboardingConfig( + atClientPreference: atClientPreference!, + domain: AtEnv.rootDomain, + appAPIKey: '477b-876u-bcez-c42z-6a3d', + rootEnvironment: AtEnv.rootEnvironment, + ), + ); + + switch (result.status) { + case AtOnboardingResultStatus.success: + if (mounted) { + await Navigator.pushReplacement( + context, + MaterialPageRoute( + builder: (context) => const SecondScreen(), + )); + } + break; + case AtOnboardingResultStatus.error: + _logger.severe( + 'Onboarding throws ${result.errorCode} error'); + if (mounted) { + await showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + content: const Text('Something went wrong'), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text('ok')) + ], + ); + }, ); - }, - ); - break; - case AtOnboardingResultStatus.cancel: - break; + } + break; + case AtOnboardingResultStatus.cancel: + break; + } } }, child: const Text('Start onboarding'), diff --git a/packages/at_chat_flutter/example/lib/second_screen.dart b/packages/at_chat_flutter/example/lib/second_screen.dart index bbed4cd7..3476af9e 100644 --- a/packages/at_chat_flutter/example/lib/second_screen.dart +++ b/packages/at_chat_flutter/example/lib/second_screen.dart @@ -9,7 +9,7 @@ class SecondScreen extends StatefulWidget { const SecondScreen({Key? key}) : super(key: key); @override - _SecondScreenState createState() => _SecondScreenState(); + State createState() => _SecondScreenState(); } class _SecondScreenState extends State { @@ -26,6 +26,7 @@ class _SecondScreenState extends State { /// Get the AtClientManager instance var atClientManager = AtClientManager.getInstance(); + @override void initState() { getAtSignAndInitializeChat(); @@ -222,8 +223,8 @@ class _SecondScreenState extends State { if (member1.trim() != '' && member2.trim() != '' && groupId != '') { setChatWithAtSign(null, isGroup: true, groupId: groupId, groupMembers: [ activeAtSign!, - member1.startsWith('@') ? member1 : '@' + member1, - member2.startsWith('@') ? member2 : '@' + member2 + member1.startsWith('@') ? member1 : '@$member1', + member2.startsWith('@') ? member2 : '@$member2' ]); Navigator.push(context, MaterialPageRoute(builder: (context) => const ThirdScreen())); @@ -238,8 +239,8 @@ class _SecondScreenState extends State { context: context, builder: (BuildContext context) { return AlertDialog( - title: Row( - children: const [Text('Some details are missing!')], + title: const Row( + children: [Text('Some details are missing!')], ), content: const Text('Please enter all fields'), actions: [ diff --git a/packages/at_chat_flutter/example/lib/third_screen.dart b/packages/at_chat_flutter/example/lib/third_screen.dart index a34ab7c0..1e63afef 100644 --- a/packages/at_chat_flutter/example/lib/third_screen.dart +++ b/packages/at_chat_flutter/example/lib/third_screen.dart @@ -5,7 +5,7 @@ class ThirdScreen extends StatefulWidget { const ThirdScreen({Key? key}) : super(key: key); @override - _ThirdScreenState createState() => _ThirdScreenState(); + State createState() => _ThirdScreenState(); } class _ThirdScreenState extends State { @@ -28,8 +28,10 @@ class _ThirdScreenState extends State { var result = await deleteMessages(); var message = result ? 'Messages are deleted' : 'Failed to delete'; - ScaffoldMessenger.of(context) - .showSnackBar(SnackBar(content: Text(message))); + if (mounted) { + ScaffoldMessenger.of(context) + .showSnackBar(SnackBar(content: Text(message))); + } }, ), ]), diff --git a/packages/at_chat_flutter/example/pubspec.yaml b/packages/at_chat_flutter/example/pubspec.yaml index a0384637..e497ce7f 100644 --- a/packages/at_chat_flutter/example/pubspec.yaml +++ b/packages/at_chat_flutter/example/pubspec.yaml @@ -36,6 +36,10 @@ dependencies: # the parent directory to use the current plugin's version. path: ../ at_onboarding_flutter: ^6.1.3 + at_client_mobile: ^3.2.13 + at_utils: ^3.0.15 + path_provider: ^2.1.1 + flutter_keychain: ^2.4.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -56,6 +60,7 @@ flutter: uses-material-design: true dev_dependencies: + flutter_lints: ^3.0.1 flutter_test: sdk: flutter # To add assets to your application, add an assets section, like this: diff --git a/packages/at_chat_flutter/lib/screens/chat_screen.dart b/packages/at_chat_flutter/lib/screens/chat_screen.dart index 1fcf00ba..192aa308 100644 --- a/packages/at_chat_flutter/lib/screens/chat_screen.dart +++ b/packages/at_chat_flutter/lib/screens/chat_screen.dart @@ -51,7 +51,7 @@ class ChatScreen extends StatefulWidget { : super(key: key); @override - _ChatScreenState createState() => _ChatScreenState(); + State createState() => _ChatScreenState(); } class _ChatScreenState extends State { @@ -174,15 +174,19 @@ class _ChatScreenState extends State { (id) async { var result = await _chatService .deleteSelectedMessage(id); - Navigator.of(context).pop(); + if (mounted) { + Navigator.of(context).pop(); + } var message = result ? 'Message is deleted' : 'Failed to delete'; - ScaffoldMessenger.of(context) - .showSnackBar(SnackBar( - content: - Text(message))); + if (mounted) { + ScaffoldMessenger.of(context) + .showSnackBar(SnackBar( + content: + Text(message))); + } }, message: snapshot.data![index], color: @@ -225,7 +229,7 @@ class _ChatScreenState extends State { ); if ((result?.files ?? []).isNotEmpty) { final file = File(result!.files.first.path!); - await _chatService.sendImageFile(context, file); + if (mounted) await _chatService.sendImageFile(context, file); } else { // User canceled the picker } diff --git a/packages/at_chat_flutter/lib/services/chat_service.dart b/packages/at_chat_flutter/lib/services/chat_service.dart index 70f9d2de..9edb6086 100644 --- a/packages/at_chat_flutter/lib/services/chat_service.dart +++ b/packages/at_chat_flutter/lib/services/chat_service.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:at_chat_flutter/models/message_model.dart'; + // ignore: import_of_legacy_library_into_null_safe import 'package:at_client_mobile/at_client_mobile.dart'; @@ -141,7 +142,7 @@ class ChatService { if (chatWithAtSignFromApp.startsWith('@')) { chatWithAtSign = chatWithAtSignFromApp; } else { - chatWithAtSign = '@' + chatWithAtSignFromApp; + chatWithAtSign = '@$chatWithAtSignFromApp'; } } else { chatWithAtSign = ''; diff --git a/packages/at_chat_flutter/lib/utils/colors.dart b/packages/at_chat_flutter/lib/utils/colors.dart index 0fcaa8d3..993a7d63 100644 --- a/packages/at_chat_flutter/lib/utils/colors.dart +++ b/packages/at_chat_flutter/lib/utils/colors.dart @@ -11,7 +11,7 @@ class CustomColors { class ContactInitialsColors { static Color getColor(String atsign) { if (atsign.length == 1) { - atsign = atsign + ' '; + atsign = '$atsign '; } switch (atsign[1].toUpperCase()) { case 'A': diff --git a/packages/at_chat_flutter/lib/widgets/bottom_sheet_dialog.dart b/packages/at_chat_flutter/lib/widgets/bottom_sheet_dialog.dart index 83f771af..cbc41fc9 100644 --- a/packages/at_chat_flutter/lib/widgets/bottom_sheet_dialog.dart +++ b/packages/at_chat_flutter/lib/widgets/bottom_sheet_dialog.dart @@ -10,7 +10,7 @@ class BottomSheetDialog extends StatefulWidget { }) : super(key: key); @override - _BottomSheetDialogState createState() => _BottomSheetDialogState(); + State createState() => _BottomSheetDialogState(); } class _BottomSheetDialogState extends State { diff --git a/packages/at_chat_flutter/lib/widgets/incoming_message_bubble.dart b/packages/at_chat_flutter/lib/widgets/incoming_message_bubble.dart index cfcb8ff4..b31f370e 100644 --- a/packages/at_chat_flutter/lib/widgets/incoming_message_bubble.dart +++ b/packages/at_chat_flutter/lib/widgets/incoming_message_bubble.dart @@ -2,6 +2,7 @@ import 'dart:typed_data'; import 'package:at_chat_flutter/models/message_model.dart'; import 'package:at_chat_flutter/utils/colors.dart'; + // ignore: import_of_legacy_library_into_null_safe import 'package:at_common_flutter/at_common_flutter.dart'; import 'package:at_chat_flutter/widgets/contacts_initials.dart'; @@ -18,8 +19,9 @@ class IncomingMessageBubble extends StatefulWidget { this.color = CustomColors.incomingMessageColor, this.avatarColor = CustomColors.defaultColor}) : super(key: key); + @override - _IncomingMessageBubbleState createState() => _IncomingMessageBubbleState(); + State createState() => _IncomingMessageBubbleState(); } class _IncomingMessageBubbleState extends State { diff --git a/packages/at_chat_flutter/lib/widgets/outgoing_message_bubble.dart b/packages/at_chat_flutter/lib/widgets/outgoing_message_bubble.dart index 852f5ff4..0af14fc8 100644 --- a/packages/at_chat_flutter/lib/widgets/outgoing_message_bubble.dart +++ b/packages/at_chat_flutter/lib/widgets/outgoing_message_bubble.dart @@ -23,7 +23,7 @@ class OutgoingMessageBubble extends StatefulWidget { : super(key: key); @override - _OutgoingMessageBubbleState createState() => _OutgoingMessageBubbleState(); + State createState() => _OutgoingMessageBubbleState(); } class _OutgoingMessageBubbleState extends State { diff --git a/packages/at_chat_flutter/lib/widgets/send_message.dart b/packages/at_chat_flutter/lib/widgets/send_message.dart index ac0ba42e..dd6bc934 100644 --- a/packages/at_chat_flutter/lib/widgets/send_message.dart +++ b/packages/at_chat_flutter/lib/widgets/send_message.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; + // ignore: import_of_legacy_library_into_null_safe import 'package:at_common_flutter/services/size_config.dart'; @@ -19,8 +20,9 @@ class SendMessage extends StatefulWidget { this.hintText, this.onMediaPressed, }) : super(key: key); + @override - _SendMessageState createState() => _SendMessageState(); + State createState() => _SendMessageState(); } class _SendMessageState extends State { diff --git a/packages/at_chat_flutter/test/widget_tests/bottom_sheet_dialog_test.dart b/packages/at_chat_flutter/test/widget_tests/bottom_sheet_dialog_test.dart index 534189f3..a439fd4b 100644 --- a/packages/at_chat_flutter/test/widget_tests/bottom_sheet_dialog_test.dart +++ b/packages/at_chat_flutter/test/widget_tests/bottom_sheet_dialog_test.dart @@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../test_material_app.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget bottomSheetDialog}) { + Widget wrapWidgetWithMaterialApp({required Widget bottomSheetDialog}) { return TestMaterialApp(home: Builder(builder: (BuildContext context) { SizeConfig().init(context); return bottomSheetDialog; @@ -21,7 +21,7 @@ void main() { testWidgets("Botton Sheet is displayed", (WidgetTester tester) async { final bottomSheetDialog = BottomSheetDialog(() {}); await tester.pumpWidget( - _wrapWidgetWithMaterialApp(bottomSheetDialog: bottomSheetDialog)); + wrapWidgetWithMaterialApp(bottomSheetDialog: bottomSheetDialog)); expect(find.byType(BottomSheetDialog), findsOneWidget); }); @@ -32,7 +32,7 @@ void main() { log('Call back is given'); }); await tester.pumpWidget( - _wrapWidgetWithMaterialApp(bottomSheetDialog: bottomSheetDialog)); + wrapWidgetWithMaterialApp(bottomSheetDialog: bottomSheetDialog)); await tester.tap((find.byType(BottomSheetDialog))); expect(bottomSheetDialog.deleteCallback.call(), null); }); diff --git a/packages/at_chat_flutter/test/widget_tests/button_widget_test.dart b/packages/at_chat_flutter/test/widget_tests/button_widget_test.dart index 3dacf5ae..c433fcc9 100644 --- a/packages/at_chat_flutter/test/widget_tests/button_widget_test.dart +++ b/packages/at_chat_flutter/test/widget_tests/button_widget_test.dart @@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../test_material_app.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget buttonWidget}) { + Widget wrapWidgetWithMaterialApp({required Widget buttonWidget}) { return TestMaterialApp(home: Builder(builder: (BuildContext context) { SizeConfig().init(context); return buttonWidget; @@ -34,7 +34,7 @@ void main() { testWidgets("Button widget is used and shown on screen", (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); + .pumpWidget(wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); expect(find.byType(ButtonWidget), findsOneWidget); }); @@ -42,14 +42,14 @@ void main() { // Test case to check button string is given testWidgets("Button text displayed", (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); + .pumpWidget(wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); expect(find.text('Click here'), findsOneWidget); }); // Test case to check onPress functionality testWidgets("OnPress is given an action", (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); + .pumpWidget(wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); expect(buttonWidget.onPress!.call(), null); }); @@ -57,7 +57,7 @@ void main() { testWidgets("BorderRadius of button widget as circular", (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); + .pumpWidget(wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); final container = tester.widget(find.byType(Container)); final decoration = container.decoration as BoxDecoration; final borderRadius = decoration.borderRadius as BorderRadius; @@ -71,7 +71,7 @@ void main() { testWidgets("Color of button is button default color", (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); + .pumpWidget(wrapWidgetWithMaterialApp(buttonWidget: buttonWidget)); final container = tester.widget(find.byType(Container)); final decoration = container.decoration as BoxDecoration; expect( diff --git a/packages/at_chat_flutter/test/widget_tests/contacts_intials_test.dart b/packages/at_chat_flutter/test/widget_tests/contacts_intials_test.dart index 13284b26..c7f4644c 100644 --- a/packages/at_chat_flutter/test/widget_tests/contacts_intials_test.dart +++ b/packages/at_chat_flutter/test/widget_tests/contacts_intials_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../test_material_app.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget contactInitial}) { + Widget wrapWidgetWithMaterialApp({required Widget contactInitial}) { return TestMaterialApp(home: Builder(builder: (BuildContext context) { SizeConfig().init(context); return contactInitial; @@ -16,21 +16,19 @@ void main() { /// Functional test cases for [contactInitial] group('Contacts Initial widget Tests:', () { - - // Test case to identify contact initial is used in screen or not - testWidgets("Button widget is used and shown on screen", + // Test case to identify contact initial is used in screen or not + testWidgets("Button widget is used and shown on screen", (WidgetTester tester) async { - await tester - .pumpWidget(_wrapWidgetWithMaterialApp(contactInitial: ContactInitial(initials:'@'))); + await tester.pumpWidget(wrapWidgetWithMaterialApp( + contactInitial: ContactInitial(initials: '@'))); expect(find.byType(ContactInitial), findsOneWidget); }); - // Test case to identify contact initial text - testWidgets("identify contact initial text", - (WidgetTester tester) async { - await tester - .pumpWidget(_wrapWidgetWithMaterialApp(contactInitial: ContactInitial(initials:'@'))); + // Test case to identify contact initial text + testWidgets("identify contact initial text", (WidgetTester tester) async { + await tester.pumpWidget(wrapWidgetWithMaterialApp( + contactInitial: ContactInitial(initials: '@'))); expect(find.text('@'), findsOneWidget); }); @@ -38,17 +36,26 @@ void main() { // Test case to check contact initial to check background color testWidgets('Contacts initial with background color', (WidgetTester tester) async { - await tester.pumpWidget(_wrapWidgetWithMaterialApp( - contactInitial: ContactInitial(initials: '@',backgroundColor: CustomColors.defaultColor,))); + await tester.pumpWidget(wrapWidgetWithMaterialApp( + contactInitial: ContactInitial( + initials: '@', + backgroundColor: CustomColors.defaultColor, + ))); final contactsInitial = tester.widget(find.byType(ContactInitial)); - expect(contactsInitial.backgroundColor, CustomColors.defaultColor,); + expect( + contactsInitial.backgroundColor, + CustomColors.defaultColor, + ); }); - - // Test case to check contact initial to check given without background color + + // Test case to check contact initial to check given without background color testWidgets('Contacts initial without background color', (WidgetTester tester) async { - await tester.pumpWidget(_wrapWidgetWithMaterialApp(contactInitial: ContactInitial(initials: '@',))); + await tester.pumpWidget(wrapWidgetWithMaterialApp( + contactInitial: ContactInitial( + initials: '@', + ))); final contactsInitial = tester.widget(find.byType(ContactInitial)); expect(contactsInitial.backgroundColor, null); diff --git a/packages/at_chat_flutter/test/widget_tests/incoming_message_bubble_test.dart b/packages/at_chat_flutter/test/widget_tests/incoming_message_bubble_test.dart index 18126acc..fd4c2e22 100644 --- a/packages/at_chat_flutter/test/widget_tests/incoming_message_bubble_test.dart +++ b/packages/at_chat_flutter/test/widget_tests/incoming_message_bubble_test.dart @@ -10,7 +10,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../test_material_app.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget incomingMessageBubble}) { + Widget wrapWidgetWithMaterialApp({required Widget incomingMessageBubble}) { return TestMaterialApp(home: Builder(builder: (BuildContext context) { SizeConfig().init(context); return incomingMessageBubble; @@ -23,7 +23,7 @@ void main() { testWidgets("Incoming message bubble widget is used and shown on screen", (WidgetTester tester) async { const incomingMessageBubble = IncomingMessageBubble(); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( incomingMessageBubble: incomingMessageBubble)); expect(find.byType(IncomingMessageBubble), findsOneWidget); @@ -36,7 +36,7 @@ void main() { final incomingMessageBubble = IncomingMessageBubble( message: message, ); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( incomingMessageBubble: incomingMessageBubble)); expect(incomingMessageBubble.message, message); }); @@ -46,7 +46,7 @@ void main() { const incomingMessageBubble = IncomingMessageBubble( color: CustomColors.defaultColor, ); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( incomingMessageBubble: incomingMessageBubble)); final container = tester .widget(find.byType(IncomingMessageBubble)); @@ -60,7 +60,7 @@ void main() { testWidgets("Color of avatar in incoming message bubble", (WidgetTester tester) async { const incomingMessageBubble = IncomingMessageBubble(); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( incomingMessageBubble: incomingMessageBubble)); final contactInitial = tester.widget(find.byType(ContactInitial)); diff --git a/packages/at_chat_flutter/test/widget_tests/outgoing_message_bubble_test.dart b/packages/at_chat_flutter/test/widget_tests/outgoing_message_bubble_test.dart index 16b95ec5..9e9cedd4 100644 --- a/packages/at_chat_flutter/test/widget_tests/outgoing_message_bubble_test.dart +++ b/packages/at_chat_flutter/test/widget_tests/outgoing_message_bubble_test.dart @@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../test_material_app.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget outgoingMessageBubble}) { + Widget wrapWidgetWithMaterialApp({required Widget outgoingMessageBubble}) { return TestMaterialApp(home: Builder(builder: (BuildContext context) { SizeConfig().init(context); return outgoingMessageBubble; @@ -22,7 +22,7 @@ void main() { (WidgetTester tester) async { // ignore: prefer_const_constructors final outgoingMessageBubble = OutgoingMessageBubble((message) {}); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( outgoingMessageBubble: outgoingMessageBubble)); expect(find.byType(OutgoingMessageBubble), findsOneWidget); @@ -37,7 +37,7 @@ void main() { (message) {}, message: displayMessage, ); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( outgoingMessageBubble: outgoingMessageBubble)); expect(outgoingMessageBubble.message, displayMessage); }); @@ -49,7 +49,7 @@ void main() { (message) {}, color: CustomColors.defaultColor, ); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( outgoingMessageBubble: outgoingMessageBubble)); final container = tester .widget(find.byType(OutgoingMessageBubble)); @@ -66,7 +66,7 @@ void main() { (message) {}, avatarColor: CustomColors.defaultColor, ); - await tester.pumpWidget(_wrapWidgetWithMaterialApp( + await tester.pumpWidget(wrapWidgetWithMaterialApp( outgoingMessageBubble: outgoingMessageBubble)); final avatarColor = tester .widget(find.byType(OutgoingMessageBubble)); diff --git a/packages/at_follows_flutter/example/lib/main.dart b/packages/at_follows_flutter/example/lib/main.dart index 77df912a..6701935a 100644 --- a/packages/at_follows_flutter/example/lib/main.dart +++ b/packages/at_follows_flutter/example/lib/main.dart @@ -2,7 +2,6 @@ import 'dart:async'; import 'package:at_follows_flutter_example/screens/follows_screen.dart'; import 'package:at_onboarding_flutter/services/onboarding_service.dart'; import 'package:flutter/material.dart'; -import 'package:at_client_mobile/at_client_mobile.dart'; import 'package:at_onboarding_flutter/at_onboarding_flutter.dart'; import 'package:at_utils/at_logger.dart' show AtSignLogger; import 'package:path_provider/path_provider.dart' diff --git a/packages/at_follows_flutter/example/lib/screens/follows_screen.dart b/packages/at_follows_flutter/example/lib/screens/follows_screen.dart index 3766cdcc..f63fd91a 100644 --- a/packages/at_follows_flutter/example/lib/screens/follows_screen.dart +++ b/packages/at_follows_flutter/example/lib/screens/follows_screen.dart @@ -2,7 +2,6 @@ import 'package:at_follows_flutter/screens/connections.dart'; import 'package:at_follows_flutter_example/services/at_service.dart'; import 'package:at_follows_flutter_example/services/notification_service.dart'; import 'package:flutter/material.dart'; -import 'package:at_utils/at_logger.dart'; import 'package:at_follows_flutter_example/utils/app_strings.dart'; class NextScreen extends StatefulWidget { diff --git a/packages/at_follows_flutter/example/lib/services/at_service.dart b/packages/at_follows_flutter/example/lib/services/at_service.dart index b7dadde4..815084cf 100644 --- a/packages/at_follows_flutter/example/lib/services/at_service.dart +++ b/packages/at_follows_flutter/example/lib/services/at_service.dart @@ -2,7 +2,8 @@ import 'dart:async'; import 'dart:convert'; import 'package:at_client_mobile/at_client_mobile.dart'; -import 'package:at_follows_flutter_example/services/notification_service.dart' as follows_notification_service; +import 'package:at_follows_flutter_example/services/notification_service.dart' + as follows_notification_service; import 'package:at_follows_flutter_example/utils/app_constants.dart'; import 'package:path_provider/path_provider.dart' as path_provider; import 'package:at_commons/at_commons.dart' as at_commons; @@ -83,6 +84,7 @@ class AtService { _atsign = await getAtSign(); String? privateKey = await getPrivateKey(_atsign!); // ignore: await_only_futures + // ignore: deprecated_member_use await atClientInstance!.startMonitor(privateKey!, (response) { acceptStream(response); }); @@ -93,7 +95,8 @@ class AtService { acceptStream(response) async { response = response.toString().replaceAll('notification:', '').trim(); var notification = AtNotification.fromJson(jsonDecode(response)); - await follows_notification_service.NotificationService().showNotification(notification); + await follows_notification_service.NotificationService() + .showNotification(notification); } } diff --git a/packages/at_follows_flutter/lib/services/connections_service.dart b/packages/at_follows_flutter/lib/services/connections_service.dart index 790e1948..ccc2f76a 100644 --- a/packages/at_follows_flutter/lib/services/connections_service.dart +++ b/packages/at_follows_flutter/lib/services/connections_service.dart @@ -410,11 +410,11 @@ class ConnectionsService { atsignData.setData(atValue); } catch (e) { - _logger.severe('Error in _getAtsignData getting value ${e}'); + _logger.severe('Error in _getAtsignData getting value $e'); } } } catch (e) { - _logger.severe('Fetching keys for $connection throws ${e}'); + _logger.severe('Fetching keys for $connection throws $e'); } return atsignData; @@ -446,6 +446,7 @@ class ConnectionsService { bool startMonitor() { AtClientManager.getInstance() + .atClient .notificationService .subscribe() .listen((notification) { diff --git a/packages/at_follows_flutter/lib/services/sdk_service.dart b/packages/at_follows_flutter/lib/services/sdk_service.dart index 4efeb9b4..48c28f78 100644 --- a/packages/at_follows_flutter/lib/services/sdk_service.dart +++ b/packages/at_follows_flutter/lib/services/sdk_service.dart @@ -106,6 +106,7 @@ class SDKService { Future notify(AtKey key, String value, OperationEnum operation, Function onDone, Function onError) async { var notificationResponse = await AtClientManager.getInstance() + .atClient .notificationService .notify(_getNotificationParams(key, value, operation)) .timeout(Duration(seconds: AppConstants.responseTimeLimit), @@ -168,7 +169,7 @@ class SDKService { ///Performs sync for current @sign sync() async { - AtClientManager.getInstance().syncService.sync(); + AtClientManager.getInstance().atClient.syncService.sync(); } ///Throws [ResponseTimeOutException]. diff --git a/packages/at_follows_flutter/lib/widgets/web_view_screen.dart b/packages/at_follows_flutter/lib/widgets/web_view_screen.dart index ae269569..0e8904b9 100644 --- a/packages/at_follows_flutter/lib/widgets/web_view_screen.dart +++ b/packages/at_follows_flutter/lib/widgets/web_view_screen.dart @@ -3,7 +3,7 @@ import 'package:at_follows_flutter/utils/color_constants.dart'; import 'package:at_follows_flutter/widgets/custom_appbar.dart'; import 'package:flutter/material.dart'; import 'package:at_utils/at_logger.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; import 'package:webview_flutter/webview_flutter.dart'; class WebViewScreen extends StatefulWidget { @@ -82,10 +82,10 @@ class _WebViewScreenState extends State { _launchURL(String url) async { // url = Uri.encodeFull(url); - if (await canLaunch(url)) { + if (await canLaunchUrlString(url)) { Navigator.pop(context); Navigator.pop(context); - await launch(url); + await launchUrlString(url); } else { _logger.severe('unable to launch $url'); } diff --git a/packages/at_follows_flutter/test/unit_tests/connections_service_test.dart b/packages/at_follows_flutter/test/unit_tests/connections_service_test.dart index b5ba7029..14a8f1ec 100644 --- a/packages/at_follows_flutter/test/unit_tests/connections_service_test.dart +++ b/packages/at_follows_flutter/test/unit_tests/connections_service_test.dart @@ -292,7 +292,7 @@ Future setUpFunc(String atsign) async { final atClientManager = AtClientManager.getInstance(); AtClientService atClientService = AtClientService(); final atClient = atClientManager.atClient; - atClientManager.syncService.sync(); + atClientManager.atClient.syncService.sync(); await setEncryptionKeys(atClient, atsign); return atClientService; } @@ -323,18 +323,24 @@ setEncryptionKeys(AtClient atClient, String atsign) async { metadata.namespaceAware = false; var result; // set pkam private key - result = await atClient.getLocalSecondary()!.putValue(AT_PKAM_PRIVATE_KEY, - demo_data.pkamPrivateKeyMap[atsign]!); // set pkam public key - result = await atClient - .getLocalSecondary()! - .putValue(AT_PKAM_PUBLIC_KEY, demo_data.pkamPublicKeyMap[atsign]!); + result = await atClient.getLocalSecondary()!.putValue( + AtConstants.atPkamPrivateKey, + demo_data.pkamPrivateKeyMap[atsign]!, + ); // set pkam public key + result = await atClient.getLocalSecondary()!.putValue( + AtConstants.atPkamPublicKey, + demo_data.pkamPublicKeyMap[atsign]!, + ); // set encryption private key result = await atClient.getLocalSecondary()!.putValue( - AT_ENCRYPTION_PRIVATE_KEY, demo_data.encryptionPrivateKeyMap[atsign]!); + AtConstants.atEncryptionPrivateKey, + demo_data.encryptionPrivateKeyMap[atsign]!, + ); //set aesKey - result = await atClient - .getLocalSecondary()! - .putValue(AT_ENCRYPTION_SELF_KEY, demo_data.aesKeyMap[atsign]!); + result = await atClient.getLocalSecondary()!.putValue( + AtConstants.atEncryptionSelfKey, + demo_data.aesKeyMap[atsign]!, + ); // set encryption public key. should be synced metadata.isPublic = true; diff --git a/packages/at_invitation_flutter/example/lib/main.dart b/packages/at_invitation_flutter/example/lib/main.dart index 95b1e9dc..5a9439a1 100644 --- a/packages/at_invitation_flutter/example/lib/main.dart +++ b/packages/at_invitation_flutter/example/lib/main.dart @@ -2,9 +2,7 @@ import 'dart:async'; import 'package:at_invitation_flutter_example/second_screen.dart'; import 'package:flutter/material.dart'; -import 'package:at_client_mobile/at_client_mobile.dart'; import 'package:at_onboarding_flutter/at_onboarding_flutter.dart'; -import 'package:at_utils/at_logger.dart' show AtSignLogger; import 'package:path_provider/path_provider.dart' show getApplicationSupportDirectory; import 'package:at_app_flutter/at_app_flutter.dart' show AtEnv; @@ -28,7 +26,7 @@ Future loadAtClientPreference() async { class MyApp extends StatefulWidget { const MyApp({Key? key}) : super(key: key); @override - _MyAppState createState() => _MyAppState(); + State createState() => _MyAppState(); } class _MyAppState extends State { @@ -37,8 +35,6 @@ class _MyAppState extends State { late AtClientPreference atClientPreference; AtClientService? atClientService; - final AtSignLogger _logger = AtSignLogger(AtEnv.appNamespace); - @override Widget build(BuildContext context) { return MaterialApp( diff --git a/packages/at_invitation_flutter/example/lib/second_screen.dart b/packages/at_invitation_flutter/example/lib/second_screen.dart index b4d9b0fc..1c55dc78 100644 --- a/packages/at_invitation_flutter/example/lib/second_screen.dart +++ b/packages/at_invitation_flutter/example/lib/second_screen.dart @@ -2,16 +2,16 @@ import 'package:at_app_flutter/at_app_flutter.dart'; import 'package:at_invitation_flutter/at_invitation_flutter.dart'; import 'package:flutter/material.dart'; import 'package:at_client_mobile/at_client_mobile.dart'; +import 'package:url_launcher/url_launcher_string.dart'; import 'constants.dart'; import 'package:uni_links/uni_links.dart'; -import 'package:url_launcher/url_launcher.dart'; import 'package:at_utils/at_logger.dart'; class SecondScreen extends StatefulWidget { const SecondScreen({Key? key}) : super(key: key); @override - _SecondScreenState createState() => _SecondScreenState(); + State createState() => _SecondScreenState(); } class _SecondScreenState extends State { @@ -115,10 +115,10 @@ class _SecondScreenState extends State { } void _checkForInvite() async { - String _url = MixedConstants.cookiePage; - await canLaunch(_url) - ? await launch(_url, forceSafariVC: false) - : throw 'Could not launch $_url'; + String url = MixedConstants.cookiePage; + await canLaunchUrlString(url) + ? await launchUrlString(url) + : throw 'Could not launch $url'; } void _handleIncomingLinks() { diff --git a/packages/at_invitation_flutter/example/pubspec.yaml b/packages/at_invitation_flutter/example/pubspec.yaml index 02bb7563..d8c47253 100644 --- a/packages/at_invitation_flutter/example/pubspec.yaml +++ b/packages/at_invitation_flutter/example/pubspec.yaml @@ -35,6 +35,11 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ + at_onboarding_flutter: ^6.1.5 + at_client_mobile: ^3.2.13 + at_utils: ^3.0.15 + flutter_keychain: ^2.4.0 + path_provider: ^2.1.1 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -58,8 +63,6 @@ dev_dependencies: # following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter. flutter: - assets: - - .env # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in diff --git a/packages/at_invitation_flutter/lib/services/invitation_service.dart b/packages/at_invitation_flutter/lib/services/invitation_service.dart index 2c9e333e..59a6a8c8 100644 --- a/packages/at_invitation_flutter/lib/services/invitation_service.dart +++ b/packages/at_invitation_flutter/lib/services/invitation_service.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:math'; -import 'package:at_commons/at_commons.dart'; import 'package:at_invitation_flutter/models/message_share.dart'; import 'package:at_invitation_flutter/widgets/share_dialog.dart'; import 'package:at_invitation_flutter/widgets/otp_dialog.dart'; diff --git a/packages/at_invitation_flutter/lib/widgets/otp_dialog.dart b/packages/at_invitation_flutter/lib/widgets/otp_dialog.dart index f8fbb161..9b675ec4 100644 --- a/packages/at_invitation_flutter/lib/widgets/otp_dialog.dart +++ b/packages/at_invitation_flutter/lib/widgets/otp_dialog.dart @@ -14,7 +14,7 @@ class OTPDialog extends StatefulWidget { : super(key: key); @override - _OTPDialogState createState() => _OTPDialogState(); + State createState() => _OTPDialogState(); } class _OTPDialogState extends State { diff --git a/packages/at_invitation_flutter/lib/widgets/share_dialog.dart b/packages/at_invitation_flutter/lib/widgets/share_dialog.dart index 32d7c7ba..5f96300f 100644 --- a/packages/at_invitation_flutter/lib/widgets/share_dialog.dart +++ b/packages/at_invitation_flutter/lib/widgets/share_dialog.dart @@ -4,13 +4,14 @@ import 'package:at_common_flutter/at_common_flutter.dart'; import 'package:at_invitation_flutter/utils/text_styles.dart' as invitation_text_styles; import 'package:flutter/material.dart'; -import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class ShareDialog extends StatefulWidget { final String? uniqueID; final String? passcode; final String? webPageLink; final String currentAtsign; + const ShareDialog( {Key? key, this.uniqueID, @@ -20,7 +21,7 @@ class ShareDialog extends StatefulWidget { : super(key: key); @override - _ShareDialogState createState() => _ShareDialogState(); + State createState() => _ShareDialogState(); } class _ShareDialogState extends State { @@ -32,6 +33,7 @@ class _ShareDialogState extends State { String emailAddress = ''; String phoneNumber = ''; int activeOption = 0; + @override void dispose() { atSignController.dispose(); @@ -169,7 +171,7 @@ class _ShareDialogState extends State { emailAddress = value.trim(); if (emailAddress != '') { if (RegExp( - r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+") + r"^[a-zA-Z0-9.a-zA-Z0-9!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+") .hasMatch(emailAddress)) { emailError = false; emailErrorMessage = ''; @@ -220,7 +222,7 @@ class _ShareDialogState extends State { setState(() { isLoading = false; }); - Navigator.pop(context); + if (mounted) Navigator.pop(context); } }, buttonColor: @@ -264,8 +266,8 @@ class _ShareDialogState extends State { Future _sendInformation() async { // construct message body - String link = (widget.webPageLink ?? '') + - '?key=${widget.uniqueID}&atsign=${widget.currentAtsign}'; + String link = + '${widget.webPageLink ?? ''}?key=${widget.uniqueID}&atsign=${widget.currentAtsign}'; String inviteText = 'Hi there, you have been invited to join this app. \n link: $link \n password: ${widget.passcode}'; @@ -274,23 +276,22 @@ class _ShareDialogState extends State { // send SMS if (phoneNumber != '') { if (Platform.isAndroid) { - var uri = 'sms:' + phoneNumber + '?body=' + messageBody; - if (await canLaunch(uri)) { - await launch(uri); + var uri = 'sms:$phoneNumber?body=$messageBody'; + if (await canLaunchUrlString(uri)) { + await launchUrlString(uri); } } else if (Platform.isIOS) { - var uri = 'sms:' + phoneNumber + '&body=' + messageBody; - if (await canLaunch(uri)) { - await launch(uri); + var uri = 'sms:$phoneNumber&body=$messageBody'; + if (await canLaunchUrlString(uri)) { + await launchUrlString(uri); } } } // send email else if (emailAddress != '') { - var uri = - 'mailto:' + emailAddress + '?subject=Invitation&body=' + messageBody; - if (await canLaunch(uri)) { - await launch(uri); + var uri = 'mailto:$emailAddress?subject=Invitation&body=$messageBody'; + if (await canLaunchUrlString(uri)) { + await launchUrlString(uri); } } } diff --git a/packages/at_invitation_flutter/test/at_invitation_flutter_test.dart b/packages/at_invitation_flutter/test/at_invitation_flutter_test.dart index 6e99279f..93753c1a 100644 --- a/packages/at_invitation_flutter/test/at_invitation_flutter_test.dart +++ b/packages/at_invitation_flutter/test/at_invitation_flutter_test.dart @@ -7,12 +7,20 @@ void main() { TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { - channel.setMockMethodCallHandler((MethodCall methodCall) async { - return '42'; - }); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + channel, + (MethodCall methodCall) async { + return '42'; + }, + ); }); tearDown(() { - channel.setMockMethodCallHandler(null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + channel, + null, + ); }); } diff --git a/packages/at_invitation_flutter/test/widgets_test/otp_dialog_test.dart b/packages/at_invitation_flutter/test/widgets_test/otp_dialog_test.dart index 2805acbb..ee80d2a5 100644 --- a/packages/at_invitation_flutter/test/widgets_test/otp_dialog_test.dart +++ b/packages/at_invitation_flutter/test/widgets_test/otp_dialog_test.dart @@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../test_material_app.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget otpDialog}) { + Widget wrapWidgetWithMaterialApp({required Widget otpDialog}) { return TestMaterialApp(home: Builder(builder: (BuildContext context) { SizeConfig().init(context); return otpDialog; @@ -15,30 +15,32 @@ void main() { /// Functional test cases for OTP Dialog Widget group('OTP Dialog Widget Tests:', () { - final otpDialog = OTPDialog(uniqueID: '25',passcode: '25032511',webPageLink: 'url for the site',); + const otpDialog = OTPDialog( + uniqueID: '25', + passcode: '25032511', + webPageLink: 'url for the site', + ); // Test Case to Check OTP Dialog is displayed testWidgets("OTP Dialog is displayed", (WidgetTester tester) async { - - await tester - .pumpWidget(_wrapWidgetWithMaterialApp(otpDialog: otpDialog)); + await tester.pumpWidget(wrapWidgetWithMaterialApp(otpDialog: otpDialog)); expect(find.byType(OTPDialog), findsOneWidget); }); - // Test case to check uniqueId given - testWidgets("Test case to check unique id is given", (WidgetTester tester) async { - await tester - .pumpWidget(_wrapWidgetWithMaterialApp(otpDialog: otpDialog)); + // Test case to check uniqueId given + testWidgets("Test case to check unique id is given", + (WidgetTester tester) async { + await tester.pumpWidget(wrapWidgetWithMaterialApp(otpDialog: otpDialog)); expect(otpDialog.uniqueID, '25'); }); // Test case to check passcode is given - testWidgets("Test case to check passcode is given", (WidgetTester tester) async { - await tester - .pumpWidget(_wrapWidgetWithMaterialApp(otpDialog: otpDialog)); + testWidgets("Test case to check passcode is given", + (WidgetTester tester) async { + await tester.pumpWidget(wrapWidgetWithMaterialApp(otpDialog: otpDialog)); expect(otpDialog.passcode, '25032511'); }); // Test case to check web page link is given - testWidgets("Test case to check web page link is given", (WidgetTester tester) async { - await tester - .pumpWidget(_wrapWidgetWithMaterialApp(otpDialog: otpDialog)); + testWidgets("Test case to check web page link is given", + (WidgetTester tester) async { + await tester.pumpWidget(wrapWidgetWithMaterialApp(otpDialog: otpDialog)); expect(otpDialog.webPageLink, 'url for the site'); }); }); diff --git a/packages/at_invitation_flutter/test/widgets_test/share_dialog_test.dart b/packages/at_invitation_flutter/test/widgets_test/share_dialog_test.dart index c17ddf74..badab1de 100644 --- a/packages/at_invitation_flutter/test/widgets_test/share_dialog_test.dart +++ b/packages/at_invitation_flutter/test/widgets_test/share_dialog_test.dart @@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart'; import '../test_material_app.dart'; void main() { - Widget _wrapWidgetWithMaterialApp({required Widget shareDialog}) { + Widget wrapWidgetWithMaterialApp({required Widget shareDialog}) { return TestMaterialApp(home: Builder(builder: (BuildContext context) { SizeConfig().init(context); return shareDialog; @@ -15,35 +15,44 @@ void main() { /// Functional test cases for Share Dialog Widget group('Share Dialog Widget Tests:', () { - final shareDialog = ShareDialog(currentAtsign: '@bluebellrelated86',uniqueID: '25',passcode: '25032511',webPageLink: 'url for the site',); + const shareDialog = ShareDialog( + currentAtsign: '@bluebellrelated86', + uniqueID: '25', + passcode: '25032511', + webPageLink: 'url for the site', + ); // Test Case to Check Share Dialog is displayed testWidgets("Share Dialog is displayed", (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(shareDialog: shareDialog)); + .pumpWidget(wrapWidgetWithMaterialApp(shareDialog: shareDialog)); expect(find.byType(ShareDialog), findsOneWidget); }); // Test case to check current atsign is given - testWidgets("Test case to check current atsign is given", (WidgetTester tester) async { + testWidgets("Test case to check current atsign is given", + (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(shareDialog: shareDialog)); + .pumpWidget(wrapWidgetWithMaterialApp(shareDialog: shareDialog)); expect(shareDialog.currentAtsign, '@bluebellrelated86'); }); // Test case to check uniqueId given - testWidgets("Test case to check unique id is given", (WidgetTester tester) async { + testWidgets("Test case to check unique id is given", + (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(shareDialog: shareDialog)); + .pumpWidget(wrapWidgetWithMaterialApp(shareDialog: shareDialog)); expect(shareDialog.uniqueID, '25'); }); // Test case to check passcode is given - testWidgets("Test case to check passcode is given", (WidgetTester tester) async { + testWidgets("Test case to check passcode is given", + (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(shareDialog: shareDialog)); + .pumpWidget(wrapWidgetWithMaterialApp(shareDialog: shareDialog)); expect(shareDialog.passcode, '25032511'); }); // Test case to check web page link is given - testWidgets("Test case to check web page link is given", (WidgetTester tester) async { + testWidgets("Test case to check web page link is given", + (WidgetTester tester) async { await tester - .pumpWidget(_wrapWidgetWithMaterialApp(shareDialog: shareDialog)); + .pumpWidget(wrapWidgetWithMaterialApp(shareDialog: shareDialog)); expect(shareDialog.webPageLink, 'url for the site'); }); }); diff --git a/packages/at_location_flutter/test/at_location_flutter_test.dart b/packages/at_location_flutter/test/at_location_flutter_test.dart index 4d9fe07a..38acc55d 100644 --- a/packages/at_location_flutter/test/at_location_flutter_test.dart +++ b/packages/at_location_flutter/test/at_location_flutter_test.dart @@ -17,17 +17,20 @@ import 'package:mocktail/mocktail.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart'; Position get mockPosition => Position( - latitude: 52.561270, - longitude: 5.639382, - timestamp: DateTime.fromMillisecondsSinceEpoch( - 500, - isUtc: true, - ), - altitude: 3000.0, - accuracy: 0.0, - heading: 0.0, - speed: 0.0, - speedAccuracy: 0.0); + latitude: 52.561270, + longitude: 5.639382, + timestamp: DateTime.fromMillisecondsSinceEpoch( + 500, + isUtc: true, + ), + altitude: 3000.0, + accuracy: 0.0, + heading: 0.0, + speed: 0.0, + speedAccuracy: 0.0, + altitudeAccuracy: 0.0, + headingAccuracy: 0.0, + ); class MockAtContactImpl extends Mock implements AtContactsImpl {} diff --git a/packages/at_login_flutter/lib/services/at_login_service.dart b/packages/at_login_flutter/lib/services/at_login_service.dart index c95ca11d..ae60ed21 100644 --- a/packages/at_login_flutter/lib/services/at_login_service.dart +++ b/packages/at_login_flutter/lib/services/at_login_service.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:at_login_flutter/domain/at_login_model.dart'; import 'package:at_login_flutter/exceptions/at_login_exceptions.dart'; import 'package:at_login_flutter/utils/app_constants.dart'; @@ -5,19 +7,20 @@ import 'package:at_login_flutter/utils/strings.dart'; import 'package:at_client_mobile/at_client_mobile.dart'; import 'dart:core'; import 'package:at_login_flutter/utils/at_login_utils.dart'; -import 'package:at_client/src/encryption_service/sign_in_public_data.dart'; import 'package:at_server_status/at_server_status.dart'; import 'package:at_utils/at_utils.dart'; +import 'package:crypton/crypton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; class AtLoginService { static final AtLoginService _singleton = AtLoginService._internal(); // late List _atLoginList; late AtClientPreference _atClientPreference; - late String? _requestorUrl; late String _initialised; - late String _atSign; + + Widget get nextScreen => _nextScreen; late Widget _nextScreen; late AtStatus atStatus; @@ -59,7 +62,7 @@ class AtLoginService { Future setAtsign(String? atSign) async { bool success = false; var namespace = _atClientPreference.namespace; - var result = await AtClientManager.getInstance() + await AtClientManager.getInstance() .setCurrentAtSign(atSign!, namespace, _atClientPreference); // if (result != null) success = true; return success; @@ -140,13 +143,11 @@ class AtLoginService { .localSecondary! .getEncryptionPrivateKey(); - var signature = await SignInPublicData.signInData( - atLoginObj.challenge, encryptionPrivateKey!); + var privateKey = RSAPrivateKey.fromString(encryptionPrivateKey ?? ''); + var dataSignature = privateKey.createSHA256Signature( + utf8.encode(atLoginObj.challenge ?? '') as Uint8List); + var signature = base64Encode(dataSignature); - // var rsaKey = RSAPrivateKey.fromString(privateKey!); - // var sha256signature = rsaKey.createSHA256Signature( - // utf8.encode(atLoginObj.challenge!) as Uint8List); - // var signature = base64Encode(sha256signature); await setAtsign(atLoginObj.atsign); _logger.info( 'putLoginProof|atLoginObj.requestorUrl:${atLoginObj.requestorUrl}'); diff --git a/packages/at_login_flutter/lib/services/custom_nav.dart b/packages/at_login_flutter/lib/services/custom_nav.dart index c28646ff..ac254e1b 100644 --- a/packages/at_login_flutter/lib/services/custom_nav.dart +++ b/packages/at_login_flutter/lib/services/custom_nav.dart @@ -9,7 +9,7 @@ class CustomNav { } push(Widget widget, context) { - WidgetsBinding.instance!.addPostFrameCallback((_) { + WidgetsBinding.instance.addPostFrameCallback((_) { Navigator.push(context, MaterialPageRoute(builder: (context) => widget)); }); } diff --git a/packages/at_login_flutter/lib/utils/at_login_utils.dart b/packages/at_login_flutter/lib/utils/at_login_utils.dart index ee3f334c..c17ceb01 100644 --- a/packages/at_login_flutter/lib/utils/at_login_utils.dart +++ b/packages/at_login_flutter/lib/utils/at_login_utils.dart @@ -44,8 +44,9 @@ class AtLoginUtils { var x509Pem = socket.peerCertificate!.pem; // test with an internet available certificate to ensure we are picking out the SAN and not the CN var data = X509Utils.x509CertificateFromPem(x509Pem); - var subjectAlternativeName = data.subjectAlternativNames; - var commonName = data.subject['2.5.4.3']; + var subjectAlternativeName = + data.tbsCertificate?.extensions?.subjectAlternativNames; + var commonName = data.tbsCertificate?.subject['2.5.4.3']; subjectAlternativeName!.add(commonName!); print('SAN: $subjectAlternativeName'); for (var i = 0; i < subjectAlternativeName.length; i++) { diff --git a/packages/at_login_flutter/lib/widgets/at_login_dashboard_widget.dart b/packages/at_login_flutter/lib/widgets/at_login_dashboard_widget.dart index c1a235d3..fa7304e1 100644 --- a/packages/at_login_flutter/lib/widgets/at_login_dashboard_widget.dart +++ b/packages/at_login_flutter/lib/widgets/at_login_dashboard_widget.dart @@ -1,5 +1,4 @@ import 'package:at_client_mobile/at_client_mobile.dart'; -import 'package:at_commons/at_commons.dart'; import 'package:at_login_flutter/domain/at_login_model.dart'; import 'package:at_login_flutter/services/at_login_service.dart'; import 'package:flutter/material.dart'; diff --git a/packages/at_login_flutter/lib/widgets/at_login_widget.dart b/packages/at_login_flutter/lib/widgets/at_login_widget.dart index 770bcc2e..e206a285 100644 --- a/packages/at_login_flutter/lib/widgets/at_login_widget.dart +++ b/packages/at_login_flutter/lib/widgets/at_login_widget.dart @@ -56,8 +56,9 @@ class AtLogin { this.domain}) { _show(); } + void _show() { - WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { showDialog( context: context, barrierDismissible: false, @@ -329,7 +330,7 @@ class _AtLoginWidgetState extends State { ElevatedButton( child: const Text(Strings.loginDenied), style: ElevatedButton.styleFrom( - primary: Colors.red, + backgroundColor: Colors.red, // padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20), textStyle: TextStyle( fontSize: 18, @@ -346,7 +347,7 @@ class _AtLoginWidgetState extends State { ElevatedButton( child: Text(Strings.loginAllowed), style: ElevatedButton.styleFrom( - primary: Colors.green, + backgroundColor: Colors.green, textStyle: TextStyle( fontSize: 18, )), @@ -378,7 +379,7 @@ class _AtLoginWidgetState extends State { ElevatedButton( child: const Text(Strings.notPairAtsign), style: ElevatedButton.styleFrom( - primary: Colors.red, + backgroundColor: Colors.red, // padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20), textStyle: TextStyle( fontSize: 18, @@ -391,7 +392,7 @@ class _AtLoginWidgetState extends State { ElevatedButton( child: Text(Strings.pairAtsign), style: ElevatedButton.styleFrom( - primary: Colors.green, + backgroundColor: Colors.green, textStyle: TextStyle( fontSize: 18, )), diff --git a/packages/at_login_flutter/pubspec.yaml b/packages/at_login_flutter/pubspec.yaml index e49c0a55..c37574c6 100644 --- a/packages/at_login_flutter/pubspec.yaml +++ b/packages/at_login_flutter/pubspec.yaml @@ -23,6 +23,7 @@ dependencies: path_provider: ^2.1.1 permission_handler: ^11.0.0 provider: ^6.0.5 + crypton: ^2.1.0 dev_dependencies: flutter_test: diff --git a/packages/at_login_flutter/test/at_login_flutter_test.dart b/packages/at_login_flutter/test/at_login_flutter_test.dart index 4906c82f..2e4eae97 100644 --- a/packages/at_login_flutter/test/at_login_flutter_test.dart +++ b/packages/at_login_flutter/test/at_login_flutter_test.dart @@ -8,13 +8,20 @@ void main() { TestWidgetsFlutterBinding.ensureInitialized(); setUp(() { - channel.setMockMethodCallHandler((MethodCall methodCall) async { - return '42'; - }); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + channel, + (MethodCall methodCall) async { + return '42'; + }, + ); }); tearDown(() { - channel.setMockMethodCallHandler(null); + TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger + .setMockMethodCallHandler( + channel, + null, + ); }); - } diff --git a/packages/at_sync_ui_flutter/example/lib/main.dart b/packages/at_sync_ui_flutter/example/lib/main.dart index da81f6ea..beebc34f 100644 --- a/packages/at_sync_ui_flutter/example/lib/main.dart +++ b/packages/at_sync_ui_flutter/example/lib/main.dart @@ -53,8 +53,8 @@ class _MyAppState extends State { primaryColor: const Color(0xFFf4533d), colorScheme: ThemeData.light().colorScheme.copyWith( primary: const Color(0xFFf4533d), + background: Colors.white, ), - backgroundColor: Colors.white, scaffoldBackgroundColor: Colors.white, ), darkTheme: ThemeData().copyWith( @@ -62,8 +62,8 @@ class _MyAppState extends State { primaryColor: Colors.blue, colorScheme: ThemeData.dark().colorScheme.copyWith( primary: Colors.blue, + background: Colors.grey[850], ), - backgroundColor: Colors.grey[850], scaffoldBackgroundColor: Colors.grey[850], ), themeMode: themeMode, diff --git a/packages/at_sync_ui_flutter/example/lib/second_screen.dart b/packages/at_sync_ui_flutter/example/lib/second_screen.dart index b1f199ce..bb38e3c5 100644 --- a/packages/at_sync_ui_flutter/example/lib/second_screen.dart +++ b/packages/at_sync_ui_flutter/example/lib/second_screen.dart @@ -7,6 +7,7 @@ import 'main.dart'; class SecondScreen extends StatefulWidget { final String activeAtSign; + const SecondScreen({required this.activeAtSign, Key? key}) : super(key: key); @override @@ -70,12 +71,14 @@ class _SecondScreenState extends State { ), ElevatedButton( onPressed: () async { + // ignore: deprecated_member_use AtSyncUIService().sync(); }, child: const Text('Default Sync'), ), ElevatedButton( onPressed: () async { + // ignore: deprecated_member_use AtSyncUIService().sync( atSyncUIOverlay: AtSyncUIOverlay.dialog, ); @@ -84,6 +87,7 @@ class _SecondScreenState extends State { ), ElevatedButton( onPressed: () async { + // ignore: deprecated_member_use AtSyncUIService().sync( atSyncUIOverlay: AtSyncUIOverlay.snackbar, ); @@ -92,6 +96,7 @@ class _SecondScreenState extends State { ), ElevatedButton( onPressed: () async { + // ignore: deprecated_member_use AtSyncUIService().sync( atSyncUIOverlay: AtSyncUIOverlay.none, ); @@ -133,6 +138,7 @@ class _SecondScreenState extends State { ), floatingActionButton: FloatingActionButton( onPressed: () async { + // ignore: deprecated_member_use AtSyncUIService().sync( atSyncUIOverlay: AtSyncUIOverlay.none, ); diff --git a/packages/at_sync_ui_flutter/example/pubspec.yaml b/packages/at_sync_ui_flutter/example/pubspec.yaml index 3fd555aa..94b5d73d 100644 --- a/packages/at_sync_ui_flutter/example/pubspec.yaml +++ b/packages/at_sync_ui_flutter/example/pubspec.yaml @@ -29,9 +29,7 @@ environment: dependencies: at_app_flutter: ^5.2.0 at_backupkey_flutter: ^4.0.10 - at_onboarding_flutter: ^6.1.3 - at_sync_ui_flutter: - path: ../ + at_onboarding_flutter: ^6.1.5 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.6 @@ -39,6 +37,10 @@ dependencies: sdk: flutter flutter_colorpicker: ^1.0.3 +dependency_overrides: + at_sync_ui_flutter: + path: ../ + dev_dependencies: # The "flutter_lints" package below contains a set of recommended lints to # encourage good coding practices. The lint set provided by the package is diff --git a/packages/at_sync_ui_flutter/lib/services/at_sync_ui_services.dart b/packages/at_sync_ui_flutter/lib/services/at_sync_ui_services.dart index bd3a124f..2acf89b9 100644 --- a/packages/at_sync_ui_flutter/lib/services/at_sync_ui_services.dart +++ b/packages/at_sync_ui_flutter/lib/services/at_sync_ui_services.dart @@ -1,13 +1,13 @@ // ignore_for_file: implementation_imports, prefer_typing_uninitialized_variables import 'dart:async'; -import 'package:at_client/src/service/sync_service.dart'; import 'package:at_client/at_client.dart'; import 'package:at_sync_ui_flutter/at_sync_ui.dart'; import 'package:flutter/material.dart'; class AtSyncUIService extends SyncProgressListener { static final AtSyncUIService _singleton = AtSyncUIService._internal(); + AtSyncUIService._internal(); factory AtSyncUIService() { @@ -47,6 +47,7 @@ class AtSyncUIService extends SyncProgressListener { /// [atSyncUIListener] can be used to listen to sync status changes Stream get atSyncUIListener => _atSyncUIListenerController.stream as Stream; + StreamSink get _atSyncUIListenerSink => _atSyncUIListenerController.sink as StreamSink; @@ -101,10 +102,12 @@ class AtSyncUIService extends SyncProgressListener { var _atSyncUIController = AtSyncUIController(); AtSyncUI.instance.setupController(controller: _atSyncUIController); - syncService = AtClientManager.getInstance().syncService; + syncService = AtClientManager.getInstance().atClient.syncService; syncService!.addProgressListener(this); + // ignore: deprecated_member_use syncService!.setOnDone(_onSuccessCallback); + // ignore: deprecated_member_use_from_same_package sync(atSyncUIOverlay: atSyncUIOverlay!, startTimer: startTimer); } From 14dcee0a79ce4a6fbb7ad793c2a4ec775e1bb33a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Jan 2024 10:30:32 +0000 Subject: [PATCH 06/17] build(deps): bump actions/dependency-review-action from 3.1.4 to 3.1.5 Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3.1.4 to 3.1.5. - [Release notes](https://github.com/actions/dependency-review-action/releases) - [Commits](https://github.com/actions/dependency-review-action/compare/01bc87099ba56df1e897b6874784491ea6309bc4...c74b580d73376b7750d3d2a50bfb8adc2c937507) --- updated-dependencies: - dependency-name: actions/dependency-review-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 10eb7802..130191f0 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -24,4 +24,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: 'Dependency Review' - uses: actions/dependency-review-action@01bc87099ba56df1e897b6874784491ea6309bc4 # v3.1.4 + uses: actions/dependency-review-action@c74b580d73376b7750d3d2a50bfb8adc2c937507 # v3.1.5 From 5e15e70b5c493e8cb6b1b48bceca62c31df0ac2f Mon Sep 17 00:00:00 2001 From: Sarthak Bakre Date: Wed, 10 Jan 2024 17:03:38 +0530 Subject: [PATCH 07/17] fix: fixed windows upload atKey issues --- .../lib/screen/at_onboarding_home_screen.dart | 6 +++--- .../lib/screen/at_onboarding_start_screen.dart | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/at_onboarding_flutter/lib/screen/at_onboarding_home_screen.dart b/packages/at_onboarding_flutter/lib/screen/at_onboarding_home_screen.dart index f22a494b..92182b4b 100644 --- a/packages/at_onboarding_flutter/lib/screen/at_onboarding_home_screen.dart +++ b/packages/at_onboarding_flutter/lib/screen/at_onboarding_home_screen.dart @@ -537,11 +537,11 @@ class _AtOnboardingHomeScreenState extends State { Future _desktopKeyPicker() async { try { XFile? file = await openFile( - acceptedTypeGroups: const [ + acceptedTypeGroups: [ // General file extensions - XTypeGroup(extensions: ['atKeys', 'atkeys']), + const XTypeGroup(extensions: ['atKeys', 'atkeys']), // Apple specific UTIs - XTypeGroup(uniformTypeIdentifiers: ['com.atsign.atkeys']), + XTypeGroup(uniformTypeIdentifiers: Platform.isMacOS ? ['com.atsign.atkeys'] : null), ], ); return file?.path; diff --git a/packages/at_onboarding_flutter/lib/screen/at_onboarding_start_screen.dart b/packages/at_onboarding_flutter/lib/screen/at_onboarding_start_screen.dart index e929e9dc..bbb2ad54 100644 --- a/packages/at_onboarding_flutter/lib/screen/at_onboarding_start_screen.dart +++ b/packages/at_onboarding_flutter/lib/screen/at_onboarding_start_screen.dart @@ -8,6 +8,7 @@ import 'package:at_onboarding_flutter/screen/at_onboarding_intro_screen.dart'; import 'package:at_onboarding_flutter/services/at_onboarding_config.dart'; import 'package:at_onboarding_flutter/services/onboarding_service.dart'; import 'package:at_onboarding_flutter/utils/at_onboarding_dimens.dart'; +import 'package:at_onboarding_flutter/utils/at_onboarding_error_util.dart'; import 'package:at_onboarding_flutter/widgets/at_onboarding_button.dart'; import 'package:at_onboarding_flutter/widgets/at_onboarding_dialog.dart'; import 'package:at_sync_ui_flutter/at_sync_material.dart'; @@ -93,10 +94,11 @@ class _AtOnboardingStartScreenState extends State { Navigator.pop(context, result); } else { if (!mounted) return; + var message = AtOnboardingErrorToString().getErrorMessage(e); Navigator.pop( context, AtOnboardingResult.error( - message: "$e", + message: message, ), ); } From dc5929e1090d043dcd02c71240da021715b411dc Mon Sep 17 00:00:00 2001 From: Sardar1208 Date: Wed, 10 Jan 2024 17:49:10 +0530 Subject: [PATCH 08/17] feat: release version 6.1.6 changelog --- packages/at_onboarding_flutter/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/at_onboarding_flutter/CHANGELOG.md b/packages/at_onboarding_flutter/CHANGELOG.md index de0ecad2..e6940445 100644 --- a/packages/at_onboarding_flutter/CHANGELOG.md +++ b/packages/at_onboarding_flutter/CHANGELOG.md @@ -1,3 +1,6 @@ +## 6.1.6 +- **FIX**: Fixed file_selector issue on Windows + ## 6.1.5 - **CHORE**: Updated tutorial_coach_mark from 1.2.9 to 1.2.11 From 7f40ad170c0be74fffedf8c4e41ca69ef63a2276 Mon Sep 17 00:00:00 2001 From: Sardar1208 Date: Wed, 10 Jan 2024 18:03:33 +0530 Subject: [PATCH 09/17] feat: updated package version --- packages/at_onboarding_flutter/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/at_onboarding_flutter/pubspec.yaml b/packages/at_onboarding_flutter/pubspec.yaml index 80ba97cb..66178daf 100644 --- a/packages/at_onboarding_flutter/pubspec.yaml +++ b/packages/at_onboarding_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: at_onboarding_flutter description: A Flutter plugin project for onboarding any atSign in atPlatform apps with ease. Provides a QRscanner option and an upload key file option to authenticate. -version: 6.1.5 +version: 6.1.6 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets/tree/trunk/packages/at_onboarding_flutter issue_tracker: https://github.com/atsign-foundation/at_widgets/issues From 2d8560cb3500acd4d41c7ae6b1393fcafbb79138 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:33:59 +0000 Subject: [PATCH 10/17] build(deps): bump actions/upload-artifact from 4.0.0 to 4.1.0 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/c7d193f32edcb7bfad88892161225aeda64e9392...1eb3cb2b3e0f29609092a73eb033bb759a334595) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/scorecards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index b11b8adf..64d98fe2 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 + uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 with: name: SARIF file path: results.sarif From 5a625f79eb75e88ae899b612caf11bbe2c810810 Mon Sep 17 00:00:00 2001 From: Sachin Singh Date: Tue, 16 Jan 2024 16:32:01 +0530 Subject: [PATCH 11/17] chore: flutter analyze resolve --- packages/at_login_flutter/lib/services/at_login_service.dart | 5 ++--- packages/at_login_flutter/lib/services/size_config.dart | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/at_login_flutter/lib/services/at_login_service.dart b/packages/at_login_flutter/lib/services/at_login_service.dart index ae60ed21..a37e629e 100644 --- a/packages/at_login_flutter/lib/services/at_login_service.dart +++ b/packages/at_login_flutter/lib/services/at_login_service.dart @@ -11,7 +11,6 @@ import 'package:at_server_status/at_server_status.dart'; import 'package:at_utils/at_utils.dart'; import 'package:crypton/crypton.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; class AtLoginService { static final AtLoginService _singleton = AtLoginService._internal(); @@ -144,8 +143,8 @@ class AtLoginService { .getEncryptionPrivateKey(); var privateKey = RSAPrivateKey.fromString(encryptionPrivateKey ?? ''); - var dataSignature = privateKey.createSHA256Signature( - utf8.encode(atLoginObj.challenge ?? '') as Uint8List); + var dataSignature = privateKey + .createSHA256Signature(utf8.encode(atLoginObj.challenge ?? '')); var signature = base64Encode(dataSignature); await setAtsign(atLoginObj.atsign); diff --git a/packages/at_login_flutter/lib/services/size_config.dart b/packages/at_login_flutter/lib/services/size_config.dart index ff9f0967..d03cc2ab 100644 --- a/packages/at_login_flutter/lib/services/size_config.dart +++ b/packages/at_login_flutter/lib/services/size_config.dart @@ -11,7 +11,6 @@ class SizeConfig { late double screenHeight; late double blockSizeHorizontal; late double blockSizeVertical; - double? deviceTextFactor; late double _safeAreaHorizontal; late double _safeAreaVertical; @@ -29,8 +28,6 @@ class SizeConfig { refHeight = 812; refWidth = 375; - deviceTextFactor = _mediaQueryData.textScaleFactor; - // print("height is::: $screenHeight"); if (screenHeight < 1200) { From 958bfa9092ca260caf7f923a645bb40a7270a1a5 Mon Sep 17 00:00:00 2001 From: Sachin Singh Date: Tue, 16 Jan 2024 18:15:50 +0530 Subject: [PATCH 12/17] chore: update version numbers and changelogs --- packages/at_backupkey_flutter/CHANGELOG.md | 4 ++++ packages/at_backupkey_flutter/pubspec.yaml | 2 +- packages/at_chat_flutter/CHANGELOG.md | 5 +++++ packages/at_chat_flutter/pubspec.yaml | 2 +- packages/at_follows_flutter/CHANGELOG.md | 4 ++++ packages/at_follows_flutter/pubspec.yaml | 2 +- packages/at_invitation_flutter/CHANGELOG.md | 11 ++++++++++- packages/at_invitation_flutter/pubspec.yaml | 2 +- packages/at_location_flutter/CHANGELOG.md | 5 ++++- packages/at_location_flutter/pubspec.yaml | 2 +- packages/at_sync_ui_flutter/CHANGELOG.md | 4 ++++ packages/at_sync_ui_flutter/pubspec.yaml | 2 +- 12 files changed, 37 insertions(+), 8 deletions(-) diff --git a/packages/at_backupkey_flutter/CHANGELOG.md b/packages/at_backupkey_flutter/CHANGELOG.md index b76559d1..333b4e38 100644 --- a/packages/at_backupkey_flutter/CHANGELOG.md +++ b/packages/at_backupkey_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.12: +- **CHORE**: Updated dependencies +- **CHORE**: Lint fixes + ## 4.0.11: - **CHORE**: Bumped all dependency versions - Major version increase of permission_handler from ^10.4.1 to ^11.0.0 diff --git a/packages/at_backupkey_flutter/pubspec.yaml b/packages/at_backupkey_flutter/pubspec.yaml index 4c3ea192..6c4035dd 100644 --- a/packages/at_backupkey_flutter/pubspec.yaml +++ b/packages/at_backupkey_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: at_backupkey_flutter description: A Flutter plugin project for saving the backup key of any atSign that is being onboarded with atPlatform apps. The backup key can be used to authenticate in other atPlatform apps. -version: 4.0.11 +version: 4.0.12 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets/tree/trunk/packages/at_backupkey_flutter issue_tracker: https://github.com/atsign-foundation/at_widgets/issues diff --git a/packages/at_chat_flutter/CHANGELOG.md b/packages/at_chat_flutter/CHANGELOG.md index c2fffce0..316e5790 100644 --- a/packages/at_chat_flutter/CHANGELOG.md +++ b/packages/at_chat_flutter/CHANGELOG.md @@ -1,3 +1,8 @@ +## 3.0.11 + +- **CHORE**: Updated dependencies +- **CHORE**: Lint fixes + ## 3.0.10 - **CHORE**: Bumped all dependency versions diff --git a/packages/at_chat_flutter/pubspec.yaml b/packages/at_chat_flutter/pubspec.yaml index 8fc02dc4..2fcf8aed 100644 --- a/packages/at_chat_flutter/pubspec.yaml +++ b/packages/at_chat_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: at_chat_flutter description: A Flutter plugin project to provide a chat feature between atSigns built on the atPlatform to any Flutter application. -version: 3.0.10 +version: 3.0.11 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets/tree/trunk/packages/at_chat_flutter issue_tracker: https://github.com/atsign-foundation/at_widgets/issues diff --git a/packages/at_follows_flutter/CHANGELOG.md b/packages/at_follows_flutter/CHANGELOG.md index 1e967cdd..3a393d0c 100644 --- a/packages/at_follows_flutter/CHANGELOG.md +++ b/packages/at_follows_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.11 +- **CHORE**: Updated dependencies +- **CHORE**: Lint fixes + ## 3.0.10 - **CHORE**: Bumped all dependency versions - Major version increase of permission_handler from ^9.2.0 to ^11.0.0 diff --git a/packages/at_follows_flutter/pubspec.yaml b/packages/at_follows_flutter/pubspec.yaml index 63cd4c54..1ca34e6b 100644 --- a/packages/at_follows_flutter/pubspec.yaml +++ b/packages/at_follows_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: at_follows_flutter description: A Flutter plugin project that provides a basic social "follows" functionality for atSigns. Provides a list of followers and following for atSigns with the option to unfollow them. -version: 3.0.10 +version: 3.0.11 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets diff --git a/packages/at_invitation_flutter/CHANGELOG.md b/packages/at_invitation_flutter/CHANGELOG.md index a8df366b..cd6d239b 100644 --- a/packages/at_invitation_flutter/CHANGELOG.md +++ b/packages/at_invitation_flutter/CHANGELOG.md @@ -1,14 +1,23 @@ +## 2.0.2 + +- **CHORE**: Updated dependencies +- **CHORE**: Lint fixes + ## 2.0.1 - **CHORE**: Bumped all dependency versions - - Major version increase of pin_code_fields from ^7.3.0 to ^8.0.1 +- Major version increase of pin_code_fields from ^7.3.0 to ^8.0.1 + ## 2.0.0 + - **DOCS**: Updated documentation - **CHORE**: Updated dependencies - **CHORE**: updated example to null safe version ## 1.0.1 + - **DOCS**: Updated documentation ## 1.0.0 + - The initial release contains feature to share data and invite any contact using SMS or email. diff --git a/packages/at_invitation_flutter/pubspec.yaml b/packages/at_invitation_flutter/pubspec.yaml index 7b0baf30..549591ad 100644 --- a/packages/at_invitation_flutter/pubspec.yaml +++ b/packages/at_invitation_flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: at_invitation_flutter description: A Flutter package to invite contacts into apps that use atProtocol. -version: 2.0.1 +version: 2.0.2 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets/tree/trunk/at_invitation_flutter issue_tracker: https://github.com/atsign-foundation/at_widgets/issues diff --git a/packages/at_location_flutter/CHANGELOG.md b/packages/at_location_flutter/CHANGELOG.md index 5d02f6ae..53a4ac7e 100644 --- a/packages/at_location_flutter/CHANGELOG.md +++ b/packages/at_location_flutter/CHANGELOG.md @@ -1,6 +1,9 @@ +# 3.1.11 +- **CHORE**: Lint fixes + # 3.1.10 - **CHORE**: Bumped all dependency versions - - Major version increase of geolocator from ^9.0.2 to ^10.0.1 +- Major version increase of geolocator from ^9.0.2 to ^10.0.1 # 3.1.9 - **CHORE**: Improved pub score of package diff --git a/packages/at_location_flutter/pubspec.yaml b/packages/at_location_flutter/pubspec.yaml index 09966c29..d354fa23 100644 --- a/packages/at_location_flutter/pubspec.yaml +++ b/packages/at_location_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: at_location_flutter description: A Flutter plugin project to share locations between two atSigns and track them on OSM (OpenStreetMap). -version: 3.1.10 +version: 3.1.11 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets/tree/trunk/packages/at_location_flutter issue_tracker: https://github.com/atsign-foundation/at_widgets/issues diff --git a/packages/at_sync_ui_flutter/CHANGELOG.md b/packages/at_sync_ui_flutter/CHANGELOG.md index aede5ad5..5849606a 100644 --- a/packages/at_sync_ui_flutter/CHANGELOG.md +++ b/packages/at_sync_ui_flutter/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.10 +- **CHORE**: Updated dependencies +- **CHORE**: Lint fixes + ## 1.0.9 - **CHORE**: Bumped all dependency versions - **REFACTOR**: Deprecated `sync()` method and moved it's implementation to init. diff --git a/packages/at_sync_ui_flutter/pubspec.yaml b/packages/at_sync_ui_flutter/pubspec.yaml index df697c81..578c5877 100644 --- a/packages/at_sync_ui_flutter/pubspec.yaml +++ b/packages/at_sync_ui_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: at_sync_ui_flutter description: A Flutter plugin project to provide UI widgets for displaying status of sync process in atProtocol apps. -version: 1.0.9 +version: 1.0.10 homepage: https://docs.atsign.com/ repository: https://github.com/atsign-foundation/at_widgets/tree/trunk/packages/at_sync_ui_flutter issue_tracker: https://github.com/atsign-foundation/at_widgets/issues From 929434eca93225cba645455c284c53d0969aa9c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:43:30 +0000 Subject: [PATCH 13/17] build(deps): bump actions/upload-artifact from 4.1.0 to 4.2.0 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.1.0 to 4.2.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/1eb3cb2b3e0f29609092a73eb033bb759a334595...694cdabd8bdb0f10b2cea11669e1bf5453eed0a6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/scorecards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 64d98fe2..cfd9bd0b 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4.1.0 + uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 with: name: SARIF file path: results.sarif From 4eda0ece2448d1392773b51fe9f269e181064582 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 10:43:35 +0000 Subject: [PATCH 14/17] build(deps): bump actions/dependency-review-action from 3.1.5 to 4.0.0 Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 3.1.5 to 4.0.0. - [Release notes](https://github.com/actions/dependency-review-action/releases) - [Commits](https://github.com/actions/dependency-review-action/compare/c74b580d73376b7750d3d2a50bfb8adc2c937507...4901385134134e04cec5fbe5ddfe3b2c5bd5d976) --- updated-dependencies: - dependency-name: actions/dependency-review-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 130191f0..3fa8b859 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -24,4 +24,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: 'Dependency Review' - uses: actions/dependency-review-action@c74b580d73376b7750d3d2a50bfb8adc2c937507 # v3.1.5 + uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976 # v4.0.0 From 5f3a2464cdba8fcbfef9ab007a93ccc92b775492 Mon Sep 17 00:00:00 2001 From: Chris Swan <478926+cpswan@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:53:39 +0000 Subject: [PATCH 15/17] ci: Restore static analysis of packages that were previously failing --- .github/workflows/static_analysis.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 35bca164..bfa162ef 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -20,19 +20,19 @@ jobs: fail-fast: false matrix: package: - # at_backupkey_flutter - #- at_chat_flutter + - at_backupkey_flutter + - at_chat_flutter - at_common_flutter - at_contacts_flutter - at_contacts_group_flutter - at_events_flutter - #- at_follows_flutter - #- at_invitation_flutter - #- at_location_flutter - #- at_login_flutter + - at_follows_flutter + - at_invitation_flutter + - at_location_flutter + - at_login_flutter - at_notify_flutter - at_onboarding_flutter - #- at_sync_ui_flutter + - at_sync_ui_flutter - at_theme_flutter steps: From 9d5f1c92f9b8b682618acdde8b4ffc4acb0086f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:13:58 +0000 Subject: [PATCH 16/17] build(deps): bump actions/upload-artifact from 4.2.0 to 4.3.0 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.2.0 to 4.3.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/694cdabd8bdb0f10b2cea11669e1bf5453eed0a6...26f96dfa697d77e81fd5907df203aa23a56210a8) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/scorecards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index cfd9bd0b..fecacaf9 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -59,7 +59,7 @@ jobs: # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF # format to the repository Actions tab. - name: "Upload artifact" - uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 + uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0 with: name: SARIF file path: results.sarif From e6a3e974a579e528a6534f38c4f0743542c1ebd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:48:12 +0000 Subject: [PATCH 17/17] build(deps): bump step-security/harden-runner from 2.6.1 to 2.7.0 Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.6.1 to 2.7.0. - [Release notes](https://github.com/step-security/harden-runner/releases) - [Commits](https://github.com/step-security/harden-runner/compare/eb238b55efaa70779f274895e782ed17c84f2895...63c24ba6bd7ba022e95695ff85de572c04a18142) --- updated-dependencies: - dependency-name: step-security/harden-runner dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 3fa8b859..fc3a42df 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: egress-policy: audit