0
import 'package:flutter/material.dart';
class Menu extends StatefulWidget {
const Menu({Key? key}) : super(key: key);
@override
_MenuState createState() => _MenuState();
}
class _MenuState extends State<Menu> {
var tbrin = [
{"nome": "images/brinquedo.jpg"},
{"nome": "images/brinquedo.jpg"},
{"nome": "images/brinquedo.jpg"},
{"nome": "images/brinquedo.jpg"},
];
String appTitle = "Pesquise o produto";
bool isSearchEnabled = true;
switchSearchBarState() {
setState(() {
isSearchEnabled = !isSearchEnabled;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 1,
backgroundColor: Colors.blue.shade100,
title: !isSearchEnabled
? Text(appTitle)
: TextField(
style: new TextStyle(
color: Colors.white,
),
decoration: new InputDecoration(
border: InputBorder.none,
prefixIcon: new Icon(Icons.search, color: Colors.white),
hintText: "Procure o produto",
hintStyle: new TextStyle(color: Colors.white)),
),
),
//****Menu selecionavel****//
body: Column(
verticalDirection: VerticalDirection.down,
children: <Widget>[
Expanded(
child: SizedBox(
child: ListView.builder(
controller: ScrollController(),
scrollDirection: Axis.horizontal,
itemCount: tbrin.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 0),
width: 150,
child: Column(
children: <Widget>[
Card(
margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
child: Container(
margin: EdgeInsets.all(0),
padding: EdgeInsets.all(0),
child: ListTile(
title: Image.asset(
tbrin[index]["nome"].toString(),
),
subtitle: Text(
"Titulo",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 25,
),
),
),
),
),
],
),
);
},
),
),
),
Expanded(
child: SizedBox(
child: ListView(
children: <Widget>[
Card(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Container(
margin: EdgeInsets.all(0),
padding: EdgeInsets.all(0),
child: ListTile(
title: Image.asset("images/brinquedo.jpg"),
subtitle: Text("Titulo",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
)),
),
),
),
Container(
width: 10,
child: ListTile(
title: Text("Titulo2",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 30,
)),
),
),
],
),
),
)
],
),
drawer: Drawer(
child: ListView(children: <Widget>[
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Colors.cyan,
),
),
ListTile(
leading: Icon(Icons.star),
title: Text("Favoritos"),
subtitle: Text("meus favoritos..."),
trailing: Icon(Icons.arrow_forward),
onTap: () {
debugPrint('toquei no drawer');
}),
])),
);
}
}
This is code over there can help me?
I tried to put everything 0 but still continues the space, I speak that space below the horizontal list
– Matheus Teixeira