Skip to content

[Bug]: toMap is recommended in the documentation, but deprecated without an apparent replacement #1291

Description

@BernieSumption

Platform

iOS 16

Plugin

device_info_plus

Version

7.0.1

Flutter SDK

3.3.4

Steps to reproduce

The documentation recommends that in order to get all available device information in a platform-agnostic way, the toMap() method should be used. This been deprecated with no apparent replacement.

I'm not sure if this is a bug report that the recommended method has been deprecated, or a feature request that a non-deprecated method be provided!

In any case, in the mean time I have downgraded to 6.0.0 so that I can use the toMap method without warnings.

Code Sample

final deviceInfoPlugin = DeviceInfoPlugin();
final deviceInfo = await deviceInfoPlugin.deviceInfo;
final allInfo = deviceInfo.toMap();

Logs

n/a - compile time error

Flutter Doctor

[✓] Flutter (Channel stable, 3.3.4, on macOS 12.5.1 21G83 darwin-arm, locale
    en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.72.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

• No issues found!

Checklist before submitting a bug

  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdevice_info_plusdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions