Added search bar on all pages

This commit is contained in:
Anton Stubenbord
2023-02-01 00:27:56 +01:00
parent e9e9fdc336
commit 748cd21713
35 changed files with 1122 additions and 653 deletions

View File

@@ -26,16 +26,6 @@ class SettingsPage extends StatelessWidget {
return Scaffold(
appBar: AppBar(
title: Text(S.of(context).appDrawerSettingsLabel),
actions: [
IconButton(
icon: const Icon(Icons.logout),
color: Theme.of(context).colorScheme.error,
onPressed: () async {
await _onLogout(context);
Navigator.pop(context);
},
),
],
),
bottomNavigationBar: BlocBuilder<PaperlessServerInformationCubit,
PaperlessServerInformationState>(
@@ -48,14 +38,16 @@ class SettingsPage extends StatelessWidget {
" " +
(info.username ?? 'unknown') +
"@${info.host}",
style: Theme.of(context).textTheme.bodySmall,
style: Theme.of(context).textTheme.labelSmall,
textAlign: TextAlign.center,
),
subtitle: Text(
S.of(context).serverInformationPaperlessVersionText +
' ' +
info.version.toString() +
' (API v${info.apiVersion})',
style: Theme.of(context).textTheme.bodySmall,
style: Theme.of(context).textTheme.labelSmall,
textAlign: TextAlign.center,
),
);
},
@@ -100,25 +92,4 @@ class SettingsPage extends StatelessWidget {
),
);
}
Future<void> _onLogout(BuildContext context) async {
try {
await context.read<AuthenticationCubit>().logout();
await context.read<ApplicationSettingsCubit>().clear();
await context.read<LabelRepository<Tag, TagRepositoryState>>().clear();
await context
.read<LabelRepository<Correspondent, CorrespondentRepositoryState>>()
.clear();
await context
.read<LabelRepository<DocumentType, DocumentTypeRepositoryState>>()
.clear();
await context
.read<LabelRepository<StoragePath, StoragePathRepositoryState>>()
.clear();
await context.read<SavedViewRepository>().clear();
await HydratedBloc.storage.clear();
} on PaperlessServerException catch (error, stackTrace) {
showErrorMessage(context, error, stackTrace);
}
}
}