update 251114
This commit is contained in:
158
lib/pages/login.dart
Normal file
158
lib/pages/login.dart
Normal file
@@ -0,0 +1,158 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:whi_flutter/const.dart';
|
||||
|
||||
class LoginPage extends StatelessWidget {
|
||||
const LoginPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
top:0,
|
||||
left:0,
|
||||
right:0,
|
||||
height: MediaQuery.of(context).size.height * 2 / 3,
|
||||
child: Image.network(
|
||||
imageURL,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
AppBar(
|
||||
backgroundColor: Colors. transparent,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
onPressed: (){},
|
||||
icon: Icon(Icons.arrow_back,color: textColor,),
|
||||
),
|
||||
title: Text(
|
||||
'Login',
|
||||
style: GoogleFonts.inter(
|
||||
color: textColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
actions: [const SizedBox(width: 48)],
|
||||
),
|
||||
Spacer(),
|
||||
Container(
|
||||
padding: const EdgeInsets.fromLTRB(24, 32, 24, 8),
|
||||
decoration: BoxDecoration(color: backgroundColor),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_buildTextField(
|
||||
icon: Icons.person_outlined,
|
||||
hintText: '',
|
||||
isDarkMode: isDarkMode,
|
||||
inputBackgroundColor: inputBackgroundColor,
|
||||
subtleTextColor: subtleTextColor,
|
||||
textColor: textColor,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildTextField(
|
||||
icon: Icons.lock_outline,
|
||||
hintText: '',
|
||||
obscureText: true,
|
||||
isDarkMode: isDarkMode,
|
||||
inputBackgroundColor: inputBackgroundColor,
|
||||
subtleTextColor: subtleTextColor,
|
||||
textColor: textColor,
|
||||
),
|
||||
SizedBox(height: 24),
|
||||
ElevatedButton(
|
||||
onPressed: () {},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: primaryColor,
|
||||
minimumSize: const Size(double.infinity, 60),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
elevation: 0,
|
||||
),
|
||||
child: Text(
|
||||
'Login',
|
||||
style: GoogleFonts.inter(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
'Forgot password?',
|
||||
style: GoogleFonts.inter(
|
||||
color: primaryColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
'Sign UP',
|
||||
style: GoogleFonts.inter(
|
||||
color: primaryColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ignore: non_constant_identifier_names
|
||||
Widget _buildTextField({
|
||||
required IconData icon,
|
||||
required String hintText,
|
||||
bool obscureText = false,
|
||||
required bool isDarkMode,
|
||||
required Color inputBackgroundColor,
|
||||
required Color subtleTextColor,
|
||||
required Color textColor,
|
||||
}) {
|
||||
return TextField(
|
||||
obscureText: obscureText,
|
||||
style: GoogleFonts.inter(color: textColor),
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 20),
|
||||
hintText: hintText,
|
||||
hintStyle: GoogleFonts.inter(color: subtleTextColor),
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.only(left: 20, right: 12),
|
||||
child: Icon(icon, color: subtleTextColor),
|
||||
),
|
||||
filled: true,
|
||||
fillColor: inputBackgroundColor,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(color: Color(0xFF137FEC), width: 2),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
83
lib/pages/signup.dart
Normal file
83
lib/pages/signup.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:whi_flutter/const.dart';
|
||||
|
||||
class SignupPage extends StatefulWidget {
|
||||
const SignupPage({super.key});
|
||||
|
||||
@override
|
||||
State<SignupPage> createState() => _SignupPageState();
|
||||
}
|
||||
|
||||
class _SignupPageState extends State<SignupPage> {
|
||||
final _formKey = GlobalKey();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(),
|
||||
body: SafeArea(
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildTextField({
|
||||
required bool isDarkMode,
|
||||
required TextEditingController controller,
|
||||
required String hintText,
|
||||
bool obscureText = false,
|
||||
TextInputType? keyboardType,
|
||||
required IconData prefixIcon,
|
||||
Widget? suffixIcon,
|
||||
String? Function(String?)? validator,
|
||||
}) {
|
||||
final primaryColor = Color(0xFF137FEC);
|
||||
final textColor = isDarkMode ? Colors.white : Color(0xFF101922);
|
||||
final placeholderColor = isDarkMode ? Colors.white70 : Colors.black54;
|
||||
final inputBackgroundColor = isDarkMode
|
||||
? Color(0xFF1C2A3A)
|
||||
: Color(0xFFF3F6F9);
|
||||
|
||||
return TextFormField(
|
||||
controller: controller,
|
||||
obscureText: obscureText,
|
||||
keyboardType: keyboardType,
|
||||
style: TextStyle(color: textColor, fontFamily: 'Poppins'),
|
||||
validator: validator,
|
||||
decoration: InputDecoration(
|
||||
hintText: hintText,
|
||||
hintStyle: TextStyle(color: placeholderColor, fontFamily: 'Poppins'),
|
||||
filled: true,
|
||||
fillColor: inputBackgroundColor,
|
||||
prefixIcon: Icon(prefixIcon, color: placeholderColor),
|
||||
suffixIcon: suffixIcon,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: primaryColor, width: 2),
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.redAccent, width: 1),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: Colors.redAccent, width: 2),
|
||||
),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 18, horizontal: 16),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user