Reputation: 157
This might be a bit out of the box question, but not being much of an abstract thinker, I find dart syntax unreasonably confusing. Apparently, for example, ThemeData is a widget that is also a class that has a class dark() that has a property that is actually a constructor, that has a class... Pure nonsense.
Does anyone has a link to a nice, clear, schematic, visual explanation of how the components are actually called, how are they connected together etc, so that the person that has more of a visual perception can understand what's going on?
I did some coding in the past, but I'm having hard times getting my head around flutter / dart syntax, as if entire google sat together and said "how we can make it look as confusing as possible? Maybe we can make Color and Colors two different classes? Great! More ideas like that anyone?!"
Any leads to a common sense, not written-by-developer explanation is greatly appreciated.
Upvotes: 1
Views: 49
Reputation: 199
Widget
is a class
. So every extension of Widget
is also a class
.
Each class can have one constructor. There can be "named constructions", so-called factories
which are predefined constructors, like ThemeData
's dark()
.
Finally Color
is a class that describes a single color. Colors
is a class that holds a lot of constants for you to use.
It is not that difficult at the end of the day, but you cannot expect to learn it all at once.
Upvotes: 1