import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
debugShowCheckedModeBanner: false,
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
void initState() {
SystemChrome.setEnabledSystemUIOverlays([]);
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
width: double.maxFinite,
height: double.maxFinite,
child: Stack(
children: <Widget>[
Image.asset(
"images/cover.png",
width: double.maxFinite,
),
Positioned(
top: 150,
child: Container(
padding: EdgeInsets.symmetric(horizontal: 35),
child: Text('Sign In',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.purple,
),
),
),
),
Positioned(
top: 180,
child: Container(
padding: EdgeInsets.symmetric(vertical: 20, horizontal: 18),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(32),
topRight: Radius.circular(32))),
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 20.0),
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Username',
prefixIcon: const Icon(
Icons.person,
color: Colors.purple,
),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 16),
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Password',
prefixIcon: const Icon(
Icons.lock,
color: Colors.purple,
)),
),
),
Container(
margin: EdgeInsets.only(top: 20),
height: 50,
width: double.maxFinite,
decoration: BoxDecoration(
color: Colors.purple.shade300,
borderRadius: BorderRadius.all(Radius.circular(32))),
child: Center(
child: Text(
'LOGIN',
style: TextStyle(color: Colors.white, fontSize: 20),
),
),
),
Container(
margin: EdgeInsets.only(top: 15),
child: Center(
child: Text(
'Forgot Password',
style: TextStyle(fontSize: 15, color: Colors.grey),
),
),
),
Container(
margin: EdgeInsets.only(top: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: Colors.purple.shade300,
borderRadius:
BorderRadius.all(Radius.circular(50)),
),
child: Center(
child: Icon(Icons.face, color: Colors.white)),
),
Container(
width: 40,
),
Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: Colors.purple.shade300,
borderRadius:
BorderRadius.all(Radius.circular(50)),
),
child: Center(
child: Icon(Icons.fingerprint,
color: Colors.white)),
)
],
),
)
],
),
),
)
],
),
),
);
}
}
name: simple_ui_login
description: A new Flutter project.
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- images/cover.png
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages