Specify keyboard types

This commit is contained in:
Hillel Coren 2021-11-29 14:43:46 +02:00
parent 4ba4d9f69b
commit 4d76ae59ab
13 changed files with 58 additions and 3 deletions

View File

@ -119,7 +119,7 @@ class ClientEditBillingAddressState extends State<ClientEditBillingAddress> {
controller: _address2Controller,
label: localization.address2,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.streetAddress,
keyboardType: TextInputType.text,
),
DecoratedFormField(
autocorrect: false,

View File

@ -118,7 +118,7 @@ class ClientEditShippingAddressState extends State<ClientEditShippingAddress> {
controller: _shippingAddress2Controller,
label: localization.address2,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.streetAddress,
keyboardType: TextInputType.text,
),
DecoratedFormField(
controller: _shippingCityController,

View File

@ -307,6 +307,7 @@ class _ClientPortalState extends State<ClientPortal>
label: localization.subdomain,
autovalidate: _autoValidate,
controller: _subdomainController,
keyboardType: TextInputType.text,
hint: localization.subdomainHelp,
validator: (value) {
if (value.isEmpty) {
@ -445,11 +446,13 @@ class _ClientPortalState extends State<ClientPortal>
controller: _termsController,
label: localization.termsOfService,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
controller: _privacyController,
label: localization.privacyPolicy,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
],
)
@ -582,21 +585,25 @@ class _ClientPortalState extends State<ClientPortal>
controller: _customMessageDashboard,
label: localization.dashboard,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
controller: _customMessageUnpaidInvoice,
label: localization.unpaidInvoice,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
controller: _customMessagePaidInvoice,
label: localization.paidInvoice,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
controller: _customMessageUnapprovedQuote,
label: localization.unapprovedQuote,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
],
),
@ -611,22 +618,26 @@ class _ClientPortalState extends State<ClientPortal>
label: localization.header,
controller: _customHeaderController,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
label: localization.footer,
controller: _customFooterController,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
label: localization.customCss,
controller: _customCssController,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
if (isSelfHosted(context))
DecoratedFormField(
label: localization.customJavascript,
controller: _customJavaScriptController,
maxLines: 6,
keyboardType: TextInputType.multiline,
),
],
)

View File

@ -256,21 +256,25 @@ class _CompanyDetailsState extends State<CompanyDetails>
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DecoratedFormField(
label: localization.idNumber,
controller: _idNumberController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
label: localization.vatNumber,
controller: _vatNumberController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
label: localization.website,
controller: _websiteController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.url,
),
DecoratedFormField(
label: localization.email,
@ -356,30 +360,35 @@ class _CompanyDetailsState extends State<CompanyDetails>
controller: _address1Controller,
autofillHints: [AutofillHints.streetAddressLine1],
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.streetAddress,
),
DecoratedFormField(
label: localization.address2,
controller: _address2Controller,
autofillHints: [AutofillHints.streetAddressLine2],
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.text,
),
DecoratedFormField(
label: localization.city,
controller: _cityController,
onSavePressed: viewModel.onSavePressed,
autofillHints: [AutofillHints.addressCity],
keyboardType: TextInputType.text,
),
DecoratedFormField(
label: localization.state,
controller: _stateController,
onSavePressed: viewModel.onSavePressed,
autofillHints: [AutofillHints.addressState],
keyboardType: TextInputType.text,
),
DecoratedFormField(
label: localization.postalCode,
controller: _postalCodeController,
onSavePressed: viewModel.onSavePressed,
autofillHints: [AutofillHints.postalCode],
keyboardType: TextInputType.text,
),
EntityDropdown(
entityType: EntityType.country,
@ -597,11 +606,13 @@ class _CompanyDetailsState extends State<CompanyDetails>
label: localization.invoiceTerms,
controller: _invoiceTermsController,
maxLines: 4,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
label: localization.invoiceFooter,
controller: _invoiceFooterController,
maxLines: 4,
keyboardType: TextInputType.multiline,
),
],
if (company.isModuleEnabled(EntityType.quote)) ...[
@ -609,11 +620,13 @@ class _CompanyDetailsState extends State<CompanyDetails>
label: localization.quoteTerms,
controller: _quoteTermsController,
maxLines: 4,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
label: localization.quoteFooter,
controller: _quoteFooterController,
maxLines: 4,
keyboardType: TextInputType.multiline,
),
],
if (company.isModuleEnabled(EntityType.credit)) ...[
@ -621,11 +634,13 @@ class _CompanyDetailsState extends State<CompanyDetails>
label: localization.creditTerms,
controller: _creditTermsController,
maxLines: 4,
keyboardType: TextInputType.multiline,
),
DecoratedFormField(
label: localization.creditFooter,
controller: _creditFooterController,
maxLines: 4,
keyboardType: TextInputType.multiline,
),
],
],

View File

@ -405,6 +405,7 @@ class _CustomFormFieldState extends State<CustomFormField> {
child: DecoratedFormField(
label: widget.label,
controller: _customFieldController,
keyboardType: TextInputType.name,
),
),
if (widget.showTaxes) ...[
@ -473,6 +474,7 @@ class _CustomFormFieldState extends State<CustomFormField> {
label: localization.options,
controller: _optionsController,
hint: localization.commaSeparatedList,
keyboardType: TextInputType.text,
),
),
SizedBox(height: 16),

