feat: login page
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
|
||||
part 'text_form_field.dart';
|
||||
@@ -0,0 +1,59 @@
|
||||
part of 'field.dart';
|
||||
|
||||
class AppTextFormField extends StatelessWidget {
|
||||
const AppTextFormField({
|
||||
super.key,
|
||||
this.hintText,
|
||||
required this.title,
|
||||
this.controller,
|
||||
this.focusNode,
|
||||
this.prefixIcon,
|
||||
this.suffixIcon,
|
||||
this.keyboardType,
|
||||
this.onChanged,
|
||||
});
|
||||
|
||||
final String? hintText;
|
||||
final String title;
|
||||
final TextEditingController? controller;
|
||||
final FocusNode? focusNode;
|
||||
final Widget? prefixIcon;
|
||||
final Widget? suffixIcon;
|
||||
final TextInputType? keyboardType;
|
||||
final ValueChanged<String>? onChanged;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(title, style: AppStyle.lg.copyWith(fontWeight: FontWeight.w600)),
|
||||
const SizedBox(height: 8),
|
||||
TextFormField(
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
keyboardType: keyboardType,
|
||||
onChanged: onChanged,
|
||||
cursorColor: AppColor.primary,
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.textPrimary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: hintText,
|
||||
prefixIcon: prefixIcon,
|
||||
suffixIcon: suffixIcon,
|
||||
prefixIconConstraints: const BoxConstraints(
|
||||
minWidth: 0,
|
||||
minHeight: 0,
|
||||
),
|
||||
suffixIconConstraints: const BoxConstraints(
|
||||
minWidth: 0,
|
||||
minHeight: 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user