flutter-sliver

Flutter TabBar and SliverAppBar that hides when you scroll down

百般思念 提交于 2019-12-04 10:54:55
问题 I am trying to create an app with a top application bar and a tab bar below. When you scroll down, the bar should hide by moving off the screen (but tabs should stay), and when you scroll back up, the application bar should show again. This behaviour can be seen in WhatsApp. Please see this video for a demonstration. (Taken from Material.io). This is a similar behaviour, although the app bar and tab bar are hidden on scroll, so it is not exactly the behaviour I am looking for. I have been

Is there any definite list of Sliver widgets

ⅰ亾dé卋堺 提交于 2019-12-03 16:38:06
I am trying to use Sliver to implement collapsible list header. As I am changing widgets from normal to Sliver I often end up with error like this: I/flutter ( 3141): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter ( 3141): The following assertion was thrown building NotificationListener<ScrollNotification>(): I/flutter ( 3141): A RenderViewport expected a child of type RenderSliver but received a child of type I/flutter ( 3141): RenderRepaintBoundary. I/flutter ( 3141): RenderObjects expect specific types of children because they

flutter implement sticky headers and the snap to item effect

最后都变了- 提交于 2019-12-03 04:30:56
问题 For the last few days, I've been reading through flutter framework documentation and especially the sliver part but I'm not quite sure where to start. I'm trying to implement the sticky headers and snap effect. Might the RenderSliverList be a good start? Do I need to re-layout things? Do I need to do additional drawing? And if so where? Any help on where to start would be a huge help, thanks in advance! Edit: I think I understood the layout part now, but I just can't find where the painting

flutter implement sticky headers and the snap to item effect

偶尔善良 提交于 2019-12-02 17:43:23
For the last few days, I've been reading through flutter framework documentation and especially the sliver part but I'm not quite sure where to start. I'm trying to implement the sticky headers and snap effect. Might the RenderSliverList be a good start? Do I need to re-layout things? Do I need to do additional drawing? And if so where? Any help on where to start would be a huge help, thanks in advance! Edit: I think I understood the layout part now, but I just can't find where the painting is supposed to happen. Edit 2: For clarification, this is the desired "sticky header effect": How can I

Horizontally scrollable cards with Snap effect in flutter

痞子三分冷 提交于 2019-12-02 16:48:00
I want to create a list of cards scrolling horizontally with snap to fit effect when swiped either from left or right. Each card has some spacing between them and fit to screen similar to below image Apart from that these horizontally scrollable list elements should be contained inside a vertically scrollable list. I all I am able to achieve is only displaying a list of horizontal scrolling cards after following example in flutter docs. class SnapCarousel extends StatelessWidget { @override Widget build(BuildContext context) { final title = 'Horizontal List'; return MaterialApp( title: title,

flutter - App bar scrolling with overlapping content in Flexible space

爱⌒轻易说出口 提交于 2019-11-30 20:54:26
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 SliverAppBar already, using the code I pasted here, I am trying to create THIS i cant use Stack for it because i cant find any onScroll callback, so far i created appbar with flexibleSpace, the app bar collapse on scroll: Scaffold( body: NestedScrollView( headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) => <Widget>[ SliverAppBar(

flutter - App bar scrolling with overlapping content in Flexible space

大兔子大兔子 提交于 2019-11-30 17:00:10
问题 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 SliverAppBar already, using the code I pasted here, I am trying to create THIS i cant use Stack for it because i cant find any onScroll callback, so far i created appbar with flexibleSpace, the app bar collapse on scroll: Scaffold( body:

how to implement a sliverAppBar with a tabBar

为君一笑 提交于 2019-11-29 13:50:43
the flutter document show a demo for SliverAppBar + TabBar + TabBarView with ListView use NestedScrollView , and it's a bit complex, so I wonder is there a simply and clear way to implement it. I tried this: CustomScrollView slivers: SliverAPPBar bottom: TabBar TabBarView children: MyWidget(list or plain widget) got error: flutter: The following assertion was thrown building Scrollable(axisDirection: right, physics: flutter: A RenderViewport expected a child of type RenderSliver but received a child of type _RenderExcludableScrollSemantics. flutter: RenderObjects expect specific types of

how to implement a sliverAppBar with a tabBar

拥有回忆 提交于 2019-11-27 06:03:15
问题 the flutter document show a demo for SliverAppBar + TabBar + TabBarView with ListView use NestedScrollView , and it's a bit complex, so I wonder is there a simply and clear way to implement it. I tried this: CustomScrollView slivers: SliverAPPBar bottom: TabBar TabBarView children: MyWidget(list or plain widget) got error: flutter: The following assertion was thrown building Scrollable(axisDirection: right, physics: flutter: A RenderViewport expected a child of type RenderSliver but received