For questions relating to Flutter's Container class. Use this tag in combination with the general [flutter] tag. If your question applies to Flutter more generally, use the [flutter] tag only.
Questions tagged [flutter-container]
107 questions
2
votes
3 answers
I want to change the color of CustomListTile which is child of ListView when onTap is clicked, and setting other children color into default one?
In a Drawer, in listview want to change the color of CustomListTile when the onTap is clicked and setting color of all other children to default?
class CustomListTile extends StatelessWidget {
final Color itemContainerColor;
const…

Aakash Solanki
- 565
- 1
- 6
- 18
1
vote
2 answers
How to make part of circle at background color in Flutter
Like below
I used BoxDecoration in Container Widget.
But I have not created
Container(
height: 100,
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: const BorderRadius.vertical(
bottom: Radius.circular(100),
),
…

sukekyo000
- 35
- 3
1
vote
1 answer
Another exception was thrown: Unexpected null value. Flutter
Here is my code:
class ListItems extends StatelessWidget {
final String child; const ListItems({super.key, required this.child});
@override Widget build(BuildContext context) { return Sizer(builder: ((context, orientation, deviceType) { return…

Zeher
- 15
- 4
1
vote
2 answers
How to add only Border shadow of a cointainer in flutter?
I have a container with a lighter background color (light green with opacity of 50%) and the container shadow color is dark black (opacity 100%). Because of darker shadow color my container color got disrupt.
Means my shadow color is much darker…

Ahmed Noman
- 37
- 5
1
vote
1 answer
How to set Container Background image as Image.file() form XFile source in flutter
I am using this function to get images from the gallery
_getFromGallery() async {
XFile? pickedFileGal = await ImagePicker().pickImage(
source: ImageSource.gallery,
maxWidth: 1800,
maxHeight: 1800,
);
if (pickedFileGal…

Abubakar
- 97
- 8
1
vote
1 answer
How can stretch height of one of child widget according to another widget in a row?
I wanted to get same dynamic height of right widget to left widget in Row Widget.Below I was attaching screenshot of my expected design. Could you help how can do that.
We can see right side date widget is expanding , So I wanted to get the height…

shanmkha
- 416
- 1
- 8
- 27
1
vote
1 answer
Variable size of container in flutter? Either width or height
I am currently developing my first flutter-application and I need some help with my onboarding screen.
The top part has a Lottiefile asset in a container. The bottom part has some Buttons.
Is it possible to set the size of the container with the…

Jeremy Brehe
- 117
- 1
- 12
1
vote
1 answer
Adding Shadow To Semi Transparent Container
I am trying to add shadow to my semi-transparent container in flutter but as you might guess shadow can be seen through the container and I cannot achieve what I want.
I tried nearly all solutions suggested at StackOverflow or Google but they…

bahadir arslan
- 4,535
- 7
- 44
- 82
1
vote
2 answers
How to stop selecting multiple containers in flutter?
Hi folks I am new to flutter and trying to design a horizontal time picker using list builder but am unable to select only one container it allowing me to select multiple containers but I want only one to select, below I attached code please help to…

shanmkha
- 416
- 1
- 8
- 27
1
vote
1 answer
Since the Listview.builder widget in flutter requires a height, some fixed heights I give to the container wrapping the widget causes to overflow
Code
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('Search Families'),
centerTitle: true,
),
backgroundColor:…

gfit21x
- 141
- 9
1
vote
1 answer
Make a Row child as wide as possible (the remaining width of the parent) in Flutter?
I have a widget that I want to display while I'm downloading some data from a REST API. It will be used by a FutureBuilder when the Future isn't completed yet.
It should display a grey square and a grey line.
Something similar to what Facebook…

nbneo
- 63
- 5
1
vote
2 answers
Show a different widget when the bool value is true and false in Flutter
Problem: While I was implementing REST API, I came across some conditional displays of widgets.
So the API response back with a bool value. Now if the bool value is false then I want to show a TextField Widget in the UI else Just a Text Widget.
Now…

Pratyay Sinha
- 511
- 1
- 6
- 16
1
vote
1 answer
How to make a Container fit to the Text length
I have a Container with maximum width and I dont want to have additional free space after words. It works fine with small words like
this .
But with long words i have additional free space and my line looks
like that . What can I do?
Here is my…

Valentyna P
- 89
- 7
1
vote
1 answer
Container inside Row and Row inside Container
In a flutter app, what is the difference between a Container inside a Row and a Row inside Container?
In flutter in each time I want to make an app, I took minutes to ask my self
which one should I choose?

SH EB
- 61
- 8
1
vote
2 answers
How to dynamically change container size based on text inside?
I'm displaying a list of Animated Containers which originally has a certain maxLines of text. When the user clicks on the container, I want the container to expand to perfectly fit the entire text
Here's my simplified code:
AnimatedContainer(
…

zinbrox
- 103
- 1
- 7