Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of new components in inventory module #408

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This project is maintained using [Melos](https://melos.invertase.dev).
### Pre-requisites

1. Flutter:
The project is built using Flutter. The project uses the latest version of Flutter on stable branch. The path should
The project is built using Flutter. The project uses the 3.16.5 [https://docs.flutter.dev/release/archive] version of Flutter. The path should
contain `flutter`.
2. Dart
`dart` should be available in the path and should use the same version as the bundled version that comes with Flutter
Expand Down Expand Up @@ -750,4 +750,4 @@ The following steps describe the manual synchronization process:
- The network manager sends a Bulk delete request to the Remote repository and returns success.
- If it is a SINGLE_CREATE operation:
- The network manager sends a Single create request to the Remote repository and returns success.
13. Success is returned to complete the sync up process.
13. Success is returned to complete the sync up process.
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@
</queries>
<!--#enddocregion android-queries-->
<application
android:label="salama"
android:label="HCM"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:allowBackup="false"
android:fullBackupOnly="false"
android:fullBackupContent="false"
<activity
android:showWhenLocked="false"
android:turnScreenOn="true"
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait"
android:allowBackup="false"
android:fullBackupContent="false"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand Down
10 changes: 10 additions & 0 deletions apps/health_campaign_field_worker_app/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
targets:
$default:
builders:
auto_route_generator:auto_route_generator:
options:
generate_for:
- lib/pages/**.dart
auto_route_generator:auto_router_generator:
generate_for:
- lib/router/**router.dart
3 changes: 3 additions & 0 deletions apps/health_campaign_field_worker_app/devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extensions:
- drift: true
- provider: true
103 changes: 67 additions & 36 deletions apps/health_campaign_field_worker_app/lib/app.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import 'package:attendance_management/blocs/app_localization.dart'
as attendance_localization;
import 'package:digit_components/digit_components.dart';
import 'package:digit_scanner/blocs/scanner.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:isar/isar.dart';
import 'package:location/location.dart';
import 'package:referral_reconciliation/blocs/referral_recon_service.dart';
import 'package:referral_reconciliation/blocs/referral_reconciliation_listeners.dart';
import 'package:referral_reconciliation/blocs/search_referral_reconciliations.dart';

import 'blocs/app_initialization/app_initialization.dart';
import 'blocs/auth/auth.dart';
import 'blocs/boundary/boundary.dart';
import 'blocs/localization/app_localization.dart';
import 'blocs/facility/facility.dart';
import 'blocs/localization/localization.dart';
import 'blocs/product_variant/product_variant.dart';
import 'blocs/project/project.dart';
import 'blocs/scanner/scanner.dart';
import 'blocs/project_facility/project_facility.dart';
import 'blocs/user/user.dart';
import 'data/data_repository.dart';
import 'data/local_store/app_shared_preferences.dart';
Expand All @@ -26,6 +28,7 @@ import 'models/data_model.dart';
import 'router/app_navigator_observer.dart';
import 'router/app_router.dart';
import 'utils/environment_config.dart';
import 'utils/localization_delegates.dart';
import 'utils/utils.dart';
import 'widgets/network_manager_provider_wrapper.dart';

Expand All @@ -36,12 +39,12 @@ class MainApplication extends StatefulWidget {
final LocalSqlDataStore sql;

const MainApplication({
Key? key,
super.key,
required this.isar,
required this.client,
required this.appRouter,
required this.sql,
}) : super(key: key);
});

@override
State<StatefulWidget> createState() {
Expand Down Expand Up @@ -79,6 +82,14 @@ class MainApplicationState extends State<MainApplication>
},
lazy: false,
),
BlocProvider(
create: (_) {
return DigitScannerBloc(
const DigitScannerState(),
);
},
lazy: false,
),
BlocProvider(
create: (context) {
return UserBloc(
Expand All @@ -101,18 +112,6 @@ class MainApplicationState extends State<MainApplication>
),
),
),
BlocProvider(
create: (ctx) => ScannerBloc(
const ScannerState(),
projectBeneficiaryRepository: ctx
.read<NetworkManager>()
.repository<ProjectBeneficiaryModel,
ProjectBeneficiarySearchModel>(ctx),
hfReferralDataRepository: ctx
.read<NetworkManager>()
.repository<HFReferralModel, HFReferralSearchModel>(ctx),
),
),
BlocProvider(
create: (ctx) => BoundaryBloc(
const BoundaryState(),
Expand Down Expand Up @@ -249,9 +248,53 @@ class MainApplicationState extends State<MainApplication>
attendanceLogRemoteRepository: ctx.read<
RemoteRepository<HCMAttendanceLogModel,
HCMAttendanceLogSearchModel>>(),
stockLocalRepository: ctx.read<
LocalRepository<HcmStockModel,
HcmStockSearchModel>>(),
stockRemoteRepository: ctx.read<
RemoteRepository<HcmStockModel,
HcmStockSearchModel>>(),
context: context,
),
),
BlocProvider(
create: (context) => FacilityBloc(
facilityLocalRepository: context.read<
LocalRepository<FacilityModel,
FacilitySearchModel>>(),
projectFacilityLocalRepository: context.read<
LocalRepository<ProjectFacilityModel,
ProjectFacilitySearchModel>>(),
),
),
BlocProvider(
create: (context) => ProductVariantBloc(
const ProductVariantEmptyState(),
productVariantDataRepository: context.read<
RemoteRepository<ProductVariantModel,
ProductVariantSearchModel>>(),
projectResourceDataRepository: context.read<
RemoteRepository<ProjectResourceModel,
ProjectResourceSearchModel>>(),
),
),
BlocProvider(
create: (context) => ProjectFacilityBloc(
const ProjectFacilityState.empty(),
projectFacilityDataRepository: context.repository<
ProjectFacilityModel,
ProjectFacilitySearchModel>(),
),
),
BlocProvider(
create: (context) => SearchReferralsBloc(),
),
BlocProvider(
create: (context) => ReferralReconServiceBloc(
const ReferralReconServiceEmptyState(),
referralReconSingleton: ReferralReconSingleton(),
),
),
],
child: BlocBuilder<LocalizationBloc, LocalizationState>(
builder: (context, langState) {
Expand Down Expand Up @@ -292,23 +335,11 @@ class MainApplicationState extends State<MainApplication>
: firstLanguage;
})
: [firstLanguage],
localizationsDelegates: [
AppLocalizations.getDelegate(
appConfig,
widget.isar,
),
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
attendance_localization.AttendanceLocalization
.getDelegate(
getLocalizationString(
widget.isar,
selectedLocale,
),
appConfig.languages!,
),
],
localizationsDelegates: getAppLocalizationDelegates(
isar: widget.isar,
appConfig: appConfig,
selectedLocale: selectedLocale,
),
locale: languages != null
? Locale(
selectedLocale!.split("_").first,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part of 'app_initialization.dart';
T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

/// @nodoc
mixin _$AppInitializationEvent {
Expand Down
Loading
Loading