Skip to content

Analyzer cleanup, drop unused provider dependency, cover inbox write APIs with tests - #14

Open
fa0311 wants to merge 1 commit into
salesforce-marketingcloud:mainfrom
fa0311:chore/analyzer-cleanup-and-inbox-tests
Open

Analyzer cleanup, drop unused provider dependency, cover inbox write APIs with tests#14
fa0311 wants to merge 1 commit into
salesforce-marketingcloud:mainfrom
fa0311:chore/analyzer-cleanup-and-inbox-tests

Conversation

@fa0311

@fa0311 fa0311 commented Jul 19, 2026

Copy link
Copy Markdown

Housekeeping for the plugin package:

  • removes the unreachable default clauses in events.dart (all three switches cover their enums), an unused import, and unused test variables
  • drops provider from dependencies - nothing in lib/, test/ or the example references it, and it's currently forced onto every consumer of the plugin
  • adds the missing unit tests for setMessageRead, deleteMessage, markAllMessagesRead and markAllMessagesDeleted

The two remaining analyzer findings in sfmc_method_channel.dart are left alone on purpose - those exact lines are reworked in #8.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants