Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow body widget to be built without padding #73

Merged
merged 2 commits into from
Jan 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _OnBoardingPageState extends State<OnBoardingPage> {
const pageDecoration = const PageDecoration(
titleTextStyle: TextStyle(fontSize: 28.0, fontWeight: FontWeight.w700),
bodyTextStyle: bodyStyle,
descriptionPadding: EdgeInsets.fromLTRB(16.0, 0.0, 16.0, 16.0),
bodyPadding: EdgeInsets.fromLTRB(16.0, 0.0, 16.0, 16.0),
pageColor: Colors.white,
imagePadding: EdgeInsets.zero,
);
Expand Down
10 changes: 4 additions & 6 deletions lib/src/model/page_decoration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ class PageDecoration {
/// @Default `EdgeInsets.only(top: 16.0, bottom: 24.0)`
final EdgeInsets titlePadding;

/// Padding of description
///
/// @Default: `EdgeInsets.zero`
final EdgeInsets descriptionPadding;
/// Padding of body
final EdgeInsets? bodyPadding;

/// Padding of footer
///
Expand Down Expand Up @@ -79,7 +77,7 @@ class PageDecoration {
this.imagePadding = const EdgeInsets.only(bottom: 24.0),
this.contentMargin = const EdgeInsets.all(16.0),
this.titlePadding = const EdgeInsets.only(top: 16.0, bottom: 24.0),
this.descriptionPadding = EdgeInsets.zero,
this.bodyPadding,
this.footerPadding = const EdgeInsets.symmetric(vertical: 24.0),
this.bodyAlignment = Alignment.topCenter,
this.imageAlignment = Alignment.bottomCenter,
Expand Down Expand Up @@ -118,7 +116,7 @@ class PageDecoration {
imagePadding: imagePadding ?? this.imagePadding,
contentMargin: contentMargin ?? this.contentMargin,
titlePadding: titlePadding ?? this.titlePadding,
descriptionPadding: descriptionPadding ?? this.descriptionPadding,
bodyPadding: descriptionPadding ?? this.bodyPadding,
footerPadding: footerPadding ?? this.footerPadding,
bodyAlignment: bodyAlignment ?? this.bodyAlignment,
imageAlignment: imageAlignment ?? this.imageAlignment,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/ui/intro_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class IntroContent extends StatelessWidget {
page.decoration.titleTextStyle,
),
),
Padding(
padding: page.decoration.descriptionPadding,
Container(
padding: page.decoration.bodyPadding,
child: _buildWidget(
page.bodyWidget,
page.body,
Expand Down