How to make a generation of text without scroll

Asked

Viewed 37 times

0

I am trying to generate text like there in text("500g oats") but I want to generate without that scroll. There is some widget that can do this?

inserir a descrição da imagem aqui

    import 'package:flutter/material.dart';

    class BoxIngredientes extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return Column(
          children: <Widget>[
            Container(
              height: 100,
              child: ListView.builder(
                padding: EdgeInsets.symmetric(horizontal: 15),
                itemCount: 3,
                itemBuilder: (BuildContext context, int index) {
                  return Container(
                    margin: EdgeInsets.only(
                      top: 5,
                      bottom: 5,
                    ),
                    child: Row(
                      children: <Widget>[
                        Icon(
                          Icons.supervised_user_circle, // trocar esse icon depois
                          size: 22,
                        ),
                        Container(
                          margin: EdgeInsets.only(
                            left: 10,
                          ),
                          child: Text("500g de aveia"), 
                        )
                      ],
                    ),
                  );
                },
              ),
            ),
          ],
        );
      }
}

1 answer

1


You can try using the NeverScrollableScrollPhysics in the ListView.builder():

physics: const NeverScrollableScrollPhysics()

According to documentation (free translation):

Creates a scrolling physics that doesn’t allow the user to scroll.

  • that’s not quite what I was thinking, because it needs to be fixed, which I need to have a dynamic height because I don’t know how many items will appear

  • @Williamgravina if you use the shrinkWrap: true together, satisfies your use case?

  • 1

    thank you from heart <3

Browser other questions tagged

You are not signed in. Login or sign up in order to post.