Build a calculator app in iOS and Android with the same code by using flutter.

Last update: Jun 19, 2022

flutter_calculator

Preview

preview

Structure

structure

Input Widgets

input widgets is all extends StatefulWidget, because they need to response the onTap gesture.

  • NumberButton. Rendering the number button (like 1,2,3...) and handling the onTap gesture.

  • OperatorButton. Rendering the operator button (like +,-,*...) and handling the onTap gesture.

  • ResultButton. Rendering the command button (like clear,equal...) and handling the onTap gesture.

Output Widgets

output widgets is all extends StatelessWidget, because they are just rendering.

  • ResultDisplay. Rendering the current result and changing display when user tap a number button.

  • HistoryBlock. Rendering the calculation histories and changing display every time when user tap a valid button.

CalculatorPage

CalculatorPage is extends StatefulWidget and holding the List of result.

CalculatorPage receives every input widgets onTap event, makes a logical calculation for these input and decide what to display to output widgets.

Thanks

This repo is inspired by react-calculator.

Thanks to the author's awesome idea and app ui.

Contact

[email protected]

GitHub

https://github.com/chenyuantao/flutter_calculator
You might also like...

Age-Calculator - Age Calculator For Flutter

Age-Calculator - Age Calculator For Flutter

Age-Calculator(Contributed by YEASEEN AHMED)

Feb 9, 2022

Age-Calculator-Lambda - Age Calculator Lambda With Flutter

Age-Calculator-Lambda - Age Calculator Lambda With Flutter

Age-Calculator-Lambda(Contributed by YEASEEN AHMED)

Feb 9, 2022

BMI Calculator - A Body Mass Index Calculator inspired by the beautiful user interface designs.

BMI Calculator A Body Mass Index Calculator inspired by the beautiful user interface designs. A multi screen app with simple functionality but full-on

Dec 2, 2021

WooCommerce App template that uses Flutter. Integrated to work with WooCommerce stores, connect and create an IOS and Android app from Flutter for IOS and Android

WooCommerce App template that uses Flutter. Integrated to work with WooCommerce stores, connect and create an IOS and Android app from Flutter for IOS and Android

WooCommerce App: Label StoreMax Label StoreMax - v5.3.1 Official WooSignal WooCommerce App About Label StoreMax Label StoreMax is an App Template for

Jun 28, 2022

An isolated worker for Flutter (Isolate) and Web (Web Worker). Behaves almost the same as the compute function, except it is not a one-off worker.

A singleton isolated worker for all platforms. On most platforms, it uses Flutter's Isolate, except on the web, since Isolate is not available, it use

Jun 19, 2022

Taking many pictures and photos list in the same page

Taking many pictures and photos list in the same page

Custom Camera Preview A component has developed with Flutter Purpose Instead of taking photos of a product and taking them one by one when users need

May 10, 2022

The same old Weather App, But 'In Flutter , By Me'

The same old Weather App, But 'In Flutter , By Me'

Weather App v1.0.1 About The same old Weather App, But 'In Flutter , By Me' . NB Still in developement Stats ### v1.0.1 - Started a Basic outline of

Mar 22, 2022

♠️ Beautiful iOS/Android poker odds calculator app made of Flutter.

 ♠️ Beautiful iOS/Android poker odds calculator app made of Flutter.

Aqua ♠️ Beautiful Texas Hold'em poker odds calculator made of Flutter. 🎛 Effectively uses ChangeNotifier/ValueNotifier with AnimatedBuilder/ValueList

May 6, 2022
Comments
  • 1. 抱歉请教个问题

                  if (widget.onPress != null) {
                    widget.onPress(widget.number);
                    setState(() {
                      pressed = true;
                    });
    

    这里的Widget.func 是调用什么地方的方法? 全局?

    Reviewed by orangemio at 2018-12-28 19:50
  • 2. hello

    Hi, I see that you are learning flutter, I am making an app to publish interactive chat stories, and I am recruiting a team of newcomers to flutter to study and work on the app. If you are interested write me an email [email protected] or in Issue on Github

    Reviewed by frilancer1547 at 2020-09-07 09:38

Related

A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your issue.
A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your issue.

r_scan A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your iss

Jun 5, 2022
Peek & Pop implementation for Flutter based on the iOS functionality of the same name.

peek_and_pop Peek & Pop implementation for Flutter based on the iOS functionality of the same name. Finally, the v1.0.0 release! More fluent, more opt

Jun 24, 2022
Write iOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.
Write iOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.

Dart_Native Dart_Native operates as both a code generator tool and a bridge to communicate between Dart and native APIs. Replaces the low-performing F

Jun 28, 2022
Simple-Calculator-App - Simple Calculator App using Flutter
Simple-Calculator-App - Simple Calculator App using Flutter

Simple Calculator App I created this calculator using Flutter. I took inspiratio

Jan 26, 2022
BMI calculator app - BMI calculator app written with dart language using flutter
BMI calculator app - BMI calculator app written with dart language using flutter

BMI_calculator_app This app is written with dart language using flutter framewor

Feb 5, 2022
Body-Mass-Index-Calculator - Body Mass Index Calculator Using Flutter
Body-Mass-Index-Calculator - Body Mass Index Calculator Using Flutter

Body-Mass-Index-Calculator Image Video Presentation bandicam.2022-02-18.00-33-22

May 12, 2022
Todo app - contains same UI and different state management techniques (without using StatefulWidget)
Todo app - contains same UI and different state management techniques (without using StatefulWidget)

This repo contains same UI and different state management techniques (without using StatefulWidget) to compare and prefer based on your coding style.

May 19, 2022
Flutter-calculator - An elegant calculator app written in Flutter
Flutter-calculator - An elegant calculator app written in Flutter

Elegant Calculator A simple and elegant Calculator app developer in Flutter. Preview Getting Started This project is a starting point for a Flutter ap

Jun 1, 2022
Love-Calculator-Flutter - A Love Calculator Flutter app created for learning basic stuffs in Dart
Love-Calculator-Flutter - A Love Calculator Flutter app created for learning basic stuffs in Dart

Love Calculator The same old Love Calculator ,but in flutter NB A simple flutter

Mar 22, 2022
Flutter-calculator - A flutter calculator appliacation which is made with dart
Flutter-calculator - A flutter calculator appliacation which is made with dart

A simple calculator A simple calculator app made with Flutter Screenshot This pr

Jan 23, 2022