[SYNC] Altered the laoding helper.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//s1 Imports
|
||||
//s2 Core Package Imports
|
||||
import 'dart:async';
|
||||
import 'package:astromic_elements/astromic_elements.dart' show AstromicWidgets;
|
||||
import 'package:flutter/material.dart';
|
||||
//s2 1st-party Package Imports
|
||||
//s2 3rd-party Package Imports
|
||||
@@ -23,7 +24,6 @@ class AstromicLoadingHelper {
|
||||
}) {
|
||||
_style = style;
|
||||
return GlobalLoaderOverlay(
|
||||
child: child,
|
||||
disableBackButton: !style.canDismess,
|
||||
closeOnBackButton: style.canDismess,
|
||||
//
|
||||
@@ -33,8 +33,25 @@ class AstromicLoadingHelper {
|
||||
switchOutCurve: style.outCurve,
|
||||
transitionBuilder: (Widget w, Animation<double> a) => style.animationBuilder?.call(w, a),
|
||||
//
|
||||
overlayColor: style.backgroundColor,
|
||||
overlayWidgetBuilder: (dynamic progress) => style.loadingWidget(progress),
|
||||
overlayColor: style.maskColor,
|
||||
overlayWidgetBuilder: (dynamic progress) => AstromicWidgets.blur(
|
||||
child: Container(),
|
||||
childOnTop: ConstrainedBox(
|
||||
constraints: const BoxConstraints.tightFor(),
|
||||
child: Center(
|
||||
child: Container(
|
||||
padding: style.loadingBoxPadding,
|
||||
decoration: BoxDecoration(
|
||||
color: style.loadingBoxColor,
|
||||
borderRadius: style.loadingBoxRadius,
|
||||
),
|
||||
child: style.loadingWidget(progress),
|
||||
),
|
||||
),
|
||||
),
|
||||
sigma: style.maskBlur != null ? (style.maskBlur!.$1.toDouble(), style.maskBlur!.$2.toDouble()) : null,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,11 @@ import 'package:flutter/material.dart';
|
||||
class AstromicLoadingOverlayStyle {
|
||||
final Widget Function(dynamic progress) loadingWidget;
|
||||
//
|
||||
final Color? backgroundColor;
|
||||
final (int sigmaX, int sigmaY)? backgroundBlur;
|
||||
final Color? maskColor;
|
||||
final (int sigmaX, int sigmaY)? maskBlur;
|
||||
final Color? loadingBoxColor;
|
||||
final EdgeInsetsGeometry? loadingBoxPadding;
|
||||
final BorderRadiusGeometry? loadingBoxRadius;
|
||||
//
|
||||
final bool canDismess;
|
||||
//
|
||||
@@ -15,8 +18,11 @@ class AstromicLoadingOverlayStyle {
|
||||
final Function(Widget child, Animation<double> animation)? animationBuilder;
|
||||
AstromicLoadingOverlayStyle({
|
||||
required this.loadingWidget,
|
||||
this.backgroundColor,
|
||||
this.backgroundBlur,
|
||||
this.maskColor,
|
||||
this.maskBlur,
|
||||
this.loadingBoxColor,
|
||||
this.loadingBoxPadding,
|
||||
this.loadingBoxRadius,
|
||||
this.canDismess = false,
|
||||
this.inCurve = Curves.easeOut,
|
||||
this.inDuration = const Duration(milliseconds: 250),
|
||||
@@ -27,8 +33,11 @@ class AstromicLoadingOverlayStyle {
|
||||
|
||||
AstromicLoadingOverlayStyle copyWith({
|
||||
Widget Function(dynamic progress)? loadingWidget,
|
||||
Color? backgroundColor,
|
||||
(int sigmaX, int sigmaY)? backgroundBlur,
|
||||
Color? maskColor,
|
||||
(int sigmaX, int sigmaY)? maskBlur,
|
||||
Color? loadingBoxColor,
|
||||
EdgeInsetsGeometry? loadingBoxPadding,
|
||||
BorderRadiusGeometry? loadingBoxRadius,
|
||||
bool? canDismess,
|
||||
Duration? inDuration,
|
||||
Duration? outDuration,
|
||||
@@ -38,8 +47,11 @@ class AstromicLoadingOverlayStyle {
|
||||
}) {
|
||||
return AstromicLoadingOverlayStyle(
|
||||
loadingWidget: loadingWidget ?? this.loadingWidget,
|
||||
backgroundColor: backgroundColor ?? this.backgroundColor,
|
||||
backgroundBlur: backgroundBlur ?? this.backgroundBlur,
|
||||
maskColor: maskColor ?? this.maskColor,
|
||||
maskBlur: maskBlur ?? this.maskBlur,
|
||||
loadingBoxColor: loadingBoxColor ?? this.loadingBoxColor,
|
||||
loadingBoxPadding: loadingBoxPadding ?? this.loadingBoxPadding,
|
||||
loadingBoxRadius: loadingBoxRadius ?? this.loadingBoxRadius,
|
||||
canDismess: canDismess ?? this.canDismess,
|
||||
inDuration: inDuration ?? this.inDuration,
|
||||
outDuration: outDuration ?? this.outDuration,
|
||||
@@ -51,6 +63,6 @@ class AstromicLoadingOverlayStyle {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AstromicLoadingOverlayStyle(loadingWidget: $loadingWidget, backgroundColor: $backgroundColor, backgroundBlur: $backgroundBlur, canDismess: $canDismess, inDuration: $inDuration, outDuration: $outDuration, inCurve: $inCurve, outCurve: $outCurve, animationBuilder: $animationBuilder)';
|
||||
return 'AstromicLoadingOverlayStyle(loadingWidget: $loadingWidget, maskColor: $maskColor, maskBlur: $maskBlur, loadingBoxColor: $loadingBoxColor, loadingBoxPadding: $loadingBoxPadding, loadingBoxRadius: $loadingBoxRadius, canDismess: $canDismess, inDuration: $inDuration, outDuration: $outDuration, inCurve: $inCurve, outCurve: $outCurve, animationBuilder: $animationBuilder)';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user