View File

@ -214,11 +214,13 @@ class _EmailSettingsState extends State<EmailSettings> {
label: localization.fromName,
controller: _fromNameController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DecoratedFormField(
label: localization.replyToName,
controller: _replyToNameController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DecoratedFormField(
label: localization.replyToEmail,

View File

@ -284,6 +284,7 @@ class _GeneratedNumbersState extends State<GeneratedNumbers>
DecoratedFormField(
label: localization.recurringPrefix,
controller: _recurringPrefixController,
keyboardType: TextInputType.text,
),
if (company.isModuleEnabled(EntityType.quote))
BoolDropdownButton(
@ -527,10 +528,12 @@ class _EntityNumberSettingsState extends State<EntityNumberSettings> {
DecoratedFormField(
label: localization.numberPattern,
controller: _patternController,
keyboardType: TextInputType.text,
),
DecoratedFormField(
label: localization.numberCounter,
controller: _counterController,
keyboardType: TextInputType.number,
),
],
),

View File

@ -295,6 +295,7 @@ class _FileImportState extends State<_FileImport> {
final field = DecoratedFormField(
enabled: false,
keyboardType: TextInputType.text,
key: ValueKey(uploadPart.key +
(multipartFile != null ? multipartFile.filename : '')),
label: localization.lookup(uploadPart.value),

View File

@ -149,6 +149,8 @@ class _OnlinePaymentsState extends State<OnlinePayments> {
label: localization.minimumUnderPaymentAmount,
controller: _minimumAmountController,
isMoney: true,
keyboardType: TextInputType.numberWithOptions(
decimal: true, signed: true),
),
),
]),

View File

@ -3,6 +3,7 @@ import 'dart:async';
import 'dart:convert';
// Flutter imports:
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -229,12 +230,15 @@ class _SettingsWizardState extends State<SettingsWizard> {
controller: _nameController,
validator: (value) =>
value.isEmpty ? localization.pleaseEnterAValue : null,
keyboardType: TextInputType.name,
);
final firstName = DecoratedFormField(
label: localization.firstName,
autovalidate: _autoValidate,
controller: _firstNameController,
keyboardType: TextInputType.text,
autofillHints: [AutofillHints.givenName],
validator: (value) =>
value.isEmpty ? localization.pleaseEnterAValue : null,
);
@ -243,6 +247,8 @@ class _SettingsWizardState extends State<SettingsWizard> {
label: localization.lastName,
autovalidate: _autoValidate,
controller: _lastNameController,
keyboardType: TextInputType.text,
autofillHints: [AutofillHints.familyName],
validator: (value) =>
value.isEmpty ? localization.pleaseEnterAValue : null,
);
@ -304,6 +310,7 @@ class _SettingsWizardState extends State<SettingsWizard> {
label: localization.subdomain,
autovalidate: _autoValidate,
controller: _subdomainController,
keyboardType: TextInputType.text,
validator: (value) {
if (value.isEmpty) {
return localization.pleaseEnterAValue;

View File

@ -100,6 +100,8 @@ class _TaskSettingsState extends State<TaskSettings> {
label: localization.defaultTaskRate,
onSavePressed: viewModel.onSavePressed,
isMoney: true,
keyboardType:
TextInputType.numberWithOptions(decimal: true, signed: true),
),
if (!viewModel.state.settingsUIState.isFiltered) ...[
SizedBox(height: 32),

View File

@ -309,12 +309,13 @@ class _TemplatesAndRemindersState extends State<TemplatesAndReminders>
label: localization.subject,
controller: _subjectController,
hint: _defaultSubject,
keyboardType: TextInputType.text,
),
DecoratedFormField(
keyboardType: TextInputType.multiline,
label: localization.body,
controller: _bodyController,
maxLines: 8,
keyboardType: TextInputType.multiline,
hint: _defaultBody,
),
]),
@ -554,11 +555,15 @@ class _ReminderSettingsState extends State<ReminderSettings> {
label: localization.lateFeeAmount,
controller: _feeAmountController,
isMoney: true,
keyboardType:
TextInputType.numberWithOptions(decimal: true, signed: true),
),
DecoratedFormField(
label: localization.lateFeePercent,
controller: _feePercentController,
isPercent: true,
keyboardType:
TextInputType.numberWithOptions(decimal: true, signed: true),
),
],
),

View File

@ -183,6 +183,7 @@ class _UserDetailsState extends State<UserDetails>
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DecoratedFormField(
label: localization.lastName,
@ -192,6 +193,7 @@ class _UserDetailsState extends State<UserDetails>
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.name,
),
DecoratedFormField(
label: localization.email,
@ -201,11 +203,13 @@ class _UserDetailsState extends State<UserDetails>
: null,
autovalidate: autoValidate,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.emailAddress,
),
DecoratedFormField(
label: localization.phone,
controller: _phoneController,
onSavePressed: viewModel.onSavePressed,
keyboardType: TextInputType.phone,
),
PasswordFormField(
controller: _passwordController,
@ -500,6 +504,7 @@ class _EnableTwoFactorState extends State<_EnableTwoFactor> {
validator: (value) => value.isEmpty
? AppLocalization.of(context).pleaseEnterAValue
: null,
keyboardType: TextInputType.number,
onSavePressed: (context) => _onSavePressed(),
),
),