Finished inbox, fixed reverse sort order, bloc refactorings

This commit is contained in:
Anton Stubenbord
2022-11-30 01:24:28 +01:00
parent 50190f035e
commit b1db2a1209
27 changed files with 1144 additions and 632 deletions

View File

@@ -0,0 +1,36 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:paperless_mobile/features/inbox/bloc/inbox_cubit.dart';
class InboxEmptyWidget extends StatelessWidget {
const InboxEmptyWidget({
Key? key,
required GlobalKey<RefreshIndicatorState> emptyStateRefreshIndicatorKey,
}) : _emptyStateRefreshIndicatorKey = emptyStateRefreshIndicatorKey,
super(key: key);
final GlobalKey<RefreshIndicatorState> _emptyStateRefreshIndicatorKey;
@override
Widget build(BuildContext context) {
return RefreshIndicator(
key: _emptyStateRefreshIndicatorKey,
onRefresh: () => BlocProvider.of<InboxCubit>(context).loadInbox(),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('You do not have unseen documents.'),
TextButton(
onPressed: () =>
_emptyStateRefreshIndicatorKey.currentState?.show(),
child: Text('Refresh'),
),
],
),
),
);
}
}

View File

@@ -11,14 +11,16 @@ import 'package:paperless_mobile/features/documents/view/widgets/document_previe
import 'package:paperless_mobile/features/labels/bloc/global_state_bloc_provider.dart';
import 'package:paperless_mobile/features/labels/tags/view/widgets/tags_widget.dart';
class DocumentInboxItem extends StatelessWidget {
class InboxItem extends StatelessWidget {
static const _a4AspectRatio = 1 / 1.4142;
final DocumentModel document;
const DocumentInboxItem({
const InboxItem({
super.key,
required this.document,
});
static const _a4AspectRatio = 1 / 1.4142;
@override
Widget build(BuildContext context) {
return ListTile(