<itemvalue="Look up the value of [key], or add a new entry if it isn't there. Returns the value associated to [key], if there is one. Otherwise calls [ifAbsent] to get a new value, associates [key] to that value, and then returns the new value. ```dart final diameters = <num, String>{1.0: 'Earth'}; final otherDiameters = <double, String>{0.383: 'Mercury', 0.949: 'Venus'}; for (final item in otherDiameters.entries) { diameters.putIfAbsent(item.key, () => item.value); } print(diameters); {1.0: Earth, 0.383: Mercury, 0.949: Venus} If the key already exists, the current value is returned. final result = diameters.putIfAbsent(0.383, () => 'Random'); print(result); Mercury print(diameters); {1.0: Earth, 0.383: Mercury, 0.949: Venus} ``` Calling [ifAbsent] must not add or remove keys from the map."/>
<itemvalue="Look up the value of [key], or add a new entry if it isn't there. Returns the value associated to [key], if there is one. Otherwise calls [ifAbsent] to get a new value, associates [key] to that value, and then returns the new value. ```dart final diameters = <num, String>{1.0: 'Earth'}; final otherDiameters = <double, String>{0.383: 'Mercury', 0.949: 'Venus'}; for (final item in otherDiameters.entries) { diameters.putIfAbsent(item.key, () => item.value); } print(diameters); {1.0: Earth, 0.383: Mercury, 0.949: Venus} If the key already exists, the current value is returned. final result = diameters.putIfAbsent(0.383, () => 'Random'); print(result); Mercury print(diameters); {1.0: Earth, 0.383: Mercury, 0.949: Venus} ``` Calling [ifAbsent] must not add or remove keys from the map."/>
<itemvalue="put If Absent"/>
<itemvalue="put If Absent"/>
@ -50,18 +57,11 @@
<itemvalue="A common pattern when using bottom navigation bars is to support navigating to the initial location when tapping the item that is already active. This example demonstrates how to support this behavior, using the initialLocation parameter of goBranch."/>
<itemvalue="A common pattern when using bottom navigation bars is to support navigating to the initial location when tapping the item that is already active. This example demonstrates how to support this behavior, using the initialLocation parameter of goBranch."/>
<itemvalue="When navigating to a new branch, it's recommended to use the goBranch method, as doing so makes sure the last navigation state of the Navigator for the branch is restored."/>
<itemvalue="When navigating to a new branch, it's recommended to use the goBranch method, as doing so makes sure the last navigation state of the Navigator for the branch is restored."/>
<itemvalue="Navigate to the current location of the branch at the provided index when tapping an item in the BottomNavigationBar."/>
<itemvalue="Navigate to the current location of the branch at the provided index when tapping an item in the BottomNavigationBar."/>
<itemvalue="The [Navigator] replaced `oldRoute` with `newRoute`."/>
<itemvalue="The [Navigator] pushed `route`. The route immediately below that one, and thus the previously active route, is `previousRoute`."/>
<itemvalue="Expando mapping instances of NavigatorObserver to their associated NavigatorState (or `null`, if there is no associated NavigatorState). The reason we don't use a private instance field of type `NavigatorState?` is because as part of implementing https:github.comdart-langlanguageissues2020, it will soon become a runtime error to invoke a private member that is mocked in another library. By using an expando rather than an instance field, we ensure that a mocked NavigatorObserver can still properly keep track of its associated NavigatorState."/>
<itemvalue="An interface for observing the behavior of a [Navigator]."/>
<itemvalue="Clip with anti-aliasing and saveLayer immediately following the clip. This mode not only clips with anti-aliasing, but also allocates an offscreen buffer. All subsequent paints are carried out on that buffer before finally being clipped and composited back. This is very slow. It has no bleeding edge artifacts (that [antiAlias] has) but it changes the semantics as an offscreen buffer is now introduced. (See https:github.comflutterflutterissues18057issuecomment-394197336 for a difference between paint without saveLayer and paint with saveLayer.) This will be only rarely needed. One case where you might need this is if you have an image overlaid on a very different background color. In these cases, consider whether you can avoid overlaying multiple colors in one spot (e.g. by having the background color only present where the image is absent). If you can, [antiAlias] would be fine and much faster. See also: [antiAlias], which is much faster, and has similar clipping results."/>
<itemvalue="Clip with anti-aliasing. This mode has anti-aliased clipping edges to achieve a smoother look. It' s much faster than [antiAliasWithSaveLayer], but slower than [hardEdge]. This will be the common case when dealing with circles and arcs. Different from [hardEdge] and [antiAliasWithSaveLayer], this clipping may have bleeding edge artifacts. (See https:fiddle.skia.orgc21cb4c2b2515996b537f36e7819288ae for an example.) See also: [hardEdge], which is a little faster, but with lower fidelity. [antiAliasWithSaveLayer], which is much slower, but can avoid the bleeding edges if there's no other way. [Paint.isAntiAlias], which is the anti-aliasing switch for general draw operations."/>
<itemvalue="Clip, but do not apply anti-aliasing. This mode enables clipping, but curves and non-axis-aligned straight lines will be jagged as no effort is made to anti-alias. Faster than other clipping modes, but slower than [none]. This is a reasonable choice when clipping is needed, if the container is an axis- aligned rectangle or an axis-aligned rounded rectangle with very small corner radii. See also: [antiAlias], which is more reasonable when clipping is needed and the shape is not an axis-aligned rectangle."/>