CINXE.COM
BoxConstraints class - rendering library - Dart API
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no"> <meta name="description" content="API docs for the BoxConstraints class from the rendering library, for the Dart programming language."> <title>BoxConstraints class - rendering library - Dart API</title> <!-- required because all the links are pseudo-absolute --> <base href="../"> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0" rel="stylesheet"> <link rel="stylesheet" href="static-assets/github.css?v1"> <link rel="stylesheet" href="static-assets/styles.css?v1"> <link rel="icon" href="static-assets/favicon.png?v1"> <!-- style overrides for dartdoc --> <style> @import 'https://fonts.googleapis.com/css?family=Roboto:500,400italic,300,400,100i'; @import 'https://fonts.googleapis.com/css?family=Google+Sans:500,400italic,300,400,100i'; @import 'https://fonts.googleapis.com/css?family=Open+Sans:500,400italic,300,400,100i'; @import 'https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Sharp|Material+Icons+Round'; </style> <link href="https://flutter.github.io/assets-for-api-docs/assets/cupertino/cupertino.css" rel="stylesheet" type="text/css"> <link href="../assets/overrides.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Sharp|Material+Icons+Round" rel="stylesheet"> <style> /* Rule for sizing the icon. */ .md-36 { font-size: 36px; } </style> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f) })(window,document,'script','dataLayer','GTM-ND4LWWZ');</script> <!-- End Google Tag Manager --> <!-- Cookie Banner --> <link rel="stylesheet" href="https://www.gstatic.com/glue/cookienotificationbar/cookienotificationbar.min.css"> <!-- End Cookie Banner --> <script async="" defer="" src="../assets/api_survey.js"></script> <!-- Styles and scripting for handling custom code snippets --> <link href="../assets/snippets.css" rel="stylesheet" type="text/css"> <script src="../assets/snippets.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Flutter API" href="/opensearch.xml"/> </head> <body data-base-href="../" data-using-base-href="true" class="light-theme"> <div id="overlay-under-drawer"></div> <header id="title"> <span id="sidenav-left-toggle" class="material-symbols-outlined" role="button" tabindex="0">menu</span> <ol class="breadcrumbs gt-separated dark hidden-xs"> <li><a href="index.html">Flutter</a></li> <li><a href="rendering/rendering-library.html">rendering.dart</a></li> <li class="self-crumb">BoxConstraints class</li> </ol> <div class="self-name">BoxConstraints</div> <form class="search navbar-right" role="search"> <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search..."> </form> <div class="toggle" id="theme-button" title="Toggle brightness"> <label for="theme"> <input type="checkbox" id="theme" value="light-theme"> <span id="dark-theme-button" class="material-symbols-outlined"> dark_mode </span> <span id="light-theme-button" class="material-symbols-outlined"> light_mode </span> </label> </div> </header> <main> <div id="dartdoc-main-content" class="main-content" data-above-sidebar="rendering/rendering-library-sidebar.html" data-below-sidebar="rendering/BoxConstraints-class-sidebar.html"> <div> <div id="external-links" class="btn-group"><a title="View source code" class="source-link" href="https://github.com/flutter/flutter/blob/main/packages/flutter/lib/src/rendering/box.dart#L91"><span class="material-symbols-outlined">description</span></a></div> <h1><span class="kind-class">BoxConstraints</span> class </h1></div> <section class="desc markdown"> <p>Immutable layout constraints for <a href="rendering/RenderBox-class.html">RenderBox</a> layout.</p> <p>A <a href="dart-ui/Size-class.html">Size</a> respects a <a href="rendering/BoxConstraints-class.html">BoxConstraints</a> if, and only if, all of the following relations hold:</p> <ul> <li><a href="rendering/BoxConstraints/minWidth.html">minWidth</a> <= <a href="dart-ui/Size/width.html">Size.width</a> <= <a href="rendering/BoxConstraints/maxWidth.html">maxWidth</a></li> <li><a href="rendering/BoxConstraints/minHeight.html">minHeight</a> <= <a href="dart-ui/Size/height.html">Size.height</a> <= <a href="rendering/BoxConstraints/maxHeight.html">maxHeight</a></li> </ul> <p>The constraints themselves must satisfy these relations:</p> <ul> <li>0.0 <= <a href="rendering/BoxConstraints/minWidth.html">minWidth</a> <= <a href="rendering/BoxConstraints/maxWidth.html">maxWidth</a> <= <a href="dart-core/double/infinity-constant.html">double.infinity</a></li> <li>0.0 <= <a href="rendering/BoxConstraints/minHeight.html">minHeight</a> <= <a href="rendering/BoxConstraints/maxHeight.html">maxHeight</a> <= <a href="dart-core/double/infinity-constant.html">double.infinity</a></li> </ul> <p><a href="dart-core/double/infinity-constant.html">double.infinity</a> is a legal value for each constraint.</p> <h2 id="the-box-layout-model">The box layout model</h2> <p>Render objects in the Flutter framework are laid out by a one-pass layout model which walks down the render tree passing constraints, then walks back up the render tree passing concrete geometry.</p> <p>For boxes, the constraints are <a href="rendering/BoxConstraints-class.html">BoxConstraints</a>, which, as described herein, consist of four numbers: a minimum width <a href="rendering/BoxConstraints/minWidth.html">minWidth</a>, a maximum width <a href="rendering/BoxConstraints/maxWidth.html">maxWidth</a>, a minimum height <a href="rendering/BoxConstraints/minHeight.html">minHeight</a>, and a maximum height <a href="rendering/BoxConstraints/maxHeight.html">maxHeight</a>.</p> <p>The geometry for boxes consists of a <a href="dart-ui/Size-class.html">Size</a>, which must satisfy the constraints described above.</p> <p>Each <a href="rendering/RenderBox-class.html">RenderBox</a> (the objects that provide the layout models for box widgets) receives <a href="rendering/BoxConstraints-class.html">BoxConstraints</a> from its parent, then lays out each of its children, then picks a <a href="dart-ui/Size-class.html">Size</a> that satisfies the <a href="rendering/BoxConstraints-class.html">BoxConstraints</a>.</p> <p>Render objects position their children independently of laying them out. Frequently, the parent will use the children's sizes to determine their position. A child does not know its position and will not necessarily be laid out again, or repainted, if its position changes.</p> <h2 id="terminology">Terminology</h2> <p>When the minimum constraints and the maximum constraint in an axis are the same, that axis is <em>tightly</em> constrained. See: <a href="rendering/BoxConstraints/BoxConstraints.tightFor.html"> BoxConstraints.tightFor</a>, <a href="rendering/BoxConstraints/BoxConstraints.tightForFinite.html">BoxConstraints.tightForFinite</a>, <a href="rendering/BoxConstraints/tighten.html">tighten</a>, <a href="rendering/BoxConstraints/hasTightWidth.html">hasTightWidth</a>, <a href="rendering/BoxConstraints/hasTightHeight.html">hasTightHeight</a>, <a href="rendering/BoxConstraints/isTight.html">isTight</a>.</p> <p>An axis with a minimum constraint of 0.0 is <em>loose</em> (regardless of the maximum constraint; if it is also 0.0, then the axis is simultaneously tight and loose!). See: <a href="rendering/BoxConstraints/BoxConstraints.loose.html">BoxConstraints.loose</a>, <a href="rendering/BoxConstraints/loosen.html">loosen</a>.</p> <p>An axis whose maximum constraint is not infinite is <em>bounded</em>. See: <a href="rendering/BoxConstraints/hasBoundedWidth.html">hasBoundedWidth</a>, <a href="rendering/BoxConstraints/hasBoundedHeight.html">hasBoundedHeight</a>.</p> <p>An axis whose maximum constraint is infinite is <em>unbounded</em>. An axis is <em>expanding</em> if it is tightly infinite (its minimum and maximum constraints are both infinite). See: <a href="rendering/BoxConstraints/BoxConstraints.expand.html">BoxConstraints.expand</a>.</p> <p>An axis whose <em>minimum</em> constraint is infinite is just said to be <em>infinite</em> (since by definition the maximum constraint must also be infinite in that case). See: <a href="rendering/BoxConstraints/hasInfiniteWidth.html">hasInfiniteWidth</a>, <a href="rendering/BoxConstraints/hasInfiniteHeight.html">hasInfiniteHeight</a>.</p> <p>A size is <em>constrained</em> when it satisfies a <a href="rendering/BoxConstraints-class.html">BoxConstraints</a> description. See: <a href="rendering/BoxConstraints/constrain.html">constrain</a>, <a href="rendering/BoxConstraints/constrainWidth.html">constrainWidth</a>, <a href="rendering/BoxConstraints/constrainHeight.html">constrainHeight</a>, <a href="rendering/BoxConstraints/constrainDimensions.html">constrainDimensions</a>, <a href="rendering/BoxConstraints/constrainSizeAndAttemptToPreserveAspectRatio.html">constrainSizeAndAttemptToPreserveAspectRatio</a>, <a href="rendering/BoxConstraints/isSatisfiedBy.html">isSatisfiedBy</a>.</p> </section> <section> <dl class="dl-horizontal"> <dt>Inheritance</dt> <dd> <ul class="gt-separated dark clazz-relationships"> <li><a href="dart-core/Object-class.html">Object</a></li> <li><a href="rendering/Constraints-class.html">Constraints</a></li> <li>BoxConstraints</li> </ul> </dd> </dl> </section> <section class="summary offset-anchor" id="constructors"> <h2>Constructors</h2> <dl class="constructor-summary-list"> <dt id="BoxConstraints" class="callable"> <span class="name"><a href="rendering/BoxConstraints/BoxConstraints.html">BoxConstraints</a></span><span class="signature">({<span class="parameter" id="-param-minWidth"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">minWidth</span> = <span class="default-value">0.0</span>, </span><span class="parameter" id="-param-maxWidth"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">maxWidth</span> = <span class="default-value">double.infinity</span>, </span><span class="parameter" id="-param-minHeight"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">minHeight</span> = <span class="default-value">0.0</span>, </span><span class="parameter" id="-param-maxHeight"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">maxHeight</span> = <span class="default-value">double.infinity</span></span>})</span> </dt> <dd> Creates box constraints with the given constraints. <div class="constructor-modifier features">const</div> </dd> <dt id="BoxConstraints.expand" class="callable"> <span class="name"><a href="rendering/BoxConstraints/BoxConstraints.expand.html">BoxConstraints.expand</a></span><span class="signature">({<span class="parameter" id="expand-param-width"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">width</span>, </span><span class="parameter" id="expand-param-height"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">height</span></span>})</span> </dt> <dd> Creates box constraints that expand to fill another box constraints. <div class="constructor-modifier features">const</div> </dd> <dt id="BoxConstraints.fromViewConstraints" class="callable"> <span class="name"><a href="rendering/BoxConstraints/BoxConstraints.fromViewConstraints.html">BoxConstraints.fromViewConstraints</a></span><span class="signature">(<span class="parameter" id="fromViewConstraints-param-constraints"><span class="type-annotation"><a href="dart-ui/ViewConstraints-class.html">ViewConstraints</a></span> <span class="parameter-name">constraints</span></span>)</span> </dt> <dd> Creates box constraints that match the given view constraints. </dd> <dt id="BoxConstraints.loose" class="callable"> <span class="name"><a href="rendering/BoxConstraints/BoxConstraints.loose.html">BoxConstraints.loose</a></span><span class="signature">(<span class="parameter" id="loose-param-size"><span class="type-annotation"><a href="dart-ui/Size-class.html">Size</a></span> <span class="parameter-name">size</span></span>)</span> </dt> <dd> Creates box constraints that forbid sizes larger than the given size. </dd> <dt id="BoxConstraints.tight" class="callable"> <span class="name"><a href="rendering/BoxConstraints/BoxConstraints.tight.html">BoxConstraints.tight</a></span><span class="signature">(<span class="parameter" id="tight-param-size"><span class="type-annotation"><a href="dart-ui/Size-class.html">Size</a></span> <span class="parameter-name">size</span></span>)</span> </dt> <dd> Creates box constraints that is respected only by the given size. </dd> <dt id="BoxConstraints.tightFor" class="callable"> <span class="name"><a href="rendering/BoxConstraints/BoxConstraints.tightFor.html">BoxConstraints.tightFor</a></span><span class="signature">({<span class="parameter" id="tightFor-param-width"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">width</span>, </span><span class="parameter" id="tightFor-param-height"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">height</span></span>})</span> </dt> <dd> Creates box constraints that require the given width or height. <div class="constructor-modifier features">const</div> </dd> <dt id="BoxConstraints.tightForFinite" class="callable"> <span class="name"><a href="rendering/BoxConstraints/BoxConstraints.tightForFinite.html">BoxConstraints.tightForFinite</a></span><span class="signature">({<span class="parameter" id="tightForFinite-param-width"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">width</span> = <span class="default-value">double.infinity</span>, </span><span class="parameter" id="tightForFinite-param-height"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">height</span> = <span class="default-value">double.infinity</span></span>})</span> </dt> <dd> Creates box constraints that require the given width or height, except if they are infinite. <div class="constructor-modifier features">const</div> </dd> </dl> </section> <section class="summary offset-anchor" id="instance-properties"> <h2>Properties</h2> <dl class="properties"> <dt id="biggest" class="property"> <span class="name"><a href="rendering/BoxConstraints/biggest.html">biggest</a></span> <span class="signature">→ <a href="dart-ui/Size-class.html">Size</a></span> </dt> <dd> The biggest size that satisfies the constraints. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="flipped" class="property"> <span class="name"><a href="rendering/BoxConstraints/flipped.html">flipped</a></span> <span class="signature">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </dt> <dd> A box constraints with the width and height constraints flipped. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="hasBoundedHeight" class="property"> <span class="name"><a href="rendering/BoxConstraints/hasBoundedHeight.html">hasBoundedHeight</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Whether there is an upper bound on the maximum height. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="hasBoundedWidth" class="property"> <span class="name"><a href="rendering/BoxConstraints/hasBoundedWidth.html">hasBoundedWidth</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Whether there is an upper bound on the maximum width. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="hashCode" class="property"> <span class="name"><a href="rendering/BoxConstraints/hashCode.html">hashCode</a></span> <span class="signature">→ <a href="dart-core/int-class.html">int</a></span> </dt> <dd> The hash code for this object. <div class="features"><span class="feature">no setter</span><span class="feature">override</span></div> </dd> <dt id="hasInfiniteHeight" class="property"> <span class="name"><a href="rendering/BoxConstraints/hasInfiniteHeight.html">hasInfiniteHeight</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Whether the height constraint is infinite. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="hasInfiniteWidth" class="property"> <span class="name"><a href="rendering/BoxConstraints/hasInfiniteWidth.html">hasInfiniteWidth</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Whether the width constraint is infinite. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="hasTightHeight" class="property"> <span class="name"><a href="rendering/BoxConstraints/hasTightHeight.html">hasTightHeight</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Whether there is exactly one height value that satisfies the constraints. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="hasTightWidth" class="property"> <span class="name"><a href="rendering/BoxConstraints/hasTightWidth.html">hasTightWidth</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Whether there is exactly one width value that satisfies the constraints. <div class="features"><span class="feature">no setter</span></div> </dd> <dt id="isNormalized" class="property"> <span class="name"><a href="rendering/BoxConstraints/isNormalized.html">isNormalized</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Returns whether the object's constraints are normalized. Constraints are normalized if the minimums are less than or equal to the corresponding maximums. <div class="features"><span class="feature">no setter</span><span class="feature">override</span></div> </dd> <dt id="isTight" class="property"> <span class="name"><a href="rendering/BoxConstraints/isTight.html">isTight</a></span> <span class="signature">→ <a href="dart-core/bool-class.html">bool</a></span> </dt> <dd> Whether there is exactly one size that satisfies the constraints. <div class="features"><span class="feature">no setter</span><span class="feature">override</span></div> </dd> <dt id="maxHeight" class="property"> <span class="name"><a href="rendering/BoxConstraints/maxHeight.html">maxHeight</a></span> <span class="signature">→ <a href="dart-core/double-class.html">double</a></span> </dt> <dd> The maximum height that satisfies the constraints. <div class="features"><span class="feature">final</span></div> </dd> <dt id="maxWidth" class="property"> <span class="name"><a href="rendering/BoxConstraints/maxWidth.html">maxWidth</a></span> <span class="signature">→ <a href="dart-core/double-class.html">double</a></span> </dt> <dd> The maximum width that satisfies the constraints. <div class="features"><span class="feature">final</span></div> </dd> <dt id="minHeight" class="property"> <span class="name"><a href="rendering/BoxConstraints/minHeight.html">minHeight</a></span> <span class="signature">→ <a href="dart-core/double-class.html">double</a></span> </dt> <dd> The minimum height that satisfies the constraints. <div class="features"><span class="feature">final</span></div> </dd> <dt id="minWidth" class="property"> <span class="name"><a href="rendering/BoxConstraints/minWidth.html">minWidth</a></span> <span class="signature">→ <a href="dart-core/double-class.html">double</a></span> </dt> <dd> The minimum width that satisfies the constraints. <div class="features"><span class="feature">final</span></div> </dd> <dt id="runtimeType" class="property inherited"> <span class="name"><a href="dart-core/Object/runtimeType.html">runtimeType</a></span> <span class="signature">→ <a href="dart-core/Type-class.html">Type</a></span> </dt> <dd class="inherited"> A representation of the runtime type of the object. <div class="features"><span class="feature">no setter</span><span class="feature">inherited</span></div> </dd> <dt id="smallest" class="property"> <span class="name"><a href="rendering/BoxConstraints/smallest.html">smallest</a></span> <span class="signature">→ <a href="dart-ui/Size-class.html">Size</a></span> </dt> <dd> The smallest size that satisfies the constraints. <div class="features"><span class="feature">no setter</span></div> </dd> </dl> </section> <section class="summary offset-anchor" id="instance-methods"> <h2>Methods</h2> <dl class="callables"> <dt id="constrain" class="callable"> <span class="name"><a href="rendering/BoxConstraints/constrain.html">constrain</a></span><span class="signature">(<wbr><span class="parameter" id="constrain-param-size"><span class="type-annotation"><a href="dart-ui/Size-class.html">Size</a></span> <span class="parameter-name">size</span></span>) <span class="returntype parameter">→ <a href="dart-ui/Size-class.html">Size</a></span> </span> </dt> <dd> Returns the size that both satisfies the constraints and is as close as possible to the given size. </dd> <dt id="constrainDimensions" class="callable"> <span class="name"><a href="rendering/BoxConstraints/constrainDimensions.html">constrainDimensions</a></span><span class="signature">(<wbr><span class="parameter" id="constrainDimensions-param-width"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">width</span>, </span><span class="parameter" id="constrainDimensions-param-height"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">height</span></span>) <span class="returntype parameter">→ <a href="dart-ui/Size-class.html">Size</a></span> </span> </dt> <dd> Returns the size that both satisfies the constraints and is as close as possible to the given width and height. </dd> <dt id="constrainHeight" class="callable"> <span class="name"><a href="rendering/BoxConstraints/constrainHeight.html">constrainHeight</a></span><span class="signature">(<wbr>[<span class="parameter" id="constrainHeight-param-height"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">height</span> = <span class="default-value">double.infinity</span></span>]) <span class="returntype parameter">→ <a href="dart-core/double-class.html">double</a></span> </span> </dt> <dd> Returns the height that both satisfies the constraints and is as close as possible to the given height. </dd> <dt id="constrainSizeAndAttemptToPreserveAspectRatio" class="callable"> <span class="name"><a href="rendering/BoxConstraints/constrainSizeAndAttemptToPreserveAspectRatio.html">constrainSizeAndAttemptToPreserveAspectRatio</a></span><span class="signature">(<wbr><span class="parameter" id="constrainSizeAndAttemptToPreserveAspectRatio-param-size"><span class="type-annotation"><a href="dart-ui/Size-class.html">Size</a></span> <span class="parameter-name">size</span></span>) <span class="returntype parameter">→ <a href="dart-ui/Size-class.html">Size</a></span> </span> </dt> <dd> Returns a size that attempts to meet the following conditions, in order: </dd> <dt id="constrainWidth" class="callable"> <span class="name"><a href="rendering/BoxConstraints/constrainWidth.html">constrainWidth</a></span><span class="signature">(<wbr>[<span class="parameter" id="constrainWidth-param-width"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">width</span> = <span class="default-value">double.infinity</span></span>]) <span class="returntype parameter">→ <a href="dart-core/double-class.html">double</a></span> </span> </dt> <dd> Returns the width that both satisfies the constraints and is as close as possible to the given width. </dd> <dt id="copyWith" class="callable"> <span class="name"><a href="rendering/BoxConstraints/copyWith.html">copyWith</a></span><span class="signature">(<wbr>{<span class="parameter" id="copyWith-param-minWidth"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">minWidth</span>, </span><span class="parameter" id="copyWith-param-maxWidth"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">maxWidth</span>, </span><span class="parameter" id="copyWith-param-minHeight"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">minHeight</span>, </span><span class="parameter" id="copyWith-param-maxHeight"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">maxHeight</span></span>}) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Creates a copy of this box constraints but with the given fields replaced with the new values. </dd> <dt id="debugAssertIsValid" class="callable"> <span class="name"><a href="rendering/BoxConstraints/debugAssertIsValid.html">debugAssertIsValid</a></span><span class="signature">(<wbr>{<span class="parameter" id="debugAssertIsValid-param-isAppliedConstraint"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">isAppliedConstraint</span> = <span class="default-value">false</span>, </span><span class="parameter" id="debugAssertIsValid-param-informationCollector"><span class="type-annotation"><a href="foundation/InformationCollector.html">InformationCollector</a>?</span> <span class="parameter-name">informationCollector</span></span>}) <span class="returntype parameter">→ <a href="dart-core/bool-class.html">bool</a></span> </span> </dt> <dd> Asserts that the constraints are valid. <div class="features"><span class="feature">override</span></div> </dd> <dt id="deflate" class="callable"> <span class="name"><a href="rendering/BoxConstraints/deflate.html">deflate</a></span><span class="signature">(<wbr><span class="parameter" id="deflate-param-edges"><span class="type-annotation"><a href="painting/EdgeInsetsGeometry-class.html">EdgeInsetsGeometry</a></span> <span class="parameter-name">edges</span></span>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Returns new box constraints that are smaller by the given edge dimensions. </dd> <dt id="enforce" class="callable"> <span class="name"><a href="rendering/BoxConstraints/enforce.html">enforce</a></span><span class="signature">(<wbr><span class="parameter" id="enforce-param-constraints"><span class="type-annotation"><a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> <span class="parameter-name">constraints</span></span>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Returns new box constraints that respect the given constraints while being as close as possible to the original constraints. </dd> <dt id="heightConstraints" class="callable"> <span class="name"><a href="rendering/BoxConstraints/heightConstraints.html">heightConstraints</a></span><span class="signature">(<wbr>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Returns box constraints with the same height constraints but with unconstrained width. </dd> <dt id="isSatisfiedBy" class="callable"> <span class="name"><a href="rendering/BoxConstraints/isSatisfiedBy.html">isSatisfiedBy</a></span><span class="signature">(<wbr><span class="parameter" id="isSatisfiedBy-param-size"><span class="type-annotation"><a href="dart-ui/Size-class.html">Size</a></span> <span class="parameter-name">size</span></span>) <span class="returntype parameter">→ <a href="dart-core/bool-class.html">bool</a></span> </span> </dt> <dd> Whether the given size satisfies the constraints. </dd> <dt id="loosen" class="callable"> <span class="name"><a href="rendering/BoxConstraints/loosen.html">loosen</a></span><span class="signature">(<wbr>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Returns new box constraints that remove the minimum width and height requirements. </dd> <dt id="normalize" class="callable"> <span class="name"><a href="rendering/BoxConstraints/normalize.html">normalize</a></span><span class="signature">(<wbr>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Returns a box constraints that <a href="rendering/BoxConstraints/isNormalized.html">isNormalized</a>. </dd> <dt id="noSuchMethod" class="callable inherited"> <span class="name"><a href="dart-core/Object/noSuchMethod.html">noSuchMethod</a></span><span class="signature">(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation"><a href="dart-core/Invocation-class.html">Invocation</a></span> <span class="parameter-name">invocation</span></span>) <span class="returntype parameter">→ dynamic</span> </span> </dt> <dd class="inherited"> Invoked when a nonexistent method or property is accessed. <div class="features"><span class="feature">inherited</span></div> </dd> <dt id="tighten" class="callable"> <span class="name"><a href="rendering/BoxConstraints/tighten.html">tighten</a></span><span class="signature">(<wbr>{<span class="parameter" id="tighten-param-width"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">width</span>, </span><span class="parameter" id="tighten-param-height"><span class="type-annotation"><a href="dart-core/double-class.html">double</a>?</span> <span class="parameter-name">height</span></span>}) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Returns new box constraints with a tight width and/or height as close to the given width and height as possible while still respecting the original box constraints. </dd> <dt id="toString" class="callable"> <span class="name"><a href="rendering/BoxConstraints/toString.html">toString</a></span><span class="signature">(<wbr>) <span class="returntype parameter">→ <a href="dart-core/String-class.html">String</a></span> </span> </dt> <dd> A string representation of this object. <div class="features"><span class="feature">override</span></div> </dd> <dt id="widthConstraints" class="callable"> <span class="name"><a href="rendering/BoxConstraints/widthConstraints.html">widthConstraints</a></span><span class="signature">(<wbr>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Returns box constraints with the same width constraints but with unconstrained height. </dd> </dl> </section> <section class="summary offset-anchor" id="operators"> <h2>Operators</h2> <dl class="callables"> <dt id="operator %" class="callable"> <span class="name"><a href="rendering/BoxConstraints/operator_modulo.html">operator %</a></span><span class="signature">(<wbr><span class="parameter" id="%-param-value"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">value</span></span>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Computes the remainder of each constraint parameter by the given value. </dd> <dt id="operator *" class="callable"> <span class="name"><a href="rendering/BoxConstraints/operator_multiply.html">operator *</a></span><span class="signature">(<wbr><span class="parameter" id="*-param-factor"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">factor</span></span>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Scales each constraint parameter by the given factor. </dd> <dt id="operator /" class="callable"> <span class="name"><a href="rendering/BoxConstraints/operator_divide.html">operator /</a></span><span class="signature">(<wbr><span class="parameter" id="/-param-factor"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">factor</span></span>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Scales each constraint parameter by the inverse of the given factor. </dd> <dt id="operator ==" class="callable"> <span class="name"><a href="rendering/BoxConstraints/operator_equals.html">operator ==</a></span><span class="signature">(<wbr><span class="parameter" id="==-param-other"><span class="type-annotation"><a href="dart-core/Object-class.html">Object</a></span> <span class="parameter-name">other</span></span>) <span class="returntype parameter">→ <a href="dart-core/bool-class.html">bool</a></span> </span> </dt> <dd> The equality operator. <div class="features"><span class="feature">override</span></div> </dd> <dt id="operator ~/" class="callable"> <span class="name"><a href="rendering/BoxConstraints/operator_truncate_divide.html">operator ~/</a></span><span class="signature">(<wbr><span class="parameter" id="~/-param-factor"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">factor</span></span>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a></span> </span> </dt> <dd> Scales each constraint parameter by the inverse of the given factor, rounded to the nearest integer. </dd> </dl> </section> <section class="summary offset-anchor" id="static-methods"> <h2>Static Methods</h2> <dl class="callables"> <dt id="lerp" class="callable"> <span class="name"><a href="rendering/BoxConstraints/lerp.html">lerp</a></span><span class="signature">(<wbr><span class="parameter" id="lerp-param-a"><span class="type-annotation"><a href="rendering/BoxConstraints-class.html">BoxConstraints</a>?</span> <span class="parameter-name">a</span>, </span><span class="parameter" id="lerp-param-b"><span class="type-annotation"><a href="rendering/BoxConstraints-class.html">BoxConstraints</a>?</span> <span class="parameter-name">b</span>, </span><span class="parameter" id="lerp-param-t"><span class="type-annotation"><a href="dart-core/double-class.html">double</a></span> <span class="parameter-name">t</span></span>) <span class="returntype parameter">→ <a href="rendering/BoxConstraints-class.html">BoxConstraints</a>?</span> </span> </dt> <dd> Linearly interpolate between two BoxConstraints. </dd> </dl> </section> </div> <!-- /.main-content --> <div id="dartdoc-sidebar-left" class="sidebar sidebar-offcanvas-left"> <!-- The search input and breadcrumbs below are only responsively visible at low resolutions. --> <header id="header-search-sidebar" class="hidden-l"> <form class="search-sidebar" role="search"> <input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search..."> </form> </header> <ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav"> <li><a href="index.html">Flutter</a></li> <li><a href="rendering/rendering-library.html">rendering</a></li> <li class="self-crumb">BoxConstraints class</li> </ol> <h5>rendering library</h5> <div id="dartdoc-sidebar-left-content"></div> </div> <div id="dartdoc-sidebar-right" class="sidebar sidebar-offcanvas-right"> </div><!--/.sidebar-offcanvas--> </main> <footer> <span class="no-break"> Flutter 0.0.0 </span> <script src="footer.js"></script> </footer> <script src="static-assets/highlight.pack.js?v1"></script> <script src="static-assets/docs.dart.js"></script> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-ND4LWWZ" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- Cookie Banner --> <div class="glue-footer"></div> <button aria-hidden="true" class="glue-footer__link glue-cookie-notification-bar-control">Cookies management controls</button> <script src="https://www.gstatic.com/glue/cookienotificationbar/cookienotificationbar.min.js" data-glue-cookie-notification-bar-category="2B"></script> <!-- End Cookie Banner --> </body> </html>