์Šคํ‚ฌ dart-use-primary-constructors
๐Ÿ“ฆ

dart-use-primary-constructors

์ฝ˜ํ…์ธ  ๋ฆฌ๋น„์ „ r1 ์•ˆ์ „ โš™๏ธ ์™ธ๋ถ€ ๋ช…๋ น์–ด

Write Dart Primary Constructors Correctly

Primary constructor migrations can introduce syntax, scope, and initialization errors. This skill provides version-aware guidance, refactoring steps, diagnostics, and focused examples for Dart.

์ง€์›: Claude Codex Code(CC)
Maintain this Skill? Claim it ๐Ÿฅ‰ 77 ๋ธŒ๋ก ์ฆˆ

๋‚ด ์—์ด์ „ํŠธ๋กœ ์„ค์น˜

์ด ์š”์ฒญ์„ ์—์ด์ „ํŠธ์— ๋ณต์‚ฌํ•˜์„ธ์š”. ๊ณต์‹ Skill ํŽ˜์ด์ง€์™€ ๋งค๋‹ˆํŽ˜์ŠคํŠธ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

์—์ด์ „ํŠธ ์š”์ฒญ
Review the Skillstore skill "dart-use-primary-constructors" from https://skillstore.io/skills/dart-lang-dart-use-primary-constructors.md and its manifest at https://skillstore.io/api/skills/dart-lang-dart-use-primary-constructors/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.

์—์ด์ „ํŠธ๋Š” ๊ณ„์†ํ•ด์„œ ๊ณ„ํš์„ ํ‘œ์‹œํ•˜๊ณ  ๋ณด์•ˆ ์ •์ฑ…์—์„œ ์š”๊ตฌํ•˜๋Š” ํ™•์ธ์„ ์š”์ฒญํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์—์ด์ „ํŠธ๊ฐ€ ์ฝ๊ธฐ ์‰ฌ์šด ๋ฆฌ์†Œ์Šค

AI ์—์ด์ „ํŠธ, ํฌ๋กค๋Ÿฌ, ์Šคํฌ๋ฆฝํŠธ๊ฐ€ ์ „์ฒด ํŽ˜์ด์ง€ ๋Œ€์‹  ์ •๋ฆฌ๋œ ์ปจํ…์ŠคํŠธ๋งŒ ํ•„์š”ํ•  ๋•Œ ์ด ๋งํฌ๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”.

ํ…Œ์ŠคํŠธํ•ด ๋ณด๊ธฐ

"dart-use-primary-constructors" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. Explain whether primary constructors are available in Dart 3.12.

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

Dart 3.12 treats primary constructors as experimental. Enable the primary-constructors experiment in analyzer configuration or with the compiler flag.

"dart-use-primary-constructors" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. Migrate a user model with final name and age fields.

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

Move both final fields into the class header as declaring parameters. Remove the duplicate field declarations and constructor, then use a semicolon body.

"dart-use-primary-constructors" ์‚ฌ์šฉ ์ค‘์ž…๋‹ˆ๋‹ค. Explain why a late field cannot use a primary constructor parameter.

์˜ˆ์ƒ ๊ฒฐ๊ณผ:

Primary initializer scope excludes late field initializers because they may run after construction. Store the value in a non-late field first.

๋ณด์•ˆ ๊ฐ์‚ฌ

์•ˆ์ „

All 62 static findings are false positives caused by Markdown backticks, fenced Dart examples, or ordinary documentation text. The skill contains no executable scripts, shell interpolation, system reconnaissance, prompt injection, or other malicious intent.

1
์Šค์บ”๋œ ํŒŒ์ผ
263
๋ถ„์„๋œ ์ค„ ์ˆ˜
0
๊ฒ€ํ†  ํ•ญ๋ชฉ
0
์˜คํƒ ๋ฌด์‹œ๋จ
๊ฐ€์žฅ ์ตœ๊ทผ์— ์™„๋ฃŒ๋œ ์ •์ ยท์˜๋ฏธ๋ก ์  ๊ฐ์‚ฌ์—์„œ ํ™•์ธ๋œ ๋ณด์•ˆ ๋ฐœ๊ฒฌ ์‚ฌํ•ญ์ด ๊ฐ์ง€๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์Šคํ‚ฌ์— ๋ถ€์ž‘์šฉ์ด ์—†์Œ์„ ์ฆ๋ช…ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
๊ฐ์‚ฌ์ž: codex
์ด ๋ณด๊ณ ์„œ ๊ณต์œ  ๋ฐ ์ธ์šฉ

