'Why my bottom sheet has an awkward white space at the top? Flutter
I am trying to make my ListView of items inside my bottom sheet scrollable. I make it work with DraggableScrollableSheet widget but there's this awkward white space. Can someone review my code and tell me what's wrong?
onPressed: () {
showModalBottomSheet(
isDismissible: true,
isScrollControlled: true,
context: context,
shape: const RoundedRectangleBorder(
borderRadius: const BorderRadius.vertical(
top: Radius.circular(20),
)),
builder: (context) => DraggableScrollableSheet(
initialChildSize: 0.7,
minChildSize: 0.2,
maxChildSize: 0.75,
builder: (_, controller) => Container(
padding: const EdgeInsets.all(16),
child: ListView(
children: [
Image.network(
imageURl,
loadingBuilder: (context, child, loadingProgress) {
if (loadingProgress == null) return child;
return const CircularProgressIndicator();
},
errorBuilder: (context, error, stackTrace) =>
Text(errorMessage),
),
ListTile(
title: Text(
information1,
textAlign: TextAlign.justify,
),
),
ListTile(
title: Text(
information2,
textAlign: TextAlign.justify,
),
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
child: CupertinoButton.filled(
padding: EdgeInsets.all(15),
child: Text(information3),
onPressed: () async {
if (await canLaunch(linkURl)) {
await launch(
linkURl,
universalLinksOnly: true,
);
} else {
throw 'There was a problem to open the url.';
}
},
),
),
),
],
),
),
),
);
},
As you can seen in the above video, there is an awkward white space on top of the image. What's causing it and how do I get rid of it?
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|