mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
68 lines
1.9 KiB
Dart
68 lines
1.9 KiB
Dart
|
||
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,
|
||
});
|
||
|
||
final bool isRequired;
|
||
final String textFieldName;
|
||
final String? description;
|
||
final TextEditingController? controller;
|
||
|
||
|
||
@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),
|
||
],
|
||
),
|
||
Text(
|
||
description??'', // ' The password will be sent to the visitor’s email address.',
|
||
style: Theme.of(context)
|
||
.textTheme
|
||
.bodySmall!
|
||
.copyWith(
|
||
fontSize: 9,
|
||
fontWeight: FontWeight.w400,
|
||
color: ColorsManager.textGray),
|
||
),
|
||
],
|
||
),
|
||
const SizedBox(height: 7,),
|
||
Container(
|
||
decoration: containerDecoration,
|
||
child: TextFormField(
|
||
controller: controller,
|
||
style: const TextStyle(color: Colors.black),
|
||
decoration: textBoxDecoration()!
|
||
.copyWith(hintText: 'Please enter'),
|
||
),
|
||
),
|
||
],
|
||
);
|
||
}
|
||
}
|