Questions tagged [sliver-grid]

22 questions
7
votes
4 answers

Error: SliverGeometry is not valid: The "scrollExtent" is negative. in flutter Sliver Grid View Laout

EXCEPTION CAUGHT BY RENDERING LIBRARY The following assertion was thrown during performLayout(): SliverGeometry is not valid: The "scrollExtent" is negative. The RenderSliver that returned the offending geometry was: RenderSliverGrid#f9778…
sr2k23
  • 127
  • 1
  • 2
  • 12
7
votes
2 answers

How to give background color to SliverGrid?

For ListView or GridView we wrap it with Container. But how can I give background color to SliverGrid?
Figen Güngör
  • 12,169
  • 14
  • 66
  • 108
4
votes
1 answer

Flutter RenderObject assertion failure

I am having the following error : ======== Exception caught by scheduler library ===================================================== The following assertion was thrown during a scheduler callback: Updated layout information required for…
Tom3652
  • 2,540
  • 3
  • 19
  • 45
3
votes
1 answer

render slivergrid using bloc in flutter

Here is the case :- i have a Bloc named XYZBloc which loads data from network. i need to render these lists into sliverGrid. the same list goes pretty well with sliverList. Store.dart @override Widget build(BuildContext context) { return…
avinash
  • 501
  • 2
  • 8
  • 16
2
votes
3 answers

ScrollExtent is negative in flutter

Getting a very pesky error on this segment of my Flutter app and no clue why: child: GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 1, childAspectRatio: 4 / 3, mainAxisSpacing:…
Obisi7
  • 485
  • 1
  • 5
  • 18
2
votes
2 answers

Add a border radius to SliverGrid background in flutter

I'm building an app with flutter and get stuck while working on building a grid of items using SliverGrid inside CustomScrollView and I'm not able to add border-radius to its background. Note, I can add a radius to the individual grid item. This is…
adkstar
  • 178
  • 1
  • 10
2
votes
0 answers

Can I assign an onClick() function to my various SliverPersistentHeader to jump to that position in the CustomScrollView?

I have successfully built my CustomScrollView() that contains SliverGrid() items and SliverPersistentHeaders() which are pinned. I want a click on any SliverPersistentHeader() to scroll to the exact position. I want to know if this is possible in…
lordvidex
  • 3,581
  • 3
  • 17
  • 25
1
vote
1 answer

How to achieve horizontal grid scroll with sliver

How to get horizontal grid view similar to this example using sliver:[]. I've tries using he example given here but it is using mutiple container inside children to get the desired result. also tries giving it to list.generate but that dosen't seems…
Digamber negi
  • 407
  • 1
  • 7
  • 20
1
vote
2 answers

How to gridview item height make dynamic in flutter

I'm starting to learn the flutter language and I want to display the product list in GridView. But there is one problem that arises. When I run the app GridView items are displayed perfectly like the below image. But when I close the app and open…
Abhi S
  • 250
  • 2
  • 18
1
vote
1 answer

SliverGrid not showing inside CustomScrollView in Flutter

I want to get data from REST api, using future SliverGrid should build. But it is not showing, shows just white color and also I didn't know how to specify the total grid items count in SliverGrid. So if it shows it must generate more than the…
Mahi
  • 1,297
  • 1
  • 14
  • 28
1
vote
3 answers

Avoid rebuilding of children while scrolling in SliverGrid in flutter

Hi I am using the below code in a CustomScrollView to show images in grid using SliverGrid and SliverChildBuilderDelegate. On Scrolling very fast, the children widget that has already have cached image gets destroyed when gone off screen and rebuilt…
Shashi Kiran
  • 999
  • 5
  • 13
  • 27
1
vote
1 answer

How to achieve different item heights in sliver grid

I want to create a shopping cart app. I used a Sliver grid having different items with different heights but it's not working. Please help grid in flutter
Amon Chowdhury
  • 101
  • 1
  • 5
1
vote
1 answer

How to use itemCount in SliverGrid?

Most probably I got the concept my SliverGrid entirely wrong, What I am trying to do is, UI wise I want the collapsible SliverAppBar which is already available in Flutter. My main content body is set of images coming from API response and already…
Jithesh Kt
  • 2,023
  • 6
  • 32
  • 48
0
votes
1 answer

CustomScrollView and SliverGrid Repeating

I have a CustomScrollView that receives a future sliver, it works but the sliver keeps on repeating its elements Here is my code in homepage late Future> europe; @override void initState() { super.initState(); …
0
votes
1 answer

How to create Card list with multiple Sizes in flutter?

enter image description hereI want to make Card list for products with multiple sizes like if the builder crossAxisCount:2, one should be square card and the other is rectangle card to seem catchy to eye i tried to add the sizes by my self for each…
1
2