From bfaa4a5bce18de4821636c4578b2a26e8baf062a Mon Sep 17 00:00:00 2001 From: Tom Robiquet Date: Thu, 25 Apr 2019 00:05:02 +0100 Subject: [PATCH] Added required parameters to FlexibleSpaceBarSettings (#30612) --- .../lib/src/material/flexible_space_bar.dart | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index cbef109376..6c3ac7ac4d 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -260,14 +260,24 @@ class FlexibleSpaceBarSettings extends InheritedWidget { /// /// Used by [Scaffold] and [SliverAppBar]. [child] must have a /// [FlexibleSpaceBar] widget in its tree for the settings to take affect. + /// + /// The required [toolbarOpacity], [minExtent], [maxExtent], [currentExtent], + /// and [child] parameters must not be null. const FlexibleSpaceBarSettings({ Key key, - this.toolbarOpacity, - this.minExtent, - this.maxExtent, + @required this.toolbarOpacity, + @required this.minExtent, + @required this.maxExtent, @required this.currentExtent, @required Widget child, - }) : assert(currentExtent != null), + }) : assert(toolbarOpacity != null), + assert(minExtent != null && minExtent >= 0), + assert(maxExtent != null && maxExtent >= 0), + assert(currentExtent != null && currentExtent >= 0), + assert(toolbarOpacity >= 0.0), + assert(minExtent <= maxExtent), + assert(minExtent <= currentExtent), + assert(currentExtent <= maxExtent), super(key: key, child: child); /// Affects how transparent the text within the toolbar appears.