Lasse R.H. Nielsen
9f70bc7c1b
Add Future.syncValue(T value) constructor.
...
There is currently no way to create a future with a specific value
that doesn't accept a `FutureOr` argument, and tries to flatten it.
The `Future.syncValue(T value)` constructor does not accept a
`Future<T>`, which makes it easier to control the type and argument.
It may also be more efficient than constructors which need to first
check if the argument is a `Future<T>` (and `_Future<T>`) first.
You shouldn't create a `Future<Future<Object>>`, but you might for
testing, and this constructor makes that easier too.
(It should really be called `Future.value`, but that name was taken
by what should probably have been `Future.new`.)
See https://dartbug.com/59814 for performance considerations.
CoreLibraryReviewExempt: No platform specific code or new functionality.
Change-Id: Ib5728055a06b20433dcd448ca7ad1baa54ec681c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451022
Reviewed-by: Nate Bosch <nbosch@google.com >
Commit-Queue: Lasse Nielsen <lrn@google.com >
2025-09-24 06:40:52 -07:00
..
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2023-04-20 19:19:01 +00:00
2025-06-02 10:59:31 -07:00
2025-06-02 10:59:31 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-09-24 06:40:52 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-06-02 10:59:31 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2025-09-16 02:05:23 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-09-16 02:05:23 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-09-16 02:05:23 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-09-16 02:05:23 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2025-05-02 04:08:54 -07:00
2024-10-11 16:53:52 +00:00