Skip to content

[Bug]: type 'BaseDeviceInfo' is not a subtype of type 'WebBrowserInfo' in type cast #3610

Open
@ja1mecc

Description

@ja1mecc

Platform

iPhone 16 Pro Max

Plugin

device_info_plus

Version

11.5.0

Flutter SDK

3.29.0

Steps to reproduce

WebBrowserInfo webBrowserInfo = await deviceInfo.webBrowserInfo;
print(webBrowserInfo.userAgent);

Code Sample

Logs

[ +222 ms] flutter: b0e0d1c47fc54505ae4fdb227655c69e
[ +478 ms] [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: type 'BaseDeviceInfo' is not a subtype of
type 'WebBrowserInfo' in type cast
                    #0      DeviceInfoPlugin.webBrowserInfo (package:device_info_plus/device_info_plus.dart:83:62)
                    <asynchronous suspension>
                    #1      DeviceProvider.getData
(package:credicorp_app_pass/providers/dispositivo/dispositivo_provider.dart:32:37)
                    <asynchronous suspension>

Flutter Doctor

flutter doctor -v                     ░▒▓ INT ↵  at 10:52:50  
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.5 24F74 darwin-arm64, locale es-419) [2.4s]
    • Flutter version 3.29.0 on channel stable at /Users/jaimehualafernandez/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 35c388afb5 (4 months ago), 2025-02-10 12:48:41 -0800
    • Engine revision f73bfc4522
    • Dart version 3.7.0
    • DevTools version 2.42.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [4.0s]
    • Android SDK at /Users/jaimehualafernandez/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [3.7s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [12ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2) [11ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.101.0) [10ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.112.0

[✓] Connected device (4 available) [7.6s]
    • iPhone 16 Pro Max (mobile)      • B2588901-D651-4130-8DC3-60B7DBD5A098 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-18-0 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.5 24F74 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.5 24F74 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 137.0.7151.120
    ! Error: Browsing on the local area network for iPhone de Dari. Ensure the device is unlocked and attached with a cable or
      associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [895ms]
    • All expected network resources are available.

• No issues found!

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions