Input Data - Dart
Input Data - Dart
dart';
import 'package:bmi_app/result.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class BMICalc extends StatefulWidget {
@override
_BMICalcState createState() => _BMICalcState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF24233d),
appBar: AppBar(
backgroundColor: Color(0xFF05104f),
title: Center(
child: Text('BMI Calculator',
style: TextStyle(
color: Colors.white,
fontSize: 15,
fontWeight: FontWeight.bold
),
),
),
),
body:SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
children:<Widget> [
SizedBox(
width: 25
),
Container(
child: Material(
borderRadius: BorderRadius.circular(10),
elevation: 3.0,
color: Color(0xFF24233d),
shadowColor: Color(0xFF0abeff) ,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(FontAwesomeIcons.male,
size: 25,
color: Color(0xFF0abeff)
),
Text('Male',
style: TextStyle(
fontSize: 15,
color: Color(0xFF0abeff)
),
)
],
),
),
),
height: 135,
width: 120,
),
SizedBox(
width: 25
),
Container(
child: Material(
borderRadius: BorderRadius.circular(10),
elevation: 3.0,
color: Color(0xFF24233d),
shadowColor: Color(0xFF0abeff) ,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(FontAwesomeIcons.female,
size: 25,
color: Color(0xFF0abeff)
),
Text('Female',
style: TextStyle(
fontSize: 15,
color: Color(0xFF0abeff)
),
)
],
),
),
),
height: 135,
width: 120,
),
],
),
Container(
child: Material(
borderRadius: BorderRadius.circular(10),
elevation: 3.0,
color: Color(0xFF24233d),
shadowColor: Color(0xFF0abeff) ,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('Height',
style: TextStyle(
fontSize: 15,
color: Color(0xFF0abeff)
),
),
Padding(padding: EdgeInsets.only(top: 5)),
Text(height.toString(),
style: TextStyle(
fontSize: 30,
color: Color(0xFF0abeff)
),
),
Padding(padding: EdgeInsets.only(top: 5)),
Row(
children: [
SizedBox(width: 80),
IconButton(icon: Icon(FontAwesomeIcons.plus,
color: Colors.white,
size:15),
onPressed: (){
setState(() {
height ++;
});
}),
SizedBox(width: 10),
IconButton(icon: Icon(FontAwesomeIcons.minus,
color: Colors.white,
size:15),
onPressed: (){
setState(() {
height --;
});
}),
],
),
],
),
),
),
height: 135,
width: 265,
),
),
),
height: 135,
width: 120,
),
SizedBox(
width: 25
),
Container(
child: Material(
borderRadius: BorderRadius.circular(10),
elevation: 3.0,
color: Color(0xFF24233d),
shadowColor: Color(0xFF0abeff) ,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text("Age",
style: TextStyle(
fontSize: 15,
color: Color(0xFF0abeff)
),
),
Padding(padding: EdgeInsets.only(top: 5)),
Text(age.toString(),
style: TextStyle(
fontSize: 30,
color: Color(0xFF0abeff)
),
),
Padding(padding: EdgeInsets.only(top: 5)),
Row(
children: [
SizedBox(width: 10),
IconButton(icon: Icon(FontAwesomeIcons.plus,
color: Colors.white,
size:15),
onPressed: (){
setState(() {
age ++;
});
}),
SizedBox(width: 5),
IconButton(icon: Icon(FontAwesomeIcons.minus,
color: Colors.white,
size:15),
onPressed: (){
setState(() {
age --;
});
}),
],
),
],
),
),
),
height: 135,
width: 120,
),
],
),
],
),
),
);
}
}