-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorsrefactorImproving readability/efficiency without behavioral changesImproving readability/efficiency without behavioral changesteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Null-aware elements offer a shorthand for adding an element to a list, if the element is non-null. Consider this code before the feature:
Stack(
fit: StackFit.expand,
children: [
const AbsorbPointer(),
if (widget.child != null) widget.child!,
],
)This causes repetition of widget.child, and is verbose. With null-aware elements this becomes:
Stack(
fit: StackFit.expand,
children: [
const AbsorbPointer(),
?widget.child,
],
)Now that the framework has adopted Dart 3.8 (#171703), we can adopt this feature in the framework too!
Important
Doing this successfully will involve several smaller PRs, rather than one big one that migrates the whole framework at once. Please do not send a mega-PR, break the changes up into sections.
cc @justinmc and @loic-sharma for visibility. :)
0xharkirat, tirth-patel-nc and bdlukaa
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.good first issueRelatively approachable for first-time contributorsRelatively approachable for first-time contributorsrefactorImproving readability/efficiency without behavioral changesImproving readability/efficiency without behavioral changesteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team