Reputation: 138
I'm developing a File Manager app in Flutter, and I want to implement a feature where the user can have multiple tabs open in the app (like Chrome tabs or Tabs in ES File Explorer). For the transition animation I'm chosing to implement a scaling animation, where I scale down the current tab to reveal other open tabs in the background. To achieve this I'm using a ListView to hold the tabs and a Tansform.scale to scale down the tabs. But I'm getting an unexpected result. The pictures below show my expected vs actual result: (First one is the expected result, designed by me in Adobe XD, and the second one is the result I get)
After reading online, I learn that Transform.scale, scales it's child after laying it out, so the boundary of the page remain same even after scaling and thus, I get the 2nd result. So is there a widget that can scale it's child before laying it out, so that I get the result I want?
Upvotes: 0
Views: 672
Reputation: 44220
Do you mean, is there a widget besides https://api.flutter.dev/flutter/widgets/FittedBox-class.html to do what you want? :)
Or if that's not precisely what you want, look at its source and borrow the ideas. A few pretty good things come together in a FittedBox.
Upvotes: 2