Skip to content

Commit

Permalink
fixed timeline step not showing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rachana-egov committed Oct 30, 2024
1 parent bf4dd29 commit cfcbb37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _TimelineMoleculeState extends LocalizedState<TimelineMolecule> {
List<TimelineStep> stepsToShow = [];
int firstFutureIndex = 0;

if (widget.showAllSteps) {
if (widget.showAllSteps || (showMoreFuture && showMorePast)) {
// Show all steps, including future steps in reverse order
List<TimelineStep> futureSteps = sortedSteps
.where((step) => step.state == TimelineStepState.future)
Expand All @@ -46,7 +46,7 @@ class _TimelineMoleculeState extends LocalizedState<TimelineMolecule> {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,37 +68,37 @@ List<Story> 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,
),
],
Expand Down

0 comments on commit cfcbb37

Please sign in to comment.