All is well until I try and add the inkwell widget. Why can I not put it here? I need to add the onTap().
ERROR: Too many positional arguments: 0 expected, but 1 found.
body: AnimationLimiter(
child: ListView.builder(
padding: EdgeInsets.all(_w / 30),
physics: const BouncingScrollPhysics(
parent: AlwaysScrollableScrollPhysics()),
itemCount: 3,
itemBuilder: (BuildContext context, int index) {
return InkWell(
return AnimationConfiguration.staggeredList(
position: index,
delay: const Duration(milliseconds: 100),
<Missing code here because not needed to understand more about the problem>
child: Center(
child: Text(
mylist[index],
textAlign: TextAlign.center,
style: GoogleFonts.laila(
textStyle:
Theme.of(context).textTheme.headlineMedium,
fontSize: 30,
fontWeight: FontWeight.w900,
color: Colors.black54,
),
),
),
),
),
),
);// AnimationConfiguration.staggeredList
); //inkwell
>Solution :
the content inside the InkWell must be child, not return it.
body: AnimationLimiter(
child: ListView.builder(
padding: EdgeInsets.all(_w / 30),
physics: const BouncingScrollPhysics(
parent: AlwaysScrollableScrollPhysics()),
itemCount: 3,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: AnimationConfiguration.staggeredList(
position: index,
delay: const Duration(milliseconds: 100),
child: Center(
child: Text(
mylist[index],
textAlign: TextAlign.center,
style: GoogleFonts.laila(
textStyle:
Theme.of(context).textTheme.headlineMedium,
fontSize: 30,
fontWeight: FontWeight.w900,
color: Colors.black54,
),
),
),
),
),
),
)
),
); //inkwell