Files
syncrow-web/lib/pages/common/custom_web_textfield.dart
2024-08-20 09:10:59 +03:00

83 lines
2.4 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:syncrow_web/utils/color_manager.dart';
import 'package:syncrow_web/utils/style.dart';
class CustomWebTextField extends StatelessWidget {
const CustomWebTextField({
super.key,
required this.isRequired,
required this.textFieldName,
required this.controller,
this.description,
this.validator,
});
final bool isRequired;
final String textFieldName;
final String? description;
final TextEditingController? controller;
final String? Function(String?)? validator;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if(isRequired)
Row(
children: [
Text('* ',
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(color: Colors.red),
),
Text(textFieldName),
],
),
const SizedBox(width: 10,),
Text(
description??'', // ' The password will be sent to the visitors email address.',
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(
fontSize: 9,
fontWeight: FontWeight.w400,
color: ColorsManager.textGray),
),
],
),
const SizedBox(height: 7,),
Container(
decoration: containerDecoration.copyWith(
color: const Color(0xFFF5F6F7),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.3),
spreadRadius:2,
blurRadius: 3,
offset: Offset(1, 1), // changes position of shadow
),
]
),
child: Container(
child: TextFormField(
validator: validator,
controller: controller,
style: const TextStyle(color: Colors.black),
decoration: textBoxDecoration()!
.copyWith(hintText: 'Please enter'),
),
),
),
],
);
}
}