Commit 1e76c1f8 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Added backgroundColor to SnackBar (#6929)

parent 5ceaaeef
......@@ -113,6 +113,7 @@ class SnackBar extends StatelessWidget {
SnackBar({
Key key,
this.content,
this.backgroundColor,
this.action,
this.duration: _kSnackBarDisplayDuration,
this.animation
......@@ -125,6 +126,9 @@ class SnackBar extends StatelessWidget {
/// Typically a [Text] widget.
final Widget content;
/// The Snackbar's background color. By default the color is dark grey.
final Color backgroundColor;
/// (optional) An action that the user can take based on the snack bar.
///
/// For example, the snack bar might let the user undo the operation that
......@@ -201,7 +205,7 @@ class SnackBar extends StatelessWidget {
},
child: new Material(
elevation: 6,
color: _kSnackBackground,
color: backgroundColor ?? _kSnackBackground,
child: new Theme(
data: darkTheme,
child: new FadeTransition(
......@@ -238,6 +242,7 @@ class SnackBar extends StatelessWidget {
return new SnackBar(
key: key ?? fallbackKey,
content: content,
backgroundColor: backgroundColor,
action: action,
duration: duration,
animation: newAnimation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment