How to get a non scrollable ListView?
Don't put a listview in a scrollview, it doesn't work. If you want a list of items that doesn't scroll, it's called a linearlayout.
How to implement a Non scrollable listview inside a SingleChildScrollView
class _DashboardState extends State<Dashboard> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('App Bar Here')),
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('Hello World'),
Container(
child: ListView.builder(
physics: NeverScrollableScrollPhysics() //add this line,
itemBuilder: (context, index) {
return Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: <Widget>[
Container(
color: Color(0xffaaaaaa),
height: 20,
child: Text('Jss One')),
Text(
'English',
style: TextStyle(fontSize: 20),
),
],
),
),
);
},
itemCount: 50,
),
),],),));
}}
set physics property to NeverScrollablePhysics() in order to not scroll the lisview
Flutter: ListView disable scrolling with touchscreen
As mentioned in the comments, the NeverScrollableScrollPhysics class will do this:
NeverScrollableScrollPhysics class
Scroll physics that does not allow the user to scroll.
Particular text in List view should be non scrollable in flutter
Going with Patrick's answer but with a little modification.
Column(
children: [
Text('ANNOUNCEMENT'),
SizedBox(
height:500 //give a height of your choice
ListView(
children: [
cont(),
conttwo(),
],
),
),
],
),
ListView with Expanded when not scrollable
You should use a Column
inside of LayoutBuilder
and with a ConstrainedBox
, set The minHeight of the Column to maxHeight of LayoutBuilder
:
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: viewportConstraints.maxHeight,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
YourListView(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
),
YourFooter(),
],
),
),
);
},
);
}
ListView.builder is not scrolling inside column
Add this to your ListView.builder()
physics: const ScrollPhysics(),
Related Topics
Eclipse Installation Error: Install_Failed_Uid_Changed
How to Get a Non Scrollable Listview
Quality Selector for Exoplayer 2
Write_Secure_Settings Permission Error Even When Added in Manifest
Android Convert Date and Time to Milliseconds
Very Large Soap Response - Android- Out of Memory Error
How to Get Screen Size of Device
Noclassdeffounderror at Google Play Services V2 Library
Android Linkify Text - Spannable Text in Single Text View - as Like Twitter Tweet
Android Opengl Es Transparent Background
How to Ping a Url in an Android Service
Android Mapactivity:Couldn't Get Connection Factory Client
Failed to Resolve: Com.Github.Philjay:Mpandroidchart:V2.1.4
Is Proguard.Cfg Needed for Library Projects
Android Splash Screen Sizes for Ldpi,Mdpi, Hdpi, Xhdpi Displays? - Eg:1024X768 Pixels for Ldpi