CopyPastor

Detecting plagiarism made easy.

Score: 0.8217138496533396; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2023-01-16
by redbnlrg

Original Post

Original - Posted on 2022-06-22
by Lerex



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Try to wrap `ListView.builder` in a `SizedBox` with a specific `height` and `width`.
AlertDialog( title: const Text('Choose Device'), content: SizedBox( height: 300, width: 300, child: ListView.builder( shrinkWrap: true, itemCount: 7, itemBuilder: (context, index) => SizedBox( height: 150.0, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ Row( children: <Widget>[ const Icon(Icons.toys), Padding( padding: const EdgeInsets.only(left: 8.0), child: Text('strDevice'), ), ], ), const SizedBox( height: 20.0, ), ], ), ), ), ), ),
Try this
``` child: Column( //STRETCH TO FIT WIDTH crossAxisAlignment: CrossAxisAlignment.stretch, children: [ //REMOVED CONTAINER FROM HERE ListView.builder( shrinkWrap: true, scrollDirection: Axis.horizontal, itemCount: itemss.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: const EdgeInsets.all(8.0), //CHANGED TO CARD child: Card( Color: selectedIndex == index ? Colors.amber : null, onTap: () { setState(() { selectedIndex = index; }); }, child : Container( height: 50, width: MediaQuery.of(context).size.width, decoration: BoxDecoration( color: Colors.blue.shade900, borderRadius: BorderRadius.circular(10), ), //PUT CHILD OF ANYTHING HERE child : ) ), ) }), ], ) ```

        
Present in both answers; Present only in the new answer; Present only in the old answer;