'Remove space around an image flutter
Hello im making an app where I have an image from the camera with a send button. Around the image is much space and if the image's height is less than the send button isnt at the bottom anymore. I need the image vertically centered and a maximun width. The Message container should be on the bottom. Thanks for your help.
This is the code of my app:
return Scaffold(
resizeToAvoidBottomInset: false,
body: Stack(
alignment: Alignment.bottomCenter,
children: [
Image.file(widget.image,),
Container(
child: Row(
children: [
Expanded(
child: Container(
margin: EdgeInsets.all(3),
height: 50,
child: TextField(
controller: _writeMessageTextEditingController,
style: TextStyle(
color: Colors.white),
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 15, top: 15,),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(300),
borderSide: BorderSide(
width: 0,
style:
BorderStyle.none,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(300),
borderSide: BorderSide(
width: 0,
style: BorderStyle.none,
),
),
filled: true,
hintStyle: TextStyle( color: Colors.grey, ),
hintText: "Message",
fillColor: Colors.grey[800],
),
),
),
),
Container(
margin: EdgeInsets.all(3),
height: 50,
width: 50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xff0077b6),
),
padding: EdgeInsets.all(8),
child: GestureDetector(
child: Icon(
Icons.send,
color: Colors.white,
),
onTap: (){
String message = _writeMessageTextEditingController.text.toString();
File file = widget.image;
print(file);
print(message);
_writeMessageTextEditingController.clear();
Navigator.pop(context);
//send message to server
},
),
),
],
),
),
],
),
);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
