From 55d73d712edf5524350dcaa38fbf92453057d002 Mon Sep 17 00:00:00 2001 From: ice-hector <96414297+ice-hector@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:26:01 +0200 Subject: [PATCH 1/3] feat: add bookmark icon into the feed item footer --- Gemfile.lock | 38 ++++++++-------- .../bookmark_footer_button.dart | 44 +++++++++++++++++++ .../counter_items_footer.dart | 8 ++++ .../feed/views/components/post/post.dart | 3 +- .../article_details_page.dart | 2 + .../video/views/components/video_actions.dart | 2 + 6 files changed, 77 insertions(+), 20 deletions(-) create mode 100644 lib/app/components/counter_items_footer/bookmark_footer_button.dart diff --git a/Gemfile.lock b/Gemfile.lock index 3982138f6..45a352663 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,16 +10,16 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.1001.0) - aws-sdk-core (3.211.0) + aws-partitions (1.1032.0) + aws-sdk-core (3.214.1) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.95.0) + aws-sdk-kms (1.96.0) aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.169.0) + aws-sdk-s3 (1.177.0) aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -58,8 +58,8 @@ GEM faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) + faraday-multipart (1.1.0) + multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) @@ -67,8 +67,8 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.1) faraday (~> 1.0) - fastimage (2.3.1) - fastlane (2.225.0) + fastimage (2.4.0) + fastlane (2.226.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -108,7 +108,7 @@ GEM tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) + xcpretty (~> 0.4.0) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-firebase_app_distribution (0.9.1) google-apis-firebaseappdistribution_v1 (~> 0.3.0) @@ -157,12 +157,12 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-cookie (1.0.7) + http-cookie (1.0.8) domain_name (~> 0.5) httpclient (2.8.3) jmespath (1.6.2) - json (2.7.6) - jwt (2.9.3) + json (2.9.1) + jwt (2.10.1) base64 mini_magick (4.13.2) mini_mime (1.1.5) @@ -171,9 +171,9 @@ GEM nanaimo (0.4.0) naturally (2.2.1) nkf (0.2.0) - optparse (0.5.0) + optparse (0.6.0) os (1.1.4) - plist (3.7.1) + plist (3.7.2) public_suffix (6.0.1) rake (13.2.1) representable (3.2.0) @@ -181,10 +181,10 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.3.9) - rouge (2.0.7) + rexml (3.4.0) + rouge (3.28.0) ruby2_keywords (0.0.5) - rubyzip (2.3.2) + rubyzip (2.4.1) security (0.1.5) signet (0.19.0) addressable (~> 2.8) @@ -213,8 +213,8 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.4.0) rexml (>= 3.3.6, < 4.0) - xcpretty (0.3.0) - rouge (~> 2.0.7) + xcpretty (0.4.0) + rouge (~> 3.28.0) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) diff --git a/lib/app/components/counter_items_footer/bookmark_footer_button.dart b/lib/app/components/counter_items_footer/bookmark_footer_button.dart new file mode 100644 index 000000000..243178582 --- /dev/null +++ b/lib/app/components/counter_items_footer/bookmark_footer_button.dart @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: ice License 1.0 + +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:ion/app/extensions/extensions.dart'; +import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; +import 'package:ion/app/features/feed/providers/bookmarks_notifier.c.dart'; +import 'package:ion/app/features/nostr/model/event_reference.c.dart'; +import 'package:ion/generated/assets.gen.dart'; + +class BookmarkFooterButton extends ConsumerWidget { + const BookmarkFooterButton({ + required this.eventReference, + required this.type, + super.key, + }); + + final EventReference? eventReference; + final BookmarksSetType type; + + @override + Widget build(BuildContext context, WidgetRef ref) { + if (eventReference == null) { + return const SizedBox.shrink(); + } + + final isBookmarked = ref.watch(isBookmarkedProvider(eventReference!)).value ?? false; + return IconButton( + icon: SvgPicture.asset( + isBookmarked ? Assets.svg.iconBookmarksOn : Assets.svg.iconBookmarks, + width: 16.0.s, + height: 16.0.s, + colorFilter: isBookmarked + ? null + : ColorFilter.mode(context.theme.appColors.onTertararyBackground, BlendMode.srcIn), + ), + onPressed: () => ref.read(bookmarksNotifierProvider.notifier).toggleBookmark( + eventReference!, + type: type, + ), + ); + } +} diff --git a/lib/app/components/counter_items_footer/counter_items_footer.dart b/lib/app/components/counter_items_footer/counter_items_footer.dart index 158f06e7e..bf3e4341d 100644 --- a/lib/app/components/counter_items_footer/counter_items_footer.dart +++ b/lib/app/components/counter_items_footer/counter_items_footer.dart @@ -2,16 +2,19 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:ion/app/components/counter_items_footer/bookmark_footer_button.dart'; import 'package:ion/app/components/counter_items_footer/likes_counter_button.dart'; import 'package:ion/app/components/counter_items_footer/replies_counter_button.dart'; import 'package:ion/app/components/counter_items_footer/reposts_counter_button.dart'; import 'package:ion/app/components/counter_items_footer/share_button.dart'; import 'package:ion/app/extensions/num.dart'; +import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/nostr/model/event_reference.c.dart'; class CounterItemsFooter extends HookConsumerWidget { CounterItemsFooter({ required this.eventReference, + required this.type, double? bottomPadding, double? topPadding, this.color, @@ -20,6 +23,7 @@ class CounterItemsFooter extends HookConsumerWidget { topPadding = topPadding ?? 10.0.s; final EventReference eventReference; + final BookmarksSetType type; final double bottomPadding; final double topPadding; final Color? color; @@ -49,6 +53,10 @@ class CounterItemsFooter extends HookConsumerWidget { color: color, ), ), + BookmarkFooterButton( + eventReference: eventReference, + type: type, + ), ShareButton( eventReference: eventReference, color: color, diff --git a/lib/app/features/feed/views/components/post/post.dart b/lib/app/features/feed/views/components/post/post.dart index 7906c000b..92f4560e8 100644 --- a/lib/app/features/feed/views/components/post/post.dart +++ b/lib/app/features/feed/views/components/post/post.dart @@ -6,6 +6,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:ion/app/components/counter_items_footer/counter_items_footer.dart'; import 'package:ion/app/components/skeleton/skeleton.dart'; import 'package:ion/app/extensions/extensions.dart'; +import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/feed/data/models/entities/article_data.c.dart'; import 'package:ion/app/features/feed/data/models/entities/post_data.c.dart'; import 'package:ion/app/features/feed/views/components/article/article.dart'; @@ -55,7 +56,7 @@ class Post extends ConsumerWidget { SizedBox(height: 10.0.s), PostBody(postEntity: postEntity), if (framedEvent != null) _FramedEvent(eventReference: framedEvent), - footer ?? CounterItemsFooter(eventReference: eventReference), + footer ?? CounterItemsFooter(eventReference: eventReference, type: BookmarksSetType.posts), ], ); } diff --git a/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart b/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart index c4828bdcf..c03a312d7 100644 --- a/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart +++ b/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart @@ -8,6 +8,7 @@ import 'package:ion/app/components/screen_offset/screen_side_offset.dart'; import 'package:ion/app/components/separated/separator.dart'; import 'package:ion/app/extensions/extensions.dart'; import 'package:ion/app/features/feed/data/models/article_topic.dart'; +import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/feed/data/models/entities/article_data.c.dart'; import 'package:ion/app/features/feed/views/components/text_editor/text_editor_preview.dart'; import 'package:ion/app/features/feed/views/pages/article_details_page/components/article_details_date_topics.dart'; @@ -90,6 +91,7 @@ class ArticleDetailsPage extends HookConsumerWidget { child: CounterItemsFooter( eventReference: eventReference, bottomPadding: 10.0.s, + type: BookmarksSetType.articles, ), ), Container(color: context.theme.appColors.primaryBackground, height: 8.0.s), diff --git a/lib/app/features/video/views/components/video_actions.dart b/lib/app/features/video/views/components/video_actions.dart index f80dace69..8f0af0825 100644 --- a/lib/app/features/video/views/components/video_actions.dart +++ b/lib/app/features/video/views/components/video_actions.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:ion/app/components/counter_items_footer/counter_items_footer.dart'; import 'package:ion/app/extensions/extensions.dart'; +import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/nostr/model/event_reference.c.dart'; class VideoActions extends StatelessWidget { @@ -24,6 +25,7 @@ class VideoActions extends StatelessWidget { topPadding: 0, eventReference: eventReference, color: context.theme.appColors.secondaryBackground, + type: BookmarksSetType.videos, ), ); } From 778bd775e880e8ff8f4731cb68811a204dff4e90 Mon Sep 17 00:00:00 2001 From: ice-hector <96414297+ice-hector@users.noreply.github.com> Date: Tue, 7 Jan 2025 20:32:15 +0200 Subject: [PATCH 2/3] refactor: types --- .../counter_items_footer/bookmark_footer_button.dart | 4 ---- .../components/counter_items_footer/counter_items_footer.dart | 4 ---- lib/app/features/feed/views/components/post/post.dart | 3 +-- .../pages/article_details_page/article_details_page.dart | 2 -- lib/app/features/video/views/components/video_actions.dart | 2 -- 5 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/app/components/counter_items_footer/bookmark_footer_button.dart b/lib/app/components/counter_items_footer/bookmark_footer_button.dart index 243178582..b1634b6bd 100644 --- a/lib/app/components/counter_items_footer/bookmark_footer_button.dart +++ b/lib/app/components/counter_items_footer/bookmark_footer_button.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:ion/app/extensions/extensions.dart'; -import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/feed/providers/bookmarks_notifier.c.dart'; import 'package:ion/app/features/nostr/model/event_reference.c.dart'; import 'package:ion/generated/assets.gen.dart'; @@ -12,12 +11,10 @@ import 'package:ion/generated/assets.gen.dart'; class BookmarkFooterButton extends ConsumerWidget { const BookmarkFooterButton({ required this.eventReference, - required this.type, super.key, }); final EventReference? eventReference; - final BookmarksSetType type; @override Widget build(BuildContext context, WidgetRef ref) { @@ -37,7 +34,6 @@ class BookmarkFooterButton extends ConsumerWidget { ), onPressed: () => ref.read(bookmarksNotifierProvider.notifier).toggleBookmark( eventReference!, - type: type, ), ); } diff --git a/lib/app/components/counter_items_footer/counter_items_footer.dart b/lib/app/components/counter_items_footer/counter_items_footer.dart index bf3e4341d..35fe6672e 100644 --- a/lib/app/components/counter_items_footer/counter_items_footer.dart +++ b/lib/app/components/counter_items_footer/counter_items_footer.dart @@ -8,13 +8,11 @@ import 'package:ion/app/components/counter_items_footer/replies_counter_button.d import 'package:ion/app/components/counter_items_footer/reposts_counter_button.dart'; import 'package:ion/app/components/counter_items_footer/share_button.dart'; import 'package:ion/app/extensions/num.dart'; -import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/nostr/model/event_reference.c.dart'; class CounterItemsFooter extends HookConsumerWidget { CounterItemsFooter({ required this.eventReference, - required this.type, double? bottomPadding, double? topPadding, this.color, @@ -23,7 +21,6 @@ class CounterItemsFooter extends HookConsumerWidget { topPadding = topPadding ?? 10.0.s; final EventReference eventReference; - final BookmarksSetType type; final double bottomPadding; final double topPadding; final Color? color; @@ -55,7 +52,6 @@ class CounterItemsFooter extends HookConsumerWidget { ), BookmarkFooterButton( eventReference: eventReference, - type: type, ), ShareButton( eventReference: eventReference, diff --git a/lib/app/features/feed/views/components/post/post.dart b/lib/app/features/feed/views/components/post/post.dart index 92f4560e8..7906c000b 100644 --- a/lib/app/features/feed/views/components/post/post.dart +++ b/lib/app/features/feed/views/components/post/post.dart @@ -6,7 +6,6 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:ion/app/components/counter_items_footer/counter_items_footer.dart'; import 'package:ion/app/components/skeleton/skeleton.dart'; import 'package:ion/app/extensions/extensions.dart'; -import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/feed/data/models/entities/article_data.c.dart'; import 'package:ion/app/features/feed/data/models/entities/post_data.c.dart'; import 'package:ion/app/features/feed/views/components/article/article.dart'; @@ -56,7 +55,7 @@ class Post extends ConsumerWidget { SizedBox(height: 10.0.s), PostBody(postEntity: postEntity), if (framedEvent != null) _FramedEvent(eventReference: framedEvent), - footer ?? CounterItemsFooter(eventReference: eventReference, type: BookmarksSetType.posts), + footer ?? CounterItemsFooter(eventReference: eventReference), ], ); } diff --git a/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart b/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart index c03a312d7..c4828bdcf 100644 --- a/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart +++ b/lib/app/features/feed/views/pages/article_details_page/article_details_page.dart @@ -8,7 +8,6 @@ import 'package:ion/app/components/screen_offset/screen_side_offset.dart'; import 'package:ion/app/components/separated/separator.dart'; import 'package:ion/app/extensions/extensions.dart'; import 'package:ion/app/features/feed/data/models/article_topic.dart'; -import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/feed/data/models/entities/article_data.c.dart'; import 'package:ion/app/features/feed/views/components/text_editor/text_editor_preview.dart'; import 'package:ion/app/features/feed/views/pages/article_details_page/components/article_details_date_topics.dart'; @@ -91,7 +90,6 @@ class ArticleDetailsPage extends HookConsumerWidget { child: CounterItemsFooter( eventReference: eventReference, bottomPadding: 10.0.s, - type: BookmarksSetType.articles, ), ), Container(color: context.theme.appColors.primaryBackground, height: 8.0.s), diff --git a/lib/app/features/video/views/components/video_actions.dart b/lib/app/features/video/views/components/video_actions.dart index 8f0af0825..f80dace69 100644 --- a/lib/app/features/video/views/components/video_actions.dart +++ b/lib/app/features/video/views/components/video_actions.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:ion/app/components/counter_items_footer/counter_items_footer.dart'; import 'package:ion/app/extensions/extensions.dart'; -import 'package:ion/app/features/feed/data/models/bookmarks/bookmarks_set.c.dart'; import 'package:ion/app/features/nostr/model/event_reference.c.dart'; class VideoActions extends StatelessWidget { @@ -25,7 +24,6 @@ class VideoActions extends StatelessWidget { topPadding: 0, eventReference: eventReference, color: context.theme.appColors.secondaryBackground, - type: BookmarksSetType.videos, ), ); } From 8214ed69f49b51e7b2752e6a3ab4d2862e913e53 Mon Sep 17 00:00:00 2001 From: ice-hector <96414297+ice-hector@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:38:57 +0200 Subject: [PATCH 3/3] refactor: button --- ios/Podfile.lock | 56 +++++++++---------- .../bookmark_footer_button.dart | 40 ------------- .../counter_items_footer.dart | 9 ++- .../bookmark_button/bookmark_button.dart | 13 ++++- 4 files changed, 46 insertions(+), 72 deletions(-) delete mode 100644 lib/app/components/counter_items_footer/bookmark_footer_button.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0fe719dcf..17d30c33c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -351,7 +351,7 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/video_player_avfoundation/darwin" SPEC CHECKSUMS: - audio_waveforms: a6dde7fe7c0ea05f06ffbdb0f7c1b2b2ba6cedcf + audio_waveforms: cd736909ebc6b6a164eb74701d8c705ce3241e1c BanubaARCloudSDK: 40da62afeea642301ca8092600c9bb9cf67fe30e BanubaAudioBrowserSDK: 3a92807e60daa70dcaa1e76920abab97e7a73bf4 BanubaLicenseServicingSDK: f2b51a4288d6b9796063855f5db6dc227819de22 @@ -374,46 +374,46 @@ SPEC CHECKSUMS: BNBSdkApi: f773621958cf0f7776e18f90b96ace13b29d84e2 BNBSdkCore: cc7711127dbcaf392d0a25f4a858d98ffc5c9213 BNBSkin: 3a741bbba57a2a860fe4a69dbd597d7d9aea5793 - camera_avfoundation: 04b44aeb14070126c6529e5ab82cc7c9fca107cf - device_info_plus: 71ffc6ab7634ade6267c7a93088ed7e4f74e5896 + camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4 + device_info_plus: 97af1d7e84681a90d0693e63169a5d50e0839a0d DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 ffmpeg-kit-ios-full-gpl: 80adc341962e55ef709e36baa8ed9a70cf4ea62b - ffmpeg_kit_flutter_full_gpl: ce18b888487c05c46ed252cd2e7956812f2e3bd1 - file_picker: 9b3292d7c8bc68c8a7bf8eb78f730e49c8efc517 - file_saver: 6cdbcddd690cb02b0c1a0c225b37cd805c2bf8b6 + ffmpeg_kit_flutter_full_gpl: 8d15c14c0c3aba616fac04fe44b3d27d02e3c330 + file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655 + file_saver: 503e386464dbe118f630e17b4c2e1190fa0cf808 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - flutter_inappwebview_ios: b89ba3482b96fb25e00c967aae065701b66e9b99 - flutter_keyboard_visibility: 4625131e43015dbbe759d9b20daaf77e0e3f6619 - flutter_secure_storage: 1ed9476fba7e7a782b22888f956cce43e2c62f13 - image_cropper: 5f162dcf988100dc1513f9c6b7eb42cd6fbf9156 - image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a - ion_screenshot_detector: 6981b7ec0add023ce57337882e28dc4b80caad4b - local_auth_darwin: 553ce4f9b16d3fdfeafce9cf042e7c9f77c1c391 + flutter_inappwebview_ios: 6f63631e2c62a7c350263b13fa5427aedefe81d4 + flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069 + flutter_secure_storage: d33dac7ae2ea08509be337e775f6b59f1ff45f12 + image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf + image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 + ion_screenshot_detector: bd85296e1347b5bf5acf71407a6d9b7933bfe604 + local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb OrderedSet: e539b66b644ff081c73a262d24ad552a69be3a94 - package_info_plus: 566e1b7a2f3900e4b0020914ad3fc051dcc95596 - passkeys_ios: 939d7d44f825048c8dffd4644f52444164c80ecd - path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 - permission_handler_apple: 4ed2196e43d0651e8ff7ca3483a069d469701f2d - photo_manager: d2fbcc0f2d82458700ee6256a15018210a81d413 - qr_code_scanner: d77f94ecc9abf96d9b9b8fc04ef13f611e5a147a - quill_native_bridge: fd2819cf6da02fb6cbf9de37835f96e798e145eb + package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85 + passkeys_ios: fdae8c06e2178a9fcb9261a6cb21fb9a06a81d53 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 + photo_manager: ff695c7a1dd5bc379974953a2b5c0a293f7c4c8a + qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e + quill_native_bridge: e5afa7d49c08cf68c52a5e23bc272eba6925c622 SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8 - share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a - shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 - sqflite: c35dad70033b8862124f8337cc994a809fcd9fa3 + share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f + shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 + sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqlite3: 7559e33dae4c78538df563795af3a86fc887ee71 - sqlite3_flutter_libs: f0b59f6bb2a18597d0796558725007e5a7428397 + sqlite3_flutter_libs: 1b4e98da20ebd4e9b1240269b78cdcf492dbe9f3 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 - ua_client_hints: ef4ddde0e2b2be5f0731a31721c4cbbb889b1aa4 - url_launcher_ios: 694010445543906933d732453a59da0a173ae33d - ve_sdk_flutter: e23c4a6f1b84eeacee1daf2a81ba0f0694ed76f1 + ua_client_hints: 3b617011e47bea4b1ea65647efa12860b7280ad5 + url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe + ve_sdk_flutter: c90ec3fc424953a7b82cd1edd5143bc756899e92 VEEffectsSDK: 40dca6a76aeff8630ce1b49ef7643d2a2655dd0f VEExportSDK: 32e97cf98ecbf86aed563fbd4c9131d7bbddbe92 VEPlaybackSDK: 65bb7377c9c8524557d7b5d6723e321fc16fc4a1 - video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b + video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3 VideoEditor: b3e55fe6a6589e715365da822172f54b6fea8169 PODFILE CHECKSUM: f19afb20048b05a04dbc809ad7d199f1df053e9a diff --git a/lib/app/components/counter_items_footer/bookmark_footer_button.dart b/lib/app/components/counter_items_footer/bookmark_footer_button.dart deleted file mode 100644 index b1634b6bd..000000000 --- a/lib/app/components/counter_items_footer/bookmark_footer_button.dart +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: ice License 1.0 - -import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; -import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:ion/app/extensions/extensions.dart'; -import 'package:ion/app/features/feed/providers/bookmarks_notifier.c.dart'; -import 'package:ion/app/features/nostr/model/event_reference.c.dart'; -import 'package:ion/generated/assets.gen.dart'; - -class BookmarkFooterButton extends ConsumerWidget { - const BookmarkFooterButton({ - required this.eventReference, - super.key, - }); - - final EventReference? eventReference; - - @override - Widget build(BuildContext context, WidgetRef ref) { - if (eventReference == null) { - return const SizedBox.shrink(); - } - - final isBookmarked = ref.watch(isBookmarkedProvider(eventReference!)).value ?? false; - return IconButton( - icon: SvgPicture.asset( - isBookmarked ? Assets.svg.iconBookmarksOn : Assets.svg.iconBookmarks, - width: 16.0.s, - height: 16.0.s, - colorFilter: isBookmarked - ? null - : ColorFilter.mode(context.theme.appColors.onTertararyBackground, BlendMode.srcIn), - ), - onPressed: () => ref.read(bookmarksNotifierProvider.notifier).toggleBookmark( - eventReference!, - ), - ); - } -} diff --git a/lib/app/components/counter_items_footer/counter_items_footer.dart b/lib/app/components/counter_items_footer/counter_items_footer.dart index 35fe6672e..034909510 100644 --- a/lib/app/components/counter_items_footer/counter_items_footer.dart +++ b/lib/app/components/counter_items_footer/counter_items_footer.dart @@ -2,12 +2,12 @@ import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; -import 'package:ion/app/components/counter_items_footer/bookmark_footer_button.dart'; import 'package:ion/app/components/counter_items_footer/likes_counter_button.dart'; import 'package:ion/app/components/counter_items_footer/replies_counter_button.dart'; import 'package:ion/app/components/counter_items_footer/reposts_counter_button.dart'; import 'package:ion/app/components/counter_items_footer/share_button.dart'; -import 'package:ion/app/extensions/num.dart'; +import 'package:ion/app/extensions/extensions.dart'; +import 'package:ion/app/features/components/entities_list/components/bookmark_button/bookmark_button.dart'; import 'package:ion/app/features/nostr/model/event_reference.c.dart'; class CounterItemsFooter extends HookConsumerWidget { @@ -50,8 +50,11 @@ class CounterItemsFooter extends HookConsumerWidget { color: color, ), ), - BookmarkFooterButton( + BookmarkButton( eventReference: eventReference, + iconSize: 16.0.s, + colorFilter: + ColorFilter.mode(context.theme.appColors.onTertararyBackground, BlendMode.srcIn), ), ShareButton( eventReference: eventReference, diff --git a/lib/app/features/components/entities_list/components/bookmark_button/bookmark_button.dart b/lib/app/features/components/entities_list/components/bookmark_button/bookmark_button.dart index 586821d32..66471c0b5 100644 --- a/lib/app/features/components/entities_list/components/bookmark_button/bookmark_button.dart +++ b/lib/app/features/components/entities_list/components/bookmark_button/bookmark_button.dart @@ -8,9 +8,16 @@ import 'package:ion/app/features/nostr/model/event_reference.c.dart'; import 'package:ion/generated/assets.gen.dart'; class BookmarkButton extends ConsumerWidget { - const BookmarkButton({required this.eventReference, super.key}); + const BookmarkButton({ + required this.eventReference, + this.iconSize, + this.colorFilter, + super.key, + }); final EventReference? eventReference; + final double? iconSize; + final ColorFilter? colorFilter; @override Widget build(BuildContext context, WidgetRef ref) { @@ -19,9 +26,13 @@ class BookmarkButton extends ConsumerWidget { } final isBookmarked = ref.watch(isBookmarkedProvider(eventReference!)).value ?? false; + return IconButton( icon: SvgPicture.asset( isBookmarked ? Assets.svg.iconBookmarksOn : Assets.svg.iconBookmarks, + width: iconSize, + height: iconSize, + colorFilter: isBookmarked ? null : colorFilter, ), onPressed: () => ref.read(bookmarksNotifierProvider.notifier).toggleBookmark( eventReference!,