Flutter dynamic height of ListView

You are using Flexible widget, that’s why your ListView expands. You have to change Flexible to ConstrainedBox and add shrinkWrap: true to your ListView. ConstrainedBox( constraints: BoxConstraints(maxHeight: 200, minHeight: 56.0), child: ListView.builder( shrinkWrap: true, itemBuilder: (BuildContext context, int index) { return ListTile( leading: CircleAvatar( backgroundColor: Colors.cyan, ), title: Text(‘Test restaurant’), subtitle: Text(’80m’), ); }, itemCount: … Read more

How do I make some text tappable (respond to taps) in Flutter?

As seen on this answer, you can use an InkWell or a gesture detector. For example InkWell( child: Text(“Hello”), onTap: () {print(“value of your text”);}, ) Or var textValue = “Flutter” InkWell( child: Text(textValue), onTap: () {print(textValue);}, ) EDIT : As Collin Jackson suggested, you can also use a FlatButton FlatButton( onPressed: () {print(“Hello world”);}, … Read more

Background Image for Scaffold

Try using Stack check the following sample: @override Widget build(BuildContext context) { return Stack( children: <Widget>[ Image.asset( “resources/background.png”, height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width, fit: BoxFit.cover, ), Scaffold( backgroundColor: Colors.transparent, appBar: AppBar( backgroundColor: Colors.transparent, elevation: 0.0, ), bottomNavigationBar: Container( padding: EdgeInsets.only(left: 4.0, right: 4.0), height: 44.0 + MediaQuery.of(context).padding.bottom, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ IconButton(icon: Icon(Icons.star)), IconButton(icon: … Read more

Flutter how to display datepicker when textformfield is clicked

Update 2020: As pointed by another answer @Lekr0 this can now be done using onTap() property of TextFormField. TextFormField( onTap: (){ // Below line stops keyboard from appearing FocusScope.of(context).requestFocus(new FocusNode()); // Show Date Picker Here }, ) Original Answer: Simple Way of Doing it : Wrap your TextFormField with IgnorePointer & wrap IgnorePointer with InkWell … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)