A Flutter-based calculator application providing basic arithmetic operations, designed with a clean, dark-themed UI.
- Basic Arithmetic Operations: Supports addition, subtraction, multiplication, and division.
- Percentage Conversion: Calculates percentage of the displayed number.
- Clear and Delete Functions: "AC" button to reset all fields, and "DEL" button to remove the last entered character.
- Responsive Layout: Buttons adjust dynamically for a consistent user experience across devices.
- Dark Theme: Minimalistic dark theme for a smooth, visually appealing interface.
Follow these instructions to get a local copy of the project up and running.
- Flutter SDK
- Any IDE supporting Flutter (e.g., VS Code, Android Studio)
-
Clone the repository:
git clone https://github.com/AadityaPanda/calculator.git cd calculator-app
-
Install dependencies:
flutter pub get
-
Run the app:
flutter run
main.dart
: Initializes the app and sets up the dark theme.calculator_screen.dart
: Contains the main layout of the calculator screen, button actions, and calculator logic.button_values.dart
: Defines the buttons and their labels used in the calculator.
import 'package:flutter/material.dart';
import 'calculator_screen.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Calculator',
debugShowCheckedModeBanner: false,
theme: ThemeData.dark(),
home: const CalculatorScreen(),
);
}
}
Handles button presses, arithmetic logic, and displays results.
Defines constants for each button label, which are used throughout the app for consistency and ease of maintenance.