flutter - Uber category selection animation - Stack Overflow
I am developing Uber like app using flutter and I want to achieve the animation of widgets when a category of ride is selected like the image below.
My code:
Widget rideOption(RideOption ride, bool isSelected) {
return AnimatedContainer(
height: 150,
duration: Duration(milliseconds: 500),
curve: Curves.easeInOut,
margin: EdgeInsets.symmetric(vertical: 8),
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: isSelected ? Colors.white : Colors.grey[200],
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: isSelected ? Colors.black : Colors.grey[300]!,
width: 2,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: isSelected ? 16 : 0),
if (!isSelected)
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AnimatedAlign(
duration: Duration(milliseconds: 500),
curve: Curves.easeInOut,
alignment: isSelected ? Alignment.topCenter : Alignment.centerLeft,
child: Image.asset(
ride.imagePath,
height: 60,
width: 60,
),
),
Text(
ride.title,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
Text(
ride.priceRange,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
],
)
else
Expanded(
child: Column(
children: [
AnimatedAlign(
duration: Duration(milliseconds: 500),
curve: Curves.easeInOut,
alignment: isSelected ? Alignment.topCenter : Alignment.centerLeft,
child: Image.asset(
ride.imagePath,
height: 60,
width: 60,
),
),
Row(
children: [
SizedBox(width: 16),
Text(
ride.title,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
Spacer(),
Text(
ride.priceRange,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
),
),
],
),
],
),
),
],
),
);
}
As you see i implemented this widget but the transition is immediately but i want it like Uber app smooth and sliding the car image from left bottom to top center
What I want:
最新文章
- 全球PC销量创五年新低 硬件式微应用崛起
- 传言成真:微软宣布以72亿美元收购诺基亚手机部门
- c++ - Why is my OpenGL application rendering a 3D model with unexpected transparency? - Stack Overflow
- python - How to define grammar for minimum 1 of foo and maximum 1 of bar - Stack Overflow
- java - Difficulty Embedding ICC Profile into PDF Using PDFBox, iText, and Ghostscrip - Stack Overflow
- r markdown - Rstudio custom traceback - Stack Overflow
- flutter - App Name Not Updating in Android Recent Apps View Despite Manifest and Strings Configuration - Stack Overflow
- How to import a svelte.ts component from another app where the import is with $lib - Stack Overflow
- javascript - How can you use a React hook conditionally in a function component - Stack Overflow
- c# - I have a time clock connected to my local network and I have a Windows server on localweb and I can't get the clock
- python - hydra submitit launcher plugin fails to import modules that can be imported normally when omitting the plugin - Stack O
- How to find kafka broker username and password - Stack Overflow
- python - Pyinstaller (Mac App) - Why only permission given to the executable file (instead of .app bundle) could work? - Stack O
- laravel - Customizing Fortify for Multi-Tenant Password Resets Tokens with Domain-Specific Tokens - Stack Overflow
- java - How to configure asynchronous processors with StepBuilder in Spring batch v5.2 - Stack Overflow
- python - ReCaptcha v3 works locally but not in deployment - Stack Overflow
- excel - Are there any advantages to use `Application.Match` on a VBA array instead of looping over it when you only care if an e