Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ import Flutter
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {

FlutterLocalNotificationsPlugin.setPluginRegistrantCallback { (registry) in
GeneratedPluginRegistrant.register(with: registry)
}

if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
}

GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
Expand Down
18 changes: 12 additions & 6 deletions lib/calc/bmiCalc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@
import 'dart:math';

class BMICalculator {
BMICalculator({this.height, this.weight, this.age, this.waist, this.gender});
BMICalculator({
required this.height,
required this.weight,
required this.age,
this.waist,
required this.gender,
});

final int height;
final double weight;
final int age;
final int waist;
final int? waist;
final int gender;

double _bmi = 0;
double _bf = 0;

double calculateBMI() {
_bmi = weight / pow(height / 100, 2);
return num.parse(_bmi.toStringAsFixed(1));
_bmi = (weight / pow(height / 100, 2));
return double.parse(_bmi.toStringAsFixed(1));
}

double calculateBF() {
Expand All @@ -29,10 +35,10 @@ class BMICalculator {
(0.005 * _bmi * _bmi * gender) +
(0.00021 * _bmi * _bmi * age);
if (_bf > 0)
return num.parse(_bf.toStringAsFixed(1));
return double.parse(_bf.toStringAsFixed(1));
else
return 0;
}

// Body fat % = -44.988 + (0.503 * age) + (10.689 * gender) + (3.172 * BMI) - (0.026 * BMI2) + (0.181 * BMI * gender) - (0.02 * BMI * age) - (0.005 * BMI2 * gender) + (0.00021 * BMI2 * age)
// Body fat % = -44.988 + (0.503 * age) + (10.689 * gender) + (3.172 * BMI) - (0.026 * BMI2) + (0.181 * BMI * gender) - (0.02 * BMI * age) - (0.005 * BMI2 * gender) + (0.00021 * BMI2 * age)
}
4 changes: 2 additions & 2 deletions lib/components/buttonButton.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:bp_notepad/components/constants.dart';

class ButtonButton extends StatelessWidget {
ButtonButton({@required this.onTap, @required this.buttonTitle});
final Function onTap;
ButtonButton({required this.onTap, required this.buttonTitle});
final VoidCallback onTap;
final String buttonTitle;
@override
Widget build(BuildContext context) {
Expand Down
6 changes: 3 additions & 3 deletions lib/components/iconContent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import 'package:flutter/material.dart';

class IconFont extends StatelessWidget {
IconFont({this.icon, this.lable, this.textStyle,this.colorStyle});
IconFont({required this.icon, required this.label, required this.textStyle,required this.colorStyle});
final IconData icon;
final String lable;
final String label;
final TextStyle textStyle;
final Color colorStyle;

Expand All @@ -21,7 +21,7 @@ class IconFont extends StatelessWidget {
const SizedBox(
height: 10.0,
),
Text(lable, style: textStyle)
Text(label, style: textStyle)
],
);
}
Expand Down
Loading