Specify keyboard types

This commit is contained in:
Hillel Coren 2021-11-29 16:18:53 +02:00
parent 4d76ae59ab
commit 6dc62a676e
17 changed files with 38 additions and 1 deletions

View File

@ -242,6 +242,7 @@ class ItemEditDetailsState extends State<ItemEditDetails> {
label: localization.product,
controller: _productKeyController,
onSavePressed: widget.entityViewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
keyboardType: TextInputType.multiline,

View File

@ -241,6 +241,7 @@ class _PaymentEditState extends State<PaymentEdit> {
onSavePressed: viewModel.onSavePressed,
validator: (value) =>
value.isEmpty ? localization.pleaseEnterAValue : null,
keyboardType: TextInputType.text,
),
if (payment.isNew || payment.isApplying == true)
for (var index = 0; index < invoicePaymentables.length; index++)
@ -297,6 +298,7 @@ class _PaymentEditState extends State<PaymentEdit> {
controller: _transactionReferenceController,
label: localization.transactionReference,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
CustomField(
controller: _custom1Controller,
@ -382,6 +384,7 @@ class _PaymentEditState extends State<PaymentEdit> {
controller: _exchangeRateController,
label: localization.exchangeRate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.numberWithOptions(decimal: true),
),
Focus(
onFocusChange: (hasFocus) {
@ -421,6 +424,8 @@ class _PaymentEditState extends State<PaymentEdit> {
_convertedAmount = parseDouble(value);
},
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.numberWithOptions(
decimal: true, signed: false),
),
),
],

View File

@ -158,6 +158,7 @@ class _ProductEditState extends State<ProductEdit> {
: null,
autovalidate: _autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
keyboardType: TextInputType.multiline,

View File

@ -233,6 +233,7 @@ class _SubscriptionEditState extends State<SubscriptionEdit>
controller: _nameController,
label: localization.name,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DynamicSelector(
entityType: EntityType.group,
@ -372,6 +373,7 @@ class _SubscriptionEditState extends State<SubscriptionEdit>
label: localization.promoCode,
controller: _promoCodeController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DiscountField(
label: localization.promoDiscount,
@ -488,6 +490,7 @@ class _SubscriptionEditState extends State<SubscriptionEdit>
controller: _postPurchaseHeaderKeyController,
onSavePressed: viewModel.onSavePressed,
onChanged: (value) => setState(() {}),
keyboardType: TextInputType.text,
),
),
SizedBox(
@ -499,6 +502,7 @@ class _SubscriptionEditState extends State<SubscriptionEdit>
controller: _postPurchaseHeaderValueController,
onSavePressed: viewModel.onSavePressed,
onChanged: (value) => setState(() {}),
keyboardType: TextInputType.text,
),
),
SizedBox(

View File

@ -229,7 +229,7 @@ class _TaskEditDesktopState extends State<TaskEditDesktop> {
DecoratedFormField(
controller: _numberController,
label: localization.taskNumber,
isMoney: false,
keyboardType: TextInputType.text,
),
DecoratedFormField(
key: ValueKey('__rate__'),

View File

@ -173,6 +173,7 @@ class _TaskEditDetailsState extends State<TaskEditDetails> {
controller: _numberController,
label: localization.taskNumber,
autocorrect: false,
keyboardType: TextInputType.text,
),
DecoratedFormField(
key: ValueKey('__rate__'),

View File

@ -90,6 +90,7 @@ class _KanbanTaskCardState extends State<KanbanTaskCard> {
minLines: 2,
maxLines: 10,
onChanged: (value) => _description = value,
keyboardType: TextInputType.multiline,
),
SizedBox(height: 12),
Row(

View File

@ -70,6 +70,7 @@ class _KanbanStatusCardState extends State<KanbanStatusCard> {
maxLines: 1,
onChanged: (value) => _name = value,
onSavePressed: (context) => _onSavePressed(),
keyboardType: TextInputType.text,
),
SizedBox(height: 8),
Row(

View File

@ -107,6 +107,7 @@ class _TaskStatusEditState extends State<TaskStatusEdit> {
controller: _nameController,
autovalidate: _autoValidate,
label: localization.name,
keyboardType: TextInputType.name,
validator: (val) => val.isEmpty || val.trim().isEmpty
? localization.pleaseEnterAName
: null,

View File

@ -104,12 +104,14 @@ class _TaxRateEditState extends State<TaxRateEdit> {
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
label: localization.rate,
controller: _rateController,
isPercent: true,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.numberWithOptions(decimal: true),
),
],
)

View File

@ -109,6 +109,7 @@ class _TokenEditState extends State<TokenEdit> {
? localization.pleaseEnterAName
: null,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
],
),

View File

@ -199,6 +199,7 @@ class _UserEditState extends State<UserEdit>
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DecoratedFormField(
label: localization.lastName,
@ -208,6 +209,7 @@ class _UserEditState extends State<UserEdit>
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DecoratedFormField(
label: localization.email,
@ -217,11 +219,13 @@ class _UserEditState extends State<UserEdit>
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.emailAddress,
),
DecoratedFormField(
label: localization.phone,
controller: _phoneController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.phone,
),
/*
PasswordFormField(

View File

@ -106,26 +106,31 @@ class VendorEditAddressState extends State<VendorEditAddress> {
controller: _address1Controller,
label: localization.address1,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.streetAddress,
),
DecoratedFormField(
controller: _address2Controller,
label: localization.address2,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
controller: _cityController,
label: localization.city,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
controller: _stateController,
label: localization.state,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
controller: _postalCodeController,
label: localization.postalCode,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
EntityDropdown(
entityType: EntityType.country,

View File

@ -264,11 +264,13 @@ class VendorContactEditDetailsState extends State<VendorContactEditDetails> {
controller: _firstNameController,
onSavePressed: (_) => _onDoneContactPressed(),
label: localization.firstName,
keyboardType: TextInputType.name,
),
DecoratedFormField(
controller: _lastNameController,
onSavePressed: (_) => _onDoneContactPressed(),
label: localization.lastName,
keyboardType: TextInputType.name,
),
DecoratedFormField(
controller: _emailController,

View File

@ -177,6 +177,7 @@ class VendorEditDetailsState extends State<VendorEditDetails> {
: null,
onSavePressed: viewModel.onSavePressed,
label: localization.name,
keyboardType: TextInputType.name,
decoration: !kIsWeb && (Platform.isIOS || Platform.isAndroid)
? InputDecoration(
labelText: localization.name,
@ -203,6 +204,7 @@ class VendorEditDetailsState extends State<VendorEditDetails> {
label: localization.number,
controller: _numberController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
UserPicker(
userId: vendor.assignedUserId,
@ -213,11 +215,13 @@ class VendorEditDetailsState extends State<VendorEditDetails> {
controller: _idNumberController,
label: localization.idNumber,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
controller: _vatNumberController,
label: localization.vatNumber,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
controller: _websiteController,

View File

@ -159,6 +159,7 @@ class _WebhookEditState extends State<WebhookEdit> {
controller: _headerKeyController,
onSavePressed: viewModel.onSavePressed,
onChanged: (value) => setState(() {}),
keyboardType: TextInputType.text,
),
),
SizedBox(
@ -170,6 +171,7 @@ class _WebhookEditState extends State<WebhookEdit> {
controller: _headerValueController,
onSavePressed: viewModel.onSavePressed,
onChanged: (value) => setState(() {}),
keyboardType: TextInputType.text,
),
),
SizedBox(

View File

@ -130,6 +130,7 @@ void confirmCallback({
onChanged: (value) => _typed = value,
hint: typeToConfirm,
onSavePressed: (context) => _onPressed(),
keyboardType: TextInputType.text,
),
if (askForReason) ...[
SizedBox(height: 30),
@ -138,6 +139,7 @@ void confirmCallback({
onChanged: (value) => _reason = value,
minLines: 4,
maxLines: 4,
keyboardType: TextInputType.multiline,
),
],
SizedBox(height: 30),