Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() => runApp(MyApp());
- class MyApp extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- debugShowCheckedModeBanner: false,
- title: "EMI Calculator",
- theme: ThemeData(
- primarySwatch: Colors.teal,
- ),
- home: Calc(),
- );
- }
- }
- class Calc extends StatefulWidget {
- @override
- CalcState createState() => CalcState();
- }
- class CalcState extends State<Calc> {
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text("My EMI Calculator"),
- elevation: 0.0,
- ),
- body: Center(
- child: Container(
- child: Column(
- children: <Widget>[
- Container(
- padding: EdgeInsets.all(10.0),
- child: TextField(
- keyboardType: TextInputType.number,
- decoration: InputDecoration(
- labelText: "Enter Principal Amount",
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.all(10.0),
- child: TextField(
- keyboardType: TextInputType.number,
- decoration: InputDecoration(
- labelText: "Interest Rate (%)",
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.all(10.0),
- child: Row(
- children: <Widget>[
- Flexible(
- flex: 4,
- fit: FlexFit.tight,
- child: TextField(
- decoration: InputDecoration(labelText: "Duration"),
- ),
- ),
- Flexible(
- flex: 1,
- child: Column(
- children: <Widget>[
- Text("Year(s)"),
- Switch(
- value: false,
- )
- ],
- ),
- )
- ],
- )),
- Flexible(
- child: RaisedButton(
- child: Text("Calculate"),
- textColor: Colors.white,
- color: Colors.teal[700],
- onPressed: () => print("2222.."),
- elevation: 5.0,
- ),
- ),
- Container(
- child: Column(
- children: <Widget>[
- Text("Your monthly EMI is:"),
- Container(
- child: Text("results here..."),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement