letsar / local_hero Goto Github PK
View Code? Open in Web Editor NEWA widget which implicitly launches a hero animation when its position changed within the same route.
License: MIT License
A widget which implicitly launches a hero animation when its position changed within the same route.
License: MIT License
this package not working with the latest flutter version.
Let me know if I am missing something, but when I try to move between two different types of widgets, the widgets to be rendered is swapped in the next transition.
Container(
key: ValueKey(tile),
child: LocalHero(
tag: tile.text,
child: GestureDetector(
onTap: () {
setState(() {
colTiles.add(tile);
rowTiles.remove(tile);
});
},
child: Container(
color: tile.color,
height: 60,
width: 60,
child: Padding(
padding: const EdgeInsets.all(16),
child: CircleAvatar(
backgroundColor: Colors.white70,
foregroundColor: Colors.black54,
child: Text(tile.text),
),
),
),
),
),
)
Container(
key: ValueKey(tile),
child: LocalHero(
tag: tile.text,
child: GestureDetector(
onTap: () {
setState(() {
rowTiles.add(tile);
colTiles.remove(tile);
});
},
child: Container(
width: 80,
height: 80,
color: tile.color,
),
),
),
)
So basically the top widget has text and the bottom doesn't.
The issue is TopWidget is rendered in the bottom column in the next transition if the item was previously a part of the top row.
Here is the code if you want to test it out yourself.
Hello i hope you are good Thank you for continuing the Package and fix the problems , i am very grateful for that , i have just one feature if possible you can add it make local_hero but not in straight line the transaction not in the straight line that we have right now it will be very helpful thank you and makefade aniamtion when change the item if it wasn't the same widget inside
Sometimes, I want to do stuff after the local heroes are done animating.
Current flow is that I change the inflightbuilder to add False to an array, whenever a local hero starts animating, and to add True to the same array when the status is animationStatus == completed. Whenever the number of True == number of False, I do what I want to do next.
Does it make sense for the LocalHeroController to provide a callback to do, I guess that would be way more efficient than a bunch of setState commands?
Love the package and would like to buy you a coffee. Do you mind adding a sponsor button to your repository?
Any plans to migrate to null safety version?
Hello @letsar !
Great package as always ๐๐พ I really think this can be a game changer for many use cases.
I can't make it run with GridView items though, do you have any idea why?
Greetings from an former colleague from OAB ๐
Currently if you update the flightShuttleBuilder
, it does not update the underlying tracker to use the newly provided callback as it's only read once on LocalHero
's initState()
I noticed that I had to add a LocalHeroScope to my app, in order to make everything work.
Does it make sense to integrate that into LocalHeroController? Would make for much simpler implementation right?
Also, made a pull request, so that everything compiles neatly (at least for Android development) without warnings.
The animation works just fine but in the logs it looks very bad. Don't know what to do. Can I leave It like that.
The following assertion was thrown while notifying status listeners for AnimationController:
Assertion failed: file:///Users/apatrck03/Developer/flutter/packages/flutter/lib/src/rendering/object.dart:2221:12
!_debugDisposed
is not true
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49 throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3 assertFailed
packages/flutter/src/rendering/object.dart 2221:13 markNeedsPaint
packages/local_hero/src/rendering/local_hero_layer.dart 34:7 [_onAnimationStatusChanged]
packages/flutter/src/animation/listener_helpers.dart 233:27 notifyStatusListeners
packages/flutter/src/animation/animation_controller.dart 814:7 [_checkStatusChanged]
packages/flutter/src/animation/animation_controller.dart 367:5 set value
packages/local_hero/src/rendering/controller.dart 55:19 [_onAnimationStatusChanged]
packages/flutter/src/animation/listener_helpers.dart 233:27 notifyStatusListeners
packages/flutter/src/animation/animation_controller.dart 814:7 [_checkStatusChanged]
packages/flutter/src/animation/animation_controller.dart 830:5 [_tick]
packages/flutter/src/scheduler/ticker.dart 238:12 [_tick]
packages/flutter/src/scheduler/binding.dart 1143:15 [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1056:106 <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/linked_hash_map.dart 21:13 forEach
packages/flutter/src/scheduler/binding.dart 1054:16 handleBeginFrame
packages/flutter/src/scheduler/binding.dart 975:5 [_handleBeginFrame]
lib/_engine/engine/platform_dispatcher.dart 1018:13 invoke1
lib/_engine/engine/platform_dispatcher.dart 136:5 invokeOnBeginFrame
lib/_engine/engine.dart 431:45 <fn>
The AnimationController notifying status listeners was: AnimationController#2c63e(โฎ 0.000; paused)
Hi!
I got a strange behavior on real devices Android versions 9, 10.
Flutter 3.3.3 and higher.
Object motion animation is missing.
On emulators everything is fine.
On Ios everything is fine.
On a real device Android version 13 all is good.
I have attached a video with an example of the problem.
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.