๋ฒ„์ „์ด ์ง€์ •๋œ ํ‰๊ฐ€ ๋ณด๊ณ ์„œ, ์ค‘๋ฆฝ ๋ฐฐ์ง€, ์ž„๋ฒ ๋“œ ์นด๋“œ ๋ฐ ์ธ์šฉ์„ ๊ณต์œ ํ•˜์„ธ์š”. Skillstore๋Š” ๊ทผ๊ฑฐ๋ฅผ ๋ณด๊ณ ํ•˜์ง€๋งŒ ์ด Skill์˜ ์•ˆ์ „ ์—ฌ๋ถ€๋ฅผ ํŒ๋‹จํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๋ฒ„์ „๋ณ„ ๋ณด๊ณ ์„œ ์—ด๊ธฐ
๋ณด์•ˆ ํ‰๊ฐ€

๋ณด๊ณ ์„œ ๋งํฌ ๋ณต์‚ฌ

https://skillstore.io/skills/dart-lang-dart-use-primary-constructors/audits/1?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_report

Markdown ๋ฐฐ์ง€

[![Skillstore security assessment](https://skillstore.io/badges/skills/dart-lang-dart-use-primary-constructors/security.svg)](https://skillstore.io/skills/dart-lang-dart-use-primary-constructors?utm_source=security_passport_badge)

HTML ๋ฐฐ์ง€

<a href="https://skillstore.io/skills/dart-lang-dart-use-primary-constructors?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/dart-lang-dart-use-primary-constructors/security.svg" alt="Skillstore security assessment" loading="lazy"></a>

์ž„๋ฒ ๋“œ ์นด๋“œ

<iframe src="https://skillstore.io/embed/skills/dart-lang-dart-use-primary-constructors.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>
ํ•™์ˆ  ์ธ์šฉ (APA ยท BibTeX ยท CFF)

APA ์ธ์šฉ

dart-lang. (2026). dart-use-primary-constructors security audit report (audit version 1) [Author version unspecified]. Skillstore. https://skillstore.io/skills/dart-lang-dart-use-primary-constructors/audits/1

BibTeX ์ธ์šฉ

@techreport{dart-lang-dart-lang-dart-use-primary-constructors-2026, author = {dart-lang}, title = {dart-use-primary-constructors security audit report (audit version 1)}, institution = {Skillstore}, year = {2026}, number = {1}, url = {https://skillstore.io/skills/dart-lang-dart-use-primary-constructors/audits/1}, note = {Author version unspecified} }

CITATION.cff

cff-version: 1.2.0 message: "If you use this Skill, cite its author and this versioned security audit report." title: "dart-use-primary-constructors security audit report (audit version 1)" version: "unspecified" type: report authors: - name: "dart-lang" date-released: "2026-08-22" url: "https://skillstore.io/skills/dart-lang-dart-use-primary-constructors/audits/1" identifiers: - type: other value: "skillstore:dart-lang-dart-use-primary-constructors:audit:1" description: "Skillstore immutable audit report identifier"

๋ณ€ํ˜• ๋น„๊ต

์„ค์น˜ ๊ฐ€๋Šฅํ•œ ๋ณ€ํ˜• 2๊ฐœ

๊ฐ ์ž‘์„ฑ์ž์˜ ์Šคํ‚ฌ์€ ๋ณ„๋„์˜ ์„ค์น˜ ํ•ญ๋ชฉ์œผ๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. ์ถ”์ฒœ ๋ณ€ํ˜•์€ Skillstore ๊ทผ๊ฑฐ๋กœ ์ˆœ์œ„๊ฐ€ ์ •ํ•ด์ง‘๋‹ˆ๋‹ค.

์ด ๋ณ€ํ˜•์ด 1์œ„์ธ ์ด์œ 

์ตœ๊ทผ ์œ ์ง€๋ณด์ˆ˜๋จ
flutter ๊ถŒ์žฅ

flutter-dart-use-primary-constructors

Skillstore ์ ์ˆ˜ 77
์ฆ๊ฑฐ ์‹ ๋ขฐ๋„ ์ค‘๊ฐ„
Skillstore ์‚ฌ์šฉ๋Ÿ‰ 6
์—…๋ฐ์ดํŠธ๋จ

2026-09-09

dart-lang ํ˜„์žฌ

dart-lang-dart-use-primary-constructors

Skillstore ์ ์ˆ˜ 77
์ฆ๊ฑฐ ์‹ ๋ขฐ๋„ ์ค‘๊ฐ„
Skillstore ์‚ฌ์šฉ๋Ÿ‰ 6
์—…๋ฐ์ดํŠธ๋จ

2026-09-09

Skillstore ์ ์ˆ˜

์ด ์ ์ˆ˜์˜ ์ด์œ  ์ฆ๊ฑฐ ์‹ ๋ขฐ๋„: ์ค‘๊ฐ„
55
์•„ํ‚คํ…์ฒ˜
85
์œ ์ง€๋ณด์ˆ˜์„ฑ
87
์ฝ˜ํ…์ธ 
65
์ปค๋ฎค๋‹ˆํ‹ฐ
83
์‚ฌ์–‘ ์ค€์ˆ˜

๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ๊ฒƒ

Learn Primary Constructor Syntax

Understand parameter types, semicolon bodies, initializer scope, and version requirements through focused explanations.

Migrate Existing Models

Convert verbose data classes while preserving fields, assertions, calculations, and redirecting constructors.

Review Constructor Refactors

Identify scope violations, duplicate initialization, late-field errors, and invalid generative constructors before integration.

์ด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์‚ฌ์šฉํ•ด ๋ณด์„ธ์š”

Explain the Basics
Explain Dart primary constructors for a beginner, including supported versions and the three parameter types.
Convert a Simple Class
Convert this Dart class to a primary constructor and explain each change: [class source].
Diagnose a Constructor Error
Review this primary constructor, identify compile-time errors, and propose a corrected version: [class source].
Plan a Safe Migration
Design a migration for these related Dart classes while preserving inheritance, redirects, assertions, public APIs, and SDK compatibility: [sources].

๋ชจ๋ฒ” ์‚ฌ๋ก€

  • Confirm the project Dart version before suggesting primary constructor syntax.
  • Preserve assertions, initialization order, redirects, and public behavior during migration.
  • Run the Dart analyzer and relevant tests after applying a generated refactor.

ํ”ผํ•˜๊ธฐ

  • Do not use primary constructor parameters inside late field initializers.
  • Do not initialize the same field in both its declaration and initializer list.
  • Do not add a nonredirecting generative constructor beside a primary constructor.

์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ

Which Dart versions support primary constructors?
Dart 3.13 enables them by default. Dart 3.12 requires the experiment flag, and Dart 3.11 or earlier does not support them.
Can the skill modify my project automatically?
It can propose targeted source changes, but it does not independently run the analyzer or confirm project behavior.
What is a declaring parameter?
A parameter marked final or var creates a corresponding instance field and initializes it.
Can late fields reference primary constructor parameters?
No. Primary initializer scope is unavailable to late field initializers because their evaluation may occur after construction.
Can a class keep other generative constructors?
Other generative constructors must redirect to the primary constructor. A second nonredirecting generative constructor is invalid for supported declaration types.
Does the skill support concise in-body constructors?
Yes. It explains new and factory forms that omit the class name, including named and redirecting constructors.

๊ฐœ๋ฐœ์ž ์„ธ๋ถ€ ์ •๋ณด

์ž‘์„ฑ์ž

dart-lang

๋ผ์ด์„ ์Šค

MIT

Skillstore ๋ฆฌ๋น„์ „

r1

๋ฒ„์ „ ์•ˆ๋‚ด

์ž‘์„ฑ์ž๊ฐ€ ๋ฒ„์ „์„ ์„ ์–ธํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

์ฐธ์กฐ

69efb8b6bdd43a81a35b62c20b4be3a663e331c2

์œ ์ง€๋ณด์ˆ˜ ์ตœ์‹ ์„ฑ

2026. 8. 22.

์‚ฌ์šฉ๋Ÿ‰

0 ๋‹ค์šด๋กœ๋“œ ยท 0 ์กฐํšŒ

ํŒŒ์ผ ๊ตฌ์กฐ

๐Ÿ“„ SKILL.md