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');
            }),
      ])),
    );
  }
}

Esse é código além pode me ajudar?

print da tela

1 Resposta 1

0

Você não está conseguindo juntar essas imagens pois inseriu alguns argumentos de espaçamento, tente modificar o margin:

EdgeInsets.fromLTRB(10, 10, 10, 0),
1
  • eu tentei colocar tudo 0 mas ainda continua o espaço, eu falo esse espaço em baixo da lista horizontal 19/08/2021 às 20:39

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .