Created
April 13, 2020 12:07
-
-
Save tkuenneth/e08ddf3cbbe836c8fe676982cb20c980 to your computer and use it in GitHub Desktop.
This script uses both model.dart and converter.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:temperatureconverter/src/converter.dart'; | |
import 'package:temperatureconverter/src/model.dart'; | |
main(List<String> args) { | |
if (args.length != 3) { | |
print( | |
"Usage: main2 degreesCelsius|degreesFahrenheit|kelvin value degreesCelsius|degreesFahrenheit|kelvin"); | |
} else { | |
Model model = new Model(); | |
model.inUnit = enumFor(args[0]); | |
model.inTemperature = stringToDouble(args[1]); | |
model.outUnit = enumFor(args[2]); | |
model.calculateOutTemperature(); | |
print("${args[1]} ${args[0]} is ${model.outTemperatureAsString}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment