M3Calc is a cross-platform calculator built with Flutter and Material Design 3
It includes a dark modern interface, circular buttons, live result preview, calculation history, and desktop window size control
- Material Design 3 UI
- Dark calculator theme
- Circular calculator buttons
- Basic arithmetic operations
- Live result preview
- Calculation history
- Persistent local storage
- Desktop minimum window size
- Responsive keypad layout
- Cross-platform Flutter support
- Android
- iOS
- macOS
- Windows
- Linux
- Web
lib/
main.dart
app.dart
core/
theme/
app_theme.dart
colors.dart
storage/
history_storage.dart
features/
calculator/
calculator_screen.dart
calculator_controller.dart
calculator_engine.dart
widgets/
calc_button.dart
keypad.dart
display.dart
The app is separated into small responsibilities
Starts Flutter and configures desktop window behavior.
Contains the root MaterialApp.
Contains global colors and Material 3 theme configuration.
Contains local history storage logic.
Contains calculator math logic. This file is independent from Flutter UI code, so it can be tested separately.
Manages calculator state:
- current expression
- preview result
- final result
- button input
- calculation history
Builds the main calculator page.
Contains reusable calculator UI widgets:
- display
- keypad
- calculator button
dependencies: flutter: sdk: flutter
shared_preferences: ^2.3.2 window_manager: ^0.4.3
Used to save calculator history locally.
Used to configure desktop window size and minimum window size.
Check Flutter installation: flutter doctor Install dependencies: flutter pub get Run the app: flutter run Run static analysis: flutter analyze Run tests: flutter test
Desktop window settings are configured in lib/main.dart. const windowOptions = WindowOptions( size: Size(420, 760), minimumSize: Size(420, 760), center: true, title: 'M3Calc', ); This keeps the calculator layout stable on desktop platforms.
Android and iOS use the application identifier io.github.qutad.m3calc.
Both mobile targets are portrait-only for the current calculator layout.
For a local signed Android build, create android/key.properties:
storePassword=YOUR_KEYSTORE_PASSWORD
keyPassword=YOUR_KEY_PASSWORD
keyAlias=upload
storeFile=/absolute/path/to/m3calc-upload.jksThen build the APK:
flutter build apk --releaseThe signed APK is written to
build/app/outputs/flutter-apk/app-release.apk.
The mobile GitHub Actions workflow requires these repository secrets:
ANDROID_KEYSTORE_BASE64ANDROID_KEYSTORE_PASSWORDANDROID_KEY_ALIASANDROID_KEY_PASSWORD(optional when it matches the keystore password)IOS_CERTIFICATE_BASE64IOS_CERTIFICATE_PASSWORDIOS_PROVISIONING_PROFILE_BASE64
The Android workflow supports JKS and PKCS #12 keystores. It validates the
keystore password and alias separately before starting the Flutter build, then
passes credentials directly to Gradle without writing passwords to a properties
file. The original M3Calc key generation command used the alias upload.
Compare the local keystore with the safe size and SHA-256 values printed by CI:
wc -c < "$HOME/.android-keystores/m3calc-upload.jks"
shasum -a 256 "$HOME/.android-keystores/m3calc-upload.jks"The iOS certificate must be an Apple Distribution certificate exported with
its private key as a password-protected PKCS #12 file. The provisioning profile
must be an Ad Hoc profile for io.github.qutad.m3calc and include each test
device. The workflow reads the team and profile identifiers directly from the
profile and uploads signed Android APK and iOS IPA artifacts.
Set the repository variable ENABLE_IOS_SIGNING to true only after all iOS
signing secrets are configured. Until then, the workflow skips iOS and still
builds Android successfully.
final engine = CalculatorEngine(); final result = engine.evaluate('16×(0.5+2.5)'); Expected result: 48
The design is inspired by modern Material Design 3 calculator interfaces. Main visual style:
- dark navy background
- purple number buttons
- blue action button
- pink equals button
- pink preview result
- large readable display
MIT License