EdsonBueno / focus_detector

Android's onResume/onPause and iOS's viewDidAppear/viewDidDisappear for Flutter.
https://pub.dev/packages/focus_detector
MIT License
98 stars 54 forks source link

error: "name" field doesn't match expected name "focus_detector". #18

Open vnbrew opened 1 year ago

vnbrew commented 1 year ago

I checkout my project with my new MacBook Pro, chip Apple M1

flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.3.4, on macOS 13.0.1 22A400 darwin-arm (Rosetta), locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [✓] Xcode - develop for iOS and macOS (Xcode 14.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.75.0) [✓] Connected device (2 available) [✓] HTTP Host Availability

dependencies:
  focus_detector:
    git:
      url: https://github.com/ifnyas/focus_detector.git
      ref: master

And got an error after run: flutter pub get

Error on line 1, column 7: "name" field doesn't match expected name "focus_detector". ╷ 1 │ name: focus_detector_v2 │ ^^^^^^^^^^^^^^^^^ ╵ pub get failed (65; ╵) exit code 65

KjunLee commented 1 year ago

replace this package as your local util file.

step1. go to https://github.com/irfnyas/focus_detector/blob/master/lib/focus_detector_v2.dart step2. copy all codes, and create a new dart file to your project. step3. fix previous references or imports.