洞察探索如何利用兼容微信生态的小程序容器,实现跨平台开发,助力金融和车联网行业的数字化转型。
1023
2022-10-30
可让您将"sticky headers"放入Flutter应用程序的任何可滚动内容中
Flutter Sticky Headers
Lets you place headers on scrollable content that will stick to the top of the container whilst the content is scrolled.
Usage
You can place a StickyHeader or StickyHeaderBuilder inside any scrollable content, such as: ListView, GridView, CustomScrollView, SingleChildScrollView or similar.
Depend on it:
dependencies: sticky_headers: "^0.1.8"
Import it:
import 'package:sticky_headers/sticky_headers.dart';
Use it:
class Example extends StatelessWidget { @override Widget build(BuildContext context) { return ListView.builder(itemBuilder: (context, index) { return StickyHeader( header: Container( height: 50.0, color: Colors.blueGrey[700], padding: EdgeInsets.symmetric(horizontal: 16.0), alignment: Alignment.centerLeft, child: Text('Header #$index', style: const TextStyle(color: Colors.white), ), ), content: Container( child: Image-work(imageForIndex(index), fit: BoxFit.cover, width: double.infinity, height: 200.0), ), ); }); }}
Examples
Example 1 - Headers and Content
Example 2 - Animated Headers with Content
Example 3 - Headers overlapping the Content
Bugs/Requests
If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull request are also welcome.
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~