My Calculator is a simple calculator application built using Flutter and Dart. This app performs basic arithmetic operations like addition, subtraction, multiplication, and division.
- Basic Arithmetic Operations: Perform addition, subtraction, multiplication, and division
- Clear Input: Reset the current input and start over
- Backspace: Delete the last entered character
- Responsive Layout: The app adjusts to different screen sizes
- Prevent Division by Zero: Safeguard against division by zero, displaying infinity
- Clone the Repository:
git clone https://github.com/yourusername/calculator-app.git- Navigate to the Project Directory:
cd calculator-app- Install Dependencies:
flutter pub get- Run the App:
flutter runmain.dart: The main file that sets up the application and UI- The
MyAppwidget sets up the structure of the app and its home screen - The
Calculatorwidget manages the calculator's input and handles user interactions
Calculator Logic:
buttonPressed(): Handles all button presses from the calculator interfaceperformCalculation(): Handles the actual arithmetic calculations based on user input
- Buttons: The calculator consists of buttons for digits (0–9), operators (+, -, ×, ÷), and utility functions (C, ←, =)
- Display Screen: Shows the current input or result of the arithmetic operation
- Layout: A responsive layout using Flutter's
Column,Row, andExpandedwidgets to ensure a smooth user experience
- Enter numbers using the on-screen buttons
- Perform calculations by pressing the operator buttons (
+,-,×,÷) - Press
=to get the result - Press
Cto clear the input - Use
←to delete the last character in the input - Avoid dividing by zero; the app will return
Infinityif you attempt this
- Flutter: The framework used for building this app
- Dart: The programming language used
- Material Design: Flutter's material design components are used for the UI
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Feel free to submit a Pull Request.

