Home > Software engineering >  Wrap widget is not working for row in showmodalbottomsheet in flutter
Wrap widget is not working for row in showmodalbottomsheet in flutter

Time:10-10

showModalBottomSheet(
                  isScrollControlled: true,
                  constraints: BoxConstraints(
                      maxHeight: MediaQuery.of(context).size.height / 2.5),
                  shape: const RoundedRectangleBorder(
                      borderRadius: BorderRadius.only(
                          topLeft: Radius.circular(40),
                          topRight: Radius.circular(40))),
                  backgroundColor: Colors.grey[100],
                  context: context,
                  builder: ((BuildContext context) {
                    return Wrap(children: [
                      Row(children: [
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                        ElevatedButton(
                            onPressed: () {}, child: const Text('Button')),
                      ])
                    ]);
                  }));

I have many elevated buttons in a row in showmodalbottomsheet function. I want to show them in the bottom sheet. But Buttons are not overflowing to the second line. I used Wrap widget but it didn't work. Can somebody help me?enter image description here

  • Related