feat: Replaced old label form fields with full page search, removed badge from edit button in document details

This commit is contained in:
Anton Stubenbord
2023-04-07 18:04:56 +02:00
parent 79ccdd0946
commit 10d48e6a55
58 changed files with 3457 additions and 487 deletions

View File

@@ -2,7 +2,7 @@ import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
class ServerAddressFormField extends StatefulWidget {
@@ -42,15 +42,14 @@ class _ServerAddressFormFieldState extends State<ServerAddressFormField> {
controller: _textEditingController,
name: ServerAddressFormField.fkServerAddress,
autovalidateMode: AutovalidateMode.onUserInteraction,
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(
errorText: S.of(context)!.serverAddressMustNotBeEmpty,
),
FormBuilderValidators.match(
r"https?://.*",
errorText: S.of(context)!.serverAddressMustIncludeAScheme,
)
]),
validator: (value) {
if (value?.trim().isEmpty ?? true) {
return S.of(context)!.serverAddressMustNotBeEmpty;
}
if (!RegExp(r"https?://.*").hasMatch(value!)) {
return S.of(context)!.serverAddressMustIncludeAScheme;
}
},
decoration: InputDecoration(
hintText: "http://192.168.1.50:8000",
labelText: S.of(context)!.serverAddress,

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_form_builder/flutter_form_builder.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
import 'package:paperless_mobile/features/login/model/user_credentials.model.dart';
import 'package:paperless_mobile/features/login/view/widgets/form_fields/obscured_input_text_form_field.dart';
@@ -36,9 +36,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
field.value?.copyWith(username: username) ??
UserCredentials(username: username),
),
validator: FormBuilderValidators.required(
errorText: S.of(context)!.usernameMustNotBeEmpty,
),
validator: (value) {
if (value?.trim().isEmpty ?? true) {
return S.of(context)!.usernameMustNotBeEmpty;
}
},
autofillHints: const [AutofillHints.username],
decoration: InputDecoration(
label: Text(S.of(context)!.username),
@@ -51,9 +53,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
field.value?.copyWith(password: password) ??
UserCredentials(password: password),
),
validator: FormBuilderValidators.required(
errorText: S.of(context)!.passwordMustNotBeEmpty,
),
validator: (value) {
if (value?.trim().isEmpty ?? true) {
return S.of(context)!.passwordMustNotBeEmpty;
}
},
),
].map((child) => child.padded()).toList(),
),