{"id":249,"date":"2024-12-13T16:01:38","date_gmt":"2024-12-13T08:01:38","guid":{"rendered":"https:\/\/witlab.ph\/blog\/?p=249"},"modified":"2024-12-13T16:01:38","modified_gmt":"2024-12-13T08:01:38","slug":"how-to-create-a-calculator-app-using-flutter","status":"publish","type":"post","link":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/","title":{"rendered":"How to create a calculator app using Flutter ?"},"content":{"rendered":"<p>Good day to our valued readers!<br \/>\nMy name is Htay Min Khaung, and I work as a web developer at WIT Lab. Today, I will explain you through the step-by-step process of creating a calculator mobile application using the Flutter framework. Flutter is the open source framework with a lot of built-in widgets (components) to create a beautiful, natively compiled, multi-platform applications from a single codebase. Flutter is also supported and used by Google.<br \/>\nNow, let start coding to get a beautiful calculator mobile application.<br \/>\nFirstly, run &#8220;flutter create calculator&#8221; in the terminal (command prompt).<br \/>\nAfter you have run the command, you will see ss shown in the screenshot below&#8230;<\/p>\n<hr \/>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1132\" height=\"486\" class=\"alignnone size-medium wp-image-258\" style=\"width: 300px; display: block;\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.24.27.png\" alt=\"\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.24.27.png 1132w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.24.27-300x129.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.24.27-1024x440.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.24.27-768x330.png 768w\" sizes=\"(max-width: 1132px) 100vw, 1132px\" \/><\/p>\n<hr \/>\n<p>Then, enter command &#8220;code calculator&#8221;. The project will open in the VS Code editor. In the project folder list, we will use the &#8216;lib&#8217; folder to write the UI code. We need to add two packages: math_expressions and auto_size_text.<\/p>\n<h3>Math Expression Package<\/h3>\n<p><a href=\"https:\/\/pub.dev\/packages\/math_expressions\" target=\"_blank\" rel=\"noopener\">https:\/\/pub.dev\/packages\/math_expressions<\/a><\/p>\n<h3>Auto Size Package<\/h3>\n<p><a href=\"https:\/\/pub.dev\/packages\/auto_size_text\" target=\"_blank\" rel=\"noopener\">https:\/\/pub.dev\/packages\/auto_size_text<\/a><br \/>\nIn the lib\/main.dart file, you&#8217;ll find some code that Flutter generates by default for a demo. We will delete lines 16 to 30, as well as lines 39 to the end of the file. After deleting the code, you may encounter an error on line 19. To fix this, remove &#8220;title: &#8216;Flutter Demo Home Page'&#8221; from the MyHomePage(&#8230;) constructor. It will still show red line under MyHomePage. Now, let&#8217;s create a StatefulWidget named &#8216;MyHomePage&#8217;. On line 24, type &#8216;stf&#8217; and a popup will appear. Select &#8216;Flutter Stateful Widget&#8217; from the list. After you click it, Flutter will generate a widget named &#8216;MyWidget&#8217;. Without clicking or pressing any arrow keys, simply type &#8216;MyHomePage&#8217; to replace &#8216;MyWidget&#8217;, and the red underline will disappear. The code will look like the image below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-274\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.43.23.png\" alt=\"\" width=\"300\" height=\"211\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.43.23.png 1868w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.43.23-300x211.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.43.23-1024x720.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.43.23-768x540.png 768w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.43.23-1536x1080.png 1536w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Add two variables named &#8216;text&#8217; and &#8216;result&#8217;. The &#8216;text variable will store the user&#8217;s input, including numbers and operators, while the &#8216;result&#8217; variable will store the calculated result. Next, create a function called &#8216;reset&#8217; to reset both the &#8216;text&#8217; and &#8216;result&#8217; variables, as shown in the image below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-282\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.55.03.png\" alt=\"\" width=\"300\" height=\"126\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.55.03.png 1400w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.55.03-300x126.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.55.03-1024x429.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.55.03-768x321.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The code is simple. Set both the &#8216;text&#8217; and &#8216;result&#8217; variables to empty, and use &#8216;setState&#8217; to update the state within the MyHomePage Screen.<br \/>\nAdd another function called &#8216;calculate&#8217; that will evaluate the string expression and output the result.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-286\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.57.44.png\" alt=\"\" width=\"300\" height=\"209\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.57.44.png 1758w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.57.44-300x209.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.57.44-1024x712.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.57.44-768x534.png 768w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-14-at-13.57.44-1536x1068.png 1536w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>In the code, assign &#8216;text&#8217; variable to variable &#8216;expression&#8217;. The Parser is provided by a package like expressions to parse mathematical expressions. The Expression object represents the parsed mathematical expression. The parser verifies the syntax for correctness and prepares the expression for evaluation. Once validated, the expression processes the input data and returns the calculated result. Convert the output to number and and truncate the floating-point number to three decimal places. If an error occurs, set the result to &#8216;ERROR&#8217;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-291\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-08.59.58.png\" alt=\"\" width=\"300\" height=\"206\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-08.59.58.png 1904w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-08.59.58-300x206.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-08.59.58-1024x702.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-08.59.58-768x527.png 768w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-08.59.58-1536x1054.png 1536w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Two functions named &#8220;addText&#8221; and &#8220;deleteOneWord&#8221; will be added. &#8220;addText&#8221; will handle to add the user input data to variable &#8220;text&#8221;. If the result is &#8220;ERROR&#8221;, it will reset both the &#8220;result&#8221; and &#8220;text&#8221; variables. If result has the value, the &#8220;result&#8221; value will be transferred to the &#8220;text&#8221; variable and the &#8220;result&#8221; variable will be reset. The &#8220;deleteOneWord&#8221; functionfunction will remove the last character from the user&#8217;s input, like the behavior of the &#8216;Backspace&#8217; key on a keyboard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-293\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.06.32.png\" alt=\"\" width=\"300\" height=\"93\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.06.32.png 1900w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.06.32-300x93.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.06.32-1024x316.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.06.32-768x237.png 768w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.06.32-1536x474.png 1536w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>A new property named &#8220;buttonStyle&#8221;, of type ButtonStyle, will be added to allow easy customization of button styles. The default button style will have a grey color and 10pt rounded corners.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-295\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.15.40.png\" alt=\"\" width=\"300\" height=\"220\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.15.40.png 1658w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.15.40-300x220.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.15.40-1024x751.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.15.40-768x563.png 768w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.15.40-1536x1127.png 1536w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The button widget is a customizable button with parameters for overlay color, background, label, icon, font size, aspect ratio, and onPressed action and will be used for all buttons in the calculator application. Adding customizable parameters to the button will make it easier to adjust its appearance, resulting in a more flexible and polished UI design.<br \/>\nIn the button parameters, overlayColor is for color fading when user press the button while backgroundColor sets the button&#8217;s background color, label is the text displayed on the button and icon defines the icon shown. ratio parameter is used the button ratio for &#8220;=&#8221; button as it takes up twice the width of the other buttons.<br \/>\nNow, change the code &#8220;return const Placeholder(); to the following code:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-298\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.21.13.png\" alt=\"\" width=\"300\" height=\"50\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.21.13.png 1096w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.21.13-300x50.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.21.13-1024x170.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.21.13-768x128.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&#8220;Scaffold&#8221; is essential, and the background color of the screen will be set to grey. The screen will be divided into two sections using &#8220;column&#8221; widget: one to display the user&#8217;s input and the other to display the buttons.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-299\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.23.58.png\" alt=\"\" width=\"300\" height=\"206\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.23.58.png 1096w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.23.58-300x206.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.23.58-1024x704.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.23.58-768x528.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>For the user input display, the bottom padding will be removed from the screen height, and the display area will occupy 5 times the 1:4 ratio of the screen width, as the buttons will be arranged in 4 horizontal columns. The AutoSizeText package, added earlier, automatically adjusts the font size of the display based on the length of the user&#8217;s input. Now that we have the upper section of the UI design in place, let&#8217;s add the buttons to handle the user&#8217;s input.<br \/>\nAdd the following code the bottom of the code show above imaage.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-303\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.30.40.png\" alt=\"\" width=\"300\" height=\"39\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.30.40.png 1114w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.30.40-300x39.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.30.40-1024x134.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.30.40-768x101.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&#8220;expanded&#8221; will take all remaining spaces on the screen and &#8220;column&#8221; will be used to add 5 columns of the buttons.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-304\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.35.09.png\" alt=\"\" width=\"300\" height=\"216\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.35.09.png 1222w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.35.09-300x216.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.35.09-1024x736.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.35.09-768x552.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The uppermost row will contain 4 buttons:<\/p>\n<ul>\n<li>The History button<\/li>\n<li>The AC button, which resets the result and text variables<\/li>\n<li>A Backspace button with an icon that deletes one character from the user input, calling the deleteOneWord function we added earlier<\/li>\n<li>The &#8216;X&#8217; button, representing multiplication (*)<\/li>\n<\/ul>\n<p>We add the rest 3 rows buttons as follow:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-309\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.07.png\" alt=\"\" width=\"300\" height=\"192\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.07.png 1090w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.07-300x192.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.07-1024x656.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.07-768x492.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-310\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.21.png\" alt=\"\" width=\"300\" height=\"191\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.21.png 1090w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.21-300x191.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.21-1024x652.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.21-768x489.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-311\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.36.png\" alt=\"\" width=\"300\" height=\"191\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.36.png 1102w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.36-300x191.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.36-1024x650.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.36-768x488.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-312\" src=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.48.png\" alt=\"\" width=\"300\" height=\"156\" srcset=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.48.png 1104w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.48-300x156.png 300w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.48-1024x532.png 1024w, https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-18-at-09.43.48-768x399.png 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>The buttons will replicate the functionality of the addText function, while the last button, the = button, will call the calculate function to process and evaluate the user&#8217;s input.<br \/>\nAfter executing the code above, a calculator with an attractive UI design will appear.<br \/>\nThank you for taking the time to read through this post. I hope you found it helpful. Wishing you a wonderful day ahead!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good day to our valued readers! My name is Htay Min Khaung, and I work as a web developer at WIT Lab. Today, I will explain you through the step-by-step process of creating a calculator mobile application using the Flutter framework. Flutter is the open source framework with a lot of built-in widgets (components) to [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-249","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to create a calculator app using Flutter ? - WIT LAB %<\/title>\n<meta name=\"description\" content=\"We excel in utilizing cutting-edge technology, programming languages, and frameworks to deliver high-quality digital solutions.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to create a calculator app using Flutter ? - WIT LAB %\" \/>\n<meta property=\"og:description\" content=\"We excel in utilizing cutting-edge technology, programming languages, and frameworks to deliver high-quality digital solutions.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/\" \/>\n<meta property=\"og:site_name\" content=\"WIT LAB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/people\/WIT-LAB\/61567795364273\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-12-13T08:01:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"366\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Htay Min Kaung\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Htay Min Kaung\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/\"},\"author\":{\"name\":\"Htay Min Kaung\",\"@id\":\"https:\/\/witlab.ph\/blog\/#\/schema\/person\/c37bd963f520e565eebe682a9e319680\"},\"headline\":\"How to create a calculator app using Flutter ?\",\"datePublished\":\"2024-12-13T08:01:38+00:00\",\"dateModified\":\"2024-12-13T08:01:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/\"},\"wordCount\":973,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/witlab.ph\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png\",\"articleSection\":[\"System\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/\",\"url\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/\",\"name\":\"How to create a calculator app using Flutter ? - WIT LAB %\",\"isPartOf\":{\"@id\":\"https:\/\/witlab.ph\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png\",\"datePublished\":\"2024-12-13T08:01:38+00:00\",\"dateModified\":\"2024-12-13T08:01:38+00:00\",\"description\":\"We excel in utilizing cutting-edge technology, programming languages, and frameworks to deliver high-quality digital solutions.\",\"breadcrumb\":{\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage\",\"url\":\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png\",\"contentUrl\":\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png\",\"width\":700,\"height\":366},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/witlab.ph\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to create a calculator app using Flutter ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/witlab.ph\/blog\/#website\",\"url\":\"https:\/\/witlab.ph\/blog\/\",\"name\":\"WIT LAB\",\"description\":\"Web Development\",\"publisher\":{\"@id\":\"https:\/\/witlab.ph\/blog\/#organization\"},\"alternateName\":\"WIT LAB INC\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/witlab.ph\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/witlab.ph\/blog\/#organization\",\"name\":\"WIT LAB INC\",\"alternateName\":\"Spiceworks (Japan)\",\"url\":\"https:\/\/witlab.ph\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/witlab.ph\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/09\/logo_witlab-Copy-Copy.png\",\"contentUrl\":\"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/09\/logo_witlab-Copy-Copy.png\",\"width\":681,\"height\":616,\"caption\":\"WIT LAB INC\"},\"image\":{\"@id\":\"https:\/\/witlab.ph\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/people\/WIT-LAB\/61567795364273\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/witlab.ph\/blog\/#\/schema\/person\/c37bd963f520e565eebe682a9e319680\",\"name\":\"Htay Min Kaung\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/witlab.ph\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0a90aff2f83f2079748817650f0848ff?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0a90aff2f83f2079748817650f0848ff?s=96&d=mm&r=g\",\"caption\":\"Htay Min Kaung\"},\"url\":\"https:\/\/witlab.ph\/blog\/author\/htay-min-kaung\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to create a calculator app using Flutter ? - WIT LAB %","description":"We excel in utilizing cutting-edge technology, programming languages, and frameworks to deliver high-quality digital solutions.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/","og_locale":"en_US","og_type":"article","og_title":"How to create a calculator app using Flutter ? - WIT LAB %","og_description":"We excel in utilizing cutting-edge technology, programming languages, and frameworks to deliver high-quality digital solutions.","og_url":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/","og_site_name":"WIT LAB","article_publisher":"https:\/\/www.facebook.com\/people\/WIT-LAB\/61567795364273\/","article_published_time":"2024-12-13T08:01:38+00:00","og_image":[{"width":700,"height":366,"url":"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png","type":"image\/png"}],"author":"Htay Min Kaung","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Htay Min Kaung","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#article","isPartOf":{"@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/"},"author":{"name":"Htay Min Kaung","@id":"https:\/\/witlab.ph\/blog\/#\/schema\/person\/c37bd963f520e565eebe682a9e319680"},"headline":"How to create a calculator app using Flutter ?","datePublished":"2024-12-13T08:01:38+00:00","dateModified":"2024-12-13T08:01:38+00:00","mainEntityOfPage":{"@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/"},"wordCount":973,"commentCount":0,"publisher":{"@id":"https:\/\/witlab.ph\/blog\/#organization"},"image":{"@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage"},"thumbnailUrl":"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png","articleSection":["System"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/","url":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/","name":"How to create a calculator app using Flutter ? - WIT LAB %","isPartOf":{"@id":"https:\/\/witlab.ph\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage"},"image":{"@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage"},"thumbnailUrl":"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png","datePublished":"2024-12-13T08:01:38+00:00","dateModified":"2024-12-13T08:01:38+00:00","description":"We excel in utilizing cutting-edge technology, programming languages, and frameworks to deliver high-quality digital solutions.","breadcrumb":{"@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#primaryimage","url":"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png","contentUrl":"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/11\/How.png","width":700,"height":366},{"@type":"BreadcrumbList","@id":"https:\/\/witlab.ph\/blog\/how-to-create-a-calculator-app-using-flutter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/witlab.ph\/blog\/"},{"@type":"ListItem","position":2,"name":"How to create a calculator app using Flutter ?"}]},{"@type":"WebSite","@id":"https:\/\/witlab.ph\/blog\/#website","url":"https:\/\/witlab.ph\/blog\/","name":"WIT LAB","description":"Web Development","publisher":{"@id":"https:\/\/witlab.ph\/blog\/#organization"},"alternateName":"WIT LAB INC","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/witlab.ph\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/witlab.ph\/blog\/#organization","name":"WIT LAB INC","alternateName":"Spiceworks (Japan)","url":"https:\/\/witlab.ph\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/witlab.ph\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/09\/logo_witlab-Copy-Copy.png","contentUrl":"https:\/\/witlab.ph\/blog\/wp-content\/uploads\/2024\/09\/logo_witlab-Copy-Copy.png","width":681,"height":616,"caption":"WIT LAB INC"},"image":{"@id":"https:\/\/witlab.ph\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/WIT-LAB\/61567795364273\/"]},{"@type":"Person","@id":"https:\/\/witlab.ph\/blog\/#\/schema\/person\/c37bd963f520e565eebe682a9e319680","name":"Htay Min Kaung","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/witlab.ph\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0a90aff2f83f2079748817650f0848ff?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0a90aff2f83f2079748817650f0848ff?s=96&d=mm&r=g","caption":"Htay Min Kaung"},"url":"https:\/\/witlab.ph\/blog\/author\/htay-min-kaung\/"}]}},"_links":{"self":[{"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/posts\/249"}],"collection":[{"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/comments?post=249"}],"version-history":[{"count":52,"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions"}],"predecessor-version":[{"id":326,"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/posts\/249\/revisions\/326"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/media\/251"}],"wp:attachment":[{"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/media?parent=249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/categories?post=249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/witlab.ph\/blog\/wp-json\/wp\/v2\/tags?post=249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}