ListView showing Blank screen in flutter - flutter

I want a Background image and above that image some content will be there that should be vertically scrollable so that it should not get outside the image.
THe code is shown below
I am using the satck and one child is Image and the other is listview to acheive this but still not able to find the correct solution..
ListView(
children: <Widget>[
new Stack(
children: <Widget>[
Container(
child: background.Row3
),
Stack(
children: <Widget>[
Center(child: SvgPicture.asset('assets/Receipt.svg',height: 350,width: 200,),),/*************this is the main background image****************/
Padding(padding: EdgeInsets.only(top:100),
child: Column(
mainAxisAlignment:MainAxisAlignment.spaceAround,
children: <Widget>[
ListView(
padding: const EdgeInsets.all(8),
children: <Widget>[ /********text above background image *******************/
Center(
child:Text('Beneficiary Details',style: TextStyle(fontSize: 14,color: Colors.black),)
),
Center(
child:Text('Sushita sen',style: TextStyle(fontSize: 12,color: Colors.grey),)
),
Center(
child:Text('Reference Number',style: TextStyle(fontSize: 14,color: Colors.black),)
),
Center(
child:Text('73YHNUWD6EW7R34Y78HSDIF',style: TextStyle(fontSize: 12,color: Colors.grey),)
),
Center(
child:Text('73YHNUWD6EW7R34Y78HSDIF',style: TextStyle(fontSize: 12,color: Colors.grey),)
,),
Center(
child:Text('73YHNUWD6EW7R34Y78HSDIF',style: TextStyle(fontSize: 12,color: Colors.grey),)
,),
Center(
child:Text('73YHNUWD6EW7R34Y78HSDIF',style: TextStyle(fontSize: 12,color: Colors.grey),)
,),
Center(
child:Text('73YHNUWD6EW7R34Y78HSDIF',style: TextStyle(fontSize: 12,color: Colors.grey),)
,),
Center(
child:Text('73YHNUWD6EW7R34Y78HSDIF',style: TextStyle(fontSize: 12,color: Colors.grey),)
,),
Center(
child:Text('73YHNUWD6EW7R34Y78HSDIF',style: TextStyle(fontSize: 12,color: Colors.grey),)
,),
],
)
],
)
,)
],
)
],
)
]
),
),
),
],
),
);
}
}

#kriti sharma for background image inside the Stack widget kindly use Positoned widget on top of the Stack widget.
example:-
children: <Widget>[
Positioned(
top: 0,
right: 0,
child: Image.asset(
"assets/icons/categories/map.jpg",
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
),
),
// _buildGoogleMap(context),
// _zoomminusfunction(),
// _zoomplusfunction(),
// _buildContainer(),
],
),

Actually it not black screen you got error like,
Exception caught by rendering library
The following
assertion was thrown during performResize():
Vertical viewport was given unbounded height.
I just added scrollDirection and shrinkWrap in you list.
ListView(
scrollDirection: Axis.vertical,
shrinkWrap: true,
Your whole code
home: ListView(children: <Widget>[
new Stack(
children: <Widget>[
Container(child: Text("Hello")),
Stack(
children: <Widget>[
Container(
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.blue,
image: DecorationImage(
image: new NetworkImage(
"https://thumbs.dreamstime.com/b/funny-face-baby-27701492.jpg"),
fit: BoxFit.fill)),
),
/*************this is the main background image****************/
Padding(
padding: EdgeInsets.only(top: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
ListView(
scrollDirection: Axis.vertical,
shrinkWrap: true,
padding: const EdgeInsets.all(8),
children: <Widget>[
Center(
child: Text(
'Beneficiary Details',
style:
TextStyle(fontSize: 14, color: Colors.black),
)),
Center(
child: Text(
'Sushita sen',
style:
TextStyle(fontSize: 12, color: Colors.grey),
)),
Center(
child: Text(
'Reference Number',
style:
TextStyle(fontSize: 14, color: Colors.black),
)),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
)),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
],
)
],
),
)
],
)
],
)
]),
);

