Questions tagged [flutter-sliver]

A Sliver is a portion of a scrollable area that animate on scroll events, like stick to the top or expand when pulled to the bottom. You can use slivers to achieve custom scrolling effects. Flutter has a few Sliver implementations out of the box, such as SliverList, SliverGrid and SliverAppBar.

A Sliver is a portion of a scrollable area that animate on scroll events, like stick to the top or expand when pulled to the bottom.

Flutter has a few Sliver implementations out of the box, such as:

Check this page on the docs for general Sliver information in flutter.

460 questions
12
votes
1 answer

Flutter:Scrolling To Bottom Automatically when the screen opens

I'm using onpressed() to scroll down to bottom of the List view, but i want to achieve that without Pressing the botton, It must autoscroll for every screen opening. I tried to put it inside initState() its not working but if i press the button it…
Rajesh
  • 3,562
  • 7
  • 24
  • 43
11
votes
1 answer

Flutter. How to add Padding for SliverGrid

I use CustomScrollView with SliverGrid. I add space between grid items using this: mainAxisSpacing: 8, crossAxisSpacing: 8. But is it possible to add space (margin/padding) before the first and after the last column. I tried to wrap my SliverGrid in…
testivanivan
  • 967
  • 13
  • 36
11
votes
1 answer

PageView with pages in CustomScrollView with Flutter

I am trying to place a PageView which pages are scrollable vertically into a CustomScrollView. The reason for this setup is that I want to make use of SliverAppBar. If one starts scrolling vertically, the AppBar starts shrinking and ultimately docks…
Basic Coder
  • 10,882
  • 6
  • 42
  • 75
11
votes
1 answer

ListView inside Column causes 'Vertical viewport was given unbounded height'

I am new to flutter and having trouble with layouts. I want something like this: A sticky header and a scroll view below it. I thought of using Column widget with two children - first being the header and second being the ListView. Here is my code …
Harsh Bhikadia
  • 10,095
  • 9
  • 49
  • 70
11
votes
5 answers

Is there a way to achieve a dynamic height in bottom widget of SliverAppBar

The SliverAppBar has an attribute bottom which has to have preferredSize. Right now I have it returning constant value: ... new SliverAppBar( expandedHeight: _kFlexibleSpaceMaxHeight, flexibleSpace: new FlexibleSpaceBar(.....) ... …
Jerzy Kiler
  • 2,795
  • 4
  • 18
  • 12
10
votes
5 answers

Sliver Appbar [Collapsing Toolbar] animate title from left to center in Flutter

Here is my Build method for collapsing toolbar:- @override Widget build(BuildContext context) { return SafeArea( child: CustomScrollView( controller: controller, slivers: [ SliverAppBar( …
Hardy
  • 2,576
  • 1
  • 23
  • 45
10
votes
2 answers

How to use AnimatedSwitcher and CustomScrollView together

I want switch status with animation in CustomScrollView, but it throw error. class SliverAnimatedSwitcher extends StatefulWidget { final state; const SliverAnimatedSwitcher({Key key, this.state}) : super(key: key); @override …
Shuai Cheng
  • 111
  • 6
10
votes
1 answer

Proper method for setting childAspectRatio in flutter

What is the proper way of calculating childAspectRatio of SliverGridDelegateWithFixedCrossAxisCount in flutter. How to manage the the correct height of each view that is compatible with all devices and should work in landscape and…
Ashwin S Ashok
  • 3,623
  • 2
  • 29
  • 36
10
votes
2 answers

Pinned SliverPersistentHeader overlaps with Android StatusBar

I'm working with Slivers. I have an SliverAppBar, then a SliverPersistentHeader and finally a SliverList. The behavior I want to achieve is that the SliverAppBar scrolls off the screen but the SliverPersistentHeader to remain pinned at the top of…
Sebastian
  • 3,666
  • 2
  • 19
  • 32
10
votes
3 answers

flutter - App bar scrolling with overlapping content in Flexible space

i am trying to recreate App bar scrolling with overlapping content in Flexible space using flutter. the behavior is demonstrated here: http://karthikraj.net/2016/12/24/scrolling-behavior-for-appbars-in-android/ I created collapsing AppBar using…
CodePLeX
  • 133
  • 1
  • 2
  • 8
10
votes
1 answer

flutter - SliverList / SliverChildBuilderDelegate supply initial index or allow negative indices

I'm currently building a calendar view in Flutter using a SliverList and a SliverChildBuilderDelegate such that I don't have to render every single item in the calendar at once. The first date is epoch time, Jan 1, 1970, and the last date is some…
9
votes
2 answers

CustomscrollView scrolled to position top automatically, when i tap a textfield in sliver app bar

Developed a flutter page with search bar on top and bottom we have horizontal list view & followed by vertical list view... when i tapped on the search bar text field my below view scrolled to top position automatically. when I debug it the build…
SaravanaRaja
  • 3,228
  • 2
  • 21
  • 29
9
votes
1 answer

How to implement a SliverAppBar with a collapsable search bar

This is what I'm trying to do, it's a pretty common Widget on iOS. This is my code: return Scaffold( backgroundColor: Colors.white, body: CustomScrollView( slivers: [ SliverAppBar( automaticallyImplyLeading: false, …
herrmartell
  • 3,057
  • 4
  • 18
  • 27
8
votes
3 answers

Automatically compute `maxExtent` of `SliverPersistentHeaderDelegate`

Consider the following example that is intended to render a pinned title bar (with a potentially custom long/short text) inside of a CustomScrollView. class TitleBar extends StatelessWidget { TitleBar(this.text); final String text; …
user3612643
  • 5,096
  • 7
  • 34
  • 55
8
votes
1 answer

Flutter: How to make a ListView transparent to pointer events (but not its non-transparent contents)?

I have a Scrollable (ListView or any other) and it contains a transparent widget, say Container(height:200). I can see through both the widget and the scrollable (in other words I can see the widgets behind the scrollable). How can I be able to…
Marcelo Glasberg
  • 29,013
  • 23
  • 109
  • 133
1 2
3
30 31