|
| 1 | +// Copyright 2013 The Flutter Authors |
| 2 | +// Use of this source code is governed by a BSD-style license that can be |
| 3 | +// found in the LICENSE file. |
| 4 | + |
| 5 | +// Do not edit by hand. The code is generated from data in the Material |
| 6 | +// Design token database by the script: |
| 7 | +// packages/material_ui/tool/gen_defaults/bin/gen_defaults.dart. |
| 8 | +part of '../motion.dart'; |
| 9 | + |
| 10 | +/// The set of springs in the Material specification. |
| 11 | +/// |
| 12 | +/// Material 3 Expressive motion uses springs, grouped into two motion schemes. |
| 13 | +/// The standard scheme eases into place with minimal bounce, and suits more |
| 14 | +/// utilitarian products. The expressive scheme overshoots and bounces into |
| 15 | +/// place, and suits hero moments and key interactions. |
| 16 | +/// |
| 17 | +/// Each scheme has springs for two types of motion, in three speeds: default, |
| 18 | +/// fast, and slow. |
| 19 | +/// |
| 20 | +/// * Spatial springs animate movement, such as position, size, rotation, and |
| 21 | +/// corner radius. |
| 22 | +/// * Effects springs animate properties that shouldn't overshoot, such as |
| 23 | +/// color and opacity. |
| 24 | +/// |
| 25 | +/// Most motion should use the default speed. Smaller elements can use the fast |
| 26 | +/// speed, and larger elements can use the slow speed. |
| 27 | +/// |
| 28 | +/// Material spring tokens define a stiffness and a damping ratio, but no |
| 29 | +/// mass. The Material token named `damping` is the damping ratio (ζ), not |
| 30 | +/// [SpringDescription.damping]. Each constant is the same as |
| 31 | +/// [SpringDescription.withDampingRatio] with a mass of 1.0 and the token's |
| 32 | +/// stiffness and damping ratio, so its damping is |
| 33 | +/// `ratio * 2.0 * sqrt(stiffness)`. For example, [standardDefaultSpatial] has |
| 34 | +/// a damping of `0.9 * 2.0 * sqrt(700.0)`, about 47.62. |
| 35 | +/// |
| 36 | +/// Use them with a `SpringSimulation`, for example through |
| 37 | +/// [AnimationController.animateWith]. |
| 38 | +/// |
| 39 | +/// See also: |
| 40 | +/// |
| 41 | +/// * [Durations] and [Easing], which are the Material tokens for curve-based |
| 42 | +/// animations. |
| 43 | +/// * [M3 guidelines: Motion physics system](https://m3.material.io/styles/motion/overview/how-it-works) |
| 44 | +/// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 45 | +abstract final class Springs { |
| 46 | + /// The standard default spatial spring in the Material specification. |
| 47 | + /// |
| 48 | + /// It has a stiffness of 700.0 and a damping ratio of 0.9. |
| 49 | + /// |
| 50 | + /// See also: |
| 51 | + /// |
| 52 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 53 | + static const SpringDescription standardDefaultSpatial = SpringDescription( |
| 54 | + mass: 1.0, |
| 55 | + stiffness: 700.0, |
| 56 | + damping: 47.62352359916263, |
| 57 | + ); |
| 58 | + |
| 59 | + /// The standard fast spatial spring in the Material specification. |
| 60 | + /// |
| 61 | + /// It has a stiffness of 1400.0 and a damping ratio of 0.9. |
| 62 | + /// |
| 63 | + /// See also: |
| 64 | + /// |
| 65 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 66 | + static const SpringDescription standardFastSpatial = SpringDescription( |
| 67 | + mass: 1.0, |
| 68 | + stiffness: 1400.0, |
| 69 | + damping: 67.34983296193096, |
| 70 | + ); |
| 71 | + |
| 72 | + /// The standard slow spatial spring in the Material specification. |
| 73 | + /// |
| 74 | + /// It has a stiffness of 300.0 and a damping ratio of 0.9. |
| 75 | + /// |
| 76 | + /// See also: |
| 77 | + /// |
| 78 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 79 | + static const SpringDescription standardSlowSpatial = SpringDescription( |
| 80 | + mass: 1.0, |
| 81 | + stiffness: 300.0, |
| 82 | + damping: 31.176914536239796, |
| 83 | + ); |
| 84 | + |
| 85 | + /// The standard default effects spring in the Material specification. |
| 86 | + /// |
| 87 | + /// It has a stiffness of 1600.0 and a damping ratio of 1.0. |
| 88 | + /// |
| 89 | + /// See also: |
| 90 | + /// |
| 91 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 92 | + static const SpringDescription standardDefaultEffects = SpringDescription( |
| 93 | + mass: 1.0, |
| 94 | + stiffness: 1600.0, |
| 95 | + damping: 80.0, |
| 96 | + ); |
| 97 | + |
| 98 | + /// The standard fast effects spring in the Material specification. |
| 99 | + /// |
| 100 | + /// It has a stiffness of 3800.0 and a damping ratio of 1.0. |
| 101 | + /// |
| 102 | + /// See also: |
| 103 | + /// |
| 104 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 105 | + static const SpringDescription standardFastEffects = SpringDescription( |
| 106 | + mass: 1.0, |
| 107 | + stiffness: 3800.0, |
| 108 | + damping: 123.28828005937953, |
| 109 | + ); |
| 110 | + |
| 111 | + /// The standard slow effects spring in the Material specification. |
| 112 | + /// |
| 113 | + /// It has a stiffness of 800.0 and a damping ratio of 1.0. |
| 114 | + /// |
| 115 | + /// See also: |
| 116 | + /// |
| 117 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 118 | + static const SpringDescription standardSlowEffects = SpringDescription( |
| 119 | + mass: 1.0, |
| 120 | + stiffness: 800.0, |
| 121 | + damping: 56.568542494923804, |
| 122 | + ); |
| 123 | + |
| 124 | + /// The expressive default spatial spring in the Material specification. |
| 125 | + /// |
| 126 | + /// It has a stiffness of 380.0 and a damping ratio of 0.8. |
| 127 | + /// |
| 128 | + /// See also: |
| 129 | + /// |
| 130 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 131 | + static const SpringDescription expressiveDefaultSpatial = SpringDescription( |
| 132 | + mass: 1.0, |
| 133 | + stiffness: 380.0, |
| 134 | + damping: 31.189741903388683, |
| 135 | + ); |
| 136 | + |
| 137 | + /// The expressive fast spatial spring in the Material specification. |
| 138 | + /// |
| 139 | + /// It has a stiffness of 800.0 and a damping ratio of 0.6. |
| 140 | + /// |
| 141 | + /// See also: |
| 142 | + /// |
| 143 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 144 | + static const SpringDescription expressiveFastSpatial = SpringDescription( |
| 145 | + mass: 1.0, |
| 146 | + stiffness: 800.0, |
| 147 | + damping: 33.94112549695428, |
| 148 | + ); |
| 149 | + |
| 150 | + /// The expressive slow spatial spring in the Material specification. |
| 151 | + /// |
| 152 | + /// It has a stiffness of 200.0 and a damping ratio of 0.8. |
| 153 | + /// |
| 154 | + /// See also: |
| 155 | + /// |
| 156 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 157 | + static const SpringDescription expressiveSlowSpatial = SpringDescription( |
| 158 | + mass: 1.0, |
| 159 | + stiffness: 200.0, |
| 160 | + damping: 22.627416997969522, |
| 161 | + ); |
| 162 | + |
| 163 | + /// The expressive default effects spring in the Material specification. |
| 164 | + /// |
| 165 | + /// It has a stiffness of 1600.0 and a damping ratio of 1.0. |
| 166 | + /// |
| 167 | + /// See also: |
| 168 | + /// |
| 169 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 170 | + static const SpringDescription expressiveDefaultEffects = SpringDescription( |
| 171 | + mass: 1.0, |
| 172 | + stiffness: 1600.0, |
| 173 | + damping: 80.0, |
| 174 | + ); |
| 175 | + |
| 176 | + /// The expressive fast effects spring in the Material specification. |
| 177 | + /// |
| 178 | + /// It has a stiffness of 3800.0 and a damping ratio of 1.0. |
| 179 | + /// |
| 180 | + /// See also: |
| 181 | + /// |
| 182 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 183 | + static const SpringDescription expressiveFastEffects = SpringDescription( |
| 184 | + mass: 1.0, |
| 185 | + stiffness: 3800.0, |
| 186 | + damping: 123.28828005937953, |
| 187 | + ); |
| 188 | + |
| 189 | + /// The expressive slow effects spring in the Material specification. |
| 190 | + /// |
| 191 | + /// It has a stiffness of 800.0 and a damping ratio of 1.0. |
| 192 | + /// |
| 193 | + /// See also: |
| 194 | + /// |
| 195 | + /// * [M3 guidelines: Spring tokens](https://m3.material.io/styles/motion/overview/specs) |
| 196 | + static const SpringDescription expressiveSlowEffects = SpringDescription( |
| 197 | + mass: 1.0, |
| 198 | + stiffness: 800.0, |
| 199 | + damping: 56.568542494923804, |
| 200 | + ); |
| 201 | +} |
0 commit comments