mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 04:08:03 -06:00
Finished inbox, fixed reverse sort order, bloc refactorings
This commit is contained in:
36
lib/features/inbox/view/widgets/inbox_empty_widget.dart
Normal file
36
lib/features/inbox/view/widgets/inbox_empty_widget.dart
Normal 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'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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(
|
||||
Reference in New Issue
Block a user