WIP - Replaced get_it + injectable with Provider

This commit is contained in:
Anton Stubenbord
2022-12-21 01:14:06 +01:00
parent 10149fb7c1
commit 60aecb549d
59 changed files with 1099 additions and 1362 deletions

View File

@@ -70,8 +70,6 @@ class DocumentUploadCubit extends Cubit<DocumentUploadState> {
documentType: documentType,
tags: tags,
createdAt: createdAt,
authToken: auth.token!,
serverUrl: auth.serverUrl,
);
if (onConsumptionFinished != null) {
_documentApi

View File

@@ -166,10 +166,8 @@ class _DocumentUploadPreparationPageState
notAssignedSelectable: false,
formBuilderState: _formKey.currentState,
labelCreationWidgetBuilder: (initialName) =>
RepositoryProvider.value(
value: RepositoryProvider.of<LabelRepository<DocumentType>>(
context,
),
RepositoryProvider<LabelRepository<DocumentType>>(
create: (context) => context.watch(),
child: AddDocumentTypePage(initialName: initialName),
),
textFieldLabel:
@@ -182,11 +180,8 @@ class _DocumentUploadPreparationPageState
notAssignedSelectable: false,
formBuilderState: _formKey.currentState,
labelCreationWidgetBuilder: (initialName) =>
RepositoryProvider.value(
value:
RepositoryProvider.of<LabelRepository<Correspondent>>(
context,
),
RepositoryProvider<LabelRepository<Correspondent>>(
create: (context) => context.watch(),
child: AddCorrespondentPage(initialName: initialName),
),
textFieldLabel:
@@ -220,7 +215,7 @@ class _DocumentUploadPreparationPageState
void _onSubmit() async {
if (_formKey.currentState?.saveAndValidate() ?? false) {
final cubit = BlocProvider.of<DocumentUploadCubit>(context);
final cubit = context.read<DocumentUploadCubit>();
try {
setState(() => _isUploadLoading = true);