plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

Cache device info futures across instances

Open wytesk133 opened this issue 4 years ago • 1 comments

Cache the futures themselves rather than the results (to avoid calling the underlying plugin calls when there is a pending operation going on).

Also make the caches static members (in order for them to be shared across instances) and make the constructor const.

Description

Cache the futures themselves rather than the results (to avoid calling the underlying plugin calls when there is a pending operation going on).

Also make the caches static members (in order for them to be shared across instances) and make the constructor const.

Related Issues

N/A. This is a small optimization.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [ ] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • [x] All existing and new tests are passing.
  • [ ] I updated the version in pubspec.yaml and CHANGELOG.md.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] The analyzer (flutter analyze) does not report any problems on my PR.
  • [x] I read and followed the Flutter Style Guide.
  • [x] I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • [ ] Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • [x] No, this is not a breaking change.

wytesk133 avatar Jan 14 '22 09:01 wytesk133

@wytesk133 Is this PR marked as draft by mistake?

vbuberen avatar Apr 10 '22 10:04 vbuberen

Closing due to no activity.

vbuberen avatar Sep 26 '22 06:09 vbuberen