diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index cb958216b8..82bcaa421c 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -320,7 +320,13 @@ class _MaterialState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { final Color backgroundColor = _getBackgroundColor(context); - assert(backgroundColor != null || widget.type == MaterialType.transparency); + assert( + backgroundColor != null || widget.type == MaterialType.transparency, + 'If Material type is not MaterialType.transparency, a color must ' + 'either be passed in through the `color` property, or be defined ' + 'in the theme (ex. canvasColor != null if type is set to ' + 'MaterialType.canvas)' + ); Widget contents = widget.child; if (contents != null) { contents = AnimatedDefaultTextStyle(