You can achieve this by using a combination of widgets such as Row
, Expanded
, SizedBox
, and IntrinsicWidth
.
Here's an example:
Row(
children: [
// Your first widget here
Expanded(
child: SizedBox(), // Use a SizedBox to insert space between widgets
),
IntrinsicWidth(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start, // Align children to the top
children: [
// Your non-Text widget here
],
),
),
],
)
By wrapping the non-Text widget in an IntrinsicWidth
widget, you ensure that it takes up the minimum amount of width required to display its contents. The Expanded
widget at the beginning of the Row
then takes up all the remaining space and pushes the IntrinsicWidth
to start from the left. The SizedBox
inside Expanded
is used to insert a space between widgets. Finally, the crossAxisAlignment
property is set to CrossAxisAlignment.start
to ensure that the non-Text widget aligns to the top of the row.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-07-31 11:00:00 +0000
Seen: 9 times
Last updated: Feb 16 '23
How can one ensure that sub-classes have uniform method parameters in TypeScript?
How can the calculation of matrix determinant be performed using CUDA?
How can code repetition be prevented when using (box)plot functions?
What steps can I take to prevent my webpage from slowing down when all parts of a div are displayed?
How can circles be detected in openCV?
What is the method to determine the most precise categorization of data using Self Organizing Map?