From bc03889e00d106bcdb2cddd7b678812a841503cd Mon Sep 17 00:00:00 2001 From: Curtly Critchlow Date: Wed, 7 Aug 2024 07:10:38 -0400 Subject: [PATCH 1/2] fix: dangling library doc comment moved to the class it's associated with. --- .../lib/widgets/add_contacts_dialog.dart | 33 +++++-------------- .../lib/widgets/blocked_user_card.dart | 16 ++++----- .../lib/widgets/bottom_sheet.dart | 29 ++++++---------- .../lib/widgets/custom_circle_avatar.dart | 17 ++++------ .../lib/widgets/custom_list_tile.dart | 28 +++++++--------- .../lib/widgets/custom_search_field.dart | 6 ++-- 6 files changed, 45 insertions(+), 84 deletions(-) diff --git a/packages/at_contacts_flutter/lib/widgets/add_contacts_dialog.dart b/packages/at_contacts_flutter/lib/widgets/add_contacts_dialog.dart index a1e7d356e..2708dbc30 100644 --- a/packages/at_contacts_flutter/lib/widgets/add_contacts_dialog.dart +++ b/packages/at_contacts_flutter/lib/widgets/add_contacts_dialog.dart @@ -1,11 +1,7 @@ -/// A popup to ask the [AtSign] which is to be added - import 'package:at_common_flutter/at_common_flutter.dart'; - +import 'package:at_contacts_flutter/services/contact_service.dart'; // ignore: library_prefixes import 'package:at_contacts_flutter/utils/text_strings.dart' as contactStrings; - -import 'package:at_contacts_flutter/services/contact_service.dart'; import 'package:at_contacts_flutter/utils/text_styles.dart' // ignore: library_prefixes as contactTextStyles; @@ -53,10 +49,8 @@ class _AddContactDialogState extends State { width: 100.toWidth, child: SingleChildScrollView( child: AlertDialog( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.toWidth)), - titlePadding: EdgeInsets.only( - top: 20.toHeight, left: 25.toWidth, right: 25.toWidth), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.toWidth)), + titlePadding: EdgeInsets.only(top: 20.toHeight, left: 25.toWidth, right: 25.toWidth), title: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -71,9 +65,7 @@ class _AddContactDialogState extends State { ), content: ConstrainedBox( constraints: BoxConstraints( - maxHeight: (contactService.getAtSignError == '') - ? 325.toHeight - : 370.toHeight * deviceTextFactor), + maxHeight: (contactService.getAtSignError == '') ? 325.toHeight : 370.toHeight * deviceTextFactor), child: Column( children: [ SizedBox( @@ -146,8 +138,7 @@ class _AddContactDialogState extends State { ? const CircularProgressIndicator() : CustomButton( height: 50.toHeight * deviceTextFactor, - buttonText: - contactStrings.TextStrings().addtoContact, + buttonText: contactStrings.TextStrings().addtoContact, onPressed: () async { setState(() { isLoading = true; @@ -160,21 +151,13 @@ class _AddContactDialogState extends State { setState(() { isLoading = false; }); - if (contactService.checkAtSign != null && - contactService.checkAtSign! && - response) { + if (contactService.checkAtSign != null && contactService.checkAtSign! && response) { if (!context.mounted) return; Navigator.pop(context); } }, - buttonColor: - Theme.of(context).brightness == Brightness.light - ? Colors.black - : Colors.white, - fontColor: - Theme.of(context).brightness == Brightness.light - ? Colors.white - : Colors.black, + buttonColor: Theme.of(context).brightness == Brightness.light ? Colors.black : Colors.white, + fontColor: Theme.of(context).brightness == Brightness.light ? Colors.white : Colors.black, ) ], ), diff --git a/packages/at_contacts_flutter/lib/widgets/blocked_user_card.dart b/packages/at_contacts_flutter/lib/widgets/blocked_user_card.dart index 571ddfd59..72e96531a 100644 --- a/packages/at_contacts_flutter/lib/widgets/blocked_user_card.dart +++ b/packages/at_contacts_flutter/lib/widgets/blocked_user_card.dart @@ -1,25 +1,22 @@ -/// A list tile to display the blocked contact -/// takes in a [AtContact] blocked user -/// and displays it's name, atsign, profile picture and option to unblock the user - import 'dart:typed_data'; +import 'package:at_common_flutter/services/size_config.dart'; import 'package:at_contact/at_contact.dart'; import 'package:at_contacts_flutter/utils/text_strings.dart'; import 'package:at_contacts_flutter/utils/text_styles.dart'; import 'package:at_contacts_flutter/widgets/contacts_initials.dart'; import 'package:at_contacts_flutter/widgets/custom_circle_avatar.dart'; - -import 'package:at_common_flutter/services/size_config.dart'; import 'package:at_utils/at_logger.dart'; import 'package:flutter/material.dart'; +/// A list tile to display the blocked contact +/// takes in a [AtContact] blocked user +/// and displays it's name, atsign, profile picture and option to unblock the user class BlockedUserCard extends StatefulWidget { final AtContact? blockeduser; final Function? unblockAtsign; - const BlockedUserCard({Key? key, this.blockeduser, this.unblockAtsign}) - : super(key: key); + const BlockedUserCard({Key? key, this.blockeduser, this.unblockAtsign}) : super(key: key); @override _BlockedUserCardState createState() => _BlockedUserCardState(); } @@ -35,8 +32,7 @@ class _BlockedUserCardState extends State { @override Widget build(BuildContext context) { Widget contactImage; - if (widget.blockeduser!.tags != null && - widget.blockeduser!.tags!['image'] != null) { + if (widget.blockeduser!.tags != null && widget.blockeduser!.tags!['image'] != null) { Uint8List? image; try { List intList = widget.blockeduser!.tags!['image'].cast(); diff --git a/packages/at_contacts_flutter/lib/widgets/bottom_sheet.dart b/packages/at_contacts_flutter/lib/widgets/bottom_sheet.dart index b0d124efb..b84ff77b4 100644 --- a/packages/at_contacts_flutter/lib/widgets/bottom_sheet.dart +++ b/packages/at_contacts_flutter/lib/widgets/bottom_sheet.dart @@ -1,23 +1,19 @@ -/// A bottom sheet widget to diaplay the number of contacts selected from -/// contact list and what to do of that list on press of [Done] -/// takes in @param [onPressed] which defines what to be executed on press of [Done] -/// @param [selectedList] is a [ValueChanged] function which return the selected contacts -/// to be used outside of package. - -import 'package:at_contact/at_contact.dart'; - +import 'package:at_common_flutter/services/size_config.dart'; import 'package:at_common_flutter/widgets/custom_button.dart'; +import 'package:at_contact/at_contact.dart'; import 'package:at_contacts_flutter/services/contact_service.dart'; import 'package:at_contacts_flutter/utils/text_styles.dart'; import 'package:flutter/material.dart'; -import 'package:at_common_flutter/services/size_config.dart'; - +/// A bottom sheet widget to diaplay the number of contacts selected from +/// contact list and what to do of that list on press of [Done] +/// takes in @param [onPressed] which defines what to be executed on press of [Done] +/// @param [selectedList] is a [ValueChanged] function which return the selected contacts +/// to be used outside of package. class CustomBottomSheet extends StatelessWidget { final Function? onPressed; final ValueChanged?>? selectedList; - const CustomBottomSheet({Key? key, this.onPressed, this.selectedList}) - : super(key: key); + const CustomBottomSheet({Key? key, this.onPressed, this.selectedList}) : super(key: key); @override Widget build(BuildContext context) { var contactServive = ContactService(); @@ -52,13 +48,8 @@ class CustomBottomSheet extends StatelessWidget { buttonText: 'Done', width: 120.toWidth, height: 40.toHeight, - buttonColor: - Theme.of(context).brightness == Brightness.light - ? Colors.black - : Colors.white, - fontColor: Theme.of(context).brightness == Brightness.light - ? Colors.white - : Colors.black, + buttonColor: Theme.of(context).brightness == Brightness.light ? Colors.black : Colors.white, + fontColor: Theme.of(context).brightness == Brightness.light ? Colors.white : Colors.black, onPressed: () { onPressed!(); selectedList!(snapshot.data); diff --git a/packages/at_contacts_flutter/lib/widgets/custom_circle_avatar.dart b/packages/at_contacts_flutter/lib/widgets/custom_circle_avatar.dart index 9457a6235..6cf7d3c8e 100644 --- a/packages/at_contacts_flutter/lib/widgets/custom_circle_avatar.dart +++ b/packages/at_contacts_flutter/lib/widgets/custom_circle_avatar.dart @@ -1,14 +1,13 @@ -/// A customized circular avatar to display the profile picture with a small border -/// takes in @param [image] for the [asset image] -/// @param [size] to define the size of the avatar -/// @param [nonAsset] if the image is coming over the network -/// @param [byteImage] to display the image from the netwok - import 'dart:typed_data'; -import 'package:flutter/material.dart'; import 'package:at_common_flutter/services/size_config.dart'; +import 'package:flutter/material.dart'; +/// A customized circular avatar to display the profile picture with a small border +/// takes in @param [image] for the [asset image] +/// @param [size] to define the size of the avatar +/// @param [nonAsset] if the image is coming over the network +/// @param [byteImage] to display the image from the network class CustomCircleAvatar extends StatelessWidget { /// Asset image path final String? image; @@ -40,9 +39,7 @@ class CustomCircleAvatar extends StatelessWidget { child: CircleAvatar( radius: (size - 5).toFont, backgroundColor: Colors.transparent, - backgroundImage: nonAsset - ? Image.memory(byteImage!).image - : AssetImage(image!, package: 'at_contacts_flutter'), + backgroundImage: nonAsset ? Image.memory(byteImage!).image : AssetImage(image!, package: 'at_contacts_flutter'), ), ); } diff --git a/packages/at_contacts_flutter/lib/widgets/custom_list_tile.dart b/packages/at_contacts_flutter/lib/widgets/custom_list_tile.dart index 5f4458942..675768f88 100644 --- a/packages/at_contacts_flutter/lib/widgets/custom_list_tile.dart +++ b/packages/at_contacts_flutter/lib/widgets/custom_list_tile.dart @@ -1,11 +1,6 @@ -/// A custom list tile to display the contacts -/// takes in a function @param [onTap] to define what happens on tap of the tile -/// @param [onTrailingPresses] to set the behaviour for trailing icon -/// @param [asSelectionTile] to toggle whether the tile is selectable to select contacts -/// @param [contact] for details of the contact -/// @param [contactService] to get an instance of [AtContactsImpl] - import 'dart:typed_data'; + +import 'package:at_common_flutter/services/size_config.dart'; import 'package:at_contact/at_contact.dart'; import 'package:at_contacts_flutter/services/contact_service.dart'; import 'package:at_contacts_flutter/utils/colors.dart'; @@ -14,8 +9,13 @@ import 'package:at_contacts_flutter/widgets/contacts_initials.dart'; import 'package:at_contacts_flutter/widgets/custom_circle_avatar.dart'; import 'package:at_utils/at_logger.dart'; import 'package:flutter/material.dart'; -import 'package:at_common_flutter/services/size_config.dart'; +/// A custom list tile to display the contacts +/// takes in a function @param [onTap] to define what happens on tap of the tile +/// @param [onTrailingPresses] to set the behaviour for trailing icon +/// @param [asSelectionTile] to toggle whether the tile is selectable to select contacts +/// @param [contact] for details of the contact +/// @param [contactService] to get an instance of [AtContactsImpl] class CustomListTile extends StatefulWidget { final Function? onTap; final Function? onTrailingPressed; @@ -47,8 +47,7 @@ class _CustomListTileState extends State { @override Widget build(BuildContext context) { Widget contactImage; - if (widget.contact!.tags != null && - widget.contact!.tags!['image'] != null) { + if (widget.contact!.tags != null && widget.contact!.tags!['image'] != null) { Uint8List? image; try { List intList = widget.contact!.tags!['image'].cast(); @@ -76,8 +75,7 @@ class _CustomListTileState extends State { builder: (context, snapshot) { // ignore: omit_local_variable_types for (AtContact? contact in widget.contactService!.selectedContacts) { - if (contact == widget.contact || - contact!.atSign == widget.contact!.atSign) { + if (contact == widget.contact || contact!.atSign == widget.contact!.atSign) { isSelected = true; break; } else { @@ -112,8 +110,7 @@ class _CustomListTileState extends State { } }, title: Text( - widget.contact!.tags != null && - widget.contact!.tags!['name'] != null + widget.contact!.tags != null && widget.contact!.tags!['name'] != null ? widget.contact!.tags!['name'] : widget.contact!.atSign!.substring(1), style: TextStyle( @@ -123,8 +120,7 @@ class _CustomListTileState extends State { ), ), subtitle: Text( - (widget.contact!.tags != null && - widget.contact!.tags!['nickname'] != null + (widget.contact!.tags != null && widget.contact!.tags!['nickname'] != null ? '${widget.contact!.tags!['nickname']} (${widget.contact!.atSign!})' : widget.contact!.atSign!), style: TextStyle( diff --git a/packages/at_contacts_flutter/lib/widgets/custom_search_field.dart b/packages/at_contacts_flutter/lib/widgets/custom_search_field.dart index 13e436e62..186d04cbf 100644 --- a/packages/at_contacts_flutter/lib/widgets/custom_search_field.dart +++ b/packages/at_contacts_flutter/lib/widgets/custom_search_field.dart @@ -1,14 +1,12 @@ -/// A search field to filter out the contacts - import 'package:at_common_flutter/services/size_config.dart'; import 'package:at_contacts_flutter/utils/colors.dart'; import 'package:flutter/material.dart'; +/// A search field to filter out the contacts class ContactSearchField extends StatelessWidget { final Function(String) onChanged; final String hintText; - const ContactSearchField(this.hintText, this.onChanged, {Key? key}) - : super(key: key); + const ContactSearchField(this.hintText, this.onChanged, {Key? key}) : super(key: key); @override Widget build(BuildContext context) { From 5b907cb64fb6a3407988d0a9c5a8b334bf7388c0 Mon Sep 17 00:00:00 2001 From: Curtly Critchlow Date: Wed, 7 Aug 2024 07:21:21 -0400 Subject: [PATCH 2/2] chore: at_contacts_flutter updated to version 4.0.15. --- packages/at_contacts_flutter/CHANGELOG.md | 40 ++++++++++++++++++- .../example/android/build.gradle | 2 +- .../example/ios/Podfile.lock | 4 +- .../at_contacts_flutter/example/pubspec.yaml | 2 +- packages/at_contacts_flutter/pubspec.yaml | 6 +-- 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/packages/at_contacts_flutter/CHANGELOG.md b/packages/at_contacts_flutter/CHANGELOG.md index 8c96f9b4a..5b07fd815 100644 --- a/packages/at_contacts_flutter/CHANGELOG.md +++ b/packages/at_contacts_flutter/CHANGELOG.md @@ -1,117 +1,155 @@ +## 4.0.15 + +- **FIX**: Dangling_library_doc_comment moved +- **CHORE**: Bumped up dependency versions +- **CHORE**: Kotlin version updated + ## 4.0.14 + - **CHORE**: Bumped up dependency versions - **CHORE**: Major version increase of at_commons from ^3.0.55 to ^4.0.1 ## 4.0.13 - **FIX**: Fixed methods for fetching profile picture + ## 4.0.12 - **CHORE**: Bumped all dependency versions ## 4.0.11 + - **CHORE**: Updated dependency and improved pub score ## 4.0.10 + - **FIX**: fetching contacts made faster ## 4.0.9 + - **CHORE**: Updated text constants - **FIX**: resolved issue while fetching atSign's name and image ## 4.0.8 + - **CHORE**: Updated dependencies and android gradle versions ## 4.0.7 + - **FIX**: Image and texts bug fixes - **CHORE**: Package description updated ## 4.0.6 + - **FEAT**: Updated text - **FIX**: Corrected single selection bug ## 4.0.5 + - **FIX**: Lint Fixes according to flutter 3.0 ## 4.0.4 + - **FIX**: Added missing fontWeight - **FEAT**: Optimised adding and removing contacts ## 4.0.3 + - **FIX**: Fixed bug to get lastname and image - **FEAT**: Added list display controls ## 4.0.2 + - **CHORE**: Updated package dependencies - **FEAT**: Improved error handling ## 4.0.1 + - **CHORE**: Updated package dependencies - **CHORE**: Updated documentation ## 4.0.0 + - **FEAT**: Exposed contact services - **CHORE**: Updated return type of contact services - **DOCS**: Added documentation for contact service functions ## 3.1.3 + - **DOCS**: Added Package documentation. - **CHORE**: Added a new example. - **DOCS**: Added example documentation. ## 3.1.2 + - **FIX**: Fixed at_client dependency issue - **CHORE**: Updated at_contact dependency ## 3.1.1 + - **CHORE**: Updated package dependencies ## 3.1.0 + - **FEAT**: Added platform support for macos, windows and linux ## 3.0.2 + - **FIX**: Bug fixes - **DOCS**: Updated documentation ## 3.0.1 + - **CHORE**: Updated dependencies and bug fixes ## 3.0.0 + - **CHORE**: package updated with rsdk changes ## 2.0.3 + - **CHORE**: Updated public persona keys ## 2.0.2 + - **CHORE**: Updated repository link and description - **CHORE**: Updated dependencies ## 2.0.1 + - **CHORE**: Updated dependencies ## 2.0.0 + - **CHORE**: Null safe version - **CHORE**: Updated dependencies ## 1.0.2 + - **FIX**: Fix to prevent adding self to contact list - **FEAT**: Added function to get contact details from cached data ## 1.0.1 + - **CHORE**: The referenced packages are updated - **CHORE**: Improved avatar placeholder ## 1.0.0 + - **CHORE**: Updated example app ## 0.0.4 + - **CHORE**: The referenced packages are updated ## 0.0.3 + - **CHORE**: The referenced packages from client sdk updated ## 0.0.2 + - **CHORE**: The referenced packages from client sdk updated ## 0.0.1 -- The initial release consists of two screens - contacts and blocked contacts. \ No newline at end of file + +- The initial release consists of two screens - contacts and blocked contacts. diff --git a/packages/at_contacts_flutter/example/android/build.gradle b/packages/at_contacts_flutter/example/android/build.gradle index 713d7f6e6..23eb4f6ed 100644 --- a/packages/at_contacts_flutter/example/android/build.gradle +++ b/packages/at_contacts_flutter/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.20' repositories { google() mavenCentral() diff --git a/packages/at_contacts_flutter/example/ios/Podfile.lock b/packages/at_contacts_flutter/example/ios/Podfile.lock index 63779694e..f2b604719 100644 --- a/packages/at_contacts_flutter/example/ios/Podfile.lock +++ b/packages/at_contacts_flutter/example/ios/Podfile.lock @@ -147,7 +147,7 @@ SPEC CHECKSUMS: at_file_saver: c0e052c72d8c0296318bd70f2ae7f510887014ce at_onboarding_flutter: e8219b6d0bfb236d3837ec3528871aebdcc56e8d biometric_storage: 1400f1382af3a4cc2bf05340e13c3d8de873ceb9 - device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6 + device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 file_picker: 15fd9539e4eb735dc54bae8c0534a7a9511a03de @@ -160,7 +160,7 @@ SPEC CHECKSUMS: permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe - share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5 + share_plus: 8875f4f2500512ea181eef553c3e27dba5135aad shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe diff --git a/packages/at_contacts_flutter/example/pubspec.yaml b/packages/at_contacts_flutter/example/pubspec.yaml index 903a7e18f..3997c59ce 100644 --- a/packages/at_contacts_flutter/example/pubspec.yaml +++ b/packages/at_contacts_flutter/example/pubspec.yaml @@ -48,7 +48,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.3 + flutter_lints: ^4.0.0 flutter_test: sdk: flutter diff --git a/packages/at_contacts_flutter/pubspec.yaml b/packages/at_contacts_flutter/pubspec.yaml index f0bd32441..b78342225 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.14 +version: 4.0.15 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 @@ -24,10 +24,10 @@ dependencies: flutter_slidable: ^3.1.0 dev_dependencies: - flutter_lints: ^2.0.3 + flutter_lints: ^4.0.0 flutter_test: sdk: flutter - mocktail: ^0.3.0 + mocktail: ^1.0.4 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec