Skip to content

Fix meta package import errors#981

Merged
hiroshihorie merged 3 commits intomainfrom
hiroshi/fix-imports
Feb 6, 2026
Merged

Fix meta package import errors#981
hiroshihorie merged 3 commits intomainfrom
hiroshi/fix-imports

Conversation

@hiroshihorie
Copy link
Member

@hiroshihorie hiroshihorie commented Feb 5, 2026

fix: use explicit imports to prevent missing meta annotations on some Flutter versions

Summary by CodeRabbit

  • Chores
    • Refactored import statements throughout the codebase from broad imports with hide directives to explicit symbol declarations using show clauses. This improves code clarity, reduces unnecessary symbol exposure, and enhances maintainability.
    • Consolidated imports to leverage specialized packages for improved code organization.

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

This pull request refactors imports across the codebase to use explicit show clauses instead of broad imports or hide directives. Changes include narrowing Flutter foundation imports to specific symbols (kIsWeb, kDebugMode, ChangeNotifier, etc.), adding typed_data imports for Uint8List, and integrating meta package annotations where needed.

Changes

Cohort / File(s) Summary
Patch Entry
.changes/fix-imports
Added patch metadata documenting the import refactoring effort.
Single Symbol Foundation Imports
lib/src/agent/agent.dart, lib/src/managers/broadcast_manager.dart, lib/src/support/platform/io.dart, lib/src/core/signal_client.dart, lib/src/stats/stats.dart, lib/src/track/local/local.dart, lib/src/track/track.dart, lib/src/widgets/video_track_renderer.dart
Narrowed flutter/foundation imports to expose a single required symbol (ChangeNotifier, kIsWeb, or kIsWasm) using explicit show clauses.
Multi-Symbol Foundation Imports
lib/src/core/engine.dart, lib/src/support/platform/web.dart, lib/src/utils.dart, lib/src/widgets/screen_select_dialog.dart
Refined flutter/foundation imports to expose multiple specific symbols (e.g., kDebugMode and kIsWeb) instead of hiding internal ones.
Foundation + Typed Data Integration
lib/src/e2ee/e2ee_manager.dart, lib/src/participant/local.dart
Combined explicit foundation imports with new typed_data imports for Uint8List, supporting byte stream operations.
Foundation Replacement with Meta Annotations
lib/src/agent/chat/message.dart, lib/src/track/local/video.dart, lib/src/types/transcription_segment.dart
Replaced flutter/foundation imports with meta package imports to access @immutable or related annotations.
Import Source Relocation
lib/src/core/room.dart
Switched from flutter/foundation to dart:typed_data for Uint8List, removing the previous hide-internal approach.
Multi-Package Refactoring
lib/src/support/disposable.dart
Updated imports to explicitly show ChangeNotifier and VoidCallback from foundation, added meta package for @mustCallSuper, consolidating annotation and base class access.
Example Project
example/lib/widgets/controls.dart
Narrowed flutter/foundation import to explicitly show only kIsWeb.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • cloudwebrtc

Poem

🐰 Imports refined, now crystal clear,
Show clauses guide us far and near,
No shadows hide what we might need,
Each symbol chosen for the deed,
The foundation stands so clean and bright!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Fix meta package import errors' accurately describes the main objective—converting to explicit imports to resolve meta annotation issues across Flutter versions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hiroshi/fix-imports

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57c8d42 and 60f04f7.

📒 Files selected for processing (21)
  • .changes/fix-imports
  • example/lib/widgets/controls.dart
  • lib/src/agent/agent.dart
  • lib/src/agent/chat/message.dart
  • lib/src/core/engine.dart
  • lib/src/core/room.dart
  • lib/src/core/signal_client.dart
  • lib/src/e2ee/e2ee_manager.dart
  • lib/src/managers/broadcast_manager.dart
  • lib/src/participant/local.dart
  • lib/src/stats/stats.dart
  • lib/src/support/disposable.dart
  • lib/src/support/platform/io.dart
  • lib/src/support/platform/web.dart
  • lib/src/track/local/local.dart
  • lib/src/track/local/video.dart
  • lib/src/track/track.dart
  • lib/src/types/transcription_segment.dart
  • lib/src/utils.dart
  • lib/src/widgets/screen_select_dialog.dart
  • lib/src/widgets/video_track_renderer.dart
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: Build for Flutter Web WASM
  • GitHub Check: Build for Flutter macOS
  • GitHub Check: Build for Flutter Windows
  • GitHub Check: Build for Flutter Linux
  • GitHub Check: Build for Flutter Android
  • GitHub Check: Build for Flutter Web
  • GitHub Check: Build for Flutter iOS
🔇 Additional comments (21)
lib/src/track/local/video.dart (1)

15-19: LGTM!

The import changes correctly narrow flutter/foundation.dart to only expose kIsWeb (used at line 477 for Firefox workaround) and add an explicit package:meta/meta.dart import for the @internal annotation (used at line 179). This aligns with the PR objective of ensuring meta annotations are correctly resolved across Flutter versions.

lib/src/types/transcription_segment.dart (1)

15-15: LGTM!

Replacing the Flutter foundation import with a direct package:meta/meta.dart import ensures the @immutable annotation (used at line 17) is correctly resolved across all Flutter versions. This is a proper fix for the meta annotation resolution issue.

lib/src/support/platform/io.dart (1)

17-17: LGTM!

The explicit show kIsWeb, kIsWasm clause correctly exposes only the symbols used in this file (at line 35 in lkPlatformIsTestImplementation()).

lib/src/agent/chat/message.dart (1)

15-15: LGTM!

Switching to package:meta/meta.dart ensures the @immutable annotation (applied to ReceivedMessage at line 18 and SentMessage at line 103) is correctly resolved across Flutter versions.

lib/src/widgets/video_track_renderer.dart (1)

18-18: LGTM!

The explicit show kIsWeb clause correctly limits the import to only the symbol used in this file (at lines 146 and 281 for web-specific rendering logic).

.changes/fix-imports (1)

1-1: LGTM!

The changelog entry accurately describes the fix. The "patch" classification with type "fixed" is appropriate for this import refinement that addresses Flutter version compatibility.

lib/src/utils.dart (1)

18-20: LGTM!

Both import changes are correct:

  • dart:typed_data show Uint8List is needed for the splitUtf8 function (lines 711-733)
  • flutter/foundation.dart show kIsWeb, defaultTargetPlatform exposes only the symbols used: kIsWeb at lines 93, 190, 326 and defaultTargetPlatform at line 101
lib/src/support/platform/web.dart (1)

18-18: LGTM!

The narrowed import correctly exposes only defaultTargetPlatform and TargetPlatform, which matches the actual usage in lkPlatformIsWebMobileImplementation() at line 27.

lib/src/widgets/screen_select_dialog.dart (1)

16-18: LGTM!

The explicit imports correctly expose only the required symbols:

  • Uint8List from dart:typed_data for the _thumbnail field (line 36)
  • kDebugMode from foundation.dart for conditional debug logging (lines 73, 156, 171)
lib/src/track/local/local.dart (1)

17-17: LGTM!

The narrowed foundation import correctly exposes only kIsWeb, which is used at line 167 for web-specific screen share handling. The @internal and @mustCallSuper annotations are properly sourced from the separate package:meta/meta.dart import at line 21.

lib/src/stats/stats.dart (1)

15-15: LGTM!

The narrowed foundation import correctly exposes only kIsWeb, which is used at lines 162 and 185 to handle platform-specific bitrate calculations (different timestamp units between web and native platforms).

lib/src/track/track.dart (1)

17-17: LGTM!

The narrowed foundation import correctly exposes only kIsWeb, used at line 136 for platform-specific track stopping behavior. The @mustCallSuper and @internal annotations are properly sourced from the separate package:meta/meta.dart import at line 20.

lib/src/core/signal_client.dart (1)

18-18: LGTM!

The narrowed foundation import correctly exposes only kIsWeb, used throughout the file for platform-specific connectivity handling (lines 65, 82, 97). The @internal annotations are properly sourced from the separate package:meta/meta.dart import at line 24.

lib/src/e2ee/e2ee_manager.dart (1)

15-17: LGTM!

The explicit imports correctly expose only the required symbols:

  • Uint8List from dart:typed_data for method parameters in handleEncryptedData and encryptData
  • kDebugMode for conditional debug logging (lines 64, 99, 129, 134)
  • kIsWeb for web-specific codec handling (lines 60, 95)
lib/src/agent/agent.dart (1)

15-15: LGTM: explicit ChangeNotifier import keeps scope tight.
No behavior change; this aligns with the PR’s import hygiene goal.

lib/src/managers/broadcast_manager.dart (1)

15-15: LGTM: import narrowed to ChangeNotifier only.
No behavioral impact; improves import clarity.

example/lib/widgets/controls.dart (1)

5-5: LGTM: kIsWeb-only import is appropriate.
Keeps symbol exposure minimal with no runtime change.

lib/src/core/room.dart (1)

16-16: LGTM: explicit Uint8List import is clean.
Matches the PR’s goal and avoids broad foundation imports.

lib/src/support/disposable.dart (1)

17-19: LGTM: explicit ChangeNotifier/VoidCallback + meta import.
Improves import precision without altering behavior.

lib/src/core/engine.dart (1)

18-20: LGTM: explicit Uint8List + kDebugMode/kIsWeb imports.
Keeps symbols explicit and avoids relying on hidden exports.

lib/src/participant/local.dart (1)

20-23: LGTM: explicit Uint8List and kIsWeb imports.
Tightened imports are consistent with the refactor goal.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hiroshihorie hiroshihorie merged commit da801a9 into main Feb 6, 2026
17 checks passed
@hiroshihorie hiroshihorie deleted the hiroshi/fix-imports branch February 6, 2026 05:59
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.

1 participant