From 27444ab1ff0f471e94cce641d948e91f71b8e6f0 Mon Sep 17 00:00:00 2001 From: Viktor Ohanyan Date: Sun, 11 Jun 2023 22:47:59 +0400 Subject: [PATCH] Added content padding attribute --- lib/src/easy_loading.dart | 4 ++++ lib/src/theme.dart | 3 +++ lib/src/widgets/container.dart | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/src/easy_loading.dart b/lib/src/easy_loading.dart index 1193f48..243c8d7 100644 --- a/lib/src/easy_loading.dart +++ b/lib/src/easy_loading.dart @@ -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; @@ -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, diff --git a/lib/src/theme.dart b/lib/src/theme.dart index fdc645f..8ae6253 100644 --- a/lib/src/theme.dart +++ b/lib/src/theme.dart @@ -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; diff --git a/lib/src/widgets/container.dart b/lib/src/widgets/container.dart index 8cd8cbf..df1810a 100644 --- a/lib/src/widgets/container.dart +++ b/lib/src/widgets/container.dart @@ -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(