Committed by
GitHub
Merge pull request #2014 from jonataslaw/retro-compatibility
add snackbar retrocompatibility
Showing
1 changed file
with
80 additions
and
1 deletions
| @@ -11,6 +11,85 @@ typedef OnTap = void Function(GetSnackBar snack); | @@ -11,6 +11,85 @@ typedef OnTap = void Function(GetSnackBar snack); | ||
| 11 | 11 | ||
| 12 | typedef SnackbarStatusCallback = void Function(SnackbarStatus? status); | 12 | typedef SnackbarStatusCallback = void Function(SnackbarStatus? status); | 
| 13 | 13 | ||
| 14 | +@Deprecated('use GetSnackBar') | ||
| 15 | +class GetBar extends GetSnackBar { | ||
| 16 | + GetBar({ | ||
| 17 | + Key? key, | ||
| 18 | + String? title, | ||
| 19 | + String? message, | ||
| 20 | + Widget? titleText, | ||
| 21 | + Widget? messageText, | ||
| 22 | + Widget? icon, | ||
| 23 | + bool shouldIconPulse = true, | ||
| 24 | + double? maxWidth, | ||
| 25 | + EdgeInsets margin = const EdgeInsets.all(0.0), | ||
| 26 | + EdgeInsets padding = const EdgeInsets.all(16), | ||
| 27 | + double borderRadius = 0.0, | ||
| 28 | + Color? borderColor, | ||
| 29 | + double borderWidth = 1.0, | ||
| 30 | + Color backgroundColor = const Color(0xFF303030), | ||
| 31 | + Color? leftBarIndicatorColor, | ||
| 32 | + List<BoxShadow>? boxShadows, | ||
| 33 | + Gradient? backgroundGradient, | ||
| 34 | + Widget? mainButton, | ||
| 35 | + OnTap? onTap, | ||
| 36 | + Duration? duration, | ||
| 37 | + bool isDismissible = true, | ||
| 38 | + DismissDirection? dismissDirection, | ||
| 39 | + bool showProgressIndicator = false, | ||
| 40 | + AnimationController? progressIndicatorController, | ||
| 41 | + Color? progressIndicatorBackgroundColor, | ||
| 42 | + Animation<Color>? progressIndicatorValueColor, | ||
| 43 | + SnackPosition snackPosition = SnackPosition.BOTTOM, | ||
| 44 | + SnackStyle snackStyle = SnackStyle.FLOATING, | ||
| 45 | + Curve forwardAnimationCurve = Curves.easeOutCirc, | ||
| 46 | + Curve reverseAnimationCurve = Curves.easeOutCirc, | ||
| 47 | + Duration animationDuration = const Duration(seconds: 1), | ||
| 48 | + double barBlur = 0.0, | ||
| 49 | + double overlayBlur = 0.0, | ||
| 50 | + Color overlayColor = Colors.transparent, | ||
| 51 | + Form? userInputForm, | ||
| 52 | + SnackbarStatusCallback? snackbarStatus, | ||
| 53 | + }) : super( | ||
| 54 | + key: key, | ||
| 55 | + title: title, | ||
| 56 | + message: message, | ||
| 57 | + titleText: titleText, | ||
| 58 | + messageText: messageText, | ||
| 59 | + icon: icon, | ||
| 60 | + shouldIconPulse: shouldIconPulse, | ||
| 61 | + maxWidth: maxWidth, | ||
| 62 | + margin: margin, | ||
| 63 | + padding: padding, | ||
| 64 | + borderRadius: borderRadius, | ||
| 65 | + borderColor: borderColor, | ||
| 66 | + borderWidth: borderWidth, | ||
| 67 | + backgroundColor: backgroundColor, | ||
| 68 | + leftBarIndicatorColor: leftBarIndicatorColor, | ||
| 69 | + boxShadows: boxShadows, | ||
| 70 | + backgroundGradient: backgroundGradient, | ||
| 71 | + mainButton: mainButton, | ||
| 72 | + onTap: onTap, | ||
| 73 | + duration: duration, | ||
| 74 | + isDismissible: isDismissible, | ||
| 75 | + dismissDirection: dismissDirection, | ||
| 76 | + showProgressIndicator: showProgressIndicator, | ||
| 77 | + progressIndicatorController: progressIndicatorController, | ||
| 78 | + progressIndicatorBackgroundColor: progressIndicatorBackgroundColor, | ||
| 79 | + progressIndicatorValueColor: progressIndicatorValueColor, | ||
| 80 | + snackPosition: snackPosition, | ||
| 81 | + snackStyle: snackStyle, | ||
| 82 | + forwardAnimationCurve: forwardAnimationCurve, | ||
| 83 | + reverseAnimationCurve: reverseAnimationCurve, | ||
| 84 | + animationDuration: animationDuration, | ||
| 85 | + barBlur: barBlur, | ||
| 86 | + overlayBlur: overlayBlur, | ||
| 87 | + overlayColor: overlayColor, | ||
| 88 | + userInputForm: userInputForm, | ||
| 89 | + snackbarStatus: snackbarStatus, | ||
| 90 | + ); | ||
| 91 | +} | ||
| 92 | + | ||
| 14 | class GetSnackBar extends StatefulWidget { | 93 | class GetSnackBar extends StatefulWidget { | 
| 15 | /// A callback for you to listen to the different Snack status | 94 | /// A callback for you to listen to the different Snack status | 
| 16 | final SnackbarStatusCallback? snackbarStatus; | 95 | final SnackbarStatusCallback? snackbarStatus; | 
| @@ -20,7 +99,7 @@ class GetSnackBar extends StatefulWidget { | @@ -20,7 +99,7 @@ class GetSnackBar extends StatefulWidget { | ||
| 20 | 99 | ||
| 21 | /// The direction in which the SnackBar can be dismissed. | 100 | /// The direction in which the SnackBar can be dismissed. | 
| 22 | /// | 101 | /// | 
| 23 | - /// Cannot be null, defaults to [DismissDirection.down] when | 102 | + /// Default is [DismissDirection.down] when | 
| 24 | /// [snackPosition] == [SnackPosition.BOTTOM] and [DismissDirection.up] | 103 | /// [snackPosition] == [SnackPosition.BOTTOM] and [DismissDirection.up] | 
| 25 | /// when [snackPosition] == [SnackPosition.TOP] | 104 | /// when [snackPosition] == [SnackPosition.TOP] | 
| 26 | final DismissDirection? dismissDirection; | 105 | final DismissDirection? dismissDirection; | 
- 
Please register or login to post a comment