Skip to content

Commit

Permalink
1. Export default value of contentPadding
Browse files Browse the repository at this point in the history
2. Improve comment
3. Release 1.2.1
  • Loading branch information
Playhi committed Mar 11, 2020
1 parent 830493d commit d55e6a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.2.1] - 2020-03-11

* Export default value of contentPadding.


## [1.2.0] - 2020-03-11

* Export default value of horizontalTitleGap, minVerticalPadding and minLeadingWidth.
Expand Down
13 changes: 7 additions & 6 deletions lib/list_tile_more_customizable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class ListTileMoreCustomizableDefaultValue {

// The default minimum leading width.
static const double minLeadingWidth = 40.0;

// The default content padding.
static const EdgeInsets contentPadding =
EdgeInsets.symmetric(horizontal: 16.0);
}

/// Defines the title font used for [ListTileMoreCustomizable] descendants of a [ListTileMoreCustomizableTheme].
Expand Down Expand Up @@ -218,8 +222,7 @@ class ListTileMoreCustomizable extends StatefulWidget {
ListTileMoreCustomizableDefaultValue.horizontalTitleGap,
this.minVerticalPadding =
ListTileMoreCustomizableDefaultValue.minVerticalPadding,
this.minLeadingWidth =
ListTileMoreCustomizableDefaultValue.minLeadingWidth,
this.minLeadingWidth = ListTileMoreCustomizableDefaultValue.minLeadingWidth,
}) : assert(isThreeLine != null),
assert(enabled != null),
assert(selected != null),
Expand Down Expand Up @@ -315,7 +318,7 @@ class ListTileMoreCustomizable extends StatefulWidget {
/// The minimum padding on the top and bottom of the title and subtitle widgets.
final double minVerticalPadding;

/// The default minimum leading width.
/// The minimum leading width.
final double minLeadingWidth;

/// Add a one pixel border in between each tile. If color isn't specified the
Expand Down Expand Up @@ -486,13 +489,11 @@ class _ListTileMoreCustomizableState extends State<ListTileMoreCustomizable> {
);
}

const EdgeInsets _defaultContentPadding =
EdgeInsets.symmetric(horizontal: 16.0);
final TextDirection textDirection = Directionality.of(context);
final EdgeInsets resolvedContentPadding =
widget.contentPadding?.resolve(textDirection) ??
tileTheme?.contentPadding?.resolve(textDirection) ??
_defaultContentPadding;
ListTileMoreCustomizableDefaultValue.contentPadding;

return InkWell(
onTap: widget.enabled && widget.onTap != null ? toOnTap : null,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: list_tile_more_customizable
description: A ListTile with more customizable details, which provides more customizable functions, based on the traditional flutter ListTile.
version: 1.2.0
version: 1.2.1
homepage: https://github.com/Playhi/list_tile_more_customizable

environment:
Expand Down

0 comments on commit d55e6a2

Please sign in to comment.