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

skleton page is ready #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
![App Brewery Banner](https://github.com/londonappbrewery/Images/blob/master/AppBreweryBanner.png)


# BMI Calculator 💪

## Our Goal

The objective of this tutorial is to look at how we can customise Flutter Widgets to achieve our own beautiful user interface designs. If you have a designer on board, no matter how unconventional their designs are, we can create them using Flutter.


## What you will create

We’re going to make a Body Mass Index Calculator inspired by the beautiful designs made by [Ruben Vaalt](https://dribbble.com/shots/4585382-Simple-BMI-Calculator). It will be a multi screen app with simple functionality but full-on custom styling.
It is a Body Mass Index Calculator inspired by the beautiful designs made by [Ruben Vaalt](https://dribbble.com/shots/4585382-Simple-BMI-Calculator). It will be a multi screen app with simple functionality but full-on custom styling.

![Finished App](https://github.com/londonappbrewery/Images/blob/master/bmi-calc-demo.gif)

## What you will learn
## What will this include

- How to use Flutter themes to create coherent branding.
- How to create multi-page apps using Flutter Routes and Navigator.
Expand All @@ -27,6 +19,3 @@ We’re going to make a Body Mass Index Calculator inspired by the beautiful des
- Learn about composition vs. inheritance and the Flutter way of creating custom UI.
- Understand the difference between const and final in Dart and when to use each.

>This is a companion project to The App Brewery's Complete Flutter Development Bootcamp, check out the full course at [www.appbrewery.co](https://www.appbrewery.co/)

![End Banner](https://github.com/londonappbrewery/Images/blob/master/readme-end-banner.png)
11 changes: 11 additions & 0 deletions ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=C:\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\M Avinash Naidu\AndroidStudioProjects\bmi-calculator-flutter"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
export "FLUTTER_FRAMEWORK_DIR=C:\flutter\bin\cache\artifacts\engine\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
37 changes: 37 additions & 0 deletions lib/Calculator_brain.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'dart:math';

import 'package:flutter/cupertino.dart';

class CalculatorBrain {
CalculatorBrain({@required this.height, @required this.weight});

final int height;
final int weight;

double _bmi;

String calculateBmi() {
_bmi = weight / pow(height / 100, 2);
return _bmi.toStringAsFixed(1);
}

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

String getInterpretation() {
if (_bmi >= 25) {
return 'You have a higher than normal body weight. Try to exercise more.';
} else if (_bmi >= 18.5) {
return 'You have a normal body weight. Good job!';
} else {
return 'You have a lower than normal body weight. You can eat a bit more.';
}
}
}
21 changes: 21 additions & 0 deletions lib/Components/RoundIconButton.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, @required this.onPressed});
final IconData icon;
final Function onPressed;
@override
Widget build(BuildContext context) {
return RawMaterialButton(
child: Icon(icon),
shape: CircleBorder(),
fillColor: Color(0xFF4C4F5E),
onPressed: onPressed,
elevation: 6.0,
constraints: BoxConstraints.tightFor(
width: 56.0,
height: 56.0,
),
);
}
}
29 changes: 29 additions & 0 deletions lib/Components/bottombutton.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import '../constants.dart';

class BottomButton extends StatelessWidget {
BottomButton({@required this.buttonTitle, @required this.onTap});

final String buttonTitle;
final Function onTap;

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

class IconContent extends StatelessWidget {
IconContent({@required this.icon, this.lable});
final IconData icon;
final String lable;

@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
icon,
size: 80.0,
),
SizedBox(height: 15.0),
Text(
lable,
style: kLableTextStyle,
)
],
);
}
}
23 changes: 23 additions & 0 deletions lib/Components/reusablecard.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.cardClass, this.onPress});
final Color colour;
final Widget cardClass;
final Function onPress;

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onPress,
child: Container(
child: cardClass,
margin: EdgeInsets.all(15.0),
decoration: BoxDecoration(
color: colour,
borderRadius: BorderRadius.circular(10.0),
),
),
);
}
}
Loading