Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e8ca9c5
Updated the integer form picker and added a new text block component …
rachana-egov Jul 8, 2024
150c83e
updated description for household location and details page (#443)
rachana-egov Jul 9, 2024
b390081
replaced product variant dropdown to selection card (#445)
rachana-egov Jul 10, 2024
a93df14
HLM-6283:: IRS- Household Details Fields added (#444)
Ramkrishna-egov Jul 10, 2024
86eb01a
Updated checklist for a new type boolean (#446)
rachana-egov Jul 10, 2024
3b0ba14
HLM-6282 and HLM-6283:: House Structure Details Page added (#447)
Ramkrishna-egov Jul 11, 2024
b6f96c2
integrated checklist inside the beneficiary flow and updated gender f…
rachana-egov Jul 11, 2024
9001274
HLM-6371:: Beneficiary Registration Summary Page (#452)
Ramkrishna-egov Jul 11, 2024
e7178da
Added refused delivery page (#451)
rachana-egov Jul 12, 2024
63e4824
No delivery flow page (#453)
rachana-egov Jul 12, 2024
40ad143
HLM-6367:: Auto Create project beneficiary (#454)
Ramkrishna-egov Jul 15, 2024
1177a6d
Hlm 6414 - MDMS StatusFilter, Filter search (#448)
naveenr-egov Jul 15, 2024
9493093
HCMPRE-98 Filter search pagination, Removed private PageState (#457)
naveenr-egov Jul 17, 2024
2e7ad26
Created a new package for marking closed household (#459)
rachana-egov Jul 18, 2024
9ba7186
HCMPRE-98 - Inventory TeamCode fixes, Filter search fixes (#460)
naveenr-egov Jul 18, 2024
888fdb2
Hcmpre 118 - Closed Household, Filter improvements, Bug fixes (#467)
naveenr-egov Jul 23, 2024
09c7508
Hcmpre 155 - ClosedHousehold flow change (#478)
naveenr-egov Jul 28, 2024
b28be04
Implement search pagination (#476)
rachana-egov Jul 29, 2024
2c2e7c3
localization update, input validation for numeric, disabled delivery …
rachana-egov Jul 29, 2024
0cce089
Hcmpre 164, 165 - Count implementation for filter search (#485)
naveenr-egov Aug 2, 2024
4d26bb7
fixed reports are not getting refreshed after updating facility (#486)
rachana-egov Aug 2, 2024
ee8099f
Delivery summary page Resources and quantity added (#473)
Ramkrishna-egov Aug 2, 2024
244f2cb
updated script for closed household (#489)
rachana-egov Aug 5, 2024
1ca409c
Hcmpre 166 - Moved Localization from ISAR To SQL (#488)
naveenr-egov Aug 5, 2024
6e0b52e
Removed null condition, fixed double is not a subtype of string issue…
rachana-egov Aug 5, 2024
07b7da9
HCMPRE-177:: Metric and Table Charts Integration in Mobile dashboard …
Ramkrishna-egov Aug 6, 2024
5860ae2
HCMPRE-177:: Fetch and send attendees uuids of registers to dss filte…
Ramkrishna-egov Aug 6, 2024
caa1c5f
Task update rather than creating new, updated filter popup loading (#…
rachana-egov Aug 6, 2024
dcd1a67
updated status and registration_delivery_enums.dart (#494)
naveenr-egov Aug 7, 2024
478a4b6
Uploaded pre release for inventory-management and digit-dss (#495)
Ramkrishna-egov Aug 7, 2024
37afaf1
removed the page count from filter, updated status filter pop up (#496)
rachana-egov Aug 8, 2024
5cce00b
updated demo changes (#498)
rachana-egov Aug 8, 2024
c4c3de0
added lat and long inside additional field when user submit the check…
rachana-egov Aug 14, 2024
1b0a993
HCMPRE-221 data segration (#501)
naveen-egov Aug 19, 2024
162b89f
Added Privacy Policy (#499)
rachana-egov Aug 26, 2024
d1a8046
HCMPRE-332:: Mobile dashboard added check for lastSyncTime to convert…
Ramkrishna-egov Aug 26, 2024
c6f0449
Hcmpre 263 - Sync write transaction for ISAR - fix, Localization fall…
naveenr-egov Aug 27, 2024
6b80b8f
Impel changes - background-services, beneficiary_checklist (#548)
naveenr-egov Aug 27, 2024
fbe1a4c
resolved code rabbit comments (#549)
naveenr-egov Aug 27, 2024
7e42940
privacy policy config issue fix (#550)
rachana-egov Aug 28, 2024
78dd3f3
fixed text ellipse issue (#553)
rachana-egov Aug 28, 2024
f40558a
Resource validation added (#555)
rachana-egov Aug 30, 2024
7ff5507
UAT fixes, HCMPRE-412 (#556)
naveenr-egov Aug 30, 2024
9ad9ea9
removed dialog closing function from language page (#560)
rachana-egov Aug 30, 2024
97862a4
Merge remote-tracking branch 'origin/develop' into develop
Sep 5, 2024
6b8bde8
remved privacy policy from main app to digit component
Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions apps/health_campaign_field_worker_app/lib/pages/login.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:digit_components/digit_components.dart';
import 'package:digit_components/models/privacy_notice/privacy_notice_model.dart';
import 'package:digit_components/widgets/atoms/digit_toaster.dart';
import 'package:digit_components/widgets/privacy_notice/privacy_component.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:reactive_forms/reactive_forms.dart';
Expand All @@ -11,7 +13,7 @@ import '../router/app_router.dart';
import '../utils/environment_config.dart';
import '../utils/i18_key_constants.dart' as i18;
import '../widgets/localized.dart';
import '../widgets/privacy_notice/privacy_component.dart';


@RoutePage()
class LoginPage extends LocalizedStatefulWidget {
Expand Down Expand Up @@ -140,7 +142,7 @@ class _LoginPageState extends LocalizedState<LoginPage> {
form.control(_privacyCheck).setValidators([Validators.requiredTrue]);
form.control(_privacyCheck).updateValueAndValidity();
return PrivacyComponent(
privacyPolicy: privacyPolicyJson,
privacyPolicy: convertToPrivacyPolicyModel(privacyPolicyJson),
formControlName: _privacyCheck,
text: localizations
.translate(i18.privacyPolicy.privacyNoticeText),
Expand Down Expand Up @@ -237,3 +239,27 @@ class _LoginPageState extends LocalizedState<LoginPage> {
)
});
}


// convert to privacy notice model
PrivacyNoticeModel? convertToPrivacyPolicyModel(PrivacyPolicy? privacyPolicy) {
return PrivacyNoticeModel(
header: privacyPolicy?.header ?? '',
module: privacyPolicy?.module ?? '',
active: privacyPolicy?.active,
contents: privacyPolicy?.contents?.map((content) => ContentNoticeModel(
header: content.header,
descriptions: content.descriptions?.map((description) => DescriptionNoticeModel(
text: description.text,
type: description.type,
isBold: description.isBold,
subDescriptions: description.subDescriptions?.map((subDescription) => SubDescriptionNoticeModel(
text: subDescription.text,
type: subDescription.type,
isBold: subDescription.isBold,
isSpaceRequired: subDescription.isSpaceRequired,
)).toList(),
)).toList(),
)).toList(),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:referral_reconciliation/blocs/app_localization.dart'
as referral_reconciliation_localization;
import 'package:registration_delivery/blocs/app_localization.dart'
as registration_delivery_localization;
import 'package:digit_components/blocs/localization.dart' as component_localization;

import '../blocs/localization/app_localization.dart';
import '../data/local_store/no_sql/schema/app_configuration.dart';
Expand Down Expand Up @@ -59,6 +60,10 @@ getAppLocalizationDelegates({
digit_dss_localization.DashboardLocalization.getDelegate(
LocalizationLocalRepository().returnLocalizationFromSQL(sql) as Future,
appConfig.languages!,
)
),
component_localization.ComponentLocalization.getDelegate(
LocalizationLocalRepository().returnLocalizationFromSQL(sql) as Future,
appConfig.languages!,
),
];
}
7 changes: 3 additions & 4 deletions apps/health_campaign_field_worker_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,9 @@ packages:
digit_components:
dependency: "direct main"
description:
name: digit_components
sha256: "9cca4d9a546037080afe02b6ade82fdf01574e11f5656ad12120fd6966578616"
url: "https://pub.dev"
source: hosted
path: "../../packages/digit_components"
relative: true
source: path
version: "1.0.1+1"
digit_data_model:
dependency: "direct main"
Expand Down
52 changes: 52 additions & 0 deletions packages/digit_components/lib/blocs/localization.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import 'package:flutter/material.dart';

import 'localization_delegates.dart';


// Class responsible for handling component localization
class ComponentLocalization {
final Locale locale;
final Future<dynamic> localizedStrings;
final List<dynamic> languages;

ComponentLocalization(this.locale, this.localizedStrings, this.languages);

// Method to get the current localization instance from context
static ComponentLocalization of(BuildContext context) {
return Localizations.of<ComponentLocalization>(context, ComponentLocalization)!;
}

static final List<dynamic> _localizedStrings = <dynamic>[];

// Method to get the delegate for localization
static LocalizationsDelegate<ComponentLocalization> getDelegate(
Future<dynamic> localizedStrings, List<dynamic> languages) =>
ComponentLocalizationDelegate(localizedStrings, languages);

// Method to load localized strings
Future<bool> load() async {
_localizedStrings.clear();
// Iterate over localized strings and filter based on locale
for (var element in await localizedStrings) {
if (element.locale == '${locale.languageCode}_${locale.countryCode}') {
_localizedStrings.add(element);
}
}

return true;
}

// Method to translate a given localized value
String translate(String localizedValues) {

if (_localizedStrings.isEmpty) {
return localizedValues;
} else {
final index = _localizedStrings.indexWhere(
(medium) => medium.code == localizedValues,
);

return index != -1 ? _localizedStrings[index].message : localizedValues;
}
}
}
33 changes: 33 additions & 0 deletions packages/digit_components/lib/blocs/localization_delegates.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:flutter/material.dart';

import 'localization.dart';


class ComponentLocalizationDelegate
extends LocalizationsDelegate<ComponentLocalization> {
final Future<dynamic> localizedStrings;
final List<dynamic> languages;

const ComponentLocalizationDelegate(this.localizedStrings, this.languages);

@override
bool isSupported(Locale locale) {
return languages.map((e) {
final results = e.value.split('_');
if (results.isNotEmpty) return results.first;
}).contains(locale.languageCode);
}

@override
Future<ComponentLocalization> load(Locale locale) async {
ComponentLocalization localization =
ComponentLocalization(locale, localizedStrings, languages);
await localization.load();
return localization;
}

@override
bool shouldReload(covariant LocalizationsDelegate<ComponentLocalization> old) {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'privacy_notice_model.freezed.dart';
part 'privacy_notice_model.g.dart';

@freezed
class PrivacyNoticeModel with _$PrivacyNoticeModel {
const factory PrivacyNoticeModel({
required String header,
required String module,
bool? active,
List<ContentNoticeModel>? contents,
}) = _PrivacyNoticeModel;

factory PrivacyNoticeModel.fromJson(Map<String, dynamic> json) => _$PrivacyNoticeModelFromJson(json);
}

@freezed
class ContentNoticeModel with _$ContentNoticeModel {
const factory ContentNoticeModel({
String? header,
List<DescriptionNoticeModel>? descriptions,
}) = _ContentNoticeModel;

factory ContentNoticeModel.fromJson(Map<String, dynamic> json) => _$ContentNoticeModelFromJson(json);
}

@freezed
class DescriptionNoticeModel with _$DescriptionNoticeModel {
const factory DescriptionNoticeModel({
String? text,
String? type,
bool? isBold,
List<SubDescriptionNoticeModel>? subDescriptions,
}) = _DescriptionNoticeModel;

factory DescriptionNoticeModel.fromJson(Map<String, dynamic> json) => _$DescriptionNoticeModelFromJson(json);
}

@freezed
class SubDescriptionNoticeModel with _$SubDescriptionNoticeModel {
const factory SubDescriptionNoticeModel({
String? text,
String? type,
bool? isBold,
bool? isSpaceRequired,
}) = _SubDescriptionNoticeModel;

factory SubDescriptionNoticeModel.fromJson(Map<String, dynamic> json) => _$SubDescriptionNoticeModelFromJson(json);
}
Loading