Log In Sign Up Screen Simple UI
import "package:flutter/material.dart";
import "package:praxware_tasks/Custom_Widget/CustomWidget.dart";
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "UI one",
debugShowCheckedModeBanner: false,
theme: ThemeData(
appBarTheme: const AppBarTheme(
backgroundColor: Colors.grey,
centerTitle: true,
),
),
home: const FirstLoginRegistrationPageUi(),
);
}
}
class FirstLoginRegistrationPageUi extends StatelessWidget {
const FirstLoginRegistrationPageUi({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SizedBox(
width: 350.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset("assets/images/mobile-phone-icon.jpg"),
const SizedBox(height: 20.0),
const Text(
"Say Hello To Your New App!",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 25.0,
color: Colors.red),
),
const SizedBox(height: 20.0),
const Text(
"You've just saved a week of development and headaches.",
textAlign: TextAlign.center),
const SizedBox(height: 30.0),
UiHelper.customElevatedButton(
"Log In",
() {},
Colors.red,
300.0,
50.0,
context,
Colors.white,
20.0,
),
const SizedBox(height: 20.0),
TextButton(
onPressed: () {},
style: TextButton.styleFrom(
fixedSize: const Size(300.0, 50.0),
side: const BorderSide(color: Colors.grey),
),
child: const Text(
"Sign Up",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.blueGrey,
fontSize: 20.0),
),
),
],
),
),
),
);
}
}
import "package:flutter/material.dart";
class UiHelper {
static customAppBar(String text) {
return AppBar(
title: Text(
text,
style: const TextStyle(fontWeight: FontWeight.bold),
),
centerTitle: true,
);
}
static customElevatedButton(
String text,
VoidCallback callback,
Color color,
double width,
double height,
BuildContext context,
Color color2,
double size) {
return ElevatedButton(
onPressed: callback,
style: ElevatedButton.styleFrom(
backgroundColor: color,
fixedSize: Size(width, height),
),
child: Text(
text,
style: TextStyle(
fontWeight: FontWeight.bold, color: color2, fontSize: size),
),
);
}
static customTextFormField(TextEditingController controller, double radius,
String text, TextInputType type) {
return TextFormField(
controller: controller,
keyboardType: type,
decoration: InputDecoration(
hintText: text,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(radius),
),
),
);
}
}
Comments
Post a Comment