DEV Community

Param Mehrotra
Param Mehrotra

Posted on • Updated on

Calculator

Hello there! As I continue to progress in my programming journey, I decided to learn something new. As a quick flashback, I started off with basic python projects and then learnt about DBMS with SQL and Python mySQL. So, I decided to now move onto the user interface side by learning about Flutter.

Flutter is one of the latest user interface programming languages created by Google and I found this introductory course by The Net Ninja on Youtube quite useful.
Intro to Flutter
They go through the basics of Dart programming and the creating of basic functions and widgets on the application.

Thereafter, I decided to use my newfound knowledge to create a Calculator App. I ran my code to display it on Google, which gives us the capabilities to see what phone users will see. I then experimented with designs, colors, display, buttons and came up with a calculator -shape app for which pressing the buttons will show text on the screen.

The came the part about evaluating the equation. I did that in another function and evaluated the text using the eval function which I created using a simple algorithm. I separated the string into 2 on the either side of the sign. Used the eval function on them. Returned the values and then calculated the final equation. I then displayed in the text form on the screen.

This experience was fun and enriching as I learnt about stateful and stateless widgets and designing apps in general.

Top comments (0)