Skip to content

post-fix assignment (highly useful for declarative layouting ,in flutter) #4390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
atototenten opened this issue May 24, 2025 · 2 comments
Labels
feature Proposed language feature that solves one or more problems

Comments

@atototenten
Copy link

atototenten commented May 24, 2025

why ?
to move the decl. closer to the usage ,instead of far-away ,especially prevalent in real-world flutter usage (non fortune-500)

use-case/example/syntax :

return ClipRRect(
  borderRadius: BorderRadius.all(
    Radius.circular(12)
  ) => final border_radius,
  child: DecoratedBox(
    decoration: BoxDecoration(
      borderRadius: border_radius,
      color: color,
    ),
    child: child,
  ),
);

vs.

final border_radius = BorderRadius.all(
  Radius.circular(12)
);

// 500+ lines later

return ClipRRect(
  borderRadius: border_radius,
  child: DecoratedBox(
    decoration: BoxDecoration(
      borderRadius: border_radius,
      color: color,
    ),
    child: child,
  ),
);

thanks

@atototenten atototenten added the feature Proposed language feature that solves one or more problems label May 24, 2025
@lrhn
Copy link
Member

lrhn commented May 28, 2025

Don't love the syntax.
Do love the idea. #1420

@atototenten
Copy link
Author

at least there are some reasonable people ,in the community .

instead of these down-voter gang members

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Proposed language feature that solves one or more problems
Projects
None yet
Development

No branches or pull requests

2 participants