0

I am trying to make my tab scrollable such that if I scroll down, new content should be appearing. So I wanted to know that what we can add or what are the improvement needed.

This is my code:

 class ProductList extends StatelessWidget {
 const ProductList({Key? key}) : super(key: key);
 @override
 Widget build(BuildContext context) {
 return Wrap(
 direction: Axis.horizontal,
 alignment: WrapAlignment.start,
 crossAxisAlignment: WrapCrossAlignment.start,
 runAlignment: WrapAlignment.start,
 runSpacing: 8.0,
 spacing: 15.0,
 children: List.generate(10, (index) { 
 return SizedBox(
 width: getProportionateScreenWidth(160),
 child: GestureDetector(
 child: Column(
 crossAxisAlignment: CrossAxisAlignment.start,
 mainAxisAlignment: MainAxisAlignment.start,
 children: [
 AspectRatio(
 aspectRatio: 1.02,
 child: Container(
 padding: EdgeInsets.all(getProportionateScreenWidth(5)),
 decoration: BoxDecoration(
 color: kSecondaryColor.withOpacity(0.3),
 borderRadius: BorderRadius.circular(15),
 ),
 child: null),
 ),
 const SizedBox(height: 10),
 ],
 ),
 ),
 );
 }),
 );
 }
}
Nerdy Bunz
7,73310 gold badges58 silver badges131 bronze badges
asked Nov 24, 2021 at 10:16
2
  • do you want a infinite list with a limited items or infinite items? Commented Nov 24, 2021 at 10:20
  • My list generates 10 items. Now I want it to generate 10 more items when it reaches the bottom. I want an infinite list with limited items. Commented Nov 24, 2021 at 10:37

1 Answer 1

1

This plugin works like you want: Infinite ListView

answered Nov 24, 2021 at 11:14
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.