Skip to content

A unit converter and basic Calculator, that converts basic Physical Units such as Temperature, Pressure, Angle, Length, Area, Volume, Duration, Mass, Frequency, Energy, Data Storage.

Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
ios
 
 
lib
 
 
 
 
 
 
 
 
web
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Softpy Converter

A unit converter and basic Calculator, that converts basic Physical Units such as Temperature, Pressure, Angle, Length, Area, Volume, Duration, Mass, Frequency, Energy, Data Storage.

Getting Started

Uses math_expressions 2.0.0 (https://pub.dev/packages/math_expressions) to perform arithmatic operations.

lib/Writer.py

you would probably be thinking what this python script doing in flutter project, its purpose is just to write file and save time in present and in future, we just have to modify lib/txtfiles/ConversionNames.txt and run script, and it'll update the all files automatically. it save hours of writing hundreds of function that'll only convert number and hours to write code to call them. this file is complicated, i have no idea what i just wrote in this file, i wonder how i write it and make it work, but this is so much beneficial.

lib/functions.dart

lib/functions.dart contain functions require to perform Conversion, functions take one argument number(double n) and return converted answer as double. It was written by lib/Writer.py, so don't write to this file, it'll be overwrite whenever Python script execute.

lib/functionsCaller.dart

lib/functionsCaller.dart contain function that take two argument(String from,String to,double number) and there hundreds of if else statements, it imports functions.dart file and it'll call its function according to arguments and and pass number to those function so they could convert them and return to functionCaller.dart and it'll return it to main.dart file. It was also written by lib/Writer.py, it can be overwrite.

lib/getList.dart

this files contain lists, main.dart import this file and use it for the options of Dropdown. it has list named subjects that'll content subject dropdown, and a function that'll return list according to the current subject selected, you can read code to understand clearly.

lib/txtfiles/ConversionNames.txt

it is actually the main file, it is the most important file, it has all conversion name with their formula in braces, its not a readme and user guide file, instead it is the part of the program, python script write files by help of this file.

Ruling on writing lib/txtfiles/ConversionNames.txt

if you want to modify it, be very carefull, it may cause error. it is written in such manner, if you don't follow this manner, it would cause logical error. here's an example on how to do:

[Start]

###################### Subject ##########################

Convert A to A (n)

Convert A to B (n*2)

Convert A to C (n*3)

Convert B to A (n/2)

Convert B to B (n)

Convert B to C (n*1.5)

Convert C to A (n/3)

Convert C to B (n/1.5)

Convert C to C (n)

[End]

it must be written in a way that i wrote, where i add space, you should add space, and where i didn't, than you shouldn't, because Writer.py file read it in this manner, ohh i have no idea what i just said.here is detail: write ["Convert"] and than Space and [from_unit](there should no "To" or "to") and than Space and than ["to"](must written in small alphabets) and than space and [to_unit](there should no "To" or "to") and than space than [braces] write formula inside braces,n is the number pass by user, you could perform operation onto it, there should no space in braces.

About

A unit converter and basic Calculator, that converts basic Physical Units such as Temperature, Pressure, Angle, Length, Area, Volume, Duration, Mass, Frequency, Energy, Data Storage.

Resources

Releases

No releases published
You can’t perform that action at this time.