Skip to content

When extract locale variable, can't name with same name of parameter #4787

Description

@lsaudon

Describe the bug
When extract locale variable, can't name with same name of parameter

To Reproduce
Steps to reproduce the behavior:

  1. With this code:
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(),
      ),
    );
  }
}
  1. Extract locale variable for AppBar()
  2. The variable is appBar2 or with prompt if I set appBar, I have this error The name 'appBar' is already used in the scope.

Expected behavior
I want name variable appBar

Please complete the following information:

  • Operating System and version: macOS 14.0
  • VS Code version: 1.83.0
  • Dart extension version: 3.74.0
  • Dart/Flutter SDK version: Dart 3.1.3/Fluttter 3.13.6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions