Analyzer cleanup, drop unused provider dependency, cover inbox write APIs with tests - #14
Open
fa0311 wants to merge 1 commit into
Conversation
…nbox write APIs with tests flutter analyze reported 13 findings in the plugin package. This cleans up the ones that are self-contained: - events.dart: remove the unreachable default clauses in the EventCategory, CartEventType and CatalogObjectEventName switches; all three switches exhaustively cover their enums, so the defaults were dead code (unreachable_switch_default). - inbox_message.dart: remove the unused dart:convert import. - pubspec.yaml: drop the provider dependency; it is not referenced anywhere in lib/, test/ or the example app, and forces an unnecessary transitive dependency on every consumer of the plugin. - test/sfmc_test.dart: remove four unused mock message lists and make testMessageId a const actually used by new tests. - test/sfmc_method_channel_test.dart: make the Duration const (prefer_const_constructors). Also adds the missing unit tests for the inbox write APIs - setMessageRead, deleteMessage, markAllMessagesRead and markAllMessagesDeleted - which previously had no coverage. The remaining analyzer findings in lib/sfmc_method_channel.dart and lib/notification_message.dart are intentionally left out because those exact lines are reworked by separate bug-fix PRs.
nakasyou
approved these changes
Jul 19, 2026
nakasyou
approved these changes
Jul 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Housekeeping for the plugin package:
defaultclauses in events.dart (all three switches cover their enums), an unused import, and unused test variablesproviderfrom dependencies - nothing in lib/, test/ or the example references it, and it's currently forced onto every consumer of the pluginsetMessageRead,deleteMessage,markAllMessagesReadandmarkAllMessagesDeletedThe two remaining analyzer findings in sfmc_method_channel.dart are left alone on purpose - those exact lines are reworked in #8.