mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 14:07:59 -06:00
feat: Migrated strings, and translations to native flutter l10n plugin
This commit is contained in:
@@ -5,7 +5,8 @@ import 'package:paperless_mobile/core/widgets/paperless_logo.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/settings_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:url_launcher/link.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
@@ -31,14 +32,14 @@ class AppDrawer extends StatelessWidget {
|
||||
const Divider(),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Text(S.of(context).aboutThisApp),
|
||||
title: Text(S.of(context)!.aboutThisApp),
|
||||
leading: const Icon(Icons.info_outline),
|
||||
onTap: () => _showAboutDialog(context),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(Icons.bug_report_outlined),
|
||||
title: Text(S.of(context).reportABug),
|
||||
title: Text(S.of(context)!.reportABug),
|
||||
onTap: () {
|
||||
launchUrlString(
|
||||
'https://github.com/astubenbord/paperless-mobile/issues/new');
|
||||
@@ -48,7 +49,7 @@ class AppDrawer extends StatelessWidget {
|
||||
dense: true,
|
||||
leading: const Icon(Icons.settings_outlined),
|
||||
title: Text(
|
||||
S.of(context).settings,
|
||||
S.of(context)!.settings,
|
||||
),
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
@@ -74,7 +75,7 @@ class AppDrawer extends StatelessWidget {
|
||||
applicationName: 'Paperless Mobile',
|
||||
applicationVersion: packageInfo.version + '+' + packageInfo.buildNumber,
|
||||
children: [
|
||||
Text(S.of(context).developedBy('Anton Stubenbord')),
|
||||
Text(S.of(context)!.developedBy('Anton Stubenbord')),
|
||||
Link(
|
||||
uri: Uri.parse('https://github.com/astubenbord/paperless-mobile'),
|
||||
builder: (context, followLink) => GestureDetector(
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:paperless_mobile/core/global/asset_images.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/biometric_authentication_setting.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/language_selection_setting.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/theme_mode_setting.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class ApplicationIntroSlideshow extends StatefulWidget {
|
||||
const ApplicationIntroSlideshow({super.key});
|
||||
@@ -26,8 +26,8 @@ class _ApplicationIntroSlideshowState extends State<ApplicationIntroSlideshow> {
|
||||
child: IntroductionScreen(
|
||||
globalBackgroundColor: Theme.of(context).canvasColor,
|
||||
showDoneButton: true,
|
||||
next: Text(S.of(context).next),
|
||||
done: Text(S.of(context).done),
|
||||
next: Text(S.of(context)!.next),
|
||||
done: Text(S.of(context)!.done),
|
||||
onDone: () => Navigator.pop(context),
|
||||
dotsDecorator: DotsDecorator(
|
||||
color: Theme.of(context).colorScheme.onBackground,
|
||||
|
||||
@@ -21,7 +21,8 @@ import 'package:paperless_mobile/features/documents/view/widgets/delete_document
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/document_preview.dart';
|
||||
import 'package:paperless_mobile/features/similar_documents/cubit/similar_documents_cubit.dart';
|
||||
import 'package:paperless_mobile/features/similar_documents/view/similar_documents_view.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
@@ -102,7 +103,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
tabs: [
|
||||
Tab(
|
||||
child: Text(
|
||||
S.of(context).overview,
|
||||
S.of(context)!.overview,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
@@ -112,7 +113,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
),
|
||||
Tab(
|
||||
child: Text(
|
||||
S.of(context).content,
|
||||
S.of(context)!.content,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
@@ -122,7 +123,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
),
|
||||
Tab(
|
||||
child: Text(
|
||||
S.of(context).metaData,
|
||||
S.of(context)!.metaData,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
@@ -132,7 +133,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
),
|
||||
Tab(
|
||||
child: Text(
|
||||
S.of(context).similarDocuments,
|
||||
S.of(context)!.similarDocuments,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
@@ -198,7 +199,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
position: b.BadgePosition.topEnd(top: -12, end: -6),
|
||||
showBadge: _filteredSuggestions.hasSuggestions,
|
||||
child: Tooltip(
|
||||
message: S.of(context).editDocumentTooltip,
|
||||
message: S.of(context)!.editDocumentTooltip,
|
||||
preferBelow: false,
|
||||
verticalOffset: 40,
|
||||
child: FloatingActionButton(
|
||||
@@ -231,14 +232,14 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
IconButton(
|
||||
tooltip: S.of(context).deleteDocumentTooltip,
|
||||
tooltip: S.of(context)!.deleteDocumentTooltip,
|
||||
icon: const Icon(Icons.delete),
|
||||
onPressed: widget.allowEdit && isConnected
|
||||
? () => _onDelete(state.document)
|
||||
: null,
|
||||
).paddedSymmetrically(horizontal: 4),
|
||||
Tooltip(
|
||||
message: S.of(context).downloadDocumentTooltip,
|
||||
message: S.of(context)!.downloadDocumentTooltip,
|
||||
child: DocumentDownloadButton(
|
||||
document: state.document,
|
||||
enabled: isConnected,
|
||||
@@ -246,18 +247,18 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: S.of(context).previewTooltip,
|
||||
tooltip: S.of(context)!.previewTooltip,
|
||||
icon: const Icon(Icons.visibility),
|
||||
onPressed:
|
||||
isConnected ? () => _onOpen(state.document) : null,
|
||||
).paddedOnly(right: 4.0),
|
||||
IconButton(
|
||||
tooltip: S.of(context).openInSystemViewer,
|
||||
tooltip: S.of(context)!.openInSystemViewer,
|
||||
icon: const Icon(Icons.open_in_new),
|
||||
onPressed: isConnected ? _onOpenFileInSystemViewer : null,
|
||||
).paddedOnly(right: 4.0),
|
||||
IconButton(
|
||||
tooltip: S.of(context).shareTooltip,
|
||||
tooltip: S.of(context)!.shareTooltip,
|
||||
icon: const Icon(Icons.share),
|
||||
onPressed: isConnected
|
||||
? () =>
|
||||
@@ -322,13 +323,14 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
await context.read<DocumentDetailsCubit>().openDocumentInSystemViewer();
|
||||
if (status == ResultType.done) return;
|
||||
if (status == ResultType.noAppToOpen) {
|
||||
showGenericError(context, S.of(context).noAppToDisplayPDFFilesFound);
|
||||
showGenericError(context, S.of(context)!.noAppToDisplayPDFFilesFound);
|
||||
}
|
||||
if (status == ResultType.fileNotFound) {
|
||||
showGenericError(context, translateError(context, ErrorCode.unknown));
|
||||
}
|
||||
if (status == ResultType.permissionDenied) {
|
||||
showGenericError(context, S.of(context).couldNotOpenFilePermissionDenied);
|
||||
showGenericError(
|
||||
context, S.of(context)!.couldNotOpenFilePermissionDenied);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +344,7 @@ class _DocumentDetailsPageState extends State<DocumentDetailsPage> {
|
||||
if (delete) {
|
||||
try {
|
||||
await context.read<DocumentDetailsCubit>().delete(document);
|
||||
showSnackBar(context, S.of(context).documentSuccessfullyDeleted);
|
||||
showSnackBar(context, S.of(context)!.documentSuccessfullyDeleted);
|
||||
} on PaperlessServerException catch (error, stackTrace) {
|
||||
showErrorMessage(context, error, stackTrace);
|
||||
} finally {
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/widgets/highlighted_text.dart';
|
||||
import 'package:paperless_mobile/features/document_details/cubit/document_details_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class DocumentContentWidget extends StatelessWidget {
|
||||
final bool isFullContentLoaded;
|
||||
@@ -38,7 +38,7 @@ class DocumentContentWidget extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: TextButton(
|
||||
child: Text(S.of(context).loadFullContent),
|
||||
child: Text(S.of(context)!.loadFullContent),
|
||||
onPressed: () {
|
||||
context.read<DocumentDetailsCubit>().loadFullContent();
|
||||
},
|
||||
|
||||
@@ -5,7 +5,8 @@ import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/service/file_service.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/radio_settings_dialog.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
import 'package:paperless_mobile/helpers/permission_helpers.dart';
|
||||
import 'package:paperless_mobile/constants.dart';
|
||||
@@ -53,15 +54,15 @@ class _DocumentDownloadButtonState extends State<DocumentDownloadButton> {
|
||||
final downloadOriginal = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => RadioSettingsDialog(
|
||||
titleText: S.of(context).chooseFiletype,
|
||||
titleText: S.of(context)!.chooseFiletype,
|
||||
options: [
|
||||
RadioOption(
|
||||
value: true,
|
||||
label: S.of(context).original +
|
||||
label: S.of(context)!.original +
|
||||
" (${meta.originalMimeType.split("/").last})"),
|
||||
RadioOption(
|
||||
value: false,
|
||||
label: S.of(context).archivedPdf,
|
||||
label: S.of(context)!.archivedPdf,
|
||||
),
|
||||
],
|
||||
initialValue: false,
|
||||
@@ -91,7 +92,7 @@ class _DocumentDownloadButtonState extends State<DocumentDownloadButton> {
|
||||
createdFile.createSync(recursive: true);
|
||||
createdFile.writeAsBytesSync(bytes);
|
||||
debugPrint("Downloaded file to $filePath");
|
||||
showSnackBar(context, S.of(context).documentSuccessfullyDownloaded);
|
||||
showSnackBar(context, S.of(context)!.documentSuccessfullyDownloaded);
|
||||
} on PaperlessServerException catch (error, stackTrace) {
|
||||
showErrorMessage(context, error, stackTrace);
|
||||
} catch (error) {
|
||||
|
||||
@@ -7,7 +7,8 @@ import 'package:paperless_mobile/core/widgets/offline_widget.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/document_details/cubit/document_details_cubit.dart';
|
||||
import 'package:paperless_mobile/features/document_details/view/widgets/details_item.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/format_helpers.dart';
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
|
||||
@@ -44,39 +45,40 @@ class DocumentMetaDataWidget extends StatelessWidget {
|
||||
),
|
||||
children: [
|
||||
DetailsItem(
|
||||
label: S.of(context).archiveSerialNumber,
|
||||
label: S.of(context)!.archiveSerialNumber,
|
||||
content: document.archiveSerialNumber != null
|
||||
? Text(document.archiveSerialNumber.toString())
|
||||
: TextButton.icon(
|
||||
icon: const Icon(Icons.archive_outlined),
|
||||
label: Text(S.of(context).AssignAsn),
|
||||
label: Text(S.of(context)!.assignAsn),
|
||||
onPressed: connectivity.isConnected
|
||||
? () => _assignAsn(context)
|
||||
: null,
|
||||
),
|
||||
).paddedOnly(bottom: itemSpacing),
|
||||
DetailsItem.text(DateFormat().format(document.modified),
|
||||
label: S.of(context).modifiedAt, context: context)
|
||||
label: S.of(context)!.modifiedAt, context: context)
|
||||
.paddedOnly(bottom: itemSpacing),
|
||||
DetailsItem.text(DateFormat().format(document.added),
|
||||
label: S.of(context).addedAt, context: context)
|
||||
label: S.of(context)!.addedAt, context: context)
|
||||
.paddedOnly(bottom: itemSpacing),
|
||||
DetailsItem.text(
|
||||
meta.mediaFilename,
|
||||
context: context,
|
||||
label: S.of(context).mediaFilename,
|
||||
label: S.of(context)!.mediaFilename,
|
||||
).paddedOnly(bottom: itemSpacing),
|
||||
DetailsItem.text(
|
||||
meta.originalChecksum,
|
||||
context: context,
|
||||
label: S.of(context).originalMD5Checksum,
|
||||
label: S.of(context)!.originalMD5Checksum,
|
||||
).paddedOnly(bottom: itemSpacing),
|
||||
DetailsItem.text(formatBytes(meta.originalSize, 2),
|
||||
label: S.of(context).originalFileSize, context: context)
|
||||
label: S.of(context)!.originalFileSize,
|
||||
context: context)
|
||||
.paddedOnly(bottom: itemSpacing),
|
||||
DetailsItem.text(
|
||||
meta.originalMimeType,
|
||||
label: S.of(context).originalMIMEType,
|
||||
label: S.of(context)!.originalMIMEType,
|
||||
context: context,
|
||||
).paddedOnly(bottom: itemSpacing),
|
||||
],
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:paperless_mobile/features/document_details/view/widgets/details_
|
||||
import 'package:paperless_mobile/features/labels/storage_path/view/widgets/storage_path_widget.dart';
|
||||
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_widget.dart';
|
||||
import 'package:paperless_mobile/features/labels/view/widgets/label_text.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class DocumentOverviewWidget extends StatelessWidget {
|
||||
final DocumentModel document;
|
||||
@@ -29,7 +29,7 @@ class DocumentOverviewWidget extends StatelessWidget {
|
||||
),
|
||||
children: [
|
||||
DetailsItem(
|
||||
label: S.of(context).title,
|
||||
label: S.of(context)!.title,
|
||||
content: HighlightedText(
|
||||
text: document.title,
|
||||
highlights: queryString?.split(" ") ?? [],
|
||||
@@ -39,12 +39,12 @@ class DocumentOverviewWidget extends StatelessWidget {
|
||||
DetailsItem.text(
|
||||
DateFormat.yMMMMd().format(document.created),
|
||||
context: context,
|
||||
label: S.of(context).createdAt,
|
||||
label: S.of(context)!.createdAt,
|
||||
).paddedOnly(bottom: itemSpacing),
|
||||
Visibility(
|
||||
visible: document.documentType != null,
|
||||
child: DetailsItem(
|
||||
label: S.of(context).documentType,
|
||||
label: S.of(context)!.documentType,
|
||||
content: LabelText<DocumentType>(
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
id: document.documentType,
|
||||
@@ -54,7 +54,7 @@ class DocumentOverviewWidget extends StatelessWidget {
|
||||
Visibility(
|
||||
visible: document.correspondent != null,
|
||||
child: DetailsItem(
|
||||
label: S.of(context).correspondent,
|
||||
label: S.of(context)!.correspondent,
|
||||
content: LabelText<Correspondent>(
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
id: document.correspondent,
|
||||
@@ -64,7 +64,7 @@ class DocumentOverviewWidget extends StatelessWidget {
|
||||
Visibility(
|
||||
visible: document.storagePath != null,
|
||||
child: DetailsItem(
|
||||
label: S.of(context).storagePath,
|
||||
label: S.of(context)!.storagePath,
|
||||
content: StoragePathWidget(
|
||||
pathId: document.storagePath,
|
||||
),
|
||||
@@ -73,7 +73,7 @@ class DocumentOverviewWidget extends StatelessWidget {
|
||||
Visibility(
|
||||
visible: document.tags.isNotEmpty,
|
||||
child: DetailsItem(
|
||||
label: S.of(context).tags,
|
||||
label: S.of(context)!.tags,
|
||||
content: Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: TagsWidget(
|
||||
|
||||
@@ -16,7 +16,8 @@ import 'package:paperless_mobile/features/edit_label/view/impl/add_document_type
|
||||
import 'package:paperless_mobile/features/edit_label/view/impl/add_storage_path_page.dart';
|
||||
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_form_field.dart';
|
||||
import 'package:paperless_mobile/features/labels/view/widgets/label_form_field.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
|
||||
class DocumentEditPage extends StatefulWidget {
|
||||
@@ -59,10 +60,10 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () => _onSubmit(state.document),
|
||||
icon: const Icon(Icons.save),
|
||||
label: Text(S.of(context).saveChanges),
|
||||
label: Text(S.of(context)!.saveChanges),
|
||||
),
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).editDocument),
|
||||
title: Text(S.of(context)!.editDocument),
|
||||
bottom: _isSubmitLoading
|
||||
? const PreferredSize(
|
||||
preferredSize: Size.fromHeight(4),
|
||||
@@ -159,7 +160,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
create: (context) => context.read<LabelRepository<StoragePath>>(),
|
||||
child: AddStoragePathPage(initalValue: initialValue),
|
||||
),
|
||||
textFieldLabel: S.of(context).storagePath,
|
||||
textFieldLabel: S.of(context)!.storagePath,
|
||||
labelOptions: options,
|
||||
initialValue: IdQueryParameter.fromId(initialId),
|
||||
name: fkStoragePath,
|
||||
@@ -180,7 +181,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
create: (context) => context.read<LabelRepository<Correspondent>>(),
|
||||
child: AddCorrespondentPage(initialName: initialValue),
|
||||
),
|
||||
textFieldLabel: S.of(context).correspondent,
|
||||
textFieldLabel: S.of(context)!.correspondent,
|
||||
labelOptions: options,
|
||||
initialValue: IdQueryParameter.fromId(initialId),
|
||||
name: fkCorrespondent,
|
||||
@@ -214,7 +215,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
initialName: currentInput,
|
||||
),
|
||||
),
|
||||
textFieldLabel: S.of(context).documentType,
|
||||
textFieldLabel: S.of(context)!.documentType,
|
||||
initialValue: IdQueryParameter.fromId(initialId),
|
||||
labelOptions: options,
|
||||
name: fkDocumentType,
|
||||
@@ -249,7 +250,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
});
|
||||
try {
|
||||
await context.read<DocumentEditCubit>().updateDocument(mergedDocument);
|
||||
showSnackBar(context, S.of(context).documentSuccessfullyUpdated);
|
||||
showSnackBar(context, S.of(context)!.documentSuccessfullyUpdated);
|
||||
} on PaperlessServerException catch (error, stackTrace) {
|
||||
showErrorMessage(context, error, stackTrace);
|
||||
} finally {
|
||||
@@ -266,7 +267,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
name: fkTitle,
|
||||
validator: FormBuilderValidators.required(),
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).title),
|
||||
label: Text(S.of(context)!.title),
|
||||
),
|
||||
initialValue: initialTitle,
|
||||
);
|
||||
@@ -281,7 +282,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
name: fkCreatedDate,
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.calendar_month_outlined),
|
||||
label: Text(S.of(context).createdAt),
|
||||
label: Text(S.of(context)!.createdAt),
|
||||
),
|
||||
initialValue: initialCreatedAtDate,
|
||||
format: DateFormat.yMMMMd(),
|
||||
@@ -311,7 +312,7 @@ class _DocumentEditPageState extends State<DocumentEditPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).suggestions,
|
||||
S.of(context)!.suggestions,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@@ -23,7 +23,8 @@ import 'package:paperless_mobile/features/document_scan/cubit/document_scanner_c
|
||||
import 'package:paperless_mobile/features/document_scan/view/widgets/scanned_image_item.dart';
|
||||
import 'package:paperless_mobile/features/search_app_bar/view/search_app_bar.dart';
|
||||
import 'package:paperless_mobile/features/tasks/cubit/task_status_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/file_helpers.dart';
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
import 'package:paperless_mobile/helpers/permission_helpers.dart';
|
||||
@@ -72,7 +73,7 @@ class _ScannerPageState extends State<ScannerPage>
|
||||
state.isEmpty ? const NeverScrollableScrollPhysics() : null,
|
||||
slivers: [
|
||||
SearchAppBar(
|
||||
hintText: S.of(context).searchDocuments,
|
||||
hintText: S.of(context)!.searchDocuments,
|
||||
onOpenSearch: showDocumentSearchPage,
|
||||
bottom: PreferredSize(
|
||||
child: _buildActions(connectedState.isConnected),
|
||||
@@ -97,7 +98,7 @@ class _ScannerPageState extends State<ScannerPage>
|
||||
floatHeaderSlivers: false,
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) => [
|
||||
SearchAppBar(
|
||||
hintText: S.of(context).searchDocuments,
|
||||
hintText: S.of(context)!.searchDocuments,
|
||||
onOpenSearch: showDocumentSearchPage,
|
||||
bottom: PreferredSize(
|
||||
child: _buildActions(connectedState.isConnected),
|
||||
@@ -134,7 +135,7 @@ class _ScannerPageState extends State<ScannerPage>
|
||||
BlocBuilder<DocumentScannerCubit, List<File>>(
|
||||
builder: (context, state) {
|
||||
return TextButton.icon(
|
||||
label: Text(S.of(context).previewScan),
|
||||
label: Text(S.of(context)!.previewScan),
|
||||
onPressed: state.isNotEmpty
|
||||
? () => Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
@@ -154,7 +155,7 @@ class _ScannerPageState extends State<ScannerPage>
|
||||
BlocBuilder<DocumentScannerCubit, List<File>>(
|
||||
builder: (context, state) {
|
||||
return TextButton.icon(
|
||||
label: Text(S.of(context).clearAll),
|
||||
label: Text(S.of(context)!.clearAll),
|
||||
onPressed: state.isEmpty ? null : () => _reset(context),
|
||||
icon: const Icon(Icons.delete_sweep_outlined),
|
||||
);
|
||||
@@ -163,7 +164,7 @@ class _ScannerPageState extends State<ScannerPage>
|
||||
BlocBuilder<DocumentScannerCubit, List<File>>(
|
||||
builder: (context, state) {
|
||||
return TextButton.icon(
|
||||
label: Text(S.of(context).upload),
|
||||
label: Text(S.of(context)!.upload),
|
||||
onPressed: state.isEmpty || !isConnected
|
||||
? null
|
||||
: () => _onPrepareDocumentUpload(context),
|
||||
@@ -247,16 +248,16 @@ class _ScannerPageState extends State<ScannerPage>
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).noDocumentsScannedYet,
|
||||
S.of(context)!.noDocumentsScannedYet,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
TextButton(
|
||||
child: Text(S.of(context).scanADocument),
|
||||
child: Text(S.of(context)!.scanADocument),
|
||||
onPressed: () => _openDocumentScanner(context),
|
||||
),
|
||||
Text(S.of(context).or),
|
||||
Text(S.of(context)!.or),
|
||||
TextButton(
|
||||
child: Text(S.of(context).uploadADocumentFromThisDevice),
|
||||
child: Text(S.of(context)!.uploadADocumentFromThisDevice),
|
||||
onPressed: isConnected ? _onUploadFromFilesystem : null,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:photo_view/photo_view.dart';
|
||||
|
||||
typedef DeleteCallback = void Function();
|
||||
@@ -112,7 +113,7 @@ class _ScannedImageItemState extends State<ScannedImageItem> {
|
||||
builder: (context) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
"${S.of(context).scan} ${widget.index + 1}/${widget.totalNumberOfFiles}"),
|
||||
"${S.of(context)!.scan} ${widget.index + 1}/${widget.totalNumberOfFiles}"),
|
||||
),
|
||||
body: PhotoView(imageProvider: FileImage(widget.file)),
|
||||
),
|
||||
|
||||
@@ -7,7 +7,8 @@ import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/document_search/cubit/document_search_cubit.dart';
|
||||
import 'package:paperless_mobile/features/document_search/view/remove_history_entry_dialog.dart';
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/adaptive_documents_view.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/routes/document_details_route.dart';
|
||||
import 'dart:math' as math;
|
||||
|
||||
@@ -60,7 +61,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
hintStyle: theme.textTheme.bodyLarge?.apply(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
hintText: S.of(context).searchDocuments,
|
||||
hintText: S.of(context)!.searchDocuments,
|
||||
border: InputBorder.none,
|
||||
),
|
||||
controller: _queryController,
|
||||
@@ -181,7 +182,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
|
||||
Widget _buildResultsView(DocumentSearchState state) {
|
||||
final header = Text(
|
||||
S.of(context).results,
|
||||
S.of(context)!.results,
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
).padded();
|
||||
return CustomScrollView(
|
||||
@@ -190,7 +191,7 @@ class _DocumentSearchPageState extends State<DocumentSearchPage> {
|
||||
if (state.hasLoaded && !state.isLoading && state.documents.isEmpty)
|
||||
SliverToBoxAdapter(
|
||||
child: Center(
|
||||
child: Text(S.of(context).noMatchesFound),
|
||||
child: Text(S.of(context)!.noMatchesFound),
|
||||
),
|
||||
)
|
||||
else
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/core/widgets/dialog_utils/dialog_cancel_button.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class RemoveHistoryEntryDialog extends StatelessWidget {
|
||||
final String entry;
|
||||
@@ -10,11 +10,11 @@ class RemoveHistoryEntryDialog extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(entry),
|
||||
content: Text(S.of(context).removeQueryFromSearchHistory),
|
||||
content: Text(S.of(context)!.removeQueryFromSearchHistory),
|
||||
actions: [
|
||||
const DialogCancelButton(),
|
||||
TextButton(
|
||||
child: Text(S.of(context).remove),
|
||||
child: Text(S.of(context)!.remove),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
|
||||
@@ -15,7 +15,8 @@ import 'package:paperless_mobile/features/edit_label/view/impl/add_correspondent
|
||||
import 'package:paperless_mobile/features/edit_label/view/impl/add_document_type_page.dart';
|
||||
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_form_field.dart';
|
||||
import 'package:paperless_mobile/features/labels/view/widgets/label_form_field.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
|
||||
class DocumentUploadPreparationPage extends StatefulWidget {
|
||||
@@ -62,7 +63,7 @@ class _DocumentUploadPreparationPageState
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).prepareDocument),
|
||||
title: Text(S.of(context)!.prepareDocument),
|
||||
bottom: _isUploadLoading
|
||||
? const PreferredSize(
|
||||
child: LinearProgressIndicator(),
|
||||
@@ -73,7 +74,7 @@ class _DocumentUploadPreparationPageState
|
||||
visible: MediaQuery.of(context).viewInsets.bottom == 0,
|
||||
child: FloatingActionButton.extended(
|
||||
onPressed: _onSubmit,
|
||||
label: Text(S.of(context).upload),
|
||||
label: Text(S.of(context)!.upload),
|
||||
icon: const Icon(Icons.upload),
|
||||
),
|
||||
),
|
||||
@@ -91,7 +92,7 @@ class _DocumentUploadPreparationPageState
|
||||
widget.title ?? "scan_${fileNameDateFormat.format(_now)}",
|
||||
validator: FormBuilderValidators.required(),
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).title,
|
||||
labelText: S.of(context)!.title,
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
onPressed: () {
|
||||
@@ -121,7 +122,7 @@ class _DocumentUploadPreparationPageState
|
||||
enabled: !_syncTitleAndFilename,
|
||||
name: fkFileName,
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).fileName,
|
||||
labelText: S.of(context)!.fileName,
|
||||
suffixText: widget.fileExtension,
|
||||
suffixIcon: IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
@@ -151,7 +152,7 @@ class _DocumentUploadPreparationPageState
|
||||
}
|
||||
},
|
||||
title: Text(
|
||||
S.of(context).synchronizeTitleAndFilename,
|
||||
S.of(context)!.synchronizeTitleAndFilename,
|
||||
),
|
||||
),
|
||||
// Created at
|
||||
@@ -166,7 +167,7 @@ class _DocumentUploadPreparationPageState
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.calendar_month_outlined),
|
||||
labelText: S.of(context).createdAt + " *",
|
||||
labelText: S.of(context)!.createdAt + " *",
|
||||
suffixIcon: _showDatePickerDeleteIcon
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
@@ -189,7 +190,7 @@ class _DocumentUploadPreparationPageState
|
||||
context.read<LabelRepository<Correspondent>>(),
|
||||
child: AddCorrespondentPage(initialName: initialName),
|
||||
),
|
||||
textFieldLabel: S.of(context).correspondent + " *",
|
||||
textFieldLabel: S.of(context)!.correspondent + " *",
|
||||
name: DocumentModel.correspondentKey,
|
||||
labelOptions: state.correspondents,
|
||||
prefixIcon: const Icon(Icons.person_outline),
|
||||
@@ -204,7 +205,7 @@ class _DocumentUploadPreparationPageState
|
||||
context.read<LabelRepository<DocumentType>>(),
|
||||
child: AddDocumentTypePage(initialName: initialName),
|
||||
),
|
||||
textFieldLabel: S.of(context).documentType + " *",
|
||||
textFieldLabel: S.of(context)!.documentType + " *",
|
||||
name: DocumentModel.documentTypeKey,
|
||||
labelOptions: state.documentTypes,
|
||||
prefixIcon: const Icon(Icons.description_outlined),
|
||||
@@ -218,7 +219,7 @@ class _DocumentUploadPreparationPageState
|
||||
//Label: "Tags" + " *",
|
||||
),
|
||||
Text(
|
||||
"* " + S.of(context).uploadInferValuesHint,
|
||||
"* " + S.of(context)!.uploadInferValuesHint,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
SizedBox(height: 300),
|
||||
@@ -258,7 +259,7 @@ class _DocumentUploadPreparationPageState
|
||||
createdAt: createdAt,
|
||||
);
|
||||
showSnackBar(
|
||||
context, S.of(context).documentSuccessfullyUploadedProcessing);
|
||||
context, S.of(context)!.documentSuccessfullyUploadedProcessing);
|
||||
Navigator.pop(context, taskId);
|
||||
} on PaperlessServerException catch (error, stackTrace) {
|
||||
showErrorMessage(context, error, stackTrace);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:pdfx/pdfx.dart';
|
||||
|
||||
class DocumentView extends StatefulWidget {
|
||||
@@ -32,7 +33,7 @@ class _DocumentViewState extends State<DocumentView> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).preview),
|
||||
title: Text(S.of(context)!.preview),
|
||||
),
|
||||
body: PdfView(
|
||||
builders: PdfViewBuilders<DefaultBuilderOptions>(
|
||||
|
||||
@@ -20,7 +20,8 @@ import 'package:paperless_mobile/features/saved_view/view/add_saved_view_page.da
|
||||
import 'package:paperless_mobile/features/saved_view/view/saved_view_list.dart';
|
||||
import 'package:paperless_mobile/features/search_app_bar/view/search_app_bar.dart';
|
||||
import 'package:paperless_mobile/features/tasks/cubit/task_status_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
import 'package:paperless_mobile/routes/document_details_route.dart';
|
||||
|
||||
@@ -112,9 +113,9 @@ class _DocumentsPageState extends State<DocumentsPage>
|
||||
listener: (context, state) {
|
||||
showSnackBar(
|
||||
context,
|
||||
S.of(context).newDocumentAvailable,
|
||||
S.of(context)!.newDocumentAvailable,
|
||||
action: SnackBarActionConfig(
|
||||
label: S.of(context).reload,
|
||||
label: S.of(context)!.reload,
|
||||
onPressed: () {
|
||||
context.read<TaskStatusCubit>().acknowledgeCurrentTask();
|
||||
context.read<DocumentsCubit>().reload();
|
||||
@@ -200,7 +201,7 @@ class _DocumentsPageState extends State<DocumentsPage>
|
||||
.resetSelection(),
|
||||
),
|
||||
title: Text(
|
||||
"${state.selection.length} ${S.of(context).countSelected}",
|
||||
"${state.selection.length} ${S.of(context)!.countSelected}",
|
||||
),
|
||||
actions: [
|
||||
IconButton(
|
||||
@@ -211,13 +212,13 @@ class _DocumentsPageState extends State<DocumentsPage>
|
||||
);
|
||||
}
|
||||
return SearchAppBar(
|
||||
hintText: S.of(context).searchDocuments,
|
||||
hintText: S.of(context)!.searchDocuments,
|
||||
onOpenSearch: showDocumentSearchPage,
|
||||
bottom: TabBar(
|
||||
controller: _tabController,
|
||||
tabs: [
|
||||
Tab(text: S.of(context).documents),
|
||||
Tab(text: S.of(context).views),
|
||||
Tab(text: S.of(context)!.documents),
|
||||
Tab(text: S.of(context)!.views),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -293,7 +294,7 @@ class _DocumentsPageState extends State<DocumentsPage>
|
||||
_nestedScrollViewKey.currentState?.outerController.jumpTo(0);
|
||||
},
|
||||
label: Text(
|
||||
S.of(context).scrollToTop,
|
||||
S.of(context)!.scrollToTop,
|
||||
style: DefaultTextStyle.of(context).style.apply(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
),
|
||||
@@ -408,7 +409,7 @@ class _DocumentsPageState extends State<DocumentsPage>
|
||||
.bulkDelete(documentsState.selection);
|
||||
showSnackBar(
|
||||
context,
|
||||
S.of(context).documentsSuccessfullyDeleted,
|
||||
S.of(context)!.documentsSuccessfullyDeleted,
|
||||
);
|
||||
context.read<DocumentsCubit>().resetSelection();
|
||||
} on PaperlessServerException catch (error, stackTrace) {
|
||||
|
||||
@@ -220,7 +220,7 @@ class DefaultAdaptiveDocumentsView extends AdaptiveDocumentsView {
|
||||
|
||||
Widget _buildListView() {
|
||||
if (showLoadingPlaceholder) {
|
||||
return DocumentsListLoadingWidget();
|
||||
return const DocumentsListLoadingWidget();
|
||||
}
|
||||
|
||||
return ListView.builder(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class DeleteDocumentConfirmationDialog extends StatelessWidget {
|
||||
final DocumentModel document;
|
||||
@@ -9,12 +9,12 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).confirmDeletion),
|
||||
title: Text(S.of(context)!.confirmDeletion),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).areYouSureYouWantToDeleteTheFollowingDocuments(1),
|
||||
S.of(context)!.areYouSureYouWantToDeleteTheFollowingDocuments(1),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
@@ -26,13 +26,13 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(S.of(context).thisActionIsIrreversibleDoYouWishToProceedAnyway),
|
||||
Text(S.of(context)!.thisActionIsIrreversibleDoYouWishToProceedAnyway),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: Text(S.of(context).cancel),
|
||||
child: Text(S.of(context)!.cancel),
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
@@ -42,7 +42,7 @@ class DeleteDocumentConfirmationDialog extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
child: Text(S.of(context).delete),
|
||||
child: Text(S.of(context)!.delete),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/widgets/empty_state.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/paged_document_view/cubit/paged_documents_state.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class DocumentsEmptyState extends StatelessWidget {
|
||||
final DocumentPagingState state;
|
||||
@@ -18,13 +18,13 @@ class DocumentsEmptyState extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: EmptyState(
|
||||
title: S.of(context).oops,
|
||||
subtitle: S.of(context).thereSeemsToBeNothingHere,
|
||||
title: S.of(context)!.oops,
|
||||
subtitle: S.of(context)!.thereSeemsToBeNothingHere,
|
||||
bottomChild: state.filter != DocumentFilter.initial && onReset != null
|
||||
? TextButton(
|
||||
onPressed: onReset,
|
||||
child: Text(
|
||||
S.of(context).resetFilter,
|
||||
S.of(context)!.resetFilter,
|
||||
),
|
||||
).padded()
|
||||
: null,
|
||||
|
||||
@@ -19,6 +19,7 @@ class DocumentsListLoadingWidget extends StatelessWidget {
|
||||
);
|
||||
} else {
|
||||
return ListView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) => _buildFakeListItem(context),
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:paperless_mobile/core/widgets/form_builder_fields/extended_date_
|
||||
import 'package:paperless_mobile/features/labels/cubit/label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_form_field.dart';
|
||||
import 'package:paperless_mobile/features/labels/view/widgets/label_form_field.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'text_query_form_field.dart';
|
||||
|
||||
@@ -96,14 +96,14 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
S.of(context).advanced,
|
||||
S.of(context)!.advanced,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
),
|
||||
FormBuilderExtendedDateRangePicker(
|
||||
name: DocumentFilterForm.fkCreatedAt,
|
||||
initialValue: widget.initialFilter.created,
|
||||
labelText: S.of(context).createdAt,
|
||||
labelText: S.of(context)!.createdAt,
|
||||
onChanged: (_) {
|
||||
_checkQueryConstraints();
|
||||
},
|
||||
@@ -111,7 +111,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
FormBuilderExtendedDateRangePicker(
|
||||
name: DocumentFilterForm.fkAddedAt,
|
||||
initialValue: widget.initialFilter.added,
|
||||
labelText: S.of(context).addedAt,
|
||||
labelText: S.of(context)!.addedAt,
|
||||
onChanged: (_) {
|
||||
_checkQueryConstraints();
|
||||
},
|
||||
@@ -151,7 +151,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
formBuilderState: widget.formKey.currentState,
|
||||
name: DocumentFilterForm.fkDocumentType,
|
||||
labelOptions: state.labels,
|
||||
textFieldLabel: S.of(context).documentType,
|
||||
textFieldLabel: S.of(context)!.documentType,
|
||||
initialValue: widget.initialFilter.documentType,
|
||||
prefixIcon: const Icon(Icons.description_outlined),
|
||||
);
|
||||
@@ -166,7 +166,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
formBuilderState: widget.formKey.currentState,
|
||||
name: DocumentFilterForm.fkCorrespondent,
|
||||
labelOptions: state.labels,
|
||||
textFieldLabel: S.of(context).correspondent,
|
||||
textFieldLabel: S.of(context)!.correspondent,
|
||||
initialValue: widget.initialFilter.correspondent,
|
||||
prefixIcon: const Icon(Icons.person_outline),
|
||||
);
|
||||
@@ -181,7 +181,7 @@ class _DocumentFilterFormState extends State<DocumentFilterForm> {
|
||||
formBuilderState: widget.formKey.currentState,
|
||||
name: DocumentFilterForm.fkStoragePath,
|
||||
labelOptions: state.labels,
|
||||
textFieldLabel: S.of(context).storagePath,
|
||||
textFieldLabel: S.of(context)!.storagePath,
|
||||
initialValue: widget.initialFilter.storagePath,
|
||||
prefixIcon: const Icon(Icons.folder_outlined),
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/features/documents/view/pages/documents_page.dart';
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/search/document_filter_form.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
enum DateRangeSelection { before, after }
|
||||
|
||||
@@ -74,7 +74,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
|
||||
visible: MediaQuery.of(context).viewInsets.bottom == 0,
|
||||
child: FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.done),
|
||||
label: Text(S.of(context).apply),
|
||||
label: Text(S.of(context)!.apply),
|
||||
onPressed: _onApplyFilter,
|
||||
),
|
||||
),
|
||||
@@ -85,7 +85,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
|
||||
TextButton.icon(
|
||||
onPressed: _resetFilter,
|
||||
icon: const Icon(Icons.refresh),
|
||||
label: Text(S.of(context).reset),
|
||||
label: Text(S.of(context)!.reset),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -133,7 +133,7 @@ class _DocumentFilterPanelState extends State<DocumentFilterPanel> {
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: _heightAnimationValue * 48),
|
||||
child: Text(S.of(context).filterDocuments),
|
||||
child: Text(S.of(context)!.filterDocuments),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/translation/sort_field_localization_mapper.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/labels/cubit/label_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class SortFieldSelectionBottomSheet extends StatefulWidget {
|
||||
final SortOrder initialSortOrder;
|
||||
@@ -48,12 +48,12 @@ class _SortFieldSelectionBottomSheetState
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).orderBy,
|
||||
S.of(context)!.orderBy,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
TextButton(
|
||||
child: Text(S.of(context).apply),
|
||||
child: Text(S.of(context)!.apply),
|
||||
onPressed: () {
|
||||
widget.onSubmit(
|
||||
_currentSortField,
|
||||
@@ -105,12 +105,12 @@ class _SortFieldSelectionBottomSheetState
|
||||
ButtonSegment(
|
||||
icon: const FaIcon(FontAwesomeIcons.arrowDownAZ),
|
||||
value: SortOrder.descending,
|
||||
label: Text(S.of(context).descending),
|
||||
label: Text(S.of(context)!.descending),
|
||||
),
|
||||
ButtonSegment(
|
||||
icon: const FaIcon(FontAwesomeIcons.arrowUpZA),
|
||||
value: SortOrder.ascending,
|
||||
label: Text(S.of(context).ascending),
|
||||
label: Text(S.of(context)!.ascending),
|
||||
),
|
||||
],
|
||||
emptySelectionAllowed: false,
|
||||
|
||||
@@ -3,7 +3,8 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/widgets/form_builder_fields/form_builder_type_ahead.dart';
|
||||
import 'package:paperless_mobile/features/documents/cubit/documents_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class TextQueryFormField extends StatelessWidget {
|
||||
@@ -63,19 +64,19 @@ class TextQueryFormField extends StatelessWidget {
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
child: ListTile(
|
||||
title: Text(S.of(context).titleAndContent),
|
||||
title: Text(S.of(context)!.titleAndContent),
|
||||
),
|
||||
value: QueryType.titleAndContent,
|
||||
),
|
||||
PopupMenuItem(
|
||||
child: ListTile(
|
||||
title: Text(S.of(context).title),
|
||||
title: Text(S.of(context)!.title),
|
||||
),
|
||||
value: QueryType.title,
|
||||
),
|
||||
PopupMenuItem(
|
||||
child: ListTile(
|
||||
title: Text(S.of(context).extended),
|
||||
title: Text(S.of(context)!.extended),
|
||||
),
|
||||
value: QueryType.extended,
|
||||
),
|
||||
@@ -89,11 +90,11 @@ class TextQueryFormField extends StatelessWidget {
|
||||
String _buildLabelText(BuildContext context, QueryType queryType) {
|
||||
switch (queryType) {
|
||||
case QueryType.title:
|
||||
return S.of(context).title;
|
||||
return S.of(context)!.title;
|
||||
case QueryType.titleAndContent:
|
||||
return S.of(context).titleAndContent;
|
||||
return S.of(context)!.titleAndContent;
|
||||
case QueryType.extended:
|
||||
return S.of(context).extended;
|
||||
return S.of(context)!.extended;
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/features/documents/cubit/documents_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class BulkDeleteConfirmationDialog extends StatelessWidget {
|
||||
final DocumentsState state;
|
||||
@@ -14,24 +14,24 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
assert(state.selection.isNotEmpty);
|
||||
return AlertDialog(
|
||||
title: Text(S.of(context).confirmDeletion),
|
||||
title: Text(S.of(context)!.confirmDeletion),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).areYouSureYouWantToDeleteTheFollowingDocuments(
|
||||
S.of(context)!.areYouSureYouWantToDeleteTheFollowingDocuments(
|
||||
state.selection.length),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
...state.selection.map(_buildBulletPoint).toList(),
|
||||
const SizedBox(height: 16),
|
||||
Text(S.of(context).thisActionIsIrreversibleDoYouWishToProceedAnyway),
|
||||
Text(S.of(context)!.thisActionIsIrreversibleDoYouWishToProceedAnyway),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: Text(S.of(context).cancel),
|
||||
child: Text(S.of(context)!.cancel),
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
@@ -41,7 +41,7 @@ class BulkDeleteConfirmationDialog extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
child: Text(S.of(context).delete),
|
||||
child: Text(S.of(context)!.delete),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class ConfirmDeleteSavedViewDialog extends StatelessWidget {
|
||||
const ConfirmDeleteSavedViewDialog({
|
||||
@@ -14,18 +14,18 @@ class ConfirmDeleteSavedViewDialog extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(
|
||||
S.of(context).deleteView + view.name + "?",
|
||||
S.of(context)!.deleteView + view.name + "?",
|
||||
softWrap: true,
|
||||
),
|
||||
content: Text(S.of(context).doYouReallyWantToDeleteThisView),
|
||||
content: Text(S.of(context)!.doYouReallyWantToDeleteThisView),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: Text(S.of(context).cancel),
|
||||
child: Text(S.of(context)!.cancel),
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
S.of(context).delete,
|
||||
S.of(context)!.delete,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.error),
|
||||
),
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/view_type.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
/// Meant to be used with blocbuilder.
|
||||
class ViewTypeSelectionWidget extends StatelessWidget {
|
||||
@@ -34,19 +34,19 @@ class ViewTypeSelectionWidget extends StatelessWidget {
|
||||
_buildViewTypeOption(
|
||||
context,
|
||||
type: ViewType.list,
|
||||
label: S.of(context).list,
|
||||
label: S.of(context)!.list,
|
||||
icon: Icons.list,
|
||||
),
|
||||
_buildViewTypeOption(
|
||||
context,
|
||||
type: ViewType.grid,
|
||||
label: S.of(context).grid,
|
||||
label: S.of(context)!.grid,
|
||||
icon: Icons.grid_view_rounded,
|
||||
),
|
||||
_buildViewTypeOption(
|
||||
context,
|
||||
type: ViewType.detailed,
|
||||
label: S.of(context).detailed,
|
||||
label: S.of(context)!.detailed,
|
||||
icon: Icons.article_outlined,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:paperless_mobile/core/repository/label_repository.dart';
|
||||
import 'package:paperless_mobile/core/repository/state/indexed_repository_state.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/cubit/edit_label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/label_form.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class AddLabelPage<T extends Label> extends StatelessWidget {
|
||||
final String? initialName;
|
||||
@@ -62,7 +62,7 @@ class AddLabelFormWidget<T extends Label> extends StatelessWidget {
|
||||
fromJsonT: fromJsonT,
|
||||
submitButtonConfig: SubmitButtonConfig<T>(
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(S.of(context).create),
|
||||
label: Text(S.of(context)!.create),
|
||||
onSubmit: context.read<EditLabelCubit<T>>().create,
|
||||
),
|
||||
additionalFields: additionalFields,
|
||||
|
||||
@@ -8,7 +8,8 @@ import 'package:paperless_mobile/core/repository/label_repository.dart';
|
||||
import 'package:paperless_mobile/core/repository/state/indexed_repository_state.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/cubit/edit_label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/label_form.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
import 'package:paperless_mobile/constants.dart';
|
||||
|
||||
@@ -55,7 +56,7 @@ class EditLabelForm<T extends Label> extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).edit),
|
||||
title: Text(S.of(context)!.edit),
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => _onDelete(context),
|
||||
@@ -68,7 +69,7 @@ class EditLabelForm<T extends Label> extends StatelessWidget {
|
||||
fromJsonT: fromJsonT,
|
||||
submitButtonConfig: SubmitButtonConfig<T>(
|
||||
icon: const Icon(Icons.save),
|
||||
label: Text(S.of(context).saveChanges),
|
||||
label: Text(S.of(context)!.saveChanges),
|
||||
onSubmit: context.read<EditLabelCubit<T>>().update,
|
||||
),
|
||||
additionalFields: additionalFields,
|
||||
@@ -81,21 +82,21 @@ class EditLabelForm<T extends Label> extends StatelessWidget {
|
||||
final shouldDelete = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(S.of(context).confirmDeletion),
|
||||
title: Text(S.of(context)!.confirmDeletion),
|
||||
content: Text(
|
||||
S.of(context).deleteLabelWarningText,
|
||||
S.of(context)!.deleteLabelWarningText,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: Text(S.of(context).cancel),
|
||||
child: Text(S.of(context)!.cancel),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
child: Text(
|
||||
S.of(context).delete,
|
||||
S.of(context)!.delete,
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).colorScheme.error),
|
||||
),
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:paperless_mobile/core/repository/label_repository.dart';
|
||||
import 'package:paperless_mobile/core/repository/state/impl/correspondent_repository_state.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/cubit/edit_label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/add_label_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class AddCorrespondentPage extends StatelessWidget {
|
||||
final String? initialName;
|
||||
@@ -18,7 +18,7 @@ class AddCorrespondentPage extends StatelessWidget {
|
||||
context.read<LabelRepository<Correspondent>>(),
|
||||
),
|
||||
child: AddLabelPage<Correspondent>(
|
||||
pageTitle: Text(S.of(context).addCorrespondent),
|
||||
pageTitle: Text(S.of(context)!.addCorrespondent),
|
||||
fromJsonT: Correspondent.fromJson,
|
||||
initialName: initialName,
|
||||
),
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:paperless_mobile/core/repository/label_repository.dart';
|
||||
import 'package:paperless_mobile/core/repository/state/impl/document_type_repository_state.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/cubit/edit_label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/add_label_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class AddDocumentTypePage extends StatelessWidget {
|
||||
final String? initialName;
|
||||
@@ -21,7 +21,7 @@ class AddDocumentTypePage extends StatelessWidget {
|
||||
context.read<LabelRepository<DocumentType>>(),
|
||||
),
|
||||
child: AddLabelPage<DocumentType>(
|
||||
pageTitle: Text(S.of(context).addDocumentType),
|
||||
pageTitle: Text(S.of(context)!.addDocumentType),
|
||||
fromJsonT: DocumentType.fromJson,
|
||||
initialName: initialName,
|
||||
),
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:paperless_mobile/core/repository/state/impl/storage_path_reposit
|
||||
import 'package:paperless_mobile/features/edit_label/cubit/edit_label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/add_label_page.dart';
|
||||
import 'package:paperless_mobile/features/labels/storage_path/view/widgets/storage_path_autofill_form_builder_field.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class AddStoragePathPage extends StatelessWidget {
|
||||
final String? initalValue;
|
||||
@@ -19,7 +19,7 @@ class AddStoragePathPage extends StatelessWidget {
|
||||
context.read<LabelRepository<StoragePath>>(),
|
||||
),
|
||||
child: AddLabelPage<StoragePath>(
|
||||
pageTitle: Text(S.of(context).addStoragePath),
|
||||
pageTitle: Text(S.of(context)!.addStoragePath),
|
||||
fromJsonT: StoragePath.fromJson,
|
||||
initialName: initalValue,
|
||||
additionalFields: const [
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:paperless_mobile/core/repository/state/impl/tag_repository_state
|
||||
import 'package:paperless_mobile/core/widgets/form_builder_fields/form_builder_color_picker.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/cubit/edit_label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/add_label_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class AddTagPage extends StatelessWidget {
|
||||
final String? initialValue;
|
||||
@@ -22,7 +22,7 @@ class AddTagPage extends StatelessWidget {
|
||||
context.read<LabelRepository<Tag>>(),
|
||||
),
|
||||
child: AddLabelPage<Tag>(
|
||||
pageTitle: Text(S.of(context).addTag),
|
||||
pageTitle: Text(S.of(context)!.addTag),
|
||||
fromJsonT: Tag.fromJson,
|
||||
initialName: initialValue,
|
||||
additionalFields: [
|
||||
@@ -30,7 +30,7 @@ class AddTagPage extends StatelessWidget {
|
||||
name: Tag.colorKey,
|
||||
valueTransformer: (color) => "#${color?.value.toRadixString(16)}",
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).color),
|
||||
label: Text(S.of(context)!.color),
|
||||
),
|
||||
colorPickerType: ColorPickerType.materialPicker,
|
||||
initialValue: Color((Random().nextDouble() * 0xFFFFFF).toInt())
|
||||
@@ -38,7 +38,7 @@ class AddTagPage extends StatelessWidget {
|
||||
),
|
||||
FormBuilderCheckbox(
|
||||
name: Tag.isInboxTagKey,
|
||||
title: Text(S.of(context).inboxTag),
|
||||
title: Text(S.of(context)!.inboxTag),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:paperless_mobile/core/repository/state/impl/tag_repository_state
|
||||
import 'package:paperless_mobile/core/widgets/form_builder_fields/form_builder_color_picker.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/cubit/edit_label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/edit_label_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class EditTagPage extends StatelessWidget {
|
||||
final Tag tag;
|
||||
@@ -28,14 +28,14 @@ class EditTagPage extends StatelessWidget {
|
||||
initialValue: tag.color,
|
||||
name: Tag.colorKey,
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).color),
|
||||
label: Text(S.of(context)!.color),
|
||||
),
|
||||
colorPickerType: ColorPickerType.blockPicker,
|
||||
),
|
||||
FormBuilderCheckbox(
|
||||
initialValue: tag.isInboxTag,
|
||||
name: Tag.isInboxTagKey,
|
||||
title: Text(S.of(context).inboxTag),
|
||||
title: Text(S.of(context)!.inboxTag),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -5,7 +5,8 @@ import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/translation/matching_algorithm_localization_mapper.dart';
|
||||
import 'package:paperless_mobile/core/type/types.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
import 'package:paperless_mobile/constants.dart';
|
||||
|
||||
@@ -75,7 +76,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
|
||||
FormBuilderTextField(
|
||||
name: Label.nameKey,
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).name,
|
||||
labelText: S.of(context)!.name,
|
||||
errorText: _errors[Label.nameKey],
|
||||
),
|
||||
validator: FormBuilderValidators.required(),
|
||||
@@ -88,7 +89,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
|
||||
MatchingAlgorithm.defaultValue)
|
||||
.value,
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).matchingAlgorithm,
|
||||
labelText: S.of(context)!.matchingAlgorithm,
|
||||
errorText: _errors[Label.matchingAlgorithmKey],
|
||||
),
|
||||
onChanged: (val) {
|
||||
@@ -112,7 +113,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
|
||||
FormBuilderTextField(
|
||||
name: Label.matchKey,
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).match,
|
||||
labelText: S.of(context)!.match,
|
||||
errorText: _errors[Label.matchKey],
|
||||
),
|
||||
initialValue: widget.initialValue?.match,
|
||||
@@ -121,7 +122,7 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
|
||||
FormBuilderCheckbox(
|
||||
name: Label.isInsensitiveKey,
|
||||
initialValue: widget.initialValue?.isInsensitive ?? true,
|
||||
title: Text(S.of(context).caseIrrelevant),
|
||||
title: Text(S.of(context)!.caseIrrelevant),
|
||||
),
|
||||
...widget.additionalFields,
|
||||
].padded(),
|
||||
|
||||
@@ -28,7 +28,8 @@ import 'package:paperless_mobile/features/notifications/services/local_notificat
|
||||
import 'package:paperless_mobile/features/saved_view/cubit/saved_view_cubit.dart';
|
||||
import 'package:paperless_mobile/features/sharing/share_intent_queue.dart';
|
||||
import 'package:paperless_mobile/features/tasks/cubit/task_status_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/file_helpers.dart';
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
@@ -153,41 +154,41 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
}
|
||||
final filename = extractFilenameFromPath(mediaFile.path);
|
||||
final extension = p.extension(mediaFile.path);
|
||||
if (await File(mediaFile.path).exists()) {
|
||||
final bytes = File(mediaFile.path).readAsBytesSync();
|
||||
final success = await Navigator.push<bool>(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => BlocProvider.value(
|
||||
value: DocumentUploadCubit(
|
||||
documentApi: context.read(),
|
||||
tagRepository: context.read(),
|
||||
correspondentRepository: context.read(),
|
||||
documentTypeRepository: context.read(),
|
||||
),
|
||||
child: DocumentUploadPreparationPage(
|
||||
fileBytes: bytes,
|
||||
filename: filename,
|
||||
title: filename,
|
||||
fileExtension: extension,
|
||||
),
|
||||
if (await File(mediaFile.path).exists()) {
|
||||
final bytes = File(mediaFile.path).readAsBytesSync();
|
||||
final success = await Navigator.push<bool>(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => BlocProvider.value(
|
||||
value: DocumentUploadCubit(
|
||||
documentApi: context.read(),
|
||||
tagRepository: context.read(),
|
||||
correspondentRepository: context.read(),
|
||||
documentTypeRepository: context.read(),
|
||||
),
|
||||
child: DocumentUploadPreparationPage(
|
||||
fileBytes: bytes,
|
||||
filename: filename,
|
||||
title: filename,
|
||||
fileExtension: extension,
|
||||
),
|
||||
),
|
||||
) ??
|
||||
false;
|
||||
if (success) {
|
||||
await Fluttertoast.showToast(
|
||||
msg: S.of(context).documentSuccessfullyUploadedProcessing,
|
||||
);
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg: S.of(context).couldNotAccessReceivedFile,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
),
|
||||
) ??
|
||||
false;
|
||||
if (success) {
|
||||
await Fluttertoast.showToast(
|
||||
msg: S.of(context)!.documentSuccessfullyUploadedProcessing,
|
||||
);
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
} else {
|
||||
Fluttertoast.showToast(
|
||||
msg: S.of(context)!.couldNotAccessReceivedFile,
|
||||
toastLength: Toast.LENGTH_LONG,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -198,7 +199,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
Icons.description,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
label: S.of(context).documents,
|
||||
label: S.of(context)!.documents,
|
||||
),
|
||||
RouteDescription(
|
||||
icon: const Icon(Icons.document_scanner_outlined),
|
||||
@@ -206,7 +207,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
Icons.document_scanner,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
label: S.of(context).scanner,
|
||||
label: S.of(context)!.scanner,
|
||||
),
|
||||
RouteDescription(
|
||||
icon: const Icon(Icons.sell_outlined),
|
||||
@@ -214,7 +215,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
Icons.sell,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
label: S.of(context).labels,
|
||||
label: S.of(context)!.labels,
|
||||
),
|
||||
RouteDescription(
|
||||
icon: const Icon(Icons.inbox_outlined),
|
||||
@@ -222,7 +223,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
||||
Icons.inbox,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
label: S.of(context).inbox,
|
||||
label: S.of(context)!.inbox,
|
||||
badgeBuilder: (icon) => BlocBuilder<InboxCubit, InboxState>(
|
||||
bloc: _inboxCubit,
|
||||
builder: (context, state) {
|
||||
|
||||
@@ -6,7 +6,8 @@ import 'package:paperless_mobile/core/repository/saved_view_repository.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class VerifyIdentityPage extends StatelessWidget {
|
||||
@@ -19,12 +20,12 @@ class VerifyIdentityPage extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: Theme.of(context).colorScheme.background,
|
||||
title: Text(S.of(context).verifyYourIdentity),
|
||||
title: Text(S.of(context)!.verifyYourIdentity),
|
||||
),
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(S.of(context).useTheConfiguredBiometricFactorToAuthenticate)
|
||||
Text(S.of(context)!.useTheConfiguredBiometricFactorToAuthenticate)
|
||||
.paddedSymmetrically(horizontal: 16),
|
||||
const Icon(
|
||||
Icons.fingerprint,
|
||||
@@ -39,7 +40,7 @@ class VerifyIdentityPage extends StatelessWidget {
|
||||
TextButton(
|
||||
onPressed: () => _logout(context),
|
||||
child: Text(
|
||||
S.of(context).disconnect,
|
||||
S.of(context)!.disconnect,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
@@ -52,7 +53,7 @@ class VerifyIdentityPage extends StatelessWidget {
|
||||
.read<ApplicationSettingsCubit>()
|
||||
.state
|
||||
.isLocalAuthenticationEnabled),
|
||||
child: Text(S.of(context).verifyIdentity),
|
||||
child: Text(S.of(context)!.verifyIdentity),
|
||||
),
|
||||
],
|
||||
).padded(16),
|
||||
|
||||
@@ -14,7 +14,8 @@ import 'package:paperless_mobile/features/inbox/view/widgets/inbox_empty_widget.
|
||||
import 'package:paperless_mobile/features/inbox/view/widgets/inbox_item.dart';
|
||||
import 'package:paperless_mobile/features/paged_document_view/view/document_paging_view_mixin.dart';
|
||||
import 'package:paperless_mobile/features/search_app_bar/view/search_app_bar.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
|
||||
class InboxPage extends StatefulWidget {
|
||||
@@ -52,7 +53,7 @@ class _InboxPageState extends State<InboxPage>
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return FloatingActionButton.extended(
|
||||
label: Text(S.of(context).allSeen),
|
||||
label: Text(S.of(context)!.allSeen),
|
||||
icon: const Icon(Icons.done_all),
|
||||
onPressed: state.hasLoaded && state.documents.isNotEmpty
|
||||
? () => _onMarkAllAsSeen(
|
||||
@@ -128,7 +129,7 @@ class _InboxPageState extends State<InboxPage>
|
||||
controller: pagingScrollController,
|
||||
slivers: [
|
||||
SearchAppBar(
|
||||
hintText: S.of(context).searchDocuments,
|
||||
hintText: S.of(context)!.searchDocuments,
|
||||
onOpenSearch: showDocumentSearchPage,
|
||||
),
|
||||
if (state.documents.isEmpty)
|
||||
@@ -150,7 +151,7 @@ class _InboxPageState extends State<InboxPage>
|
||||
child: HintCard(
|
||||
show: !state.isHintAcknowledged,
|
||||
hintText:
|
||||
S.of(context).swipeLeftToMarkADocumentAsSeen,
|
||||
S.of(context)!.swipeLeftToMarkADocumentAsSeen,
|
||||
onHintAcknowledged: () =>
|
||||
context.read<InboxCubit>().acknowledgeHint(),
|
||||
),
|
||||
@@ -178,7 +179,7 @@ class _InboxPageState extends State<InboxPage>
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
).padded(),
|
||||
Text(
|
||||
S.of(context).markAsSeen,
|
||||
S.of(context)!.markAsSeen,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
@@ -198,19 +199,19 @@ class _InboxPageState extends State<InboxPage>
|
||||
final isActionConfirmed = await showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(S.of(context).markAllAsSeen),
|
||||
title: Text(S.of(context)!.markAllAsSeen),
|
||||
content: Text(
|
||||
S.of(context).areYouSureYouWantToMarkAllDocumentsAsSeen,
|
||||
S.of(context)!.areYouSureYouWantToMarkAllDocumentsAsSeen,
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: Text(S.of(context).cancel),
|
||||
child: Text(S.of(context)!.cancel),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: Text(
|
||||
S.of(context).ok,
|
||||
S.of(context)!.ok,
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.error),
|
||||
),
|
||||
),
|
||||
@@ -228,9 +229,9 @@ class _InboxPageState extends State<InboxPage>
|
||||
final removedTags = await context.read<InboxCubit>().removeFromInbox(doc);
|
||||
showSnackBar(
|
||||
context,
|
||||
S.of(context).removeDocumentFromInbox,
|
||||
S.of(context)!.removeDocumentFromInbox,
|
||||
action: SnackBarActionConfig(
|
||||
label: S.of(context).undo,
|
||||
label: S.of(context)!.undo,
|
||||
onPressed: () => _onUndoMarkAsSeen(doc, removedTags),
|
||||
),
|
||||
);
|
||||
@@ -267,10 +268,10 @@ class _InboxPageState extends State<InboxPage>
|
||||
documents,
|
||||
(doc) {
|
||||
if (doc.added.isToday) {
|
||||
return S.of(context).today;
|
||||
return S.of(context)!.today;
|
||||
}
|
||||
if (doc.added.isYesterday) {
|
||||
return S.of(context).yesterday;
|
||||
return S.of(context)!.yesterday;
|
||||
}
|
||||
return DateFormat.yMMMMd().format(doc.added);
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_mobile/features/inbox/cubit/inbox_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class InboxEmptyWidget extends StatelessWidget {
|
||||
const InboxEmptyWidget({
|
||||
@@ -23,11 +23,11 @@ class InboxEmptyWidget extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(S.of(context).youDoNotHaveUnseenDocuments),
|
||||
Text(S.of(context)!.youDoNotHaveUnseenDocuments),
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
_emptyStateRefreshIndicatorKey.currentState?.show(),
|
||||
child: Text(S.of(context).refresh),
|
||||
child: Text(S.of(context)!.refresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -8,7 +8,8 @@ import 'package:paperless_mobile/features/documents/view/widgets/document_previe
|
||||
import 'package:paperless_mobile/features/inbox/cubit/inbox_cubit.dart';
|
||||
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_widget.dart';
|
||||
import 'package:paperless_mobile/features/labels/view/widgets/label_text.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/routes/document_details_route.dart';
|
||||
|
||||
class InboxItem extends StatefulWidget {
|
||||
@@ -99,7 +100,7 @@ class _InboxItemState extends State<InboxItem> {
|
||||
child: ActionChip(
|
||||
avatar: const Icon(Icons.delete_outline),
|
||||
shape: chipShape,
|
||||
label: Text(S.of(context).deleteDocument),
|
||||
label: Text(S.of(context)!.deleteDocument),
|
||||
onPressed: () async {
|
||||
final shouldDelete = await showDialog<bool>(
|
||||
context: context,
|
||||
@@ -147,7 +148,7 @@ class _InboxItemState extends State<InboxItem> {
|
||||
maxWidth: 50,
|
||||
),
|
||||
child: Text(
|
||||
S.of(context).quickAction,
|
||||
S.of(context)!.quickAction,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 3,
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
@@ -190,9 +191,9 @@ class _InboxItemState extends State<InboxItem> {
|
||||
shape: chipShape,
|
||||
label: hasAsn
|
||||
? Text(
|
||||
'${S.of(context).asn} #${widget.document.archiveSerialNumber}',
|
||||
'${S.of(context)!.asn} #${widget.document.archiveSerialNumber}',
|
||||
)
|
||||
: Text(S.of(context).assignASN),
|
||||
: Text(S.of(context)!.assignAsn),
|
||||
onPressed: !hasAsn
|
||||
? () {
|
||||
setState(() {
|
||||
@@ -352,7 +353,7 @@ class _InboxItemState extends State<InboxItem> {
|
||||
// avatar: const Icon(Icons.calendar_today_outlined),
|
||||
// shape: chipShape,
|
||||
// label: Text(
|
||||
// "${S.of(context).createdAt}: ${DateFormat.yMd().format(e)}",
|
||||
// "${S.of(context)!.createdAt}: ${DateFormat.yMd().format(e)}",
|
||||
// ),
|
||||
// onPressed: () => context
|
||||
// .read<InboxCubit>()
|
||||
|
||||
@@ -2,7 +2,7 @@ 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/core/workarounds/colored_chip.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class StoragePathAutofillFormBuilderField extends StatefulWidget {
|
||||
final String name;
|
||||
@@ -48,7 +48,7 @@ class _StoragePathAutofillFormBuilderFieldState
|
||||
controller: _textEditingController,
|
||||
validator: FormBuilderValidators.required(), //TODO: INTL
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).storagePath),
|
||||
label: Text(S.of(context)!.storagePath),
|
||||
suffixIcon: _showClearIcon
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
@@ -69,65 +69,65 @@ class _StoragePathAutofillFormBuilderFieldState
|
||||
runSpacing: 4.0,
|
||||
children: [
|
||||
InputChip(
|
||||
label: Text(S.of(context).archiveSerialNumber),
|
||||
label: Text(S.of(context)!.archiveSerialNumber),
|
||||
onPressed: () => _addParameterToInput("{asn}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).correspondent),
|
||||
label: Text(S.of(context)!.correspondent),
|
||||
onPressed: () =>
|
||||
_addParameterToInput("{correspondent}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).documentType),
|
||||
label: Text(S.of(context)!.documentType),
|
||||
onPressed: () =>
|
||||
_addParameterToInput("{document_type}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).tags),
|
||||
label: Text(S.of(context)!.tags),
|
||||
onPressed: () => _addParameterToInput("{tag_list}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).title),
|
||||
label: Text(S.of(context)!.title),
|
||||
onPressed: () => _addParameterToInput("{title}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt),
|
||||
label: Text(S.of(context)!.createdAt),
|
||||
onPressed: () => _addParameterToInput("{created}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt +
|
||||
" (${S.of(context).storagePathYear})"),
|
||||
label: Text(S.of(context)!.createdAt +
|
||||
" (${S.of(context)!.storagePathYear})"),
|
||||
onPressed: () =>
|
||||
_addParameterToInput("{created_year}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt +
|
||||
" (${S.of(context).storagePathMonth})"),
|
||||
label: Text(S.of(context)!.createdAt +
|
||||
" (${S.of(context)!.storagePathMonth})"),
|
||||
onPressed: () =>
|
||||
_addParameterToInput("{created_month}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt +
|
||||
" (${S.of(context).storagePathDay})"),
|
||||
label: Text(S.of(context)!.createdAt +
|
||||
" (${S.of(context)!.storagePathDay})"),
|
||||
onPressed: () => _addParameterToInput("{created_day}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt),
|
||||
label: Text(S.of(context)!.createdAt),
|
||||
onPressed: () => _addParameterToInput("{added}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt +
|
||||
" (${S.of(context).storagePathYear})"),
|
||||
label: Text(S.of(context)!.createdAt +
|
||||
" (${S.of(context)!.storagePathYear})"),
|
||||
onPressed: () => _addParameterToInput("{added_year}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt +
|
||||
" (${S.of(context).storagePathMonth})"),
|
||||
label: Text(S.of(context)!.createdAt +
|
||||
" (${S.of(context)!.storagePathMonth})"),
|
||||
onPressed: () => _addParameterToInput("{added_month}", field),
|
||||
),
|
||||
InputChip(
|
||||
label: Text(S.of(context).createdAt +
|
||||
" (${S.of(context).storagePathDay})"),
|
||||
label: Text(S.of(context)!.createdAt +
|
||||
" (${S.of(context)!.storagePathDay})"),
|
||||
onPressed: () => _addParameterToInput("{added_day}", field),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:paperless_mobile/core/repository/state/impl/tag_repository_state
|
||||
import 'package:paperless_mobile/core/workarounds/colored_chip.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/edit_label/view/impl/add_tag_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class TagFormField extends StatefulWidget {
|
||||
final TagsQuery? initialValue;
|
||||
@@ -94,8 +94,8 @@ class _TagFormFieldState extends State<TagFormField> {
|
||||
Icons.label_outline,
|
||||
),
|
||||
suffixIcon: _buildSuffixIcon(context, field),
|
||||
labelText: S.of(context).tags,
|
||||
hintText: S.of(context).filterTags,
|
||||
labelText: S.of(context)!.tags,
|
||||
hintText: S.of(context)!.filterTags,
|
||||
),
|
||||
controller: _textEditingController,
|
||||
),
|
||||
@@ -138,10 +138,10 @@ class _TagFormFieldState extends State<TagFormField> {
|
||||
late String? title;
|
||||
switch (data) {
|
||||
case _onlyNotAssignedId:
|
||||
title = S.of(context).notAssigned;
|
||||
title = S.of(context)!.notAssigned;
|
||||
break;
|
||||
case _anyAssignedId:
|
||||
title = S.of(context).anyAssigned;
|
||||
title = S.of(context)!.anyAssigned;
|
||||
break;
|
||||
default:
|
||||
title = widget.selectableOptions[data]?.name;
|
||||
@@ -270,7 +270,7 @@ class _TagFormFieldState extends State<TagFormField> {
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
side: BorderSide.none,
|
||||
label: Text(
|
||||
S.of(context).notAssigned,
|
||||
S.of(context)!.notAssigned,
|
||||
),
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.onSurface.withOpacity(0.12),
|
||||
@@ -323,7 +323,7 @@ class _TagFormFieldState extends State<TagFormField> {
|
||||
padding: const EdgeInsets.all(4),
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
side: BorderSide.none,
|
||||
label: Text(S.of(context).anyAssigned),
|
||||
label: Text(S.of(context)!.anyAssigned),
|
||||
backgroundColor:
|
||||
Theme.of(context).colorScheme.onSurfaceVariant.withOpacity(0.12),
|
||||
onDeleted: () => field.didChange(const IdsTagsQuery()),
|
||||
|
||||
@@ -18,7 +18,7 @@ import 'package:paperless_mobile/features/edit_label/view/impl/edit_tag_page.dar
|
||||
import 'package:paperless_mobile/features/labels/cubit/label_cubit.dart';
|
||||
import 'package:paperless_mobile/features/labels/view/widgets/label_tab_view.dart';
|
||||
import 'package:paperless_mobile/features/search_app_bar/view/search_app_bar.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class LabelsPage extends StatefulWidget {
|
||||
const LabelsPage({Key? key}) : super(key: key);
|
||||
@@ -72,7 +72,7 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
context,
|
||||
),
|
||||
sliver: SearchAppBar(
|
||||
hintText: S.of(context).searchDocuments,
|
||||
hintText: S.of(context)!.searchDocuments,
|
||||
onOpenSearch: showDocumentSearchPage,
|
||||
bottom: TabBar(
|
||||
controller: _tabController,
|
||||
@@ -161,9 +161,9 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
),
|
||||
onEdit: _openEditCorrespondentPage,
|
||||
emptyStateActionButtonLabel:
|
||||
S.of(context).addNewCorrespondent,
|
||||
S.of(context)!.addNewCorrespondent,
|
||||
emptyStateDescription:
|
||||
S.of(context).noCorrespondentsSetUp,
|
||||
S.of(context)!.noCorrespondentsSetUp,
|
||||
onAddNew: _openAddCorrespondentPage,
|
||||
),
|
||||
],
|
||||
@@ -186,9 +186,9 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
),
|
||||
onEdit: _openEditDocumentTypePage,
|
||||
emptyStateActionButtonLabel:
|
||||
S.of(context).addNewDocumentType,
|
||||
S.of(context)!.addNewDocumentType,
|
||||
emptyStateDescription:
|
||||
S.of(context).noDocumentTypesSetUp,
|
||||
S.of(context)!.noDocumentTypesSetUp,
|
||||
onAddNew: _openAddDocumentTypePage,
|
||||
),
|
||||
],
|
||||
@@ -219,9 +219,9 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
: null,
|
||||
),
|
||||
emptyStateActionButtonLabel:
|
||||
S.of(context).addNewTag,
|
||||
S.of(context)!.addNewTag,
|
||||
emptyStateDescription:
|
||||
S.of(context).noTagsSetUp,
|
||||
S.of(context)!.noTagsSetUp,
|
||||
onAddNew: _openAddTagPage,
|
||||
),
|
||||
],
|
||||
@@ -245,9 +245,9 @@ class _LabelsPageState extends State<LabelsPage>
|
||||
),
|
||||
contentBuilder: (path) => Text(path.path),
|
||||
emptyStateActionButtonLabel:
|
||||
S.of(context).addNewStoragePath,
|
||||
S.of(context)!.addNewStoragePath,
|
||||
emptyStateDescription:
|
||||
S.of(context).noStoragePathsSetUp,
|
||||
S.of(context)!.noStoragePathsSetUp,
|
||||
onAddNew: _openAddStoragePathPage,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:flutter_typeahead/flutter_typeahead.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/core/widgets/form_builder_fields/form_builder_type_ahead.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
///
|
||||
/// Form field allowing to select labels (i.e. correspondent, documentType)
|
||||
@@ -79,7 +79,7 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
|
||||
noItemsFoundBuilder: (context) => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Text(
|
||||
S.of(context).noItemsFound,
|
||||
S.of(context)!.noItemsFound,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).disabledColor, fontSize: 18.0),
|
||||
@@ -97,7 +97,8 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
|
||||
),
|
||||
itemBuilder: (context, suggestion) => ListTile(
|
||||
title: Text(
|
||||
widget.labelOptions[suggestion.id]?.name ?? S.of(context).notAssigned,
|
||||
widget.labelOptions[suggestion.id]?.name ??
|
||||
S.of(context)!.notAssigned,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -141,7 +142,7 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
|
||||
),
|
||||
selectionToTextTransformer: (suggestion) {
|
||||
if (suggestion == const IdQueryParameter.notAssigned()) {
|
||||
return S.of(context).notAssigned;
|
||||
return S.of(context)!.notAssigned;
|
||||
}
|
||||
return widget.labelOptions[suggestion.id]?.name ?? "";
|
||||
},
|
||||
@@ -194,11 +195,11 @@ class _LabelFormFieldState<T extends Label> extends State<LabelFormField<T>> {
|
||||
|
||||
String _getLocalizedHint(BuildContext context) {
|
||||
if (T == Correspondent) {
|
||||
return S.of(context).startTyping;
|
||||
return S.of(context)!.startTyping;
|
||||
} else if (T == DocumentType) {
|
||||
return S.of(context).startTyping;
|
||||
return S.of(context)!.startTyping;
|
||||
} else {
|
||||
return S.of(context).filterTags;
|
||||
return S.of(context)!.filterTags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@ import 'package:paperless_mobile/features/documents/view/widgets/adaptive_docume
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/selection/view_type_selection_widget.dart';
|
||||
import 'package:paperless_mobile/features/linked_documents/cubit/linked_documents_cubit.dart';
|
||||
import 'package:paperless_mobile/features/paged_document_view/view/document_paging_view_mixin.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/routes/document_details_route.dart';
|
||||
|
||||
class LinkedDocumentsPage extends StatefulWidget {
|
||||
@@ -24,7 +25,7 @@ class _LinkedDocumentsPageState extends State<LinkedDocumentsPage>
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).linkedDocuments),
|
||||
title: Text(S.of(context)!.linkedDocuments),
|
||||
actions: [
|
||||
BlocBuilder<LinkedDocumentsCubit, LinkedDocumentsState>(
|
||||
builder: (context, state) {
|
||||
|
||||
@@ -5,7 +5,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/login/model/client_certificate.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/constants.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
@@ -40,7 +41,7 @@ class _ClientCertificateFormFieldState
|
||||
}
|
||||
assert(_selectedFile != null);
|
||||
if (_selectedFile?.path.split(".").last != 'pfx') {
|
||||
return S.of(context).invalidCertificateFormat;
|
||||
return S.of(context)!.invalidCertificateFormat;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@@ -50,8 +51,8 @@ class _ClientCertificateFormFieldState
|
||||
return Theme(
|
||||
data: theme,
|
||||
child: ExpansionTile(
|
||||
title: Text(S.of(context).clientcertificate),
|
||||
subtitle: Text(S.of(context).configureMutualTLSAuthentication),
|
||||
title: Text(S.of(context)!.clientcertificate),
|
||||
subtitle: Text(S.of(context)!.configureMutualTLSAuthentication),
|
||||
children: [
|
||||
InputDecorator(
|
||||
decoration: InputDecoration(
|
||||
@@ -67,7 +68,7 @@ class _ClientCertificateFormFieldState
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: () => _onSelectFile(field),
|
||||
child: Text(S.of(context).select),
|
||||
child: Text(S.of(context)!.select),
|
||||
),
|
||||
_buildSelectedFileText(field).paddedOnly(left: 8),
|
||||
],
|
||||
@@ -85,7 +86,7 @@ class _ClientCertificateFormFieldState
|
||||
// ListTile(
|
||||
// leading: ElevatedButton(
|
||||
// onPressed: () => _onSelectFile(field),
|
||||
// child: Text(S.of(context).select),
|
||||
// child: Text(S.of(context)!.select),
|
||||
// ),
|
||||
// title: _buildSelectedFileText(field),
|
||||
// trailing: AbsorbPointer(
|
||||
@@ -108,7 +109,7 @@ class _ClientCertificateFormFieldState
|
||||
onChanged: (value) => field.didChange(
|
||||
field.value?.copyWith(passphrase: value),
|
||||
),
|
||||
label: S.of(context).passphrase,
|
||||
label: S.of(context)!.passphrase,
|
||||
).padded(),
|
||||
] else
|
||||
...[]
|
||||
@@ -143,7 +144,7 @@ class _ClientCertificateFormFieldState
|
||||
if (field.value == null) {
|
||||
assert(_selectedFile == null);
|
||||
return Text(
|
||||
S.of(context).selectFile,
|
||||
S.of(context)!.selectFile,
|
||||
style: Theme.of(context).textTheme.labelMedium?.apply(
|
||||
color: Theme.of(context).hintColor,
|
||||
),
|
||||
|
||||
@@ -3,7 +3,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.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class ServerAddressFormField extends StatefulWidget {
|
||||
static const String fkServerAddress = "serverAddress";
|
||||
@@ -44,16 +44,16 @@ class _ServerAddressFormFieldState extends State<ServerAddressFormField> {
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
validator: FormBuilderValidators.compose([
|
||||
FormBuilderValidators.required(
|
||||
errorText: S.of(context).serverAddressMustNotBeEmpty,
|
||||
errorText: S.of(context)!.serverAddressMustNotBeEmpty,
|
||||
),
|
||||
FormBuilderValidators.match(
|
||||
r"https?://.*",
|
||||
errorText: S.of(context).serverAddressMustIncludeAScheme,
|
||||
errorText: S.of(context)!.serverAddressMustIncludeAScheme,
|
||||
)
|
||||
]),
|
||||
decoration: InputDecoration(
|
||||
hintText: "http://192.168.1.50:8000",
|
||||
labelText: S.of(context).serverAddress,
|
||||
labelText: S.of(context)!.serverAddress,
|
||||
suffixIcon: _canClear
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
|
||||
@@ -4,7 +4,7 @@ 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';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class UserCredentialsFormField extends StatefulWidget {
|
||||
static const fkCredentials = 'credentials';
|
||||
@@ -37,22 +37,22 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
|
||||
UserCredentials(username: username),
|
||||
),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).usernameMustNotBeEmpty,
|
||||
errorText: S.of(context)!.usernameMustNotBeEmpty,
|
||||
),
|
||||
autofillHints: const [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).username),
|
||||
label: Text(S.of(context)!.username),
|
||||
),
|
||||
),
|
||||
ObscuredInputTextFormField(
|
||||
key: const ValueKey('login-password'),
|
||||
label: S.of(context).password,
|
||||
label: S.of(context)!.password,
|
||||
onChanged: (password) => field.didChange(
|
||||
field.value?.copyWith(password: password) ??
|
||||
UserCredentials(password: password),
|
||||
),
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).passwordMustNotBeEmpty,
|
||||
errorText: S.of(context)!.passwordMustNotBeEmpty,
|
||||
),
|
||||
),
|
||||
].map((child) => child.padded()).toList(),
|
||||
@@ -73,11 +73,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
|
||||
FocusScope.of(context).requestFocus(_focusNodes[fkPassword]);
|
||||
},
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).usernameMustNotBeEmpty,
|
||||
errorText: S.of(context)!.usernameMustNotBeEmpty,
|
||||
),
|
||||
autofillHints: const [AutofillHints.username],
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).username,
|
||||
labelText: S.of(context)!.username,
|
||||
),
|
||||
).padded(),
|
||||
FormBuilderTextField(
|
||||
@@ -88,11 +88,11 @@ class _UserCredentialsFormFieldState extends State<UserCredentialsFormField> {
|
||||
},
|
||||
autofillHints: const [AutofillHints.password],
|
||||
validator: FormBuilderValidators.required(
|
||||
errorText: S.of(context).passwordMustNotBeEmpty,
|
||||
errorText: S.of(context)!.passwordMustNotBeEmpty,
|
||||
),
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: S.of(context).password,
|
||||
labelText: S.of(context)!.password,
|
||||
),
|
||||
).padded(),
|
||||
],
|
||||
|
||||
@@ -6,7 +6,8 @@ import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/login/model/reachability_status.dart';
|
||||
import 'package:paperless_mobile/features/login/view/widgets/form_fields/client_certificate_form_field.dart';
|
||||
import 'package:paperless_mobile/features/login/view/widgets/form_fields/server_address_form_field.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ServerConnectionPage extends StatefulWidget {
|
||||
@@ -32,7 +33,7 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: kToolbarHeight - 4,
|
||||
title: Text(S.of(context).connectToPaperless),
|
||||
title: Text(S.of(context)!.connectToPaperless),
|
||||
bottom: PreferredSize(
|
||||
child: _isCheckingConnection
|
||||
? const LinearProgressIndicator()
|
||||
@@ -65,7 +66,7 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
|
||||
onPressed: _updateReachability,
|
||||
),
|
||||
FilledButton(
|
||||
child: Text(S.of(context).continueLabel),
|
||||
child: Text(S.of(context)!.continueLabel),
|
||||
onPressed: _reachabilityStatus == ReachabilityStatus.reachable
|
||||
? widget.onContinue
|
||||
: null,
|
||||
@@ -108,37 +109,37 @@ class _ServerConnectionPageState extends State<ServerConnectionPage> {
|
||||
case ReachabilityStatus.reachable:
|
||||
return _buildIconText(
|
||||
Icons.done,
|
||||
S.of(context).connectionSuccessfulylEstablished,
|
||||
S.of(context)!.connectionSuccessfulylEstablished,
|
||||
Colors.green,
|
||||
);
|
||||
case ReachabilityStatus.notReachable:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).couldNotEstablishConnectionToTheServer,
|
||||
S.of(context)!.couldNotEstablishConnectionToTheServer,
|
||||
errorColor,
|
||||
);
|
||||
case ReachabilityStatus.unknownHost:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).hostCouldNotBeResolved,
|
||||
S.of(context)!.hostCouldNotBeResolved,
|
||||
errorColor,
|
||||
);
|
||||
case ReachabilityStatus.missingClientCertificate:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).loginPageReachabilityMissingClientCertificateText,
|
||||
S.of(context)!.loginPageReachabilityMissingClientCertificateText,
|
||||
errorColor,
|
||||
);
|
||||
case ReachabilityStatus.invalidClientCertificateConfiguration:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).incorrectOrMissingCertificatePassphrase,
|
||||
S.of(context)!.incorrectOrMissingCertificatePassphrase,
|
||||
errorColor,
|
||||
);
|
||||
case ReachabilityStatus.connectionTimeout:
|
||||
return _buildIconText(
|
||||
Icons.close,
|
||||
S.of(context).connectionTimedOut,
|
||||
S.of(context)!.connectionTimedOut,
|
||||
errorColor,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:flutter_form_builder/flutter_form_builder.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/login/view/widgets/form_fields/server_address_form_field.dart';
|
||||
import 'package:paperless_mobile/features/login/view/widgets/form_fields/user_credentials_form_field.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class ServerLoginPage extends StatefulWidget {
|
||||
final Future<void> Function() onDone;
|
||||
@@ -29,7 +29,7 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
|
||||
'';
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).loginPageSignInTitle),
|
||||
title: Text(S.of(context)!.loginPageSignInTitle),
|
||||
bottom: _isLoginLoading
|
||||
? const PreferredSize(
|
||||
preferredSize: Size.fromHeight(4.0),
|
||||
@@ -39,7 +39,7 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
Text(S.of(context).signInToServer(serverAddress)).padded(),
|
||||
Text(S.of(context)!.signInToServer(serverAddress)).padded(),
|
||||
const UserCredentialsFormField(),
|
||||
],
|
||||
),
|
||||
@@ -53,7 +53,7 @@ class _ServerLoginPageState extends State<ServerLoginPage> {
|
||||
await widget.onDone();
|
||||
setState(() => _isLoginLoading = false);
|
||||
},
|
||||
child: Text(S.of(context).signIn),
|
||||
child: Text(S.of(context)!.signIn),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:form_builder_validators/form_builder_validators.dart';
|
||||
import 'package:paperless_api/paperless_api.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/documents/view/widgets/search/document_filter_form.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class AddSavedViewPage extends StatefulWidget {
|
||||
final DocumentFilter currentFilter;
|
||||
@@ -25,12 +25,12 @@ class _AddSavedViewPageState extends State<AddSavedViewPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).newView),
|
||||
title: Text(S.of(context)!.newView),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
icon: const Icon(Icons.add),
|
||||
onPressed: () => _onCreate(context),
|
||||
label: Text(S.of(context).create),
|
||||
label: Text(S.of(context)!.create),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
@@ -46,18 +46,18 @@ class _AddSavedViewPageState extends State<AddSavedViewPage> {
|
||||
name: _AddSavedViewPageState.fkName,
|
||||
validator: FormBuilderValidators.required(),
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).name),
|
||||
label: Text(S.of(context)!.name),
|
||||
),
|
||||
),
|
||||
FormBuilderCheckbox(
|
||||
name: _AddSavedViewPageState.fkShowOnDashboard,
|
||||
initialValue: false,
|
||||
title: Text(S.of(context).showOnDashboard),
|
||||
title: Text(S.of(context)!.showOnDashboard),
|
||||
),
|
||||
FormBuilderCheckbox(
|
||||
name: _AddSavedViewPageState.fkShowInSidebar,
|
||||
initialValue: false,
|
||||
title: Text(S.of(context).showInSidebar),
|
||||
title: Text(S.of(context)!.showInSidebar),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -94,18 +94,18 @@ class _AddSavedViewPageState extends State<AddSavedViewPage> {
|
||||
name: fkName,
|
||||
validator: FormBuilderValidators.required(),
|
||||
decoration: InputDecoration(
|
||||
label: Text(S.of(context).name),
|
||||
label: Text(S.of(context)!.name),
|
||||
),
|
||||
),
|
||||
FormBuilderCheckbox(
|
||||
name: fkShowOnDashboard,
|
||||
initialValue: false,
|
||||
title: Text(S.of(context).showOnDashboard),
|
||||
title: Text(S.of(context)!.showOnDashboard),
|
||||
),
|
||||
FormBuilderCheckbox(
|
||||
name: fkShowInSidebar,
|
||||
initialValue: false,
|
||||
title: Text(S.of(context).showInSidebar),
|
||||
title: Text(S.of(context)!.showInSidebar),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:paperless_mobile/core/widgets/hint_card.dart';
|
||||
import 'package:paperless_mobile/features/saved_view/cubit/saved_view_cubit.dart';
|
||||
import 'package:paperless_mobile/features/saved_view_details/cubit/saved_view_details_cubit.dart';
|
||||
import 'package:paperless_mobile/features/saved_view_details/view/saved_view_details_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class SavedViewList extends StatelessWidget {
|
||||
const SavedViewList({super.key});
|
||||
@@ -21,7 +21,7 @@ class SavedViewList extends StatelessWidget {
|
||||
return SliverToBoxAdapter(
|
||||
child: HintCard(
|
||||
hintText:
|
||||
S.of(context).createViewsToQuicklyFilterYourDocuments,
|
||||
S.of(context)!.createViewsToQuicklyFilterYourDocuments,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class SavedViewList extends StatelessWidget {
|
||||
enabled: connectivity.isConnected,
|
||||
title: Text(view.name),
|
||||
subtitle: Text(
|
||||
S.of(context).nFiltersSet(view.filterRules.length),
|
||||
S.of(context)!.nFiltersSet(view.filterRules.length),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:hydrated_bloc/hydrated_bloc.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:paperless_mobile/features/login/services/authentication_service.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/color_scheme_option.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
part 'application_settings_cubit.g.dart';
|
||||
part 'application_settings_state.dart';
|
||||
|
||||
@@ -44,7 +44,7 @@ class ApplicationSettingsState {
|
||||
|
||||
static String get _defaultPreferredLocaleSubtag {
|
||||
String preferredLocale = Platform.localeName.split("_").first;
|
||||
if (!S.delegate.supportedLocales
|
||||
if (!S.supportedLocales
|
||||
.any((locale) => locale.languageCode == preferredLocale)) {
|
||||
preferredLocale = 'en';
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ import 'package:paperless_mobile/core/widgets/hint_card.dart';
|
||||
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
|
||||
import 'package:paperless_mobile/features/login/cubit/authentication_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/helpers/message_helpers.dart';
|
||||
|
||||
class AccountSettingsDialog extends StatelessWidget {
|
||||
@@ -24,7 +25,7 @@ class AccountSettingsDialog extends StatelessWidget {
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(S.of(context).account),
|
||||
Text(S.of(context)!.account),
|
||||
const CloseButton(),
|
||||
],
|
||||
),
|
||||
@@ -49,7 +50,7 @@ class AccountSettingsDialog extends StatelessWidget {
|
||||
ListTile(
|
||||
dense: true,
|
||||
leading: const Icon(Icons.person_add_rounded),
|
||||
title: Text(S.of(context).addAnotherAccount),
|
||||
title: Text(S.of(context)!.addAnotherAccount),
|
||||
onTap: () {},
|
||||
),
|
||||
const Divider(),
|
||||
@@ -60,7 +61,7 @@ class AccountSettingsDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
S.of(context).disconnect,
|
||||
S.of(context)!.disconnect,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onError,
|
||||
),
|
||||
|
||||
@@ -5,7 +5,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/color_scheme_option_setting.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/language_selection_setting.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/theme_mode_setting.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
import 'package:paperless_mobile/constants.dart';
|
||||
|
||||
class ApplicationSettingsPage extends StatelessWidget {
|
||||
@@ -15,7 +16,7 @@ class ApplicationSettingsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).applicationSettings),
|
||||
title: Text(S.of(context)!.applicationSettings),
|
||||
),
|
||||
body: ListView(
|
||||
children: const [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/biometric_authentication_setting.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class SecuritySettingsPage extends StatelessWidget {
|
||||
const SecuritySettingsPage({super.key});
|
||||
@@ -8,7 +8,7 @@ class SecuritySettingsPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(S.of(context).security)),
|
||||
appBar: AppBar(title: Text(S.of(context)!.security)),
|
||||
body: ListView(
|
||||
children: const [
|
||||
BiometricAuthenticationSetting(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/clear_storage_settings.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class StorageSettingsPage extends StatelessWidget {
|
||||
const StorageSettingsPage({super.key});
|
||||
@@ -9,7 +9,7 @@ class StorageSettingsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).storage),
|
||||
title: Text(S.of(context)!.storage),
|
||||
),
|
||||
body: ListView(
|
||||
children: const [
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:paperless_mobile/core/bloc/paperless_server_information_state.da
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/pages/application_settings_page.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/pages/security_settings_page.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class SettingsPage extends StatelessWidget {
|
||||
const SettingsPage({super.key});
|
||||
@@ -14,7 +14,7 @@ class SettingsPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(S.of(context).settings),
|
||||
title: Text(S.of(context)!.settings),
|
||||
),
|
||||
bottomNavigationBar: BlocBuilder<PaperlessServerInformationCubit,
|
||||
PaperlessServerInformationState>(
|
||||
@@ -22,13 +22,13 @@ class SettingsPage extends StatelessWidget {
|
||||
final info = state.information!;
|
||||
return ListTile(
|
||||
title: Text(
|
||||
S.of(context).loggedInAs(info.username ?? 'unknown') +
|
||||
S.of(context)!.loggedInAs(info.username ?? 'unknown') +
|
||||
"@${info.host}",
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
subtitle: Text(
|
||||
S.of(context).paperlessServerVersion +
|
||||
S.of(context)!.paperlessServerVersion +
|
||||
' ' +
|
||||
info.version.toString() +
|
||||
' (API v${info.apiVersion})',
|
||||
@@ -42,21 +42,21 @@ class SettingsPage extends StatelessWidget {
|
||||
children: [
|
||||
ListTile(
|
||||
// leading: const Icon(Icons.style_outlined),
|
||||
title: Text(S.of(context).applicationSettings),
|
||||
subtitle: Text(S.of(context).languageAndVisualAppearance),
|
||||
title: Text(S.of(context)!.applicationSettings),
|
||||
subtitle: Text(S.of(context)!.languageAndVisualAppearance),
|
||||
onTap: () => _goto(const ApplicationSettingsPage(), context),
|
||||
),
|
||||
ListTile(
|
||||
// leading: const Icon(Icons.security_outlined),
|
||||
title: Text(S.of(context).security),
|
||||
subtitle: Text(S.of(context).biometricAuthentication),
|
||||
title: Text(S.of(context)!.security),
|
||||
subtitle: Text(S.of(context)!.biometricAuthentication),
|
||||
onTap: () => _goto(const SecuritySettingsPage(), context),
|
||||
),
|
||||
// ListTile(
|
||||
// // leading: const Icon(Icons.storage_outlined),
|
||||
// title: Text(S.of(context).storage),
|
||||
// title: Text(S.of(context)!.storage),
|
||||
// subtitle:
|
||||
// Text(S.of(context).mangeFilesAndStorageSpace),
|
||||
// Text(S.of(context)!.mangeFilesAndStorageSpace),
|
||||
// onTap: () => _goto(const StorageSettingsPage(), context),
|
||||
// ),
|
||||
],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class BiometricAuthenticationSetting extends StatelessWidget {
|
||||
const BiometricAuthenticationSetting({super.key});
|
||||
@@ -12,11 +12,11 @@ class BiometricAuthenticationSetting extends StatelessWidget {
|
||||
builder: (context, settings) {
|
||||
return SwitchListTile(
|
||||
value: settings.isLocalAuthenticationEnabled,
|
||||
title: Text(S.of(context).biometricAuthentication),
|
||||
subtitle: Text(S.of(context).authenticateOnAppStart),
|
||||
title: Text(S.of(context)!.biometricAuthentication),
|
||||
subtitle: Text(S.of(context)!.authenticateOnAppStart),
|
||||
onChanged: (val) async {
|
||||
final String localizedReason =
|
||||
S.of(context).authenticateToToggleBiometricAuthentication(
|
||||
S.of(context)!.authenticateToToggleBiometricAuthentication(
|
||||
val ? 'enable' : 'disable',
|
||||
);
|
||||
await context
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:paperless_mobile/core/widgets/hint_card.dart';
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/model/color_scheme_option.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/radio_settings_dialog.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class ColorSchemeOptionSetting extends StatelessWidget {
|
||||
const ColorSchemeOptionSetting({super.key});
|
||||
@@ -18,7 +18,7 @@ class ColorSchemeOptionSetting extends StatelessWidget {
|
||||
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
|
||||
builder: (context, settings) {
|
||||
return ListTile(
|
||||
title: Text(S.of(context).colors),
|
||||
title: Text(S.of(context)!.colors),
|
||||
subtitle: Text(
|
||||
translateColorSchemeOption(
|
||||
context,
|
||||
@@ -28,8 +28,8 @@ class ColorSchemeOptionSetting extends StatelessWidget {
|
||||
onTap: () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => RadioSettingsDialog<ColorSchemeOption>(
|
||||
titleText: S.of(context).colors,
|
||||
descriptionText: S.of(context).colorSchemeHint,
|
||||
titleText: S.of(context)!.colors,
|
||||
descriptionText: S.of(context)!.colorSchemeHint,
|
||||
options: [
|
||||
RadioOption(
|
||||
value: ColorSchemeOption.classic,
|
||||
@@ -46,7 +46,7 @@ class ColorSchemeOptionSetting extends StatelessWidget {
|
||||
],
|
||||
footer: _isBelowAndroid12()
|
||||
? HintCard(
|
||||
hintText: S.of(context).colorSchemeNotSupportedWarning,
|
||||
hintText: S.of(context)!.colorSchemeNotSupportedWarning,
|
||||
hintIcon: Icons.warning_amber,
|
||||
)
|
||||
: null,
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/radio_settings_dialog.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class LanguageSelectionSetting extends StatefulWidget {
|
||||
const LanguageSelectionSetting({super.key});
|
||||
@@ -25,7 +25,7 @@ class _LanguageSelectionSettingState extends State<LanguageSelectionSetting> {
|
||||
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
|
||||
builder: (context, settings) {
|
||||
return ListTile(
|
||||
title: Text(S.of(context).language),
|
||||
title: Text(S.of(context)!.language),
|
||||
subtitle: Text(_languageOptions[settings.preferredLocaleSubtag]!),
|
||||
onTap: () => showDialog<String>(
|
||||
context: context,
|
||||
@@ -33,7 +33,7 @@ class _LanguageSelectionSettingState extends State<LanguageSelectionSetting> {
|
||||
footer: const Text(
|
||||
"* Work in progress, not fully translated yet. Some words may be displayed in English!",
|
||||
),
|
||||
titleText: S.of(context).language,
|
||||
titleText: S.of(context)!.language,
|
||||
options: [
|
||||
RadioOption(
|
||||
value: 'en',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class RadioSettingsDialog<T> extends StatefulWidget {
|
||||
final List<RadioOption<T>> options;
|
||||
@@ -41,11 +41,11 @@ class _RadioSettingsDialogState<T> extends State<RadioSettingsDialog<T>> {
|
||||
widget.confirmButton ??
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(S.of(context).cancel)),
|
||||
child: Text(S.of(context)!.cancel)),
|
||||
widget.confirmButton ??
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, _groupValue),
|
||||
child: Text(S.of(context).ok)),
|
||||
child: Text(S.of(context)!.ok)),
|
||||
],
|
||||
title: widget.titleText != null ? Text(widget.titleText!) : null,
|
||||
content: Column(
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:paperless_mobile/features/settings/cubit/application_settings_cubit.dart';
|
||||
import 'package:paperless_mobile/features/settings/view/widgets/radio_settings_dialog.dart';
|
||||
import 'package:paperless_mobile/generated/l10n.dart';
|
||||
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
|
||||
|
||||
class ThemeModeSetting extends StatelessWidget {
|
||||
const ThemeModeSetting({super.key});
|
||||
@@ -12,13 +12,13 @@ class ThemeModeSetting extends StatelessWidget {
|
||||
return BlocBuilder<ApplicationSettingsCubit, ApplicationSettingsState>(
|
||||
builder: (context, settings) {
|
||||
return ListTile(
|
||||
title: Text(S.of(context).appearance),
|
||||
title: Text(S.of(context)!.appearance),
|
||||
subtitle: Text(_mapThemeModeToLocalizedString(
|
||||
settings.preferredThemeMode, context)),
|
||||
onTap: () => showDialog<ThemeMode>(
|
||||
context: context,
|
||||
builder: (_) => RadioSettingsDialog<ThemeMode>(
|
||||
titleText: S.of(context).appearance,
|
||||
titleText: S.of(context)!.appearance,
|
||||
initialValue: context
|
||||
.read<ApplicationSettingsCubit>()
|
||||
.state
|
||||
@@ -26,15 +26,15 @@ class ThemeModeSetting extends StatelessWidget {
|
||||
options: [
|
||||
RadioOption(
|
||||
value: ThemeMode.system,
|
||||
label: S.of(context).systemTheme,
|
||||
label: S.of(context)!.systemTheme,
|
||||
),
|
||||
RadioOption(
|
||||
value: ThemeMode.light,
|
||||
label: S.of(context).lightTheme,
|
||||
label: S.of(context)!.lightTheme,
|
||||
),
|
||||
RadioOption(
|
||||
value: ThemeMode.dark,
|
||||
label: S.of(context).darkTheme,
|
||||
label: S.of(context)!.darkTheme,
|
||||
)
|
||||
],
|
||||
),
|
||||
@@ -51,11 +51,11 @@ class ThemeModeSetting extends StatelessWidget {
|
||||
String _mapThemeModeToLocalizedString(ThemeMode theme, BuildContext context) {
|
||||
switch (theme) {
|
||||
case ThemeMode.system:
|
||||
return S.of(context).system;
|
||||
return S.of(context)!.system;
|
||||
case ThemeMode.light:
|
||||
return S.of(context).light;
|
||||
return S.of(context)!.light;
|
||||
case ThemeMode.dark:
|
||||
return S.of(context).dark;
|
||||
return S.of(context)!.dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user