flutter-sliver

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

一个人想着一个人 提交于 2019-12-10 22:49:20
问题 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 click through the transparent widget and the scrollable, so that I reach the widgets behind the scrollable? ListView( children: [ Container(height: 200), // Transparent. Container(color: Colors.red, height: 200), ], ); Note, I cannot wrap the

Flutter: Change text when FlexibleSpaceBar is collapsed

社会主义新天地 提交于 2019-12-10 18:09:20
问题 I have looked through the Flutter documentation to try and find an event, callback or even a state that I could hook into when the FlexibleSpaceBar is collapsed or expanded. return new FlexibleSpaceBar( title: new Column( crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[ new Text(_name, style: textTheme.headline), new Text(_caption, style: textTheme.caption) ]), centerTitle: false, background: getImage());` When the FlexibleSpaceBar is

Minimum height in SliverAppBar (Flutter)?

懵懂的女人 提交于 2019-12-10 14:12:36
问题 Is it possible set a minimum height on SliverAppBar when is collapsed? If yes, how I can do that? Work's adding a bottom widget on SliveAppBar: bottom: PreferredSize( preferredSize: Size(20.0, 20.0), child: Text(''), ), 回答1: The answer to this is both yes and no. If you want to make it larger than what it currently is, you can set a 'bottom' widget which takes up some space below the main part of the app bar, so you can make it appear larger. It isn't possible to change the height of the

Is there any definite list of Sliver widgets

天涯浪子 提交于 2019-12-09 13:17:25
问题 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):

Flutter How to check if Sliver AppBar is expanded or collapsed?

大憨熊 提交于 2019-12-08 18:26:38
问题 I am using a SliverAppBar in Flutter, with a background widget. The thing is When it's expanded , the title and icons (leading and actions) should be white in order to be seen correctly, and when it's collapsed , they should be changed to black . Any ideas on how I can get a bool out of it? Or other ways of resolving this problem. Thank you. class SliverExample extends StatefulWidget { final Widget backgroundWidget; final Widget bodyWidgets; SliverExample({ this.backgroundWidget, this.body, }

Flutter tabsView and NestedScrollView scroll issue

你离开我真会死。 提交于 2019-12-06 12:19:01
问题 i have "NestedScrollView" that content a "tabView" and every tab view content a "List builder" , when i scroll inside one of list builder (inside tabs) , all other tabs is sync the scroll position if i add "ScrollController" to each listview (in tabs) , then the listBuilder inside the tab scroll separated of "NastedScrollView" here is an example code : import 'package:flutter/material.dart'; void main() => runApp( MaterialApp( home: MyApp() , ) ); class MyApp extends StatefulWidget{

Flutter tabsView and NestedScrollView scroll issue

半城伤御伤魂 提交于 2019-12-04 21:40:22
i have "NestedScrollView" that content a "tabView" and every tab view content a "List builder" , when i scroll inside one of list builder (inside tabs) , all other tabs is sync the scroll position if i add "ScrollController" to each listview (in tabs) , then the listBuilder inside the tab scroll separated of "NastedScrollView" here is an example code : import 'package:flutter/material.dart'; void main() => runApp( MaterialApp( home: MyApp() , ) ); class MyApp extends StatefulWidget{ MyAppState createState() => MyAppState(); } class MyAppState extends State<MyApp> with

Can Flutter efficiently layout nested lists?

╄→гoц情女王★ 提交于 2019-12-04 19:16:56
Can a layout like this be achieved and rendered efficiently in Flutter? Example: Yellow and blue blocks can both be around 30 elements, so I guess something like ListView.builder should be used. I have tried nesting 2 ListView.builder, the inner with shrinkWrap = true. The yellow block is being built just when is needed, but the blue list, although it has an itemBuilder, it builds all children elements at once, causing performance problems. new ListView.builder( itemCount: 20, itemBuilder: (BuildContext context, int blockIdx) { print("Building block $blockIdx"); return new Column( children: [

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

帅比萌擦擦* 提交于 2019-12-04 12:08:13
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 Widget build(BuildContext context) { return Material( elevation: 8.0, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Padding( padding: const EdgeInsets.all(16.0), child: Text( title, style: Theme.of(context).textTheme.subhead.copyWith(fontSize: 18.0), textAlign: TextAlign.left, ), ), Divider(height: 4.0), ListView

Allow GridView to overlap SliverAppBar

房东的猫 提交于 2019-12-04 11:17:38
I am trying to reproduce the following example from the earlier Material design specifications (open for animated demo): Until now I was able to produce the scrolling effect, but the overlap of the content is still missing. I couldn't find out how to do this properly. import 'package:flutter/material.dart'; class HomePage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: CustomScrollView( slivers: <Widget>[ SliverAppBar( title: Text('Title'), expandedHeight: 200.0, primary: true, pinned: true, ), SliverFixedExtentList( itemExtent: 30.0, delegate: