Skip to content

Commit

Permalink
feat: ImpaktfullUiListView make configurabl
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlooverenkoen committed Jan 30, 2025
1 parent 411f9f6 commit 17e520a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.37.0

## Fix

- ImpaktfullUiListView make `useSafeArea` configurable

# 0.36.0

## Feat
Expand Down
10 changes: 9 additions & 1 deletion lib/src/components/list_view/list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ImpaktfullUiListView<T> extends StatefulWidget
final Widget Function(BuildContext context, T item, int index)?
separatorBuilder;
final EdgeInsetsGeometry padding;
final bool useSafeArea;
final double spacing;
final int itemsPerRow;
final bool separated;
Expand All @@ -39,6 +40,7 @@ class ImpaktfullUiListView<T> extends StatefulWidget
const ImpaktfullUiListView({
required List<Widget> this.children,
this.isLoading = false,
this.useSafeArea = true,
this.spacing = 0,
this.onRefresh,
this.itemsPerRow = 1,
Expand Down Expand Up @@ -69,6 +71,7 @@ class ImpaktfullUiListView<T> extends StatefulWidget
this.onRefresh,
this.itemsPerRow = 1,
this.padding = EdgeInsets.zero,
this.useSafeArea = true,
this.shrinkWrap = false,
this.reversed = false,
this.scrollPhysics,
Expand All @@ -92,6 +95,7 @@ class ImpaktfullUiListView<T> extends StatefulWidget
this.onRefresh,
this.itemsPerRow = 1,
this.padding = EdgeInsets.zero,
this.useSafeArea = true,
this.shrinkWrap = false,
this.reversed = false,
this.scrollPhysics,
Expand All @@ -111,6 +115,7 @@ class ImpaktfullUiListView<T> extends StatefulWidget
this.refreshBtnLabel,
this.onRefresh,
this.padding = EdgeInsets.zero,
this.useSafeArea = true,
this.shrinkWrap = false,
this.reversed = false,
this.scrollPhysics,
Expand Down Expand Up @@ -174,7 +179,10 @@ class _ImpaktfullUiListViewState<T> extends State<ImpaktfullUiListView<T>> {
return ImpaktfullUiComponentThemeBuilder<ImpaktfullUiListViewTheme>(
overrideComponentTheme: widget.theme,
builder: (context, componentTheme) {
final padding = MediaQuery.paddingOf(context).add(widget.padding);
final safeAreaPadding = widget.useSafeArea
? MediaQuery.paddingOf(context)
: EdgeInsets.zero;
final padding = safeAreaPadding.add(widget.padding);
if (widget.children != null) {
return ImpaktfullUiRefreshIndicator(
onRefresh: widget.onRefresh,
Expand Down

0 comments on commit 17e520a

Please sign in to comment.