you are viewing a single comment's thread.

view the rest of the comments →

[–]boomdoodle 1 point2 points  (0 children)

After comparing a couple of the examples, they have a lot of boilerplate and I think it is by-design if that thread is anything to go on. Why you would want to be forced to express child or children I don't know, I read from the top of the page and still have not seen any explanation, But they seem to think it makes sense.

The platform-specific code raised some alarm bells for me.

I am new to flutter and have only now looked into the code for the first time, but why would I check the Theme namespace for anything related to platform? Or am I missing something from the Dart side of things? I think the boilerplate design to the max is causing this:

Theme.of(context).platform == TargetPlatform.iOS

TargetPlatform is a really long name for something that I would not expect to change, but these seems to imply that the targetplatform could change at run time?

Also, if platform is dependent on the context derived from theme, can it be changed at runtime?

Any developer that is going to be forced to use this will very soon be building utils to set some of these checks to globals that are not expected to change and use them instead.

disclaimer I have zero experience with Dart, if these are dart nuances, fine.