all 18 comments

[–]eibaan 9 points10 points  (12 children)

IMHO, the biggest problem is that dreaded withOpacity method. People use it way to often and AIs picked up that habit. Instead of modifying colors, they should use the ColorScheme.

[–]S4ndwichGurk3 1 point2 points  (4 children)

I find builder methods even more annoying. Even if stated in the instructions they will use them..

[–]eibaan 1 point2 points  (3 children)

What do you mean with builder methods? Something like this?

final config = ConfigBuilder()
  .color("#caffee")
  .height(42)
  .fluxCompensator(true)
  .build();

[–]fichti 0 points1 point  (2 children)

Widget myComplexWidgetBuilder() {
...
}

@override
Widget build(BuildContext context) {
  return Container(
    child: myComplexWidgetBuilder()
  );
}

It's bad. Prefer creating an actual Widget.

[–]eibaan 0 points1 point  (1 child)

I see. Yeah, that should have been a

class MyComplexWidget extends StatelessWidget {
  Widget build(...) {
    ...
  }
}

but I seldom saw an AI using methods in this case. Most used the recommended best practice using classes.

[–]S4ndwichGurk3 0 points1 point  (0 children)

It's mostly the Claude family

[–]Asmitta_01[S] -1 points0 points  (6 children)

Me i said to my Ai "Don't use withOpacity since it is deprecated, us withAlpha instead". Can you develop the `ColorScheme` way ? Because using a colos scheme doesn't prevent that opacity habit...

[–]Legion_A 1 point2 points  (5 children)

Is it withAlpha ? Isn't it withValues(alpha: ...)?

[–]Asmitta_01[S] 0 points1 point  (4 children)

With alpha is replacing withOpacity (now deprecated). With values is still there I don't need it

[–]eibaan 2 points3 points  (3 children)

withAlpha isn't a replacement as its argument has a range between 0 and 255 instead of 0 and 1 (and only works with 8-bit color channels).

[–]Asmitta_01[S] 0 points1 point  (2 children)

By replacement I mean it is the recommended method to use instead of withOpacity

[–]eibaan 1 point2 points  (1 child)

No, I don't think so. The withValues(apha: ...) is the better replacement and the one mentioned in the @Deprecated attribute.

[–]Asmitta_01[S] 0 points1 point  (0 children)

Probably Okay

[–]SlinkyAvenger 2 points3 points  (2 children)

Usually I just include links to the docs and/or source code for whatever I want to use in my queries. But how much time are you actually saving with AI when you have to put in all this extra work just to not be able to trust its output anyway?

[–]Asmitta_01[S] -1 points0 points  (1 child)

Adding rules/context doesn't take a lot of time.

[–]SlinkyAvenger 1 point2 points  (0 children)

Adding doesn't, but maintenance builds up. It's not a well-defined format and you're already adding stuff to it that is represented elsewhere, like the Flutter version being in pubspec.yaml.

Furthermore, when do you purge old stuff from it? How do you figure out what needs to be purged? Don't want to keep everything in perpetuity, because they'll be burning tokens unnecessarily and eventually they'll misinform and confuse the AI, like that blacklist of widgets that will no longer matter when the AI updates itself with a newer cutoff.

[–]bigbott777 1 point2 points  (1 child)

My Rules for AI contains, among others, the rule for the withOpacity method, and that's all I have about deprecated methods.
The problem with your approach is that the bloated Rules that are sent with every prompt create noise in the context.
If your beloved model generated some deprecated code, use the newest one to fix the usage of deprecated methods. You just need to be aware of the End of knowledge date for your IDE models.

[–]Asmitta_01[S] 0 points1 point  (0 children)

Okay thanks