Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Main #17

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
Binary file modified README.md
Binary file not shown.
13 changes: 13 additions & 0 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\src\flutter\flutter"
export "FLUTTER_APPLICATION_PATH=E:\flutter projects\bmi-calculator-flutter"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
28 changes: 28 additions & 0 deletions lib/Components/bottom_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:bmi_calculator/constants.dart';

class BottomButton extends StatelessWidget {
BottomButton(@required this.ontap, this.buttontitle);

final Function ontap;
final String buttontitle;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: ontap,
child: Container(
child: Center(
child: Text(
buttontitle,
style: klargebutton,
),
),
color: kBottomCardColor,
margin: EdgeInsets.only(top: 10.0),
padding: EdgeInsets.only(bottom: 20.0),
width: double.infinity,
height: kBottomcContainerHeight,
),
);
}
}
30 changes: 30 additions & 0 deletions lib/Components/icon_content.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import '../constants.dart';

class IconContent extends StatelessWidget {
const IconContent({
this.img,
this.nam,
});
final IconData img;
final String nam;
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
img,
size: 80.0,
),
SizedBox(
height: 15.0,
),
Text(
nam,
style: kNamTextStyle,
)
],
);
}
}
23 changes: 23 additions & 0 deletions lib/Components/reusable_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';

class ReusableCard extends StatelessWidget {
ReusableCard({@required this.colour, this.cardChild, this.onPress});

final Color colour;
final Widget cardChild;
final Function onPress;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onPress,
child: Container(
child: cardChild,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: colour,
),
),
);
}
}
21 changes: 21 additions & 0 deletions lib/Components/round_icon_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';

class RoundIconButton extends StatelessWidget {
RoundIconButton(@required this.icon, this.onpressed);
final IconData icon;
final Function onpressed;
@override
Widget build(BuildContext context) {
return RawMaterialButton(
child: Icon(icon),
onPressed: onpressed,
elevation: 7.0,
constraints: BoxConstraints.tightFor(
width: 60.0,
height: 60.0,
),
shape: CircleBorder(),
fillColor: Color(0xFF4C4F5C),
);
}
}
31 changes: 31 additions & 0 deletions lib/calculator.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import 'dart:math';

class Calculator {
Calculator(this.height, this.weight);

final int height;
final int weight;
double _bmi;
String calBMI() {
_bmi = weight / pow(height / 100, 2);
return _bmi.toStringAsFixed(1);
}

String getResult() {
if (_bmi >= 25) {
return 'Overweight';
} else if (_bmi >= 18) {
return 'Normal';
} else
return 'Underweight';
}

String bmiInterpretation() {
if (_bmi >= 25) {
return 'you\'re a fat bitch.stop eating when you\'re bored and workout a bit.';
} else if (_bmi >= 18) {
return 'you\'re good to go';
} else
return 'Eat something dude,you\'re skinny af';
}
}
36 changes: 36 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';

const kBottomcContainerHeight = 80.0;
const kCardColor = Color(0xFF272A4E);
const kBottomCardColor = Color(0xFFEB1555);
const kInactiveCardColor = Color(0xFF111328);
const kMinHeight = 120.0;
const kMaxHeight = 220.0;
const kNamTextStyle = TextStyle(
fontSize: 18.0,
color: Color(0xFF8D8E98),
);
const kNumTextStyle = TextStyle(
fontSize: 50.0,
fontWeight: FontWeight.w900,
);
const klargebutton = TextStyle(
fontSize: 35.0,
fontWeight: FontWeight.bold,
);
const ktitlefont = TextStyle(
fontSize: 50.0,
fontWeight: FontWeight.bold,
);
const kresulttext = TextStyle(
fontSize: 25.0,
fontWeight: FontWeight.bold,
color: Color(0xFF24D876),
);
const kbmitext = TextStyle(
fontSize: 100.0,
fontWeight: FontWeight.bold,
);
const kbodytextstyle = TextStyle(
fontSize: 25.0,
);
29 changes: 7 additions & 22 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
import 'package:flutter/material.dart';
import 'screens/Input_page.dart';

void main() => runApp(BMICalculator());

class BMICalculator extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: InputPage(),
);
}
}

class InputPage extends StatefulWidget {
@override
_InputPageState createState() => _InputPageState();
}

class _InputPageState extends State<InputPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('BMI CALCULATOR'),
),
body: Center(
child: Text('Body Text'),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
debugShowCheckedModeBanner: false,
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: Color(0xFF0C1234),
primaryColor: Color(0xFF0C1234),
accentColor: Color(0xFFFE0167),
),
home: InputPage(),
);
}
}
Loading