|
|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_field_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../app_texts_widget.dart';
|
|
|
|
|
|
|
|
|
|
@ -50,10 +52,12 @@ class AppTextFieldCustom extends StatefulWidget {
|
|
|
|
|
class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: widget.height != 0 ? widget.height + 8 : null,
|
|
|
|
|
height: widget.height != 0 && widget.maxLines == 1 ? widget.height + 8 : null,
|
|
|
|
|
decoration: widget.hasBorder
|
|
|
|
|
? TextFieldsUtils.containerBorderDecoration(
|
|
|
|
|
Color(0Xffffffff),
|
|
|
|
|
@ -72,7 +76,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: widget.dropDownText == null
|
|
|
|
|
? EdgeInsets.symmetric(vertical: 0)
|
|
|
|
|
: EdgeInsets.symmetric(vertical: 8),
|
|
|
|
|
: EdgeInsets.symmetric(vertical: 0), // 8.0
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
@ -82,40 +86,45 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
|
|
|
|
|
widget.dropDownText != null)
|
|
|
|
|
AppText(
|
|
|
|
|
widget.hintText,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.4,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
widget.dropDownText == null
|
|
|
|
|
? TextField(
|
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
|
decoration:
|
|
|
|
|
TextFieldsUtils.textFieldSelectorDecoration(
|
|
|
|
|
widget.hintText, null, true),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.7,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Colors.grey.shade800,
|
|
|
|
|
),
|
|
|
|
|
controller: widget.controller,
|
|
|
|
|
keyboardType: widget.inputType,
|
|
|
|
|
enabled: widget.enabled,
|
|
|
|
|
minLines: widget.minLines,
|
|
|
|
|
maxLines: widget.maxLines,
|
|
|
|
|
inputFormatters: widget.inputFormatters != null
|
|
|
|
|
? widget.inputFormatters
|
|
|
|
|
: [],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
if (widget.onChanged != null) {
|
|
|
|
|
widget.onChanged(value);
|
|
|
|
|
? Container(
|
|
|
|
|
height: widget.height != 0 && widget.maxLines == 1 ? widget.height - 22 : null,
|
|
|
|
|
child: TextField(
|
|
|
|
|
textAlign: projectViewModel.isArabic
|
|
|
|
|
? TextAlign.right
|
|
|
|
|
: TextAlign.left,
|
|
|
|
|
decoration:
|
|
|
|
|
TextFieldsUtils.textFieldSelectorDecoration(
|
|
|
|
|
widget.hintText, null, true),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.7,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
|
),
|
|
|
|
|
controller: widget.controller,
|
|
|
|
|
keyboardType: widget.inputType,
|
|
|
|
|
enabled: widget.enabled,
|
|
|
|
|
minLines: widget.minLines,
|
|
|
|
|
maxLines: widget.maxLines,
|
|
|
|
|
inputFormatters: widget.inputFormatters != null
|
|
|
|
|
? widget.inputFormatters
|
|
|
|
|
: [],
|
|
|
|
|
onChanged: (value) {
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
if (widget.onChanged != null) {
|
|
|
|
|
widget.onChanged(value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
widget.dropDownText,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Colors.grey.shade800,
|
|
|
|
|
color: Color(0xFF575757),
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.7,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|