mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-08-23 14:01:14 +08:00
10 lines
256 B
Dart
10 lines
256 B
Dart
import 'dart:math';
|
|
|
|
import 'package:bmi_calculator/body_model.dart';
|
|
|
|
// I've used weight/height^2 (kg/m^2)
|
|
// You can expand this logic
|
|
double calculateBMI({required BodyModel bodyModel}) {
|
|
return (bodyModel.weight) / pow(bodyModel.height / 100, 2);
|
|
}
|