I need listview inside the Column(which is the child of SingleChildScrollView), but it is not showing up!
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class BalanceScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Column(
children: [
Padding(padding: const EdgeInsets.symmetric(vertical: 24), child: Center(child: Text('15 960 UZS',),),),
Container(height: 48, alignment: Alignment.centerLeft, padding: EdgeInsets.symmetric(horizontal: 24),
child: Row(children: [Text('Refill balance',), Spacer(), FaIcon(FontAwesomeIcons.chevronRight, size: 15,),],),),
///this is causing problem! But i need listview here
ListView(
children: [
Text('some text 1'),
Text('some text 2'),
],
)
],
),
),
);
}
}
this is showing up in terminal:

SingleChildScrollView should be removed and ListView should be wrapped with Expanded widget
Expanded(
child:ListView(
children: [
Text('some text 1'),
Text('some text 2'),
],
)
)
Since the ListView height is infinite and Column widget wants to height value of children. It gives an hasSize expection
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With