Skip to content

Commit

Permalink
Merge pull request #65 from fluttercommunity/feature/customizable_ink…
Browse files Browse the repository at this point in the history
…well

Feature/customizable inkwell
  • Loading branch information
daadu committed Oct 27, 2020
2 parents bb32be8 + 5fa7ff8 commit ebe387d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ class BackdropNavigationBackLayer extends StatelessWidget {
/// Customizable separatorBuilder used with [ListView.separated].
final IndexedWidgetBuilder separatorBuilder;

/// Allows to set a [Padding] for each item of the list.
final EdgeInsetsGeometry itemPadding;

/// Sets a custom border on the list items' [InkWell].
/// See [InkResponse.customBorder].
final ShapeBorder itemSplashBorder;

/// Sets a custom splash color on the list items. See [InkResponse.splashColor].
final Color itemSplashColor;

/// Creates an instance of [BackdropNavigationBackLayer] to be used with
/// [BackdropScaffold].
///
Expand All @@ -63,6 +73,9 @@ class BackdropNavigationBackLayer extends StatelessWidget {
this.onTap,
this.separator,
this.separatorBuilder,
this.itemPadding,
this.itemSplashBorder,
this.itemSplashColor,
}) : assert(items != null),
assert(items.isNotEmpty),
super(key: key);
Expand All @@ -72,6 +85,7 @@ class BackdropNavigationBackLayer extends StatelessWidget {
return ListView.separated(
shrinkWrap: true,
itemCount: items.length,
padding: itemPadding,
itemBuilder: (context, position) => InkWell(
child: items[position],
onTap: () {
Expand All @@ -81,6 +95,8 @@ class BackdropNavigationBackLayer extends StatelessWidget {
// call onTap function and pass new selected index
onTap?.call(position);
},
customBorder: itemSplashBorder,
splashColor: itemSplashColor,
),
separatorBuilder:
separatorBuilder ?? (builder, position) => separator ?? Container(),
Expand Down

0 comments on commit ebe387d

Please sign in to comment.