I correct it by placing ListView inside container
home: ListView(children: <Widget>[
new Stack(
children: <Widget>[
Container(child: Text("Hello")),
Stack(
children: <Widget>[
Container(
height: 100,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: Colors.blue,
image: DecorationImage(
image: new NetworkImage(
"https://thumbs.dreamstime.com/b/funny-face-baby-27701492.jpg"),
fit: BoxFit.fill)),
),
/*************this is the main background image****************/
Padding(
padding: EdgeInsets.only(top: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Conatiner( /************This container will wrap the listview and will make it scrollable also *******/
height:200,
child: ListView(
scrollDirection: Axis.vertical,
shrinkWrap: true,
padding: const EdgeInsets.all(8),
children: <Widget>[
Center(
child: Text(
'Beneficiary Details',
style:
TextStyle(fontSize: 14, color: Colors.black),
)),
Center(
child: Text(
'Sushita sen',
style:
TextStyle(fontSize: 12, color: Colors.grey),
)),
Center(
child: Text(
'Reference Number',
style:
TextStyle(fontSize: 14, color: Colors.black),
)),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
)),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
Center(
child: Text(
'73YHNUWD6EW7R34Y78HSDIF',
style:
TextStyle(fontSize: 12, color: Colors.grey),
),
),
],
)
)
],
),
)
],
)
],
)
]),
);

Related

Add buttons below the body

The code below (I shortened the code for simplicity) displays the characteristics of the device. I placed all the characteristics in the body and displayed them in a certain way. Tell me how I can make two buttons (marked in red in the photo) under the body. Or put them in the body? tell me the best way to do it.
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
),
body: Align(
alignment: Alignment.topCenter,
child: Container(
constraints: const BoxConstraints(maxWidth: 800, maxHeight: 400),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(5.0),),
child: SingleChildScrollView(
child: Card(
child: Column(
children: [
ListTile(
title: const Text('Brand:', style: TextStyle(fontWeight: FontWeight.w400, fontSize: 25)),
trailing: Text('${device.brand} ', style: const TextStyle(fontWeight: FontWeight.w400, fontSize: 20 ))),
const Divider(color: Colors.black, endIndent: 10, indent: 10),
ListTile(
title: const Text('Operation system:', style: TextStyle(fontWeight: FontWeight.w400, fontSize: 25)),
trailing: Text('${device.operation_system} ', style: const TextStyle(fontWeight: FontWeight.w400, fontSize: 20 ))),
],
),
),
)
),
));
You can use bottomNavigationBar on Scaffold
Scaffold(
bottomNavigationBar: Padding(
padding: const EdgeInsets.all(8.0), //the one you prefer
child: Row(
children: [
Expanded(
child: OutlinedButton(
onPressed: () {},
child: Text("NNNNNN"),
),
),
SizedBox(
//space between button
width: 16,
),
Expanded(
child: OutlinedButton(
onPressed: () {},
child: Text("NNNNNN"),
),
),
],
),
),
Also, you can wrap Container with Column widget
body: Column(
children: [
Container(...)//your widget
Padding(
padding: const EdgeInsets.all(8.0), //the one you prefer
child: Row(
children: [
Expanded(child: OutlinedButton(...)),
SizedBox(width:x),
Expanded(child: OutlinedButton(...)),
Full snippet on second approach
return Scaffold(
body: Column(
children: [
Container(
constraints: const BoxConstraints(maxWidth: 800, maxHeight: 400),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(5.0),
),
child: SingleChildScrollView(
child: Card(
child: Column(
children: [
ListTile(
title: const Text('Brand:',
style: TextStyle(
fontWeight: FontWeight.w400, fontSize: 25)),
trailing: Text('${device.brand} ',
style: const TextStyle(
fontWeight: FontWeight.w400, fontSize: 20))),
const Divider(
color: Colors.black, endIndent: 10, indent: 10),
ListTile(
title: const Text('Operation system:',
style: TextStyle(
fontWeight: FontWeight.w400, fontSize: 25)),
trailing: Text('${device.operation_system} ',
style: const TextStyle(
fontWeight: FontWeight.w400, fontSize: 20))),
],
),
),
)),
// Spacer(), /// you you want at the bottom
Padding(
padding: const EdgeInsets.all(8.0), //the one you prefer
child: Row(
children: [
Expanded(
child: OutlinedButton(
onPressed: () {},
child: Text("NNNNNN"),
),
),
SizedBox(
//space between button
width: 16,
),
Expanded(
child: OutlinedButton(
onPressed: () {},
child: Text("NNNNNN"),
),
),
],
),
)
],
),
);
You can check more about widgets, Column and layout.

Row with Expanded

I have 3 widgets in the row
GestureDetector(
onTap: () {},
child: Card(
margin: EdgeInsets.zero,
child: Padding(
padding: EdgeInsets.all(15),
child: Row(
children: <Widget>[
Text(
"Description",
style: TextStyle(fontSize: 15, color: Colors.orange),
),
Spacer(),
Expanded(
child: Text(
descriptionText,
style: TextStyle(fontSize: 15, color: const Color(0xff0000ff)),
),
),
Text(">", style: TextStyle(fontSize: 15, color: Colors.black))
],
),
),
),
)
The UI looked like this
How can I move the All beside > ? If the text is too long, I would like the Text displayed multi line, that why I use Expanded.
You can remove the Expanded, however if there's a need for that, you can use the textAlign property:
Expanded(
child: Text(
'All',
textAlign: TextAlign.right,
),
)
Full solution:
GestureDetector(
onTap: () {},
child: Card(
margin: EdgeInsets.zero,
child: Padding(
padding: EdgeInsets.all(15),
child: Row(
children: <Widget>[
Text(
"Description",
style: TextStyle(fontSize: 15, color: Colors.orange),
),
Spacer(),
Expanded(
child: Text(
descriptionText,
textAlign: TextAlign.right, // <-- You need this
style: TextStyle(fontSize: 15, color: const Color(0xff0000ff)),
),
),
Text(">", style: TextStyle(fontSize: 15, color: Colors.black))
],
),
),
),
)

Fit a column in expanded or container widget in Flutter

I am using innerDrawer in my profilePage. I put a column in scaffold and added widgets inside. One of these widgets is SignedContracts and this widget has an Expanded widget with a column inside. I want to fit or fill this column in expanded or container widget like second picture. I try lots of things but I did not find any solution.
Note: The red borders in the first picture to see the borders of the containers.
I made this:
But I want like this:
Scaffold part:
scaffold: Scaffold(
body: Container(
child: Column(
children: [
SizedBox(
height: 20,
),
Stack(
children: [
Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.red, width: 2),
),
child: Image.network(
"${firestoreDB.user.photoURL}",
width: 500,
height: 250,
fit: BoxFit.fill,
),
),
Positioned(
child: IconButton(
icon: Icon(Icons.menu),
onPressed: () {
_toggle();
},
),
),
Positioned(
child: Text(
"${_user.name}",
style: TextStyle(color: Colors.white, fontSize: 20.0),
),
bottom: 50,
left: 50,
),
Positioned(
child: Text(
"${_user.desc}",
style: TextStyle(color: Colors.white, fontSize: 15.0),
),
bottom: 30,
left: 50,
),
],
),
MiddleCounts(lastWeekListen, lastWeekStream,sL),
Row(),
SignedContracts(),
],
),
),
),
SignedContracts widget:
class SignedContracts extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Expanded(
child: Container(
decoration:
BoxDecoration(border: Border.all(color: Colors.red, width: 2)),
alignment: Alignment.centerLeft,
//height: 500,
padding: EdgeInsets.all(30),
//color: Colors.black,
child: Container(
decoration:
BoxDecoration(border: Border.all(color: Colors.red, width: 2)),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
"Signed Contracts",
style: TextStyle(color: Colors.white, fontSize: 30.0),
),
SizedBox(
height: 20,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
"Multiple Rights Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Sound Recording Licence",
style: TextStyle(color: Colors.grey),
),
Text(
"Merchandising Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Synchronisation Licence",
style: TextStyle(color: Colors.grey),
),
Text(
"Artist Development Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Management Agreement",
style: TextStyle(color: Colors.grey),
),
],
),
FlatButton(
onPressed: () {},
child: Text(
"Manage Contracts",
style: TextStyle(color: Colors.white),
),
color: Colors.red,
),
],
),
),
),
);
}
}
You can wrap your second Column in SignedContracts class with Expanded widget like code below:
class SignedContracts extends StatelessWidget {
#override
Widget build(BuildContext context) {
return Expanded(
child: Container(
decoration:
BoxDecoration(border: Border.all(color: Colors.red, width: 2)),
alignment: Alignment.centerLeft,
//height: 500,
padding: EdgeInsets.all(30),
//color: Colors.black,
child: Container(
decoration:
BoxDecoration(border: Border.all(color: Colors.red, width: 2)),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
children: [
Text(
"Signed Contracts",
style: TextStyle(color: Colors.white, fontSize: 30.0),
),
SizedBox(
height: 20,
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
"Multiple Rights Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Sound Recording Licence",
style: TextStyle(color: Colors.grey),
),
Text(
"Merchandising Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Synchronisation Licence",
style: TextStyle(color: Colors.grey),
),
Text(
"Artist Development Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Management Agreement",
style: TextStyle(color: Colors.grey),
),
],
),
),
FlatButton(
onPressed: () {},
child: Text(
"Manage Contracts",
style: TextStyle(color: Colors.white),
),
color: Colors.red,
),
],
),
),
),
);
}
}

Flutter text left alignment

I'm trying to align all the text to left. However, it's in the middle always as you can see the image below. I've tried using Align widget and setting textAlign property on Text widget to TextAlign.left but no luck.
card.dart
Row(
children: <Widget>[
Card(
elevation: 2,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(4)),
child: Image.network('https://loremflickr.com/100/100'),
),
),
Padding(
padding: const EdgeInsets.only(left: 8),
child: Column(
children: <Widget>[
Align(
alignment: Alignment.centerLeft,
child: Text(
'Marry Jane',
textAlign: TextAlign.left,
style: TextStyle(fontSize: 16),
),
),
Align(
alignment: Alignment.centerLeft,
child: Text(
'Make-up Artist',
textAlign: TextAlign.left,
style: TextStyle(fontSize: 14, color: Color(0xff666666)),
),
),
Row(
children: <Widget>[
Text(
'3.5',
textAlign: TextAlign.left,
style: TextStyle(fontSize: 18, color: Color(0xff666666)),
),
Icon(FontAwesomeIcons.starHalf)
],
)
],
),
)
],
),
Have you tried giving the Column CrossAxisAlignment.start?
Row(
children: <Widget>[
Card(
elevation: 2,
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(4)),
child: Image.network('https://loremflickr.com/100/100'),
),
),
Padding(
padding: const EdgeInsets.only(left: 8),
child: Column(
/// Add this
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Marry Jane',
style: TextStyle(fontSize: 16),
),
Text(
'Make-up Artist',
style: TextStyle(fontSize: 14, color: Color(0xff666666)),
),
Text(
'3.5',
style: TextStyle(fontSize: 18, color: Color(0xff666666)),
),
],
),
)
],
)

Flutter Dropdownbutton widget not opening

I've added a dropdownbutton widget to my view and when I top on the control, it doesn't open to display the available values.
I've even tried to use sample code and it's still not showing. This widget is within a SingleChildScrollView. I changed it to container to see if it was a scroll issue, but that didn't even work.
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: DropdownButton(
elevation: 2,
value: 'One',
onChanged: (val){
print(val);
},
hint: Text(
"Select the leach",
style: TextStyle(
color: Colors.black,
),
),
items: <String>['One', 'Two', 'Free', 'Four']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
})
.toList()
)
),
When clicking/tapping on the control, it should show up, but I'm not sure what I'm missing that would cause it to not show the values.
I'm not seeing any errors in the logs (at least the logs i'm familiar with)
UPDATED WITH MORE CODE:
SafeArea(
child: Scaffold(
appBar: AppBar(
title: Hero(
tag: widget.film.title + widget.film.number,
child: Material(
type: MaterialType.transparency,
child: Text(
widget.film.title,
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
fontFamily: Constant.fontRegular,
fontWeight: FontWeight.bold,
),
),
),
),
),
body:
Container(
//color: Colors.white,
height: MediaQuery.of(context).size.height,
child: SingleChildScrollView(
physics: new AlwaysScrollableScrollPhysics(),
controller: _controller,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Stack(
overflow: Overflow.visible,
children: <Widget>[
MeetNetworkImage(
fit: BoxFit.cover,
width: MediaQuery.of(context).size.width,
imageUrl: widget.film.backdrop != null ? "https://image.tmdb.org/t/p/w400/" + widget.film.backdrop : "",
loadingBuilder: (context) => Center(
child: CircularProgressIndicator(),
),
errorBuilder: (context, e) => Center(
child: FadeInImage(
fit: BoxFit.fitWidth,
width: MediaQuery.of(context).size.width,
image: AssetImage('assets/images/placeholder.png'),
placeholder:
AssetImage('assets/images/placeholder.png'),
),
),
),
Positioned(
left: MediaQuery.of(context).size.width-60,
top: 10,
child: Container(
height: 40.0,
width: 50.0,
color: Colors.transparent,
child: new Container(
decoration: new BoxDecoration(
color: widget.film.checkedoutby == null ? Colors.green : Colors.red,
borderRadius: new BorderRadius.all(Radius.circular(10))),
child: new Center(
child: new Text(widget.film.number, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0),),
)),
),
),
Positioned(
top: 180,
left: 15,
child: Container(
height: 200.0,
//color: Colors.grey[200],
child: MeetNetworkImage(
fit: BoxFit.contain,
imageUrl: widget.film.poster != null
? "https://image.tmdb.org/t/p/w200/" + widget.film.poster
: "",
loadingBuilder: (context) => Center(
child: CircularProgressIndicator(),
),
errorBuilder: (context, e) => Center(
child: FadeInImage(
fit: BoxFit.fill,
width: MediaQuery.of(context).size.width,
image:
AssetImage('assets/images/placeholder.png'),
placeholder:
AssetImage('assets/images/placeholder.png'),
),
),
),
),
),
Positioned(
left: 155,
top: 225,
child: Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Text(
'Check Out',
style: TextStyle(
fontFamily: Constant.fontRegular,
fontWeight: FontWeight.bold),
),
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: widget.users != null ?
DropdownButton(
elevation: 2,
value: widget.film.checkedoutby != null ? widget.film.checkedoutby : null,
onChanged: (val){
print(val);
},
hint: Text(
"Select the leach",
style: TextStyle(
color: Colors.black,
),
),
items: <String>['One', 'Two', 'Free', 'Four']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
})
.toList())
),
],
),
),
Container(
padding: EdgeInsets.all(8.0),
alignment: FractionalOffset.centerLeft,
child: Wrap(
children: <Widget>[
Text(
'Rating -',
style: TextStyle(
fontFamily: Constant.fontRegular,
fontWeight: FontWeight.bold),
),
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: Text(
widget.film.rating,
style: TextStyle(
fontFamily: Constant.fontRegular,
color: Colors.grey[500]),
),
),
],
),
),
Container(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Text(
'Duration -',
style: TextStyle(
fontFamily: Constant.fontRegular,
fontWeight: FontWeight.bold),
),
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: Text(
widget.film.runtime == null ? "" : widget.film.runtime,
style: TextStyle(
fontFamily: Constant.fontRegular,
color: Colors.grey[500]),
),
),
],
),
),
Container(
padding: EdgeInsets.all(8.0),
alignment: FractionalOffset.centerLeft,
child: Wrap(
children: <Widget>[
Text(
'Released -',
style: TextStyle(
fontFamily: Constant.fontRegular,
fontWeight: FontWeight.bold),
),
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: Wrap(
alignment: WrapAlignment.start,
children: <Widget>[
Text(
widget.film.released ?? "",
style: TextStyle(
fontFamily: Constant.fontRegular,
color: Colors.grey[500]),
)
],
),
)
],
),
),
],
),
),
Positioned(
top: 395,
left: 10,
width: MediaQuery.of(context).size.width-10,
child: Column(
children: <Widget>[
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Expanded(child: Text(widget.film.plot)),
],
),
Divider(),
Wrap(
children: widget.film.genre
.split(',')
.map<Widget>(
(f) => Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Chip(
labelPadding:
EdgeInsets.symmetric(horizontal: 8.0),
label: Text(f,
style: TextStyle(
color: Colors.white,
fontFamily: Constant.fontMedium,
)),
backgroundColor:
Theme.of(context).primaryColor,
),
),
).toList(),
),
],
),
),
],
),
],
),
),
),
),
);
Not exactly sure why there is a difference in what I posted above and what the solution ended up being, but here's what I've changed the view to in order to get the dropdown popover to display.
As I was debugging, I broke it down bit by bit and noticed that when I added a container with a height to take up half the view, the popover would show, but clear at the bottom of that container, essentially pushing the top location of the dropdown's list, to the bottom of the container it was in. So I'm assuming the the popover that displays the list is 'showing', but below the container so it appears to not be working. Not sure why it would attach to the 'outside' of the main parent container, but that looks like this is what it is doing.
So....I changed the setup of the scaffolds body: property to be this instead:
SingleChildScrollView(
physics: new AlwaysScrollableScrollPhysics(),
controller: _controller,
child: ConstrainedBox(
constraints: BoxConstraints.tightFor(
height: MediaQuery.of(context).size.height,
),
child: Stack(
.....