omerbyrk / add_to_cart_animation Goto Github PK
View Code? Open in Web Editor NEWflutter plugin which provide you add to cart animation.
License: Apache License 2.0
flutter plugin which provide you add to cart animation.
License: Apache License 2.0
How to initialize badges (default badge is 0). i need to use badge with list.length
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown while finalizing the widget tree:
setState() called after dispose(): _AnimationActionSheetSelectSericeState#60076(lifecycle state: defunct)
This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
My step:
Step1: Using bottom sheet view have using lib.
Step2: Action tap to many item.
Step3: Don't waiting animation end. I close bottom sheet.
Step4: Error show it
I use add_to_cart_animation in my project. When I go back from screen whree i used it to my second screen after correct dispose my screen I see error in debug console:
Exception has occurred.
FlutterError (CartIconKey#36ff4(ticker active but muted) was disposed with an active Ticker.
CartIconKey created a Ticker via its SingleTickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. The Ticker must be disposed before calling super.dispose().
Tickers used by AnimationControllers should be disposed by calling dispose() on the AnimationController itself. Otherwise, the ticker will leak.
The offending ticker was:
Ticker(created by CartIconKey#36ff4)
version: 2.0.1
Fix for that is easy. Please change order this two function. I create special PR for that isuue.
Error used controller with ChangeNotifier
Cod:
void listClick(GlobalKey widgetKey) async {
try {
// here ***********
await runAddToCartAnimation(widgetKey);
} catch (e) {
print(e);
}
await cartKey.currentState!.runCartAnimation((++cartTotalItems).toString());
}
Hello,
The package is working fine, however I can't manage to animate a container with borderRadius, the animated container (floating) has no borderRadius afterward :
Container(
key: widget.imageKey,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(
SmartBarStyle.appBorderRadius,
),
topRight: Radius.circular(
SmartBarStyle.appBorderRadius,
),
),
),
// Basically an Image.network
child: _buildProductImage(context),
),
Tyvm
when i runAddToCartAnimation throw Exception
E/flutter (16483): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value
E/flutter (16483): #0 _AddToCartAnimationState.runAddToCardAnimation (package:add_to_cart_animation/add_to_cart_animation.dart:173:42)
E/flutter (16483):
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Null check operator used on a null value. Error thrown null.
at State.setState(framework.dart:1153)
at _AddToCartAnimationState.runAddToCartAnimation(add_to_cart_animation.dart:171)
at _ProductDetailPageState.build.(product_detail_page.dart:263)
This is what I saw above on firebase, where a user had this problem. But I can't reproduce it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.