Photo by Alex Knight on Unsplash
ChatGPT generates old Flutter code
I asked ChatGPT to write me some Flutter code
In the last few months, I heard a lot of talking about ChatGPT, a language model chatbot developed by OpenAI. It's a very powerful chatbot that can understand and generate human-like text, you will be surprised by its ability to answer and chat like a human being. As a matter of fact, part of this introduction is generated by him ๐.
Now it's my turn to try it with my main field: Software development, I want to see for myself if our job as programmers will be taken over by AI, as I heard about the future of our beloved graphic designers who are suffering from some AI models that generate logos.
The first thing I tried was very simple, asking ChatGPT to generate me a Flutter code for a simple button.
And guess what was his response:
The first part was correct, but what about the second part, let's take a look.
Well, this part seems fine also, except that the RaisedButton widget is deprecated and cannot be used anymore at least with the new version of Flutter 3.3.10, so I tried to tell him that this code is not compatible with the new version of Flutter to see how it will react.
And as you see he confirmed to me that the RaisedButton is deprecated and from which version and he gave me a new code, I will show you directly the button code.
Now we see the ElevatedButton, normally this code should work, but I had one more remarque which is about the style using primary, it's no longer in use, to set a background color you need to use backgroundColor property. So I tried once again to correct him. You will see that it remembers all the conversations as you talk to a normal person.
And here we are with the final code.
Let's test it.
And as we see it's working.
To conclude, I want to let you know that I'm amazed by the results this chatbot can give, you need to give it a try and see for yourself.
Please find here the link: https://chat.openai.com
Thank you.