mirror of
https://github.com/Iconica-Development/flutter_timeline.git
synced 2025-05-19 18:43:45 +02:00
feat: add listHeaderBuilder
This commit is contained in:
parent
4f7fa834e4
commit
933386623a
3 changed files with 10 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
## 4.0.0
|
## 4.0.0
|
||||||
|
|
||||||
- Add a serviceBuilder to the userstory configuration
|
- Add a serviceBuilder to the userstory configuration
|
||||||
|
- Add a listHeaderBuilder for showing a header at the top of the list of posts in the timeline
|
||||||
|
|
||||||
## 3.0.1
|
## 3.0.1
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ class TimelineOptions {
|
||||||
this.maxContentLength,
|
this.maxContentLength,
|
||||||
this.categorySelectorButtonBuilder,
|
this.categorySelectorButtonBuilder,
|
||||||
this.postOverviewButtonBuilder,
|
this.postOverviewButtonBuilder,
|
||||||
|
this.listHeaderBuilder,
|
||||||
this.titleInputDecoration,
|
this.titleInputDecoration,
|
||||||
this.contentInputDecoration,
|
this.contentInputDecoration,
|
||||||
});
|
});
|
||||||
|
@ -156,6 +157,11 @@ class TimelineOptions {
|
||||||
String text,
|
String text,
|
||||||
)? categorySelectorButtonBuilder;
|
)? categorySelectorButtonBuilder;
|
||||||
|
|
||||||
|
/// This widgetbuilder is placed at the top of the list of posts and can be
|
||||||
|
/// used to add custom elements
|
||||||
|
final Widget Function(BuildContext context, String? category)?
|
||||||
|
listHeaderBuilder;
|
||||||
|
|
||||||
/// Builder for the post overview button
|
/// Builder for the post overview button
|
||||||
/// on the timeline post overview screen
|
/// on the timeline post overview screen
|
||||||
final Widget Function(
|
final Widget Function(
|
||||||
|
|
|
@ -223,6 +223,9 @@ class _TimelineScreenState extends State<TimelineScreen> {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
|
/// Add a optional custom header to the list of posts
|
||||||
|
widget.options.listHeaderBuilder?.call(context, category) ??
|
||||||
|
const SizedBox.shrink(),
|
||||||
...posts.map(
|
...posts.map(
|
||||||
(post) => Padding(
|
(post) => Padding(
|
||||||
padding: widget.options.postPadding,
|
padding: widget.options.postPadding,
|
||||||
|
|
Loading…
Reference in a new issue