WIP - Provider refactorings

This commit is contained in:
Anton Stubenbord
2022-12-27 00:12:33 +01:00
parent 60aecb549d
commit bf0e186646
53 changed files with 434 additions and 416 deletions
@@ -14,7 +14,7 @@ class AddCorrespondentPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<Correspondent>(
RepositoryProvider.of<LabelRepository<Correspondent>>(context),
context.read<LabelRepository<Correspondent>>(),
),
child: AddLabelPage<Correspondent>(
pageTitle: Text(S.of(context).addCorrespondentPageTitle),
@@ -17,7 +17,7 @@ class AddDocumentTypePage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<DocumentType>(
RepositoryProvider.of<LabelRepository<DocumentType>>(context),
context.read<LabelRepository<DocumentType>>(),
),
child: AddLabelPage<DocumentType>(
pageTitle: Text(S.of(context).addDocumentTypePageTitle),
@@ -15,7 +15,7 @@ class AddStoragePathPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<StoragePath>(
RepositoryProvider.of<LabelRepository<StoragePath>>(context),
context.read<LabelRepository<StoragePath>>(),
),
child: AddLabelPage<StoragePath>(
pageTitle: Text(S.of(context).addStoragePathPageTitle),
@@ -18,7 +18,7 @@ class AddTagPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<Tag>(
RepositoryProvider.of<LabelRepository<Tag>>(context),
context.read<LabelRepository<Tag>>(),
),
child: AddLabelPage<Tag>(
pageTitle: Text(S.of(context).addTagPageTitle),
@@ -14,7 +14,7 @@ class EditCorrespondentPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<Correspondent>(
RepositoryProvider.of<LabelRepository<Correspondent>>(context),
context.read<LabelRepository<Correspondent>>(),
),
child: EditLabelPage<Correspondent>(
label: correspondent,
@@ -13,7 +13,7 @@ class EditDocumentTypePage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<DocumentType>(
RepositoryProvider.of<LabelRepository<DocumentType>>(context),
context.read<LabelRepository<DocumentType>>(),
),
child: EditLabelPage<DocumentType>(
label: documentType,
@@ -14,7 +14,7 @@ class EditStoragePathPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<StoragePath>(
RepositoryProvider.of<LabelRepository<StoragePath>>(context),
context.read<LabelRepository<StoragePath>>(),
),
child: EditLabelPage<StoragePath>(
label: storagePath,
@@ -17,7 +17,7 @@ class EditTagPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => EditLabelCubit<Tag>(
RepositoryProvider.of<LabelRepository<Tag>>(context),
context.read<LabelRepository<Tag>>(),
),
child: EditLabelPage<Tag>(
label: tag,