Created
August 18, 2021 10:13
-
-
Save mhmadip/7779470cfcb40a4338784feecba2ea1f to your computer and use it in GitHub Desktop.
Homework 1: Build your business app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'My Company App', | |
home: MyHomeScreen(), | |
)); | |
} | |
class MyHomeScreen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Colors.greenAccent, | |
appBar: AppBar( | |
backgroundColor: Colors.deepOrange, | |
title: Text( | |
"My Business App", | |
), | |
), | |
body: Container( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: [ | |
Center( | |
child: Image.asset( | |
"images/logo.jpeg", | |
width: 100, | |
height: 100, | |
), | |
), | |
Padding( | |
padding: const EdgeInsets.only(bottom: 100.0), | |
child: Text( | |
"Your Business Name:", | |
style: TextStyle(fontSize: 16, color: Colors.black), | |
), | |
), | |
Expanded( | |
flex: 1, | |
child: TextFormField( | |
decoration: InputDecoration( | |
border: UnderlineInputBorder(), | |
labelText: 'Enter your username', | |
icon: Icon(Icons.person), | |
), | |
), | |
), | |
Expanded( | |
flex: 1, | |
child: TextFormField( | |
decoration: InputDecoration( | |
border: UnderlineInputBorder(), | |
labelText: 'Enter your password', | |
icon: Icon(Icons.password), | |
), | |
), | |
), | |
TextButton( | |
style: ButtonStyle( | |
backgroundColor: MaterialStateColor.resolveWith( | |
(states) => Colors.white)), | |
onPressed: () => print("Hello"), | |
child: Text("Login!")), | |
Expanded( | |
flex: 1, | |
child: Text( | |
"If you're not registered yet, then click Sign Up", | |
style: TextStyle(color: Colors.purple), | |
)) | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment