flutter_map icon indicating copy to clipboard operation
flutter_map copied to clipboard

[BUG] exception on fitBounds: type '_Smi' is not a subtype of type 'double' in type cast

Open greensopinion opened this issue 3 years ago • 3 comments

Describe The Bug

Fit map to bounds occasionally results in a typecast exception.

Expected Behavior

Typecast exception is never thrown.

Screenshots & Recordings

None

Additional Information

type '_Smi' is not a subtype of type 'double' in type cast
_CastError
#0      new CustomPoint (package:flutter_map/src/core/point.dart:6)
#1      MapState.getBoundsZoom (package:flutter_map/src/map/map.dart:521)
#2      MapState.getBoundsCenterZoom (package:flutter_map/src/map/map.dart:499)
#3      MapState.fitBounds (package:flutter_map/src/map/map.dart:447)
#4      MapControllerImpl.fitBounds (package:flutter_map/src/map/map.dart:54)

Doctors Report

% flutter doctor -v

┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.3 21E230 darwin-x64, locale en-CA)
    • Flutter version 3.0.2 at /Users/dgreen/development/flutter_stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cd41fdd495 (3 weeks ago), 2022-06-08 09:52:13 -0700
    • Engine revision f15f824b57
    • Dart version 2.17.3
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/dgreen/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode_13.2.1.app/Contents/Developer
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.2)
    • 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 11.0.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] VS Code (version 1.68.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.42.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 12.3 21E230 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 103.0.5060.53

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

To Reproduce

Unknown, this is happening with customers with a released app.


Severity This will help us to label the issue quicker and decide what needs attention first. Only choose fatal if the entire app crashes, otherwise choose non-fatal.

  • [X] Non-Fatal
  • [ ] Fatal / App Crashes

Frequency/Rarity This will help us to label the issue quicker and decide what needs attention first.

  • [ ] Once
  • [ ] Uncommon
  • [X ] Common
  • [ ] Always

I've seen this roughly 100 times in the last month.

Applicable Platforms Only select those that you've tested on - one or more. If possible, test on a variety of platforms.

  • [X] Android
  • [X] iOS
  • [ ] Web
  • [ ] Windows
  • [ ] Others (beta platforms)

greensopinion avatar Jul 01 '22 16:07 greensopinion

Hi there,

This is a bit strange, not sure what _Smi is? We might need to try tightening the generic type constraints throughout the stack trace. If you have any spare time, can you try this? Would be appreciated :)

Thanks for the report, and sorry for the long response time!

JaffaKetchup avatar Jul 18 '22 09:07 JaffaKetchup

I think that's typically an int when it comes up with that.

ibrierley avatar Jul 18 '22 09:07 ibrierley

Hey I won’t be able to get to this right away but I’ll have a look when I can.

On Mon, Jul 18, 2022 at 2:36 AM Luka S @.***> wrote:

Hi there,

This is a bit strange, not sure what _Smi is? We might need to try tightening the generic type constraints throughout the stack trace. If you have any spare time, can you try this? Would be appreciated :)

Thanks for the report, and sorry for the long response time!

— Reply to this email directly, view it on GitHub https://github.com/fleaflet/flutter_map/issues/1296#issuecomment-1186981447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKDQ7SKLNSBWLOPYQTRUKLVUUQSNANCNFSM52NFPC7Q . You are receiving this because you authored the thread.Message ID: @.***>

greensopinion avatar Jul 21 '22 14:07 greensopinion

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 21 '22 02:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Aug 27 '22 02:08 github-actions[bot]