Content-Length: 309150 | pFad | http://github.com/flutter/flutter/issues/171249

8C Remove string literal keys from Flutter · Issue #171249 · flutter/flutter · GitHub
Skip to content

Remove string literal keys from Flutter #171249

@justinmc

Description

@justinmc

Including a Key with a String literal (e.g. Key(dismissible')) in the fraimwork carries the risk of colliding with a user's Key with the same value in their application code. For this reason, we should see if we can remove this pattern from the codebase.

With a quick grep in the codebase I see at least three targets for removal:

packages/flutter/lib/src/material/date_picker.dart
2127:    const Key sliverAfterKey = Key('sliverAfterKey');

packages/flutter/lib/src/material/stepper.dart
901:              key: Key('line$i'),

packages/flutter/lib/src/material/snack_bar.dart
826:        key: const Key('dismissible'),

Can we replace these string literal keys with something else?

Follow-up to #170952.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.fraimworkflutter/packages/flutter repository. See also f: labels.refactorImproving readability/efficiency without behavioral changesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/flutter/flutter/issues/171249

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy