CustomSnackBarTheme constructor

CustomSnackBarTheme({
  1. Duration defaultDuration = const Duration(minutes: 5),
  2. bool showDefaultAction = true,
  3. TextStyle? textStyle,
  4. int maxLines = 2,
  5. Color loadingSnackBarColor = const Color(0xFF81C784),
  6. Duration loadingSnackBarDuration = const Duration(minutes: 3),
  7. TextStyle? loadingSnackBarTextStyle,
  8. Color errorSnackBarColor = const Color(0xFFE57373),
  9. Duration errorSnackBarDuration = const Duration(seconds: 10),
  10. TextStyle? errorSnackBarTextStyle,
})

This can be used to provide additional theme information for CustomSnackBar.

This is not a replacement to SnackBarThemeData. But this provide additional control over the CustomSnackBar. Note that values from this will override the values in SnackBarThemeData.

For the settings that are not present here, please take a look at the SnackBarThemeData and set the appropriate values in the default theme of the Flutter application.

Implementation

CustomSnackBarTheme({
  this.defaultDuration = const Duration(minutes: 5),
  this.showDefaultAction = true,
  this.textStyle,
  this.maxLines = 2,
  this.loadingSnackBarColor = const Color(0xFF81C784),
  this.loadingSnackBarDuration = const Duration(minutes: 3),
  this.loadingSnackBarTextStyle,
  this.errorSnackBarColor = const Color(0xFFE57373),
  this.errorSnackBarDuration = const Duration(seconds: 10),
  this.errorSnackBarTextStyle,
});