Last active
August 2, 2023 03:45
-
-
Save mazharulbelal/379249586b7314a9f359eeb9ed005f48 to your computer and use it in GitHub Desktop.
create account flutter page
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'; | |
import 'package:flutter_screenutil/flutter_screenutil.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
//void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
//Set the fit size (Find your UI design, look at the dimensions of the device screen and fill it in,unit in dp) | |
return ScreenUtilInit( | |
designSize: const Size(369, 799), | |
minTextAdapt: true, | |
splitScreenMode: true, | |
builder: (context, child) { | |
return MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: HomePage(), | |
); | |
}, | |
); | |
} | |
} | |
class HomePage extends StatelessWidget { | |
final createAccountBgColor = Color.fromRGBO(54, 124, 254, 1); | |
final darkTextColor = Color(0xff1F1A3D); | |
final lightTextColor = Color(0xff999999); | |
final bgColor = Color.fromRGBO(215, 229, 255, 1); | |
Widget getTextField({required String placeHolder}) { | |
return TextField( | |
decoration: InputDecoration( | |
border: OutlineInputBorder( | |
borderRadius: BorderRadius.circular(22.r), | |
borderSide: BorderSide(color: Colors.transparent, width: 0), | |
), | |
enabledBorder: OutlineInputBorder( | |
borderRadius: BorderRadius.circular(22.r), | |
borderSide: BorderSide(color: Colors.transparent, width: 0), | |
), | |
filled: true, | |
fillColor: Colors.white, | |
hintText: placeHolder), | |
); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: bgColor, | |
body: SafeArea( | |
child: Padding( | |
padding: EdgeInsets.symmetric(horizontal: 24.w), | |
child: Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
SizedBox( | |
height: 80.h, | |
), | |
Text( | |
"Create Account", | |
style: TextStyle(fontSize: 45, color: Colors.black), | |
), | |
SizedBox( | |
height: 50.h, | |
), | |
getTextField(placeHolder: "Name"), | |
SizedBox( | |
height: 20.h, | |
), | |
getTextField(placeHolder: "Your Email"), | |
SizedBox( | |
height: 20.h, | |
), | |
getTextField(placeHolder: "Password"), | |
SizedBox( | |
height: 20.h, | |
), | |
Row( | |
children: [ | |
Text( | |
"Sign Up", | |
style: TextStyle( | |
fontSize: 25, | |
color: Colors.black, | |
fontWeight: FontWeight.w700), | |
), | |
Spacer(), | |
MaterialButton( | |
onPressed: () {}, | |
color: Colors.blue, | |
textColor: Colors.white, | |
child: Icon( | |
Icons.arrow_forward, | |
size: 24.r, | |
), | |
padding: EdgeInsets.all(16), | |
shape: CircleBorder(), | |
) | |
], | |
), | |
SizedBox( | |
height: 20.h, | |
), | |
Row( | |
children: [ | |
Text(""), | |
Spacer(), | |
Text( | |
"Sign Up", | |
style: TextStyle( | |
fontSize: 20, | |
color: Colors.black, | |
fontWeight: FontWeight.w500), | |
), | |
], | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment