biocarl / drawing_animation

A Flutter library for gradually painting SVG path objects on canvas (drawing line animation).
https://pub.dartlang.org/packages/drawing_animation
BSD 2-Clause "Simplified" License
488 stars 123 forks source link

NoSuchMethodError: The getter 'isNotEmpty' was called on null #2

Closed orestesgaolin closed 5 years ago

orestesgaolin commented 5 years ago

Hi I'm trying to run example apps (in this case example_01) and following error occurs:

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following NoSuchMethodError was thrown building AnimatedDrawing(dirty, state:
flutter: _AnimatedDrawingWithTickerState#93952(ticker active)):
flutter: The getter 'isNotEmpty' was called on null.
flutter: Receiver: null
flutter: Tried calling: isNotEmpty
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      Object.noSuchMethod (dart:core/runtime/lib/object_patch.dart:50:5)
flutter: #1      _AbstractAnimatedDrawingState.getPathPainter 
package:drawing_animation/src/drawing_widget.dart:387
flutter: #2      _AbstractAnimatedDrawingState.getCustomPaint 
package:drawing_animation/src/drawing_widget.dart:427
flutter: #3      _AnimatedDrawingWithTickerState.build 
package:drawing_animation/src/drawing_widget.dart:562
flutter: #4      StatefulElement.build 
package:flutter/…/widgets/framework.dart:3830
flutter: #5      ComponentElement.performRebuild 
package:flutter/…/widgets/framework.dart:3741
flutter: #6      Element.rebuild 
package:flutter/…/widgets/framework.dart:3564
flutter: #7      ComponentElement._firstBuild 

This is my flutter doctor output (censored a bit)

[✓] Flutter (Channel beta, v1.3.8, on Mac OS X 10.14.3 18D109, locale pl-PL)
    • Flutter version 1.3.8 at /Users/.../Library/flutter
    • Framework revision e5b1ed7a7f (3 weeks ago), 2019-03-06 14:23:37 -0800
    • Engine revision f4951df193
    • Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at ...
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: ...
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at ...
    • Flutter plugin version 33.1.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

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

[✓] Connected device (1 available)
    • iPhone XS • ... • ios • iOS 12.1 (simulator)

• No issues found!

Do you know what may be the issue here?

biocarl commented 5 years ago

Hey @orestesgaolin!

orestesgaolin commented 5 years ago

Which version are you using - the current version (0.0.6)? Does the error occur when you switch back to an older version?

I'm using the newest version i.e. 0.0.6 and I cloned the master branch of this repository. I didn't modify the files.

I switched to the 0.0.5 and 0.0.4 version and the problem persists. In versions 0.0.4 and 0.0.5 there's no red error background in the app whereas in 0.0.6 the background changes to this: image

Have you modified example_01 e.g. loading a different asset instead?

I changed the asset to head1.svg from the example_03 and this error still occurs.

biocarl commented 5 years ago

Thank you very much @orestesgaolin! I fixed the two bugs related to your issue. With the current version 0.0.8 it should be working again. If you agree I will close this issue.

orestesgaolin commented 5 years ago

@biocarl thank you very much - this works now indeed! I'm glad you intervened so quickly!

image