Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Flutter: Inkwell is clashing with another widget

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
    

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading