Skip to content

smnasimahmed/versity_flutter_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Calculator App

Overview

This is a simple calculator app built using Flutter. It features basic arithmetic operations with a modern UI. The app demonstrates how to design a functional interface using Flutter widgets and layouts.

Features

  • User-friendly interface with large buttons for easy input.
  • Basic arithmetic operations: Addition, Subtraction, Multiplication, Division.
  • Cross-platform support for Android and iOS.
  • Minimalist design with a dark theme for comfortable usage.

What I Used / Learned

  • Flutter SDK: Used for building the user interface.
  • Dart Language: Core language for implementing logic.
  • Layouts (Column and Row): Used to arrange buttons and the display neatly.
  • Container Decorations: To design rounded buttons with colors based on functions.

Challenges and Issues

State Management Problem

Problem: The calculator uses a StatelessWidget, which doesn’t allow dynamic updates for the display. Solution: Replace with a StatefulWidget to manage input and result updates more effectively.

Display Issue

Problem: The display shows a static "0" without updating as the user presses buttons. Solution: Store input and result values in a state variable and use setState() to update the display on user interaction.

Improvements & Next Steps

Migrate to StatefulWidget to handle state changes properly. Consider Provider or Riverpod if the app becomes more complex. Use Expanded or Flexible to adapt the layout across all screen sizes.

Future Plans

  • Advanced Operations: Add functions like square roots, power, and memory storage.
  • Theme Toggle: Add light and dark mode support.
  • Landscape Mode Support: Optimize the layout for both portrait and landscape orientations.

How to Install and Run Locally

Prerequisites

Steps

Clone the repository:

https://github.com/smnasimahmed/versity_flutter_calculator.git

Install dependencies:

flutter pub get

Ensure Java 17 is the active version:

java -version
If necessary, set Java 17 manually:
  • Linux/Mac:
export JAVA_HOME=/path-to-java-17
  • Windows: Update the JAVA_HOME environment variable.

Run the app:

flutter run

Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors