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

Added content margin attribute #212

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions lib/src/easy_loading.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class EasyLoading {
/// textAlign of status, default [TextAlign.center].
late TextAlign textAlign;

/// content padding of loading.
late EdgeInsets contentMargin;

/// content padding of loading.
late EdgeInsets contentPadding;

Expand Down Expand Up @@ -223,6 +226,7 @@ class EasyLoading {
displayDuration = const Duration(milliseconds: 2000);
animationDuration = const Duration(milliseconds: 200);
textPadding = const EdgeInsets.only(bottom: 10.0);
contentMargin = const EdgeInsets.all(50.0);
contentPadding = const EdgeInsets.symmetric(
vertical: 15.0,
horizontal: 20.0,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ class EasyLoadingTheme {
static Duration get animationDuration =>
EasyLoading.instance.animationDuration;

/// contentMargin of loading
static EdgeInsets get contentMargin => EasyLoading.instance.contentMargin;

/// contentPadding of loading
static EdgeInsets get contentPadding => EasyLoading.instance.contentPadding;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class _Indicator extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(50.0),
margin: EasyLoadingTheme.contentMargin,
decoration: BoxDecoration(
color: EasyLoadingTheme.backgroundColor,
borderRadius: BorderRadius.circular(
Expand Down