In App Calculator

A beautifully designed, fully functional calculator widget that can be easily embedded into any Flutter app. Whether you're building a shopping app, a financial planner, or any application that benefits from in-app calculations—this package helps your users perform quick math without leaving your app.


Features

  • Basic Arithmetic: Supports addition, subtraction, multiplication, division, percentages, and more.
  • Light & Dark Mode: Automatically adapts to your theme or can be toggled manually.
  • Result Callback: Get calculated results using a callback (onResultCalculated) to store or use elsewhere in your app.
  • Smart Percentage Handling: Understands expressions like 100 + 20%, 200 * 10%, etc.
  • Custom UI: Modern, responsive, and scrollable layout with dynamic font resizing.
  • Easy Integration: Just drop the widget in and pass the required parameters.

Why Use This Package?

Many apps, especially in the e-commerce, finance, and utility domains, require users to perform quick calculations. Redirecting users to a separate calculator app disrupts the experience. With In App Calculator, you can keep users engaged within your app, offering them the convenience of a powerful calculator built right in.

It's lightweight, easy to implement, and adds real usability value to your app.

Getting Started

To use this package, add it to your pubspec.yaml file:

dependencies: in_app_calculator: ^1.0.0

Then run flutter pub get

Screenshots


Calculator displaying as widget Dark Mode

Calculator displaying as widget Light Mode

Calculator displaying on button press

Calculator displaying as Dialog

Usage

Import the package to use in your Flutter project import 'package:in_app_calculator/in_app_calculator.dart';.

import 'package:flutter/material.dart';
import 'package:in_app_calculator/in_app_calculator.dart';

class MyAppCenter extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Calculator in Center'),
        ),
        body: Center(
          child: InAppCalculator(
            isDarkMode: true,
            onResultCalculated: (result) {
              // Optionally handle result here
              print('Calculated Result: $result');
            },
          ),
        ),
      ),
    );
  }
}

Additional information

Contributions are welcome. If you find any issues or have feature requests, Connect with me at chalwadivaishu0880@gmail.com..

Libraries

in_app_calculator