lsaudon · GitHub

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

Read the original on github.com ↗