Flutter layout: placing a widget only half in a row - flutter

I want to layout two widgets in a Row where the first widget is simply centered (more or less) but the second widget should be rendered only half. I made this simple illustration with two containers (C1 and C2) where I want C2 to be displayed on the right but only the left part of it should be visible. The right part should be hidden. I experimented a lot with ClipRect and OverFlowBox but I seem to not be able to find a working solution.

You can do that with the positioned widget. In this video, you can check how it works! https://www.youtube.com/watch?v=EgtPleVwxBQ

Related

How to use SizeTransition with Text inside a Row without overflows

Problem summary
I'm building simple animation in which, simply, a panel expands to the right on a onTap event. The layout can be summarized as follows:
The panel has many tiles. Each tile has its own:
leading icon
title text
trailing icon
Each tile, when expanded, shows the three widgets above
Each tile, when shrinked, just shows the leading icon
The panel is scrollable to hold many icons such as these
At the end of the panel there's a simple icon which, when tapped, triggers the "expand" or "shrink" animation
The animation is built with an AnimatedContainer on the panel and a SizeTransition on the single tiles (via one single controller on the parent class)
The problem is simple: when the tiles shrink, their inner text overflows in the row.
Sample code
I just made this reproducible example on DartPad.
The obvious solution isn't helping me out
The most obvious solution is to simply wrap the Text inside a Flexible Widget: this advised by Flutter's docs and it makes sense, but unluckily it completely breaks my Layout.
Flexible introduces a flex factor that in this context is 100% unwanted.
I want my leading icons to be always at the end of the row, so my Spacer widget should "prevail" there.
I can't just play with flex factors there, as it would unintendedly hide text depending on its value.
Another code smell
Another thing I really don't like is the fact that I have to build a controller on the parent class, but I'm not actually using it on the parent class (I'm just exploiting it so I can give it to the children).
I'm new to animations in Flutter so I'm kinda confused on how I should orchestrate the whole thing here.
Any help will be appreciated / upvoted / accepted. Thank you!
As far as I understood you in a right way you just need set sizes for Row inside of SizeTransition instead of Container sizes
Here is your modified sample https://dartpad.dev/?id=a2408d29a1e8c6ce7a1cef8f21e7491d
I'd try an OverflowBox or a FittedBox (wrapping your text), depending on the result you want to achieve.

How to center and manipulate the size of a ListView?

I can't change the ListView's position, I would like it to be more in the center. I'll put it on another screen, this is just a test.
I want to put multiple item names inside a ListView on the same screen without overflowing the screen space.
I've read your questions, and based on what I understood.
You want to make your ListView in the middle of the screen Right!!
To do that, you simply have to wrap your Listview in a Center Widget as a child of your container (Pretty easy :) )

How to remove visual gap between Positioned Widgets in Stack

Even though there is absolutely no gap between my positioned widgets there is a glitchy visual gap between them. I have my Stack in an InteractiveViewer and when I zoom in and out and move about they become randomly more or less visible.
This happens with any Positioned widgets in a Stack so I've not provided any specific code of mine.
This ui looks like there is nothing that's being stacked. If you are using positioned widget then the value given maybe a problem. For this layout you can try adding all images ina column

Is building one large better than building small ~75-100 widgets

Consider the case that I have 3 adjacent list view with each list view having a sized widget of some height. Each list view has around 24 child items. I'm trying to scale the widget using onScaleUpdate in GestureDetector.
onScaleUpdate I want to change the height of each child item of all the 3 listviews.
Is rebuilding all child better or should I rebuild the whole widget?
As #Yeasin Sheikh pointed out, using ListView.builder is good because it builds only the needed children (the ones inside the screen and just a few ones outside as precaution). And as to actually answering your question, I'm no Flutter expert, but using ListView.builder I don't think it makes that much difference, Flutter is intelligent enough to solve this by itself.

Is there a way to make scrollPhysics to be the same as in ListView for Column widget?

The reason I'm asking is because I don't want to have a ListView I have a Column which fits me perfectly however the inability to scroll makes my app look irresponsive. How could I add my Column a more fluid scrollPhysics please?
I know that Column gets 100% of height of the screen and that's perfectly fine I just want to give it a responsive feel.
Warp the Column with SingleChildScrollView so that the Column will be scrollable, and you can specify the scroll scrollPhysics.