felangel / flow_builder

Flutter Flows made easy! A Flutter package which simplifies navigation flows with a flexible, declarative API.
https://pub.dev/packages/flow_builder
MIT License
395 stars 65 forks source link

NoSuchMethodError was thrown building AnimatedBuilder #38

Open akeblom opened 3 years ago

akeblom commented 3 years ago

Describe the bug Red error screen flashing by when jumping two pages back.

To Reproduce Steps to reproduce the behavior:

  1. Click 'Add article'
  2. Click 'Save article'
  3. List with articles are showed. Click Select article again to add another.
  4. Click 'Add article'
  5. Click 'Save Article'
  6. We are ending up at the correct page but a Red Flutter error screen flashing by and

Expected behavior Return to correct Page without the Error screen flashing

Logs

════════ Exception caught by widgets library ═══════════════════════════════════ The following NoSuchMethodError was thrown building AnimatedBuilder(animation: Listenable.merge([AnimationController#2f296(⏭ 1.000; paused; DISPOSED; for _PageBasedMaterialPageRoute(null))➩ProxyAnimation, AnimationController#135a3(◀ 1.000; for _PageBasedMaterialPageRoute(null))➩ProxyAnimation➩ProxyAnimation]), dirty, dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#1b2a5]], state: _AnimatedState#afc2a): The getter 'userGestureInProgress' was called on null. Receiver: null Tried calling: userGestureInProgress

The relevant error-causing widget was FlowBuilder lib/flow/articles_flow.dart:15 When the exception was thrown, this was the stack

0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)

1 CupertinoRouteTransitionMixin.isPopGestureInProgress

package:flutter/…/cupertino/route.dart:174

2 PageTransitionsTheme.buildTransitions

package:flutter/…/material/page_transitions_theme.dart:596

3 MaterialRouteTransitionMixin.buildTransitions

package:flutter/…/material/page.dart:128

4 _ModalScopeState.build.

package:flutter/…/widgets/routes.dart:794 ...

flutter doctor -v [✓] Flutter (Channel stable, 1.22.6, on macOS 11.0.1 20B50 darwin-x64, locale sv-SE) • Flutter version 1.22.6 at /Users/tobiasakeblom/dev/mobile-dev/flutter • Framework revision 9b2d32b605 (5 weeks ago), 2021-01-22 14:36:39 -0800 • Engine revision 2f0af37152 • Dart version 2.10.5

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at /Users/tobiasakeblom/Library/Android/sdk • Platform android-30, build-tools 29.0.3 • ANDROID_HOME = /Users/tobiasakeblom/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.4, Build version 12D4e • CocoaPods version 1.10.0

[!] Android Studio (version 4.1) • Android Studio at /Applications/Android Studio.app/Contents ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 29.1.3 • Dart plugin version 182.4999

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

[✓] Connected device (2 available) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator) • iPhone 12 Pro Max (mobile) • 09EF7DF2-572F-4FF9-BA70-FED85D851741 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-4 (simulator)

! Doctor found issues in 1 category.

Additional context Code with example found here https://github.com/akeblom/flow_builder_example

jonathankao97 commented 3 years ago

I cloned your codebase and was unable to replicate the behavior you described. Maybe try investigating your Flutter/dependency versioning?