You are on page 1of 3

import 'package:fitness_choice/Screens/FadeAnimation.

dart';
import 'package:flutter/material.dart';

class BmiCalculator extends StatefulWidget {


@override
_BmiCalculatorState createState() => _BmiCalculatorState();
}

class _BmiCalculatorState extends State<BmiCalculator> {


@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text("Body Mass Index"),
),

body: Container(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,

children: <Widget>[
Text(
"BMI Calculator",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.black),
),

RaisedButton(
onPressed: _showDialog,
child: new Text("EDIT"),
)

],
),
),
),
),
),
);
}

_showDialog() async{
await showDialog<String>(
context: context,
child: AlertDialog(
contentPadding: const EdgeInsets.all(8.0),
content: FadeAnimation(1.2, Container(
height: 400,
width: 400,
child: Column(
children: <Widget>[
Text("BMI Calculator", style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,

),),

Padding(
padding: const EdgeInsets.all(9.0),
child: Text("Height:", style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20
),),
),

TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "Height"
)

),

SizedBox(width: 60,
height: 40,),

Padding(
padding: const EdgeInsets.all(9.0),
child: Text("Weight:", style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20
),),
),

TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: "Weight"
)

),

Padding(
padding: const EdgeInsets.all(8.0),
child: MaterialButton(
minWidth: double.infinity,
height: 30,
color: Colors.greenAccent,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)

),

child: Text("Save",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18
),
),

onPressed: (){},

),
),

Padding(
padding: const EdgeInsets.all(8.0),

child: MaterialButton(
minWidth: double.infinity,
height: 30,
color: Colors.greenAccent,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)

),

child: Text("Cancel",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18
),
),

onPressed: (){},

),
)

],
),
),
),

)
);
}

You might also like