main_button library

Classes

AssetLottie
CircleImageWidget
CustomSizeTransition
Animates its own size and clips and aligns its child.
DefaultProfileImage
DropShadow
FileLottie
FrameRate
HexColor
ImageWidget
Lottie
A widget to display a loaded LottieComposition. The controller property allows to specify a custom AnimationController that will drive the animation. If controller is null, the animation will play automatically and the behavior could be adjusted with the properties animate, repeat and reverse.
LottieBuilder
A widget that displays a Lottie animation.
LottieCache
LottieComposition
LottieDelegates
LottieDrawable
LottieFontStyle
LottieImageAsset
LottieOptions
LottieProvider
MainButton
A custom icon button widget that provides a variety of styling and functionality options.
MainWidgetsUtil
Marker
MemoryLottie
NetworkLottie
RawLottie
A widget that displays a LottieDrawable directly.
RenderCache
SmartCachedImages
A widget that displays a cached network image with optional placeholders, error handling, and image filtering.
SmartEmptyWidget
SmartLoadingWidget
SmartRefreshIndicator
SmartScreen
SmartStatusWidget
SmartTagWidget
SmartUserImage
SmartWelcomeWidget
StatusWidget
StyledToast
Toast configuration widget, which we use to save the overall configuration for toast widget in.
StyledToastPosition
Toast position.
StyledToastTheme
Toast theme, only for default content widget.
StyledToastWidgetState
ToastFuture
The class for managing the overlay and dismiss.
ToastManager
Toast manager, manage toast list.
ValueDelegate<T>

Enums

DateFormats
dateTime => 03/11/2023 - 11:00 AM
DeviceType
EmptyType
Enum that defines the type of empty state to display.
IconType
LoadingType
Enum that defines the type of loading indicator to display.
MainButtonEnum
MainButtonEnum - primary - secondary - tertiary
StyledToastAnimation
Toast animation.
StyledToastShowType
Toast showing type.
ToastStatus

Constants

animationDuration → const Duration
Default animation duration.

Properties

currentContext BuildContext?
Current context of the page which uses the toast.
getter/setter pair
timer Timer?
getter/setter pair

Functions

daysBetween(DateTime from, DateTime to) int
dismissAllToast({bool showAnim = false}) → void
The method to dismiss all toast.
getAnimation<T>(T start, T end, AnimationController controller, {Curve curve = Curves.linearToEaseOut}) Animation<T>
Get the animation simply.
getDateTime({required String date, String? format, bool toApi = true, bool isUTC = true, String locale = 'en_US'}) String
getDurationDays({required String date, String? secondDate}) int
getFormatedDate({required String? date, DateFormats? format, bool toApi = true, bool isUTC = true, String locale = 'en_US'}) String
getSmartResponsive({required double mobile, double? tabletPortrait, double? tabletLandscape, String? text}) double
getTime({required String? time, String? format, bool toApi = true, String locale = 'en_US'}) String
Time format String must be 'HH:mm'
getWidget({required BuildContext context, required bool isLoading, required bool isEmpty, required Widget builder(BuildContext context), Widget? emptyWidget, String? message, Color? refreshColor, Color? refreshBackgroundColor, required Future<void> onRefresh()?}) Widget
A function that returns a widget based on the state of loading, empty content, or displaying data.
runDebouncer(VoidCallback action, {int milliseconds = 800}) → void
showToast(String? msg, {BuildContext? context, Duration? duration, Duration? animDuration, StyledToastPosition? position, TextStyle? textStyle, EdgeInsetsGeometry? textPadding, double toastHorizontalMargin = _defaultHorizontalMargin, Color? backgroundColor, BorderRadius? borderRadius, ShapeBorder? shapeBorder, VoidCallback? onDismiss, TextDirection? textDirection, bool? dismissOtherToast, StyledToastAnimation? animation, StyledToastAnimation? reverseAnimation, Alignment? alignment, Axis? axis, Offset? startOffset, Offset? endOffset, Offset? reverseStartOffset, Offset? reverseEndOffset, TextAlign? textAlign, Curve? curve, Curve? reverseCurve, bool? fullWidth, bool? isHideKeyboard, CustomAnimationBuilder? animationBuilder, CustomAnimationBuilder? reverseAnimBuilder, bool? isIgnoring, OnInitStateCallback? onInitState}) ToastFuture
Show normal toast with style and animation.
showToastError({required String msg, Color? backgroundColor, Widget? icon, BuildContext? context}) → void
showToastSmart({required String msg, required ToastStatus status, required Widget icon, Color? backgroundColor, Color? textColor, BuildContext? context, double radius = 12, BorderRadiusGeometry? borderRadius}) → void
showToastSuccess({required String msg, Color? backgroundColor, Widget? icon, BuildContext? context}) → void
showToastWidget({BuildContext? context, Duration? duration, Duration? animDuration, VoidCallback? onDismiss, bool? dismissOtherToast, TextDirection? textDirection, Alignment? alignment, Axis? axis, Offset? startOffset, Offset? endOffset, Offset? reverseStartOffset, Offset? reverseEndOffset, StyledToastPosition? position, StyledToastAnimation? animation, StyledToastAnimation? reverseAnimation, Curve? curve, Curve? reverseCurve, bool? isHideKeyboard, CustomAnimationBuilder? animationBuilder, CustomAnimationBuilder? reverseAnimBuilder, bool? isIgnoring, OnInitStateCallback? onInitState, required Widget builder(BuildContext? context, StyledToastTheme? theme)}) ToastFuture
Show custom content widget for toasting.

Typedefs

CustomAnimationBuilder = Widget Function(BuildContext context, AnimationController controller, Duration duration, Widget child)
Builder method for custom animation.
FontSizeResolver = double Function(num fontSize, MainWidgetsUtil instance)
LottieDecoder = Future<LottieComposition?> Function(List<int> bytes)
A function that knows how to transform a list of bytes to a LottieComposition
LottieImageProviderFactory = ImageProvider<Object>? Function(LottieImageAsset)
OnInitStateCallback = dynamic Function(Duration toastDuration, Duration animDuration)
Callback of the life cycle hook initState of toast widget.