Skip to content

1ynies/smart_calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿงฎ Smart Calculator

App logo

A comprehensive Flutter application that combines a powerful calculator with multiple unit converters, providing users with essential mathematical and conversion tools in one convenient app, built with Clean Architecture principles and featuring a stunning UI.

๐Ÿ“ฑ Screenshots

โœจ Features

  • ๐Ÿงฎ Advanced Calculator: Perform basic and advanced mathematical operations
  • ๐Ÿ”„ Multiple Converters: Convert between various units (Volume, Data, Age, Discount, Time, Temperature)
  • โœ… Input Validation: Smart validation for accurate calculations and conversions
  • ๐ŸŽจ Beautiful UI: Clean, modern interface with intuitive design
  • ๐Ÿ“ฑ Responsive Design: Adaptive UI that works seamlessly across different screen sizes
  • โšก Fast & Efficient: Optimized performance with proper state management
  • ๐Ÿ—๏ธ Clean Architecture: Well-structured codebase following Clean Architecture principles

๐ŸŽจ Design

  • Color Scheme: Modern theme with elegant styling
  • Typography: Poppins font family for a modern, clean look
  • Material Design: Latest Material Design guidelines
  • Smooth Interactions: Engaging user experience with responsive feedback

๐Ÿ—๏ธ Architecture

This project follows Clean Architecture principles with clear separation of concerns:

lib/
โ”œโ”€โ”€ core/
โ”‚   โ””โ”€โ”€ theme.dart                    # App-wide theme configurations
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ””โ”€โ”€ calculation_model.dart    # Data model for calculations
โ”‚   โ””โ”€โ”€ repositories/
โ”‚       โ”œโ”€โ”€ calculator_repository_impl.dart  # Calculator repository implementation
โ”‚       โ””โ”€โ”€ converter_repository_impl.dart   # Converter repository implementation
โ”œโ”€โ”€ domain/
โ”‚   โ”œโ”€โ”€ entities/
โ”‚   โ”‚   โ”œโ”€โ”€ calculation.dart          # Calculation entity
โ”‚   โ”‚   โ””โ”€โ”€ converter.dart            # Converter entity
โ”‚   โ”œโ”€โ”€ repository/
โ”‚   โ”‚   โ”œโ”€โ”€ calculator_repository.dart # Calculator repository interface
โ”‚   โ”‚   โ””โ”€โ”€ converter_repository.dart  # Converter repository interface
โ”‚   โ””โ”€โ”€ usecases/
โ”‚       โ”œโ”€โ”€ calculate.dart            # Calculate use case
โ”‚       โ””โ”€โ”€ convert_unit.dart         # Convert unit use case
โ””โ”€โ”€ presentation/
    โ”œโ”€โ”€ controller/
    โ”‚   โ”œโ”€โ”€ calculator_controller.dart # Calculator state management
    โ”‚   โ””โ”€โ”€ converter_controller.dart  # Converter state management
    โ”œโ”€โ”€ Screen/
    โ”‚   โ”œโ”€โ”€ age_calculator_screen.dart      # Age calculator screen
    โ”‚   โ”œโ”€โ”€ calculator_screen.dart          # Main calculator screen
    โ”‚   โ”œโ”€โ”€ converter_screen.dart           # Converter selection screen
    โ”‚   โ”œโ”€โ”€ data_converter_screen.dart      # Data converter screen
    โ”‚   โ”œโ”€โ”€ discount_calculator_screen.dart # Discount calculator screen
    โ”‚   โ”œโ”€โ”€ homepage_screen.dart            # Home page screen
    โ”‚   โ”œโ”€โ”€ onboarding_screen.dart          # Onboarding screen
    โ”‚   โ”œโ”€โ”€ splash_screen.dart              # Splash screen
    โ”‚   โ”œโ”€โ”€ standard_converter_screen.dart  # Standard converter screen
    โ”‚   โ”œโ”€โ”€ temperature_converter_screen.dart # Temperature converter screen
    โ”‚   โ”œโ”€โ”€ time_converter_screen.dart      # Time converter screen
    โ”‚   โ””โ”€โ”€ volume_converter_screen.dart    # Volume converter screen
    โ””โ”€โ”€ widgets/
        โ”œโ”€โ”€ calculator_button_widget.dart   # Calculator button widget
        โ”œโ”€โ”€ Clickable_converter_widget.dart # Clickable converter widget
        โ”œโ”€โ”€ input_card_widget.dart          # Input card widget
        โ””โ”€โ”€ output_card_widet.dart          # Output card widget

Architecture Layers

  1. Domain Layer: Contains business logic, entities, and repository interfaces
  2. Data Layer: Implements repositories and handles data operations
  3. Presentation Layer: UI components, state management, and user interactions

๐Ÿ› ๏ธ Technologies & Packages

  • Flutter SDK: ^3.9.2
  • GetX: ^4.7.2 - State management
  • Sqflite: ^2.4.2 - Local database
  • Flutter SVG: ^2.2.2 - SVG icon support
  • Clean Architecture: Design pattern for maintainable code

๐Ÿš€ Getting Started

Prerequisites

  • Flutter SDK (^3.9.2)
  • Dart SDK
  • Android Studio / VS Code
  • Android device or emulator / iOS device or simulator

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/smart_calculator.git
    cd smart_calculator
  2. Install dependencies

    flutter pub get
  3. Run the app

    flutter run

๐Ÿ“– How to Use

Calculator

  1. Launch the app and navigate to the Calculator tab
  2. Enter numbers using the keypad
  3. Use operators (+, -, ร—, รท) to build expressions
  4. Tap "=" to calculate the result
  5. Use AC to clear all input or backspace to delete last character

Converters

  1. Navigate to Converter tab
  2. Select a converter (Volume, Data, Age, Discount, Time, Temperature)
  3. Enter input value and select units
  4. View instant conversion results

๐ŸŽฏ Key Features Explained

Calculator Operations

The calculator supports a wide range of mathematical operations:

  • Basic Arithmetic: Addition, subtraction, multiplication, division
  • Advanced Operations: Percentage calculations, decimal handling
  • Real-time Display: Live expression preview as you type
  • Error Handling: Smart validation to prevent invalid operations
  • History: Track previous calculations (if implemented)

Unit Conversions

Comprehensive unit conversion system with multiple categories:

  • Volume: Conversions between liters, gallons, milliliters, cubic meters, etc.
  • Data: Digital storage units (Bytes, KB, MB, GB, TB, PB)
  • Age: Age calculations in years, months, days, hours
  • Discount: Calculate discounts, final prices, and savings percentages
  • Time: Time conversions (hours, minutes, seconds, days, weeks)
  • Temperature: Temperature scales (Celsius, Fahrenheit, Kelvin)
  • Standard Units: Additional standard unit conversions

State Management

Implements GetX for efficient state management:

  • Reactive Programming: Real-time UI updates
  • Controller Pattern: Separate business logic from UI
  • Dependency Injection: Clean separation of concerns
  • Performance Optimized: Minimal rebuilds and efficient data flow

Theme System

Comprehensive theming with:

  • Custom Color Scheme: Modern, accessible color palette
  • Poppins Font Family: Clean, readable typography
  • Material Design 3: Latest design guidelines
  • Dark/Light Mode: Adaptive theming (if implemented)
  • Consistent Styling: Unified look across all components

Input Validation

Smart validation features:

  • Real-time Feedback: Immediate error detection
  • Format Checking: Ensures correct input formats
  • Boundary Validation: Prevents invalid ranges
  • User Guidance: Helpful error messages and hints

Responsive Design

Adaptive UI that works on:

  • Mobile Devices: Optimized for phones and tablets
  • Different Screen Sizes: Flexible layouts
  • Orientation Changes: Portrait and landscape support
  • Accessibility: Screen reader support and high contrast

๐Ÿค Contributing

We welcome contributions to the Smart Calculator project! Here's how you can help:

How to Contribute

  1. Fork the repository on GitHub
  2. Clone your fork locally:
    git clone https://github.com/yourusername/smart_calculator.git
    cd smart_calculator
  3. Create a feature branch:
    git checkout -b feature/your-feature-name
  4. Make your changes and ensure they follow the project structure
  5. Test your changes thoroughly
  6. Commit your changes:
    git commit -m "Add: Brief description of your changes"
  7. Push to your fork:
    git push origin feature/your-feature-name
  8. Create a Pull Request on GitHub

Guidelines

  • Follow the existing code style and architecture
  • Write clear, concise commit messages
  • Add tests for new features
  • Update documentation as needed
  • Ensure all tests pass before submitting

Development Setup

  • Use Flutter SDK ^3.9.2
  • Run flutter pub get to install dependencies
  • Use flutter analyze to check code quality
  • Run tests with flutter test

Reporting Issues

  • Use GitHub Issues to report bugs or request features
  • Provide detailed steps to reproduce bugs
  • Include device/emulator information and Flutter version

๐Ÿ“ž Support

If you have any questions or need help, please open an issue in the GitHub repository.


Made with โค๏ธ using Flutter

About

A smart calculator app , that contains calculator and converter with GetX for state management and clean architecture for project's structre and SQLite for local storage .

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages