In flutter i am using 3.0.6 dart sdk in this when use SingleChildScrollView & using physic AlwaysScrollableScrollPhysics than i am getting an by default bouncing effect how to remove this .It possible through NeverScrollableScrollPhysics but im using refresh indicator on singleChildScrollView so i can't use this, now how can i remove this bouncig effect.
@override
Widget build(BuildContext context) {
return Scaffold(
body: RefreshIndicator(
onRefresh: () async {
await Future.delayed(Duration(milliseconds: 1500));
call_dashboard();
},
child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: GetBuilder<DashBoardController>(
builder: (dashBoardController) {
if (dashBoardController.DashBoardLoading.value) {
return Center(child: CircularProgressIndicator(
color: primary,
));
}
return Column(
children: [
Container(
padding: const EdgeInsets.all(12.0),
color: primary6,
// color: primary6,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 10),
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.fromBorderSide(
BorderSide(width: 2.5,
color:Colors.white))),
child: CircleAvatar(
radius: 30,
backgroundColor: Colors.white,
child: ClipOval(
child: Image.network(
dashBoardController.DashBoardData['data'][0]['image'].toString(),
width: 60, // Adjust the width and height as needed
height: 60,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {
return Image.asset(
'assets/images/errorImage.png', // Default image path
width: 60,
height: 60,
fit: BoxFit.cover,
);
},
),
),
)
),
sizebox_width_7,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
dashBoardController.DashBoardData['data'][0]['name'].toString(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 16,
letterSpacing: 0.25),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(
Icons.phone,
color: Colors.white,
size: 18,
),
sizebox_width_5,
Text(
dashBoardController.DashBoardData['data'][0]['mobile'].toString(),
style: TextStyle(
letterSpacing: 0.25,
fontSize: 14,
color: Colors.white),
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(
Icons.email,
color: Colors.white,
size: 18,
),
sizebox_width_5,
Text(
dashBoardController.DashBoardData['data'][0]['email'].toString(),
style: TextStyle(
letterSpacing: 0.25,
fontSize: 14,
color: Colors.white),
)
],
),
],
),
],
),
),
sizebox_height_20,
],
);
}
),
),
),
);
}
}
You need to replace AlwaysScrollableScrollPhysics() to ClampingScrollPhysics()
ClampingScrollPhysics:
Example: