Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class Home extends StatefulWidget {
- @override
- State<StatefulWidget> createState() {
- return new HomeState();
- }
- }
- class HomeState extends State<Home> {
- @override
- Widget build(BuildContext context) {
- final TextEditingController _ageController = new TextEditingController();
- final TextEditingController _heightController = new TextEditingController();
- final TextEditingController _weightController = new TextEditingController();
- return new Scaffold(
- appBar: new AppBar(
- title: new Text('BMI'),
- centerTitle: true,
- backgroundColor: Colors.pinkAccent,
- ),
- body: new Column(
- children: <Widget>[
- new Center(
- child: new Image.asset("images/bmilogo.png"),
- ),
- new Padding(padding: new EdgeInsets.all(18.0)),
- new Container(
- color: Colors.grey.shade300,
- padding: new EdgeInsets.all(15.0),
- child: new Column(
- children: <Widget>[
- new TextField(
- controller: _ageController,
- decoration: new InputDecoration(
- icon: new Icon(Icons.person_outline), labelText: "Age"),
- ),
- new TextField(
- controller: _heightController,
- decoration: new InputDecoration(
- icon: new Icon(Icons.insert_chart),
- labelText: "Height (in feet)"),
- ),
- new TextField(
- controller: _weightController,
- decoration: new InputDecoration(
- icon: new Icon(Icons.line_weight),
- labelText: "Weight (in lbs)"),
- ),
- new Padding(padding: new EdgeInsets.only(top: 20.0)),
- new RaisedButton(
- onPressed: calculate(1, 2),
- color: Colors.pinkAccent,
- child: new Text(
- "Calculate",
- style: new TextStyle(color: Colors.white),
- ),
- )
- ],
- ),
- ),
- ],
- ),
- );
- }
- void calculate(num1, num2) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement