import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown
]);
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: MainPage(),
);
}
}
class MainPage extends StatelessWidget {
const MainPage({Key? key}) : super(key: key);
double getSmallDiameter(BuildContext context) =>
MediaQuery.of(context).size.width * 2 / 3;
double getBiglDiameter(BuildContext context) =>
MediaQuery.of(context).size.width * 7 / 8;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFEEEEEE),
body: Stack(
children: [
Positioned(
right: -getSmallDiameter(context) / 3,
top: -getSmallDiameter(context) / 3,
child: Container(
width: getSmallDiameter(context),
height: getSmallDiameter(context),
decoration: const BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
colors: [Color(0xFFB226B2), Color(0xFFFF6DA7)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter)),
),
),
Positioned(
left: -getBiglDiameter(context) / 4,
top: -getBiglDiameter(context) / 4,
child: Container(
child: const Center(
child: Text(
"FlutterMafia",
style: TextStyle(
fontFamily: "Pacifico",
fontSize: 30,
color: Colors.white),
),
),
width: getBiglDiameter(context),
height: getBiglDiameter(context),
decoration: const BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
colors: [Color(0xFFB226B2), Color(0xFFFF4891)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter)),
),
),
Positioned(
right: -getBiglDiameter(context) / 2,
bottom: -getBiglDiameter(context) / 2,
child: Container(
width: getBiglDiameter(context),
height: getBiglDiameter(context),
decoration: const BoxDecoration(
shape: BoxShape.circle, color: Color(0xFFF3E9EE)),
),
),
Align(
alignment: Alignment.bottomCenter,
child: ListView(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
//border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(10)),
margin: const EdgeInsets.fromLTRB(20, 300, 20, 10),
padding: const EdgeInsets.fromLTRB(10, 0, 10, 25),
child: Column(
children: [
TextField(
decoration: InputDecoration(
icon: const Icon(
Icons.email,
color: Color(0xFFFF4891),
),
focusedBorder: UnderlineInputBorder(
borderSide:
BorderSide(color: Colors.grey.shade100 )),
labelText: "Email",
enabledBorder: InputBorder.none,
labelStyle: const TextStyle(color: Colors.grey)),
),
TextField(
obscureText: true,
decoration: InputDecoration(
icon: const Icon(
Icons.vpn_key,
color: Color(0xFFFF4891),
),
focusedBorder: UnderlineInputBorder(
borderSide:
BorderSide(color: Colors.grey.shade100)),
labelText: "Password",
enabledBorder: InputBorder.none,
labelStyle: const TextStyle(color: Colors.grey)),
)
],
),
),
Align(
alignment: Alignment.centerRight,
child: Container(
margin: const EdgeInsets.fromLTRB(0, 0, 20, 10),
child: const Text(
"FORGOT PASSWORD?",
style:
TextStyle(color: Color(0xFFFF4891), fontSize: 11),
))),
Container(
margin: const EdgeInsets.fromLTRB(20, 0, 20, 30),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: MediaQuery.of(context).size.width * 0.5,
height: 40,
child: Container(
child: Material(
borderRadius: BorderRadius.circular(20),
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(20),
splashColor: Colors.amber,
onTap: () {},
child: const Center(
child: Text(
"SIGN IN",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700),
),
),
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
gradient: const LinearGradient(
colors: [
Color(0xFFB226B2),
Color(0xFFFF4891)
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter)),
),
),
FloatingActionButton(
onPressed: () {},
mini: true,
elevation: 0,
child: const Image(
image: NetworkImage('https://images.firstpost.com/wp-content/uploads/2017/11/twitter-reuters-380p.jpg'),
),
),
FloatingActionButton(
onPressed: () {},
mini: true,
elevation: 0,
child: const Image(
image: NetworkImage('https://images.firstpost.com/wp-content/uploads/2017/11/twitter-reuters-380p.jpg'),
),
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text(
"DON'T HAVE AN ACCOUNT ? ",
style: TextStyle(
fontSize: 11,
color: Colors.grey,
fontWeight: FontWeight.w500),
),
Text(
" SIGN UP",
style: TextStyle(
fontSize: 11,
color: Color(0xFFFF4891),
fontWeight: FontWeight.w700),
)
],
)
],
),
)
],
),
);
}
}
For Queries And Assistance
Some Topic Worked On fluttermafia