harshil_simple_math 1.0.0 copy "harshil_simple_math: ^1.0.0" to clipboard
harshil_simple_math: ^1.0.0 copied to clipboard

A simple Dart package to add, subtract, multiply and divide two numbers.

imple_calc

A lightweight Flutter package for performing basic arithmetic operations such as addition, subtraction, multiplication, and division.

Features

Simple and intuitive API for arithmetic calculations.

Supports addition, subtraction, multiplication, and division.

Lightweight with no external dependencies.

Compatible with all Flutter-supported platforms, including Windows.

Getting Started

Installation

Add simple_calc to your pubspec.yaml file:

dependencies: simple_calc: ^1.0.0

Run the following command to fetch the package:

flutter pub get

Usage

Import the package and use the SimpleCalc class to perform calculations.

import 'package:simple_calc/simple_calc.dart';

void main() { final calc = SimpleCalc();

// Perform basic arithmetic operations print(calc.add(5, 3)); // Output: 8.0 print(calc.subtract(5, 3)); // Output: 2.0 print(calc.multiply(5, 3)); // Output: 15.0 print(calc.divide(6, 2)); // Output: 3.0 }

Example

Check the example/ folder for a sample Flutter project demonstrating how to use simple_calc in a real application.

API Reference

add(double a, double b): Returns the sum of a and b.

subtract(double a, double b): Returns the difference between a and b.

multiply(double a, double b): Returns the product of a and b.

divide(double a, double b): Returns the quotient of a divided by b. Throws an error if b is zero.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.

License

This package is licensed under the MIT License. See the LICENSE file for details.

2
likes
130
points
26
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A simple Dart package to add, subtract, multiply and divide two numbers.

Repository (GitHub)

License

MIT (license)

Dependencies

flutter

More

Packages that depend on harshil_simple_math