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'),
),
],
),
),
);
}
}