An BMI Calculator App that measures your Body Mass Index with decimal precision!
BMI Calculator App is an Body Mass Index (BMI) calculator that measures your BMI table with decimal precision based on your height, age and sex using custom widgets in flutter ⚖
Here is the code folder structure.
bmicalc/
|- android
|- ios
|- lib/
|-- components/
|-- screens/
|-- calculator_brain.dart
|-- constants.dart
|-- main.dart
Now, lets dive into the lib folder which has the main code for the application.
bottom_button.dart
- icon_content.dart
- reusable_card.dart
- rounded_icon_button.dart
This folder houses all the components listed above which they are custom flutter widgets with beautiful customized theme using Composition and Inheritance.
input_page.dart
- This code implementing the UI (User Interface) of the calculator screen, where the user need to provide necessary information for calculating user's BMI. Take a look of this activity at About The Project section.
results_page.dart
- This code implementing the UI (User Interface) of the results screen, there the user is shown his BMI, a classification group, a customized message and the standard BMI range. Take a look at this activity at About The Project section.
calculator_brain.dart
- This code implementing the CalculatorBrain
class, where the necessary calculations and conditionals are performed to provide a result to the user that contains the BMI, group classification and interpretation.
Method for calculating BMI:
String calculateBMI() {
_bmi = weight / pow(height / 100, 2);
return _bmi.toStringAsFixed(1); // converts this _bmi to a double before computing the string representation, as by toDouble - with exactly {fractionDigits} digits after the decimal point
}
Formula for calculating BMI:
constants.dart
- All the application level constants. Specifically, this constants.dart file contains theme classes for app widgets.
Download or clone this repo by using the link below:
https://github.com/ladunjexa/bmi-calculator-app
Go to project root and execute the following command in console to get the required dependencies:
flutter pub get
Clone the project
git clone https://github.com/ladunjexa/bmi-calculator-app
Go to the project directory
cd bmi-calculator-app
Install dependencies
flutter pub get
Start the application
flutter run
Contributions are always welcome!
See contributing.md
for ways to get started.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt for more information.
Liron Abutbul - @lironabutbul6 - @ladunjexa
Project Link: https://github.com/ladunjexa/bmi-calculator-app
This section used to mention useful resources and libraries that used in BMI Calculator App project.
- FontAwesomeFlutter
- #FlutterBrew