I have 2 containers I need to round 1 container from mid-bottom and other from mid-top so it will create a circle between 2 containers so I can add Text here. Can anyone please tell how it's possible
body: Container(
child: Column(
children: <Widget>[
SizedBox(height: (MediaQuery.of(context).size.height -
appBar.preferredSize.height - MediaQuery.of(context).padding.top) *
0.05,
),
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.red,
height: (MediaQuery.of(context).size.height -
appBar.preferredSize.height - MediaQuery.of(context).padding.top) *
0.40,
child: Column(
children: <Widget>[
Text('10%'),
Text('Say goodbye')
],
),
),
),
Container(
height: (MediaQuery.of(context).size.height -
appBar.preferredSize.height - MediaQuery.of(context).padding.top) *
0.1,
child: Text('OR'),
),
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
height: (MediaQuery.of(context).size.height -
appBar.preferredSize.height - MediaQuery.of(context).padding.top) *
0.40,
color: Colors.blue,
child: Column(
children: <Widget>[
Text('10%'),
Text('Say goodbye')
],
),
),
),
SizedBox(height: (MediaQuery.of(context).size.height -
appBar.preferredSize.height - MediaQuery.of(context).padding.top) *
0.05,
),
],
),
),
Like this
You can round a container by using a BoxDecoration and applying a BoxShape.circle to it:
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
AppBar appBar = AppBar(
title: Text('Demo'),
);
double stackHeight = MediaQuery.of(context).size.height - 105;
double stackWidth = MediaQuery.of(context).size.width;
return Scaffold(
appBar: appBar,
body: Stack(
children: [
Container(
height: stackHeight * 0.5,
width: stackWidth,
color: Colors.blue,
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
height: stackHeight * 0.5,
width: stackWidth,
color: Colors.red,
),
),
Align(
alignment: Alignment.center,
child: Container(
width: stackWidth,
height: stackHeight * 0.015,
color: Colors.black,
),
),
Align(
alignment: Alignment.center,
child: Container(
width: stackWidth,
height: stackHeight * 0.15,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black,
),
child: Align(
alignment: Alignment.center,
child: Text(
"OR",
style: TextStyle(color: Colors.white),
),
)
),
),
],
)
);
}
This produced the following screen:
you can use Stack Widget to place widgets
here is exactly what you need
body: Stack(
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height,
color: Colors.amber,
child: Column(
children: <Widget>[
Container(
height: MediaQuery.of(context).size.height * 0.48,
color: Colors.blue,
),
Container(
height: MediaQuery.of(context).size.height * 0.04,
color: Colors.black,
),
Container(
height: MediaQuery.of(context).size.height * 0.48,
color: Colors.red,
)
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.20,
width: MediaQuery.of(context).size.width * 0.20,
decoration: BoxDecoration(
color: Colors.black, shape: BoxShape.circle),
),
),
],
),
Center(
child: Text(
"QR",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0),
),
)
],
),
Hope it will help
As told before the solution may be the Stack Widget. Below a possible solution.
You can change the color of the middle part with the same color of the background in order to obtain the desired effect.
Stack(
alignment: Alignment.center,
children: <Widget>[
Column(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.blue,
height: 200),
Container(
width: MediaQuery.of(context).size.width * 0.9,
height: 20,
color: Colors.black),
Container(
width: MediaQuery.of(context).size.width * 0.9,
color: Colors.red,
height: 200),
]),
Container(
width: 100,
height: 100,
decoration: BoxDecoration(
color: Colors.black,shape: BoxShape.circle),
child: Center(child: Text("or")),
),
],
);
Related
This is my code. Help me with this:
return SafeArea(
child: Container(
width: size.width,
height: size.height,
color: background,
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
width: size.width,
height: size.height * 0.1,
child: Padding(
padding: EdgeInsets.zero,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
],
),
),
),
Container(
width: size.width,
height: size.height * 0.25,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
width: size.width * 0.25,
height: size.height * 0.25,
decoration: new BoxDecoration(
color: buttonBackground,
borderRadius: new BorderRadius.all(
Radius.circular(40.0),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
Icons.keyboard_arrow_left,
color: iconButton,
size: 38,
),
Text(
"L&R",
style: TextStyle(
fontWeight: FontWeight.bold,
color: text,
fontSize: 24,
),
),
Icon(
Icons.keyboard_arrow_right,
color: iconButton,
size: 38,
),
],
),
),
Container(
padding: EdgeInsets.zero,
width: size.width * 0.1,
height: size.width * 0.1,
decoration: new BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.topLeft,
end: Alignment.topRight,
colors: [
Colors.blue,
Colors.pink,
],
),
shape: BoxShape.circle,
),
child: Container(
padding: EdgeInsets.zero,
width: size.width * 0.4,
height: size.width * 0.4,
decoration: new BoxDecoration(
color: background,
shape: BoxShape.circle,
),
),
),
Container(
width: size.width * 0.25,
height: size.height * 0.25,
decoration: new BoxDecoration(
color: buttonBackground,
borderRadius: new BorderRadius.all(
Radius.circular(40.0),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Icon(
Icons.keyboard_arrow_up,
color: iconButton,
size: 38,
),
Text(
"U & D",
style: TextStyle(
fontWeight: FontWeight.bold,
color: text,
fontSize: 24,
),
),
Icon(
Icons.keyboard_arrow_down,
color: iconButton,
size: 38,
),
],
),
),
],
),
),
Container(
width: size.width,
height: size.height*0.23,
),
],
),
),
),
),
);
Try below code hope its helpful to you.
Add your Column Widget inside SingleChildScrollView
SingleChildScrollView(
child:Column(
children:[
//Add your widgets here
],
),
),
I'm trying to reproduce the error, but I need your constants to do so. Can you add the constants.dart file to your question? Or at least the file where you specify size.width and size.height, for example?
That way I can run your code on my computer and see what I can do to help you.
For now, I'm thinking you should probably use Flex widget (https://api.flutter.dev/flutter/widgets/Flex-class.html) to fix this problem without making the app scroll, since that's not always what you want (thinking of a login page or something).
In my application, the flutter app is adding space between appbar and the body of the screen.
Following is the image of the screen:
Following is the code:
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: true,
title: Container(
height: MediaQuery.of(context).size.width * 0.13,
child: Text('Dashboard')),
centerTitle: true,
backgroundColor: kBluePrimaryColor,
elevation: 0,
),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.33,
child: Stack(children: [
Container(
//color: kBluePrimaryColor,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.23,
child: bannerimage == '' || bannerimage == null
? Image.asset('images/user.jpg')
: Image.network(
bannerimage),
),
Positioned(
top: MediaQuery.of(context).size.height * 0.16,
left: MediaQuery.of(context).size.width * 0.03,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.height * 0.14,
height: MediaQuery.of(context).size.height * 0.14,
decoration: ShapeDecoration(
shape: CircleBorder(), color: Colors.white),
child: Padding(
padding: EdgeInsets.all(8.0),
child: DecoratedBox(
decoration: ShapeDecoration(
shape: CircleBorder(),
image: DecorationImage(
fit: BoxFit.cover,
image: imageurl == '' || imageurl == null
? AssetImage('images/user.jpg')
: NetworkImage(imageurl),
)),
),
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.05,
),
],
),
),
Positioned(
top: MediaQuery.of(context).size.height * 0.24,
left: MediaQuery.of(context).size.height * 0.165,
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
color: kOrangePrimaryColor,
onPressed: () {
print('Contacts');
},
child: RichText(
text: TextSpan(
text: 'Total: ',
style:
TextStyle(color: Colors.white, fontSize: 12),
children: <TextSpan>[
TextSpan(
text: '30',
style: TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
fontFamily: 'Calibri')),
],
),
)),
SizedBox(
width: 13,
),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
),
color: kBluePrimaryColor,
onPressed: () {
print('Address');
},
child: RichText(
text: TextSpan(
text: 'ADDRESS',
style: TextStyle(
color: Colors.white,
fontSize: 10,
fontWeight: FontWeight.bold,
fontFamily: 'Calibri')),
))
],
)),
),
]),
),
],
),
),
);
}
I tried the various answers given but it wasn't working.
I want to remove the white space between the blue appbar and the image. Can someone help me with this please?
I think it is because the banner image is not filling the container
Try adding fit: BoxFit.cover to the image
You just need to wrap the Column(Which is inside SingleChildScrollView) with Container and give its height and width.
body: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Column(
...
)
)
)
Add a toolbar height to appbar and scrollview to body:
Scaffold(
appBar: AppBar(
toolbarHeight: 40,
.....
),
body:
SingleChildScrollView(...
I know I'm late but in case somebody needs this in the future here's the solution.
In the Scaffold widget set the property "extendBodyBehindAppBar" to "true"...
I am building a flutter application where I am trying to add a container and it's child text.
I want the container to take as much height as the text requires. But instead it takes the height specified.
Following is my code:
class ChangePassword extends StatefulWidget {
#override
_ChangePasswordState createState() =>
_ChangePasswordState();
}
class _ChangePasswordState extends State<ChangePassword> {
final GlobalKey<ScaffoldState> _scaffoldkey = new GlobalKey<ScaffoldState>();
#override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
key: _scaffoldkey,
drawer: Drawer(
child: ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
Container(
height: (MediaQuery.of(context).size.height * 0.23),
child: DrawerHeader(
child: Container(
padding:
EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: Row(
children: [
Container(
height: MediaQuery.of(context).size.width * 0.1,
width: MediaQuery.of(context).size.width * 0.1,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30),
color: Theme.of(context).primaryColor,
image: DecorationImage(
fit: BoxFit.fill,
image: NetworkImage(imageurl)),
boxShadow: [
BoxShadow(
blurRadius: 25,
color: Colors.black.withOpacity(0.2),
offset: Offset(0, 10),
)
],
),
),
Container(
height: MediaQuery.of(context).size.width * 0.15,
width: MediaQuery.of(context).size.width * 0.5,
padding: EdgeInsets.symmetric(horizontal: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: TextStyle(
fontSize: 15,
color: Colors.lightBlue[900],
fontWeight: FontWeight.bold),
),
Text(email),
SizedBox(
height: 2,
),
Row(
children: [
Icon(
Icons.remove_red_eye_outlined,
size: 12,
),
Text(
'View Profile',
style: TextStyle(
fontSize: 12,
),
)
],
)
],
),
),
],
)),
decoration: BoxDecoration(
color: Colors.white,
),
),
),
],
),
),
body: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.35,
child: Stack(children: [
Positioned(
height: MediaQuery.of(context).size.height * 0.23,
top: 0,
child: Padding(
padding: EdgeInsets.only(top: 50),
child: Container(
color: Color(0xff002060),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.1,
child: Align(
alignment: Alignment.topCenter,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
GestureDetector(
onTap: () {
_scaffoldkey.currentState.openDrawer();
},
child: new Container(
child: Icon(
Icons.menu,
color: Colors.white,
size: MediaQuery.of(context).size.height *
0.04,
),
padding: new EdgeInsets.all(7.0),
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.3,
),
Container(
height:
MediaQuery.of(context).size.height * 0.07,
child: Center(
child: Text(
'Profile',
style: TextStyle(
color: Colors.white,
),
),
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.3,
),
Icon(
Icons.search,
color: Colors.white,
size: MediaQuery.of(context).size.height * 0.04,
),
],
),
),
),
),
),
Positioned(
top: MediaQuery.of(context).size.height * 0.16,
left: MediaQuery.of(context).size.width * 0.03,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.height * 0.14,
height: MediaQuery.of(context).size.height * 0.14,
decoration: ShapeDecoration(
shape: CircleBorder(), color: Colors.white),
child: Padding(
padding: EdgeInsets.all(8.0),
child: DecoratedBox(
decoration: ShapeDecoration(
shape: CircleBorder(),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(
'https://thumbor.forbes.com/thumbor/fit-in/416x416/filters%3Aformat%28jpg%29/https%3A%2F%2Fspecials-images.forbesimg.com%2Fimageserve%2F5f4ebe0c87612dab4f12a597%2F0x0.jpg%3Fbackground%3D000000%26cropX1%3D292%26cropX2%3D3684%26cropY1%3D592%26cropY2%3D3987',
))),
),
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.05,
),
Column(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.08,
child: Text(
'Bill Gates',
style: TextStyle(
fontSize: 25,
color: Colors.white,
fontWeight: FontWeight.bold,
fontFamily: 'Calibri'),
),
),
],
)
],
),
),
Positioned(
top: MediaQuery.of(context).size.height * 0.24,
left: MediaQuery.of(context).size.height * 0.165,
child: FittedBox(
fit: BoxFit.fill,
child: Container(
height: MediaQuery.of(context).size.height * 0.09,
width: MediaQuery.of(context).size.width * 0.6,
child: Text(
'Bill Gates welcomes you. Welcome to Microsoft. It gives me immense pleasure to announce Josh Hazlewood as it\'s new CEO. It is always immense pleasure to work with them. looking foward to have a great time with him.',
style: TextStyle(
color: Colors.black, fontFamily: 'Calibri'),
),
),
),
),
]),
),
],
)),
],
),
));
}
Following is the image:
I want the container that contains the text below 'Bill Gates' to be wrapped according to the information entered there.
The whole container should decrease as I am planning to add widgets below this customised appbar, so is there any way I can achieve this?
I tried to use flexible but it did not work. Can someone help me with this please?
Use fitted box:-
FittedBox(
fit:BoxFit.fitHeight,
child:Text("Your text"),
),
Do not provide the height of the container and it will adjust automatically.
#Ankit,
Culprit:
As you mentioned, the Container widget is intended to take the width and height you explicitly specify, so it does what you tell it to do.
What you should have done in the above case is avoid specifying the height for that Container which contains the Text widget as follows.
Change this code section from:
Positioned(
top: MediaQuery.of(context).size.height * 0.24,
left: MediaQuery.of(context).size.height * 0.165,
child: FittedBox(
fit: BoxFit.fill,
child: Container(
height: MediaQuery.of(context).size.height * 0.09,
width: MediaQuery.of(context).size.width * 0.6,
child: Text(
'Bill Gates welcomes you. Welcome to Microsoft. It gives me immense pleasure to announce Josh Hazlewood as it\'s new CEO. It is always immense pleasure to work with them. looking foward to have a great time with him.',
style: TextStyle(
color: Colors.black, fontFamily: 'Calibri'),
),
),
),
),
To the following code, where I have removed specifying the height property of the container:
Positioned(
top: MediaQuery.of(context).size.height * 0.24,
left: MediaQuery.of(context).size.height * 0.165,
child: FittedBox(
fit: BoxFit.height,
child: Container(
width: MediaQuery.of(context).size.width * 0.6,
child: Text(
'Bill Gates welcomes you. Welcome to Microsoft. It gives me immense pleasure to announce Josh Hazlewood as it\'s new CEO. It is always immense pleasure to work with them. looking foward to have a great time with him.',
style: TextStyle(
color: Colors.black, fontFamily: 'Calibri'),
),
),
),
),
By doing that, and wrapping the Container within a FittedBox, that varying text length Text widget will cause it to adjust its height accordingly.
Following part is important here:
child: FittedBox(
fit: BoxFit.height,
I have tried to achieve the effect shown in the highlighted portion of the image with the following code, but this produces counter-intuitive and wrong results.
Just to avoid confusion, I am talking about the effect of the middle of the smaller containers being aligned with the bottom of the large orange-ish container
My code is as follows:
Size size = MediaQuery.of(context).size;
double height = size.height;
double width = size.width;
return Column(
children: [
Expanded(
flex: 3,
child: Container(color: Colors.white),
),
Positioned(
top: height * (3 / 5) - height * 0.15 / 2,
child: Container(
color: Colors.green,
height: height * 0.15,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: height * 0.15,
width: width * 0.45,
color: Colors.red,
),
Container(
height: height * 0.15,
width: width * 0.45,
color: Colors.blue,
)
],
),
),
),
Expanded(
flex: 5,
child: Container(color: Colors.black),
),
],
);
How can I improve upon my code?
You will need to use the Stack widget to achieve this result.
Stack(children: [
Container(
height: 230,
decoration: BoxDecoration(
color: Colors.orange,
)),
Column(children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(22))),
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(22))),
Container(
height: 100,
width: 100,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(22))),
]),
),
])
])
My banner is overlapping the slack widgets i need to show the ad on bottom or footer but problem is its overlapping the container need to know how can i add in end but not overlap the containers
Here is my code
body: Stack(
children: [
GestureDetector(
onTap: () {
percengtageTrigger();
API.voteplusQuestion(snapshot.data[index], 0);
},
child: Container(
height: stackHeight * 0.5,
width: stackWidth,
color: Color(0xffF9D342),
child: Column(
children: <Widget>[
shouldShow
? Container(
padding: const EdgeInsets.only(
top: 10, right: 10),
height: stackHeight * 0.1,
color: Color(0xffF9D342),
width: double.infinity,
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.end,
children: <Widget>[
Text(
'${percentage1.toStringAsFixed(0)}%',
style: TextStyle(
color: Colors.white,
fontSize: 23,
fontFamily: 'NewsCycle',
),
),
],
))
: Container(
height: stackHeight * 0.1,
color: Color(0xffF9D342),
width: double.infinity,
),
Container(
color: Color(0xffF9D342),
height: stackHeight * 0.4,
width: double.infinity,
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 20),
child: Text(
snapshot.data[index].would,
style: TextStyle(
color: Color(0xff292826),
fontSize: 23,
fontWeight: FontWeight.bold,
fontFamily: 'NewsCycle',
),
),
),
],
)),
],
),
),
),
GestureDetector(
onTap: () {
percengtageTrigger();
API.voteplusQuestion(snapshot.data[index], 1);
},
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
height: stackHeight * 0.5,
width: stackWidth,
color: Color(0xff292826),
child: Column(
children: <Widget>[
shouldShow
? Container(
padding: const EdgeInsets.only(
top: 10, right: 10),
height: stackHeight * 0.1,
color: Color(0xff292826),
width: double.infinity,
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment:
CrossAxisAlignment.end,
children: <Widget>[
Text(
'${percentage2.toStringAsFixed(0)}%',
style: TextStyle(
color: Colors.white,
fontSize: 23,
fontFamily: 'NewsCycle',
),
),
],
))
: Container(
height: stackHeight * 0.1,
color: Color(0xff292826),
width: double.infinity,
),
Container(
color: Color(0xff292826),
height: stackHeight * 0.4,
width: double.infinity,
child: Column(
children: <Widget>[
Padding(
padding:
const EdgeInsets.only(top: 40),
child: Text(
snapshot.data[index].rather,
style: TextStyle(
color: Color(0xffF9D342),
fontSize: 23,
fontWeight: FontWeight.bold,
fontFamily: 'NewsCycle',
),
),
),
],
)),
],
),
),
),
),
Align(
alignment: Alignment.center,
child: Container(
width: stackWidth,
height: stackHeight * 0.015,
color: Colors.white,
),
),
Align(
alignment: Alignment.center,
child: Container(
width: stackWidth,
height: stackHeight * 0.15,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.white,
),
child: Align(
alignment: Alignment.center,
child: GestureDetector(
onTap: () {
nextQuestion();
},
child: Text(
"SKIP",
style: TextStyle(
color: Colors.black,
fontFamily: 'FredokaOne',
fontSize: 27),
),
),
)),
),
Align(
alignment: Alignment.bottomCenter,
child: Container(
child: AdmobBanner(
adUnitId: getBannerAdUnitId(),
adSize: bannerSize,
),
),
),
],
));
As you see in the image it's overlapping the grey container I need a yellow and grey containers in same size but on top of banner no with overlap with banner.
If your content will be scrollable in the future, then I suggest you stick with the floating ad and maybe add a wide grey background to cover some space as I've seen some apps do.
Otherwise, assign it to a small row at the bottom (And assign the rest of the elements to rows as needed). The ad will take up a lot of space though so be sure to adjust the other elements accordingly.
Since you are using stack the children in the stack will overlap. If don't want them to overlap you can use other layout widgets such as Column or ListView according to your need. You can refer to flutter docs for more info on layout widgets.