From cfcbb376c0527be2452f73277271518225f060f4 Mon Sep 17 00:00:00 2001 From: rachana-egov Date: Wed, 30 Oct 2024 17:11:29 +0530 Subject: [PATCH] fixed timeline step not showing issue --- .../widgets/molecules/digit_timeline_molecule.dart | 4 ++-- .../molecules/timeline_molecule_stories.dart | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/flutter/digit-ui-components/digit_components/lib/widgets/molecules/digit_timeline_molecule.dart b/flutter/digit-ui-components/digit_components/lib/widgets/molecules/digit_timeline_molecule.dart index f85b32b2a5..2d1e45536c 100644 --- a/flutter/digit-ui-components/digit_components/lib/widgets/molecules/digit_timeline_molecule.dart +++ b/flutter/digit-ui-components/digit_components/lib/widgets/molecules/digit_timeline_molecule.dart @@ -37,7 +37,7 @@ class _TimelineMoleculeState extends LocalizedState { List stepsToShow = []; int firstFutureIndex = 0; - if (widget.showAllSteps) { + if (widget.showAllSteps || (showMoreFuture && showMorePast)) { // Show all steps, including future steps in reverse order List futureSteps = sortedSteps .where((step) => step.state == TimelineStepState.future) @@ -46,7 +46,7 @@ class _TimelineMoleculeState extends LocalizedState { stepsToShow.addAll( sortedSteps.where((step) => step.state == TimelineStepState.present)); stepsToShow.addAll(sortedSteps - .where((step) => step.state == TimelineStepState.completed)); + .where((step) => step.state == TimelineStepState.completed).toList().reversed); firstFutureIndex = sortedSteps .lastIndexWhere((step) => step.state == TimelineStepState.future); diff --git a/flutter/digit-ui-components/storybook/lib/widgets/molecules/timeline_molecule_stories.dart b/flutter/digit-ui-components/storybook/lib/widgets/molecules/timeline_molecule_stories.dart index 4a2451431f..38a57f35b6 100644 --- a/flutter/digit-ui-components/storybook/lib/widgets/molecules/timeline_molecule_stories.dart +++ b/flutter/digit-ui-components/storybook/lib/widgets/molecules/timeline_molecule_stories.dart @@ -68,37 +68,37 @@ List timelineMoleculeStories() { ), TimelineStep( label: 'Step 2', - description: ['Description for step 1'], + description: ['Description for step 2'], state: TimelineStepState.completed, ), TimelineStep( label: 'Step 3', - description: ['Description for step 1'], + description: ['Description for step 3'], state: TimelineStepState.completed, ), TimelineStep( label: 'Step 4', - description: ['Description for step 2'], + description: ['Description for step 4'], state: TimelineStepState.present, ), TimelineStep( label: 'Step 5', - description: ['Description for step 3'], + description: ['Description for step 5'], state: TimelineStepState.future, ), TimelineStep( label: 'Step 6', - description: ['Description for step 3'], + description: ['Description for step 6'], state: TimelineStepState.future, ), TimelineStep( label: 'Step 7', - description: ['Description for step 3'], + description: ['Description for step 7'], state: TimelineStepState.future, ), TimelineStep( label: 'Step 8', - description: ['Description for step 3'], + description: ['Description for step 8'], state: TimelineStepState.future, ), ],