69 lines
2.0 KiB
Dart
69 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import 'package:lhj_flutter/const.dart';
|
|
|
|
class LoginPage extends StatelessWidget {
|
|
const LoginPage({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: backgroundColor,
|
|
body: Stack(
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.fromLTRB(24, 32, 24, 8),
|
|
decoration: BoxDecoration(color: backgroundColor),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
_buildTextField(
|
|
icon: Icons.person_outline,
|
|
hintText: 'Username',
|
|
isDarkMode: isDarkMode,
|
|
inputBackgroundColor: inputBackgroundColor,
|
|
subtleTextColor: subtleTextColor,
|
|
textColor: textColor,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
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,
|
|
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),
|
|
)
|
|
),
|
|
);
|
|
}
|