Skip to content

chore(deps): update dependency dart to v3.8.0 #4889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 24, 2025

This PR contains the following updates:

Package Update Change
dart (source) minor 3.7.3 -> 3.8.0

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

dart-lang/sdk (dart)

v3.8.0

Compare Source

Released on: 2025-05-20

Language

Dart 3.8 adds null-aware elements to the language. To use them, set
your package's [SDK constraint][language version] lower bound to 3.8
or greater (sdk: '^3.8.0').

Null-Aware Elements

Null-aware elements make it easier to omit a value from a collection literal if
it's null. The syntax works in list literals, set literals, and map literals.
For map literals, both null-aware keys and values are supported. Here is an
example a list literal written in both styles, without the null-aware elements
language feature and with it:

String? lunch = isTuesday ? 'tacos!' : null;

var withoutNullAwareElements = [
  if (lunch != null) lunch,
  if (lunch.length != null) lunch.length!,
  if (lunch.length case var length?) length,
];

var withNullAwareElements = [
  ?lunch,
  ?lunch.length,
  ?lunch.length,
];

Full details are in the feature specification.

Libraries
dart:core
  • Added Iterable.withIterator constructor.
dart:io
  • Added HttpClientBearerCredentials.
  • Updated Stdout.supportsAnsiEscapes and Stdin.supportsAnsiEscapes to
    return true for TERM containing tmux values.
dart:html
  • Breaking change: Native classes in dart:html, like HtmlElement, can no
    longer be extended. Long ago, to support custom elements, element classes
    exposed a .created constructor that adhered to the v0.5 spec of web
    components. On this release, those constructors have been removed and with
    that change, the classes can no longer be extended. In a future change, they
    may be marked as interface classes as well. This is a follow up from an
    earlier breaking change in 3.0.0 that removed the registerElement APIs. See
    #​53264 for details.
dart:ffi
  • Added Array.elements which exposes an Iterable over the Array's content.
Tools
Analyzer
  • The analyzer now supports "doc imports," a new comment-based syntax which
    enables external elements to be referenced in documentation comments without
    actually importing them. See the
    documentation

    for details.
  • Code completion is improved to offer more valid suggestions. In particular,
    the suggestions are improved when completing text in a comment reference on a
    documentation comment for an extension, a typedef, or a directive (an import,
    an export, or a library). Additionally, instance members can now be suggested
    in a documentation comment reference.
  • Offer additional assist to wrap a Flutter widget with a FutureBuilder widget.
  • Add a quick assist to wrap with ValueListenableBuilder.
  • Add a quick fix to convert an (illegal) extension field declaration into a
    getter declaration.
  • Add a quick fix to help code comply with a few lint rules that encourage
    omitting types: omit_local_variable_types,
    omit_obvious_local_variable_types, and omit_obvious_property_types.
  • Add a quick fix to create an extension method to resolve an "undefined method
    invocation" error.
  • Renaming a closure parameter is now possible.
  • Renaming a field now adjusts implicit this references in order to avoid
    name collisions.
  • Renaming a field formal parameter now properly renames known super-parameters
    in subclasses in other libraries.
  • Renaming a method parameter now properly renames across the type hierarchy.
  • The "encapsulate field" quick assist now works on final fields.
  • The "inline method" refactoring now properly handles inner closures.
  • The quick fix that adds names to a show clause or removes names from a
    hide clause can now add or remove multiple names simultaneously, in order to
    resolve as many "undefined" errors as possible.
  • The "remove const" quick fix now operates on more types of code.
  • The "add missing required argument" quick fix can now add multiple missing
    required arguments.
  • Add a new warning that reports an import or export directive with multiple
    show or hide clauses, which are never necessary.
  • Add a quick fix for this warning.
  • Add LSP document links for lint rules in analysis options files.
  • Add LSP document links for dependency packages in pubspec files.
  • Fix various issues around patterns, like highlighting, navigation, and
    autocompletion.
  • Add the [use_null_aware_elements][use_null_aware_elements] lint rule.
  • Add the experimental [unnecessary_ignore][unnecessary_ignore] lint rule.
  • (Thanks @​FMorschel for many of the above
    enhancements!)
Dart Development Compiler (dartdevc)

In order to align with dart2js semantics, DDC will now throw a runtime error
when a redirecting factory is torn off and one of its optional non-nullable
parameters is provided no value. The implicit null passed to the factory will
not match the non-nullable type and this will now throw.

In the future this will likely be a compile-time error and will be entirely
disallowed.

Dart to Javascript Compiler (dart2js)

Removed the --experiment-new-rti and --use-old-rti flags.

Dart Native Compiler

Added cross-compilation for the Linux x64 and Linux ARM64 target platforms.

Dart format

In 3.7.0, we released a largely rewritten formatter supporting a new
"tall" style. Since then, we've gotten a lot of feedback and bug
reports and made a number of fixes in response to that.

Features

Some users strongly prefer the old behavior where a trailing comma will be
preserved by the formatter and force the surrounding construct to split. That
behavior is supported again (but off by default) and can enabled by adding this
to a surrounding analysis_options.yaml file:

formatter:
  trailing_commas: preserve

This is similar to how trailing commas work in the old short style formatter
applied to code before language version 3.7.

Bug fixes
  • Don't add a trailing comma in lists that don't allow it, even when there is
    a trailing comment (#​1639).
Style changes

The following style changes are language versioned and only affect code whose
language version is 3.8 or later. Dart code at 3.7 or earlier is formatted the
same as it was before.

  • Allow more code on the same line as a named argument or =>.

    // Before:
    function(
      name:
          (param) => another(
            argument1,
            argument2,
          ),
    );
    
    // After:
    function(
      name: (param) => another(
        argument1,
        argument3,
      ),
    );
  • Allow the target or property chain part of a split method chain on the RHS of
    =, :, and =>.

    // Before:
    variable =
        target.property
            .method()
            .another();
    
    // After:
    variable = target.property
        .method()
        .another();
  • Allow the condition part of a split conditional expression on the RHS of =,
    :, and =>.

    // Before:
    variable =
        condition
        ? longThenBranch
        : longElseBranch;
    
    // After:
    variable = condition
        ? longThenBranch
        : longElseBranch;
  • Don't indent conditional branches redundantly after =, :, and =>.

    // Before:
    function(
      argument:
          condition
              ? thenBranch
              : elseBranch,
    )
    
    // After:
    function(
      argument:
          condition
          ? thenBranch
          : elseBranch,
    )
  • Indent conditional branches past the operators.

    // Before:
    condition
        ? thenBranch +
            anotherOperand
        : elseBranch(
          argument,
        );
    
    // After:
    condition
        ? thenBranch +
              anotherOperand
        : elseBranch(
            argument,
          );
  • Block format record types in typedefs:

    // Before:
    typedef ExampleRecordTypedef =
        (
          String firstParameter,
          int secondParameter,
          String thirdParameter,
          String fourthParameter,
        );
    
    // After:
    typedef ExampleRecordTypedef = (
      String firstParameter,
      int secondParameter,
      String thirdParameter,
      String fourthParameter,
    );
  • Eagerly split argument lists whose contents are complex enough to be easier
    to read spread across multiple lines even if they would otherwise fit on a
    single line.

    The heuristic is that the argument list must contain at least three named
    arguments, some of which are nested and some of which are not.

    // Before:
    TabBar(tabs: [Tab(text: 'A'), Tab(text: 'B')], labelColor: Colors.white70);
    
    // After:
    TabBar(
      tabs: [
        Tab(text: 'A'),
        Tab(text: 'B'),
      ],
      labelColor: Colors.white70,
    );

Configuration

📅 Schedule: Branch creation - "after 4pm on friday,before 9am on monday,every weekend" in timezone Europe/Paris, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from a team as a code owner May 24, 2025 16:35
@renovate renovate bot requested review from millotp and shortcuts and removed request for a team May 24, 2025 16:35
@algolia-bot
Copy link
Collaborator

algolia-bot commented May 24, 2025

✔️ Code generated!

Name Link
🪓 Triggered by 856d531e5eb0240f515a066ffa331de0e3f53134
🍃 Generated commit 9449b6bcc674a7191a1bb0abde719e6d6fb57912
🌲 Generated branch generated/renovate/dart-3.x

@renovate renovate bot force-pushed the renovate/dart-3.x branch 8 times, most recently from a46d69c to be8eb7b Compare May 24, 2025 17:54
@renovate renovate bot force-pushed the renovate/dart-3.x branch from be8eb7b to 8dede21 Compare May 24, 2025 18:01
@renovate renovate bot merged commit ca3bab7 into chore/renovateBaseBranch May 24, 2025
12 checks passed
@renovate renovate bot deleted the renovate/dart-3.x branch May 24, 2025 20:39
algolia-bot added a commit that referenced this pull request May 24, 2025
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant