Skip to content

Commit

Permalink
Added order feature for the screens as per spec (#473) (#476)
Browse files Browse the repository at this point in the history
Signed-off-by: G S Prakash <prakash.gs@cyberpwn.com>
  • Loading branch information
GSPrakash2662 authored Oct 29, 2024
1 parent fa47ab7 commit 371235e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 9 additions & 2 deletions lib/ui/onboard/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import 'package:registration_client/provider/registration_task_provider.dart';

import 'package:flutter_gen/gen_l10n/app_localizations.dart';

import '../../model/screen.dart';

class HomePage extends StatefulWidget {
static const route = "/home-page";

Expand Down Expand Up @@ -106,10 +108,12 @@ class _HomePageState extends State<HomePage> {
}

Widget getProcessUI(BuildContext context, Process process) {
List<Screen?> sortedScreens;
sortedScreens = process.screens!.toList()..sort((e1, e2) => e1!.order!.compareTo(e2!.order!));
if (process.id == "NEW" || process.id == "UPDATE") {
globalProvider.clearRegistrationProcessData();
globalProvider.setPreRegistrationId("");
for (var screen in process.screens!) {
for (var screen in sortedScreens) {
for (var field in screen!.fields!) {
if (field!.controlType == 'dropdown' &&
field.fieldType == 'default') {
Expand All @@ -122,7 +126,10 @@ class _HomePageState extends State<HomePage> {
showDialog(
context: context,
builder: (BuildContext context) => LanguageSelector(
newProcess: process,
newProcess: Process(label: process.label, autoSelectedGroups: process.autoSelectedGroups,
caption: process.caption, flow: process.flow, icon: process.icon, id: process.id,
isActive: process.isActive, order: process.order, screens: sortedScreens
),
),
);
}
Expand Down
1 change: 0 additions & 1 deletion lib/ui/process_ui/widgets/html_box_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ class _HtmlRendererState extends State<HtmlRenderer> {
DemographicsApi().getHashValue(unit8List).then((value) {
hash = value;
globalProvider.fieldInputValue[widget.field.id!] = hash;
debugPrint("ID : ${widget.field.id!}");
DemographicsApi().addSimpleTypeDemographicField(
widget.field.id!,
value,
Expand Down

0 comments on commit 371235e

Please sign in to comment.