|
|
|
|
@ -72,81 +72,82 @@ class _ApplicationDemoRequestFormScreenState extends State<ApplicationDemoReques
|
|
|
|
|
autovalidateMode: AutovalidateMode.disabled,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _fullNameController,
|
|
|
|
|
labelText: 'Full Name *',
|
|
|
|
|
textInputType: TextInputType.name,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _fullNameController.text.isEmpty) return null;
|
|
|
|
|
if (_fullNameController.text.isEmpty) return 'Full Name is required';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
16.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _emailController,
|
|
|
|
|
labelText: 'Email Address *',
|
|
|
|
|
textInputType: TextInputType.emailAddress,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _emailController.text.isEmpty) return null;
|
|
|
|
|
if (_emailController.text.isEmpty) return 'Email is required';
|
|
|
|
|
if (!Validator.isEmail(_emailController.text)) return 'Invalid email format';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
16.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _mobileController,
|
|
|
|
|
labelText: 'Mobile Number *',
|
|
|
|
|
textInputType: TextInputType.phone,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _mobileController.text.isEmpty) return null;
|
|
|
|
|
if (_mobileController.text.isEmpty) return 'Mobile Number is required';
|
|
|
|
|
if (!Validator.isPhoneNumber(_mobileController.text)) return 'Invalid mobile number';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
16.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _companyNameController,
|
|
|
|
|
labelText: 'Company Name *',
|
|
|
|
|
textInputType: TextInputType.text,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _companyNameController.text.isEmpty) return null;
|
|
|
|
|
if (_companyNameController.text.isEmpty) return 'Company Name is required';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
16.height,
|
|
|
|
|
MultipleItemDropDownMenu<ApplicationDemoRoleModel, NullableLoadingProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
title: 'Select Roles *',
|
|
|
|
|
initialValue: _selectedRoles,
|
|
|
|
|
staticData: provider.roles,
|
|
|
|
|
loading: provider.roleLoading,
|
|
|
|
|
showAsFullScreenDialog: true,
|
|
|
|
|
onSelect: (selectedRoles) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedRoles = selectedRoles ?? [];
|
|
|
|
|
_rolesValidationError = null; // Clear error when roles are selected
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
if (_rolesValidationError != null)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 8, left: 16),
|
|
|
|
|
child: Text(
|
|
|
|
|
_rolesValidationError!,
|
|
|
|
|
style: AppTextStyles.tinyFont.copyWith(
|
|
|
|
|
color: AppColor.red30,
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
spacing: 12,
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _fullNameController,
|
|
|
|
|
labelText: 'Full Name *',
|
|
|
|
|
textInputType: TextInputType.name,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _fullNameController.text.isEmpty) return null;
|
|
|
|
|
if (_fullNameController.text.isEmpty) return 'Full Name is required';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _emailController,
|
|
|
|
|
labelText: 'Email Address *',
|
|
|
|
|
textInputType: TextInputType.emailAddress,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _emailController.text.isEmpty) return null;
|
|
|
|
|
if (_emailController.text.isEmpty) return 'Email is required';
|
|
|
|
|
if (!Validator.isEmail(_emailController.text)) return 'Invalid email format';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _mobileController,
|
|
|
|
|
labelText: 'Mobile Number *',
|
|
|
|
|
textInputType: TextInputType.phone,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _mobileController.text.isEmpty) return null;
|
|
|
|
|
if (_mobileController.text.isEmpty) return 'Mobile Number is required';
|
|
|
|
|
if (!Validator.isPhoneNumber(_mobileController.text)) return 'Invalid mobile number';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
controller: _companyNameController,
|
|
|
|
|
labelText: 'Company Name *',
|
|
|
|
|
textInputType: TextInputType.text,
|
|
|
|
|
validator: (value) {
|
|
|
|
|
if (!_formSubmitted && _companyNameController.text.isEmpty) return null;
|
|
|
|
|
if (_companyNameController.text.isEmpty) return 'Company Name is required';
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
MultipleItemDropDownMenu<ApplicationDemoRoleModel, NullableLoadingProvider>(
|
|
|
|
|
context: context,
|
|
|
|
|
title: 'Select Roles *',
|
|
|
|
|
initialValue: _selectedRoles,
|
|
|
|
|
staticData: provider.roles,
|
|
|
|
|
loading: provider.roleLoading,
|
|
|
|
|
showAsFullScreenDialog: true,
|
|
|
|
|
onSelect: (selectedRoles) {
|
|
|
|
|
setState(() {
|
|
|
|
|
_selectedRoles = selectedRoles ?? [];
|
|
|
|
|
_rolesValidationError = null; // Clear error when roles are selected
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
if (_rolesValidationError != null)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 8, left: 16),
|
|
|
|
|
child: Text(
|
|
|
|
|
_rolesValidationError!,
|
|
|
|
|
style: AppTextStyles.tinyFont.copyWith(
|
|
|
|
|
color: AppColor.red30,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(16).expanded,
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context, borderRadius: 20),
|
|
|
|
|
).expanded,
|
|
|
|
|
FooterActionButton.footerContainer(
|
|
|
|
|
context: context,
|
|
|
|
|
child: AppFilledButton(
|
|
|
|
|
|