22 August 2024

Building my own Flutter apps using GPT4 prompting was surprisingly fast

The stories about the possibility of a vast majority of programmers losing their jobs to AI appears to be true. I already demonstrated how GrootGPT was created simply by prompting ChatGPT. Just a year ago, when I tried creating simple Flutter apps using ChatGPT 3.5, it barely understood what I wanted, and I couldn't create a workable app. That's changed with ChatGPT 4o. It generated the entire code I needed, and all I had to do was prompt it regarding some errors encountered, and it gave me corrected code snippets for those. These are some of those apps:

Simple Notes

Clicking any note leads to a page where you can save/export it and type more text


I became tired of the standard Notes app on my phone not having a dark mode. Also, there was no guarantee that they were siphoning off the data for analysis. So I used ChatGPT to build me one, and then customised it. The APK file is available for download in my GitHub repository.

Automatic Slideshow

On selecting a folder, the slideshow begins

I had always wanted a really simple, minimalist slideshow app, but the ones on Google Playstore were ones with ads or fancy animations which I didn't want, or they didn't have a setting for changing the pause duration between images. So I created one which even searches subfolders for images and displays them with the best fit. Dark mode too, which is another plus of building your own app. ChatGPT generated the code for this too. The APK for this too is available in my GitHub repository.

I'm in the process of building more apps using ChatGPT, and that's where I noticed a few problems:

Limitations of using ChatGPT or other GenAI for programming:

  • For complex tasks, GenAI does a poor job of generating or correcting code. 
  • Moreover, it seems to depend on what programmers have already written. When I wanted to create a countdown timer which counted down days, hours, minutes and seconds, it generated code only to display hours, minutes and seconds, because that's what programmers usually write for. I had to edit it on my own to include a countdown for days, even though Flutter had days in its Duration class by default.
  • It does not follow good coding standards. If the code GenAI was trained with, included badly written code, the code it generates will also have badly written code. Instead of using const's it used string literals in multiple parts of the code.
  • It does not necessarily "know" much about good system design and design patterns. These are concepts for which you need skilled programmers.
  • For larger chunks of code, it tends to lose track of what the code already contains, and loses track of the prompt's instructions.

The good parts of ChatGPT and GenAI:

  • It generates working code extremely fast. Tasks that I would need a few hours or days to complete, LLM's can complete in a matter of seconds.
  • It makes debugging easier. I only have to paste an error message into the prompt field, and it not only figures out where the error is, it also explains the issue and provides corrected code as a solution.
  • It makes testing and locating misuse cases easier. It can actually generate test cases for snippets of code, and can even identify where code is lacking in security, potentially pointing out how people could misuse software. 
  • It somehow finds good/efficient programming practices too, and tends to teach me on how to write code better.

It has been only a couple of years since ChatGPT has impressed us. With claims of there being no limit to which it could scale, I'm quite sure these algorithms could be trained and have safeguards built to replace even the most skilled software engineers. 


No comments: