-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
I just started playing with Flutter, and the most obvious stuff is setState. Honestly, it does not look good. Why would you want to put all your mutations into a lambda, especially if they are all side-effecting? Wouldn't it be better just to call update() directly after you do all the state mutations?
The pattern looks like it came from a functional architecture, but the main point is missing - state mutation should have been encapsulated inside setState function, but this is not the case for Flutter. Without immutability, pure lambda and state change encapsulation all of this doesn't seems have any meaning.
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight