Skip to content

Commit

Permalink
🚧 Added flutter_lints, provider
Browse files Browse the repository at this point in the history
iNcrease dart sdk, UI overhauls, function optimization
  • Loading branch information
iqfareez committed Jun 30, 2022
1 parent 5293961 commit fd18898
Show file tree
Hide file tree
Showing 17 changed files with 492 additions and 648 deletions.
3 changes: 1 addition & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ linter:
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
250 changes: 0 additions & 250 deletions lib/AppBody.dart

This file was deleted.

45 changes: 0 additions & 45 deletions lib/Utils/RegExInputFormatter.dart

This file was deleted.

46 changes: 0 additions & 46 deletions lib/Utils/bmiLegends.dart

This file was deleted.

14 changes: 14 additions & 0 deletions lib/Utils/bmi_enums.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
enum BmiEnums {
severlyUnderweight("Serverly Underweight", null, 16),
underweight("Underweight", 16, 18.5),
normal("Normal", 18.5, 25),
overweight("Overweight", 25, 30),
moderatelyObese("Moderately Obese", 30, 35),
severelyObese(
"Severely Obese", 35, null); // max value is jus a very large value

const BmiEnums(this.description, this.min, this.max);
final String description;
final double? min;
final double? max;
}
8 changes: 8 additions & 0 deletions lib/Utils/bmi_utils.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class BmiUtils {
/// a function that takes weight and height and return BMI value
static double calculateBmi(double height, double weight) {
return weight / (height * height);
}

/// TODO; BMI value validator
}
13 changes: 13 additions & 0 deletions lib/Utils/link_launcher.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:url_launcher/url_launcher.dart';

class LinkLauncher {
/// launch the given url
static void launch(String url) async {
if (!await launchUrl(Uri.parse(url))) {
Fluttertoast.showToast(
msg: "Cannot launch url $url", backgroundColor: Colors.red);
}
}
}
Loading

0 comments on commit fd18898

Please sign in to comment.