@@ -351,6 +351,7 @@ class _CongestionRatingScreenState extends State<CongestionRatingScreen> {
351
351
);
352
352
}
353
353
354
+ int ? selectedIndex;
354
355
Widget _buildCongestionPointsBox (List <String > congestionPoints) {
355
356
return Container (
356
357
padding: EdgeInsets .all (10 ),
@@ -393,7 +394,13 @@ class _CongestionRatingScreenState extends State<CongestionRatingScreen> {
393
394
child: SingleChildScrollView (
394
395
child: Column (
395
396
children: List .generate (congestionPoints.length, (index) {
396
- return Column (
397
+ return GestureDetector (
398
+ onTap: () {
399
+ setState (() {
400
+ selectedIndex = index; // Update selected congestion point
401
+ });
402
+ },
403
+ child: Column (
397
404
children: [
398
405
Padding (
399
406
padding: const EdgeInsets .symmetric (horizontal: 8.0 ),
@@ -415,12 +422,15 @@ class _CongestionRatingScreenState extends State<CongestionRatingScreen> {
415
422
endIndent: 25 ,
416
423
),
417
424
],
418
- );
425
+ )) ;
419
426
}),
420
427
),
421
428
),
422
429
),
423
- ],
430
+ if (selectedIndex != null )
431
+ _buildHourlyCongestionRatingGraph (congestionPoints[selectedIndex! ]),
432
+ _buildCongestionHistoryGraph (congestionPoints[selectedIndex! ]),
433
+ _buildImageViewer (congestionPoints[selectedIndex! ])],
424
434
),
425
435
);
426
436
}
@@ -478,35 +488,48 @@ class _CongestionRatingScreenState extends State<CongestionRatingScreen> {
478
488
);
479
489
}
480
490
481
-
482
- // Placeholder methods for graphs
483
- Widget _buildHourlyCongestionRatingGraph () {
484
- return Container (
485
- height: 200 ,
486
- color: Colors .redAccent[100 ],
487
- child: Center (
488
- child: Text ('Hourly Congestion Rating Graph' ),
489
- ),
491
+ // Placeholder methods for graphs and image viewer
492
+ Widget _buildHourlyCongestionRatingGraph (String congestionPoint) {
493
+ return Column (
494
+ children: [
495
+ Text (
496
+ congestionPoint,
497
+ style: TextStyle (
498
+ fontSize: 16 ,
499
+ fontWeight: FontWeight .bold,
500
+ ),
501
+ ),
502
+ SizedBox (height: 8 ),
503
+ Container (
504
+ height: 200 ,
505
+ color: Colors .redAccent[100 ],
506
+ child: Center (
507
+ child: Text ('Hourly Congestion Rating' ),
508
+ ),
509
+ ),
510
+ ],
490
511
);
491
512
}
492
513
493
- Widget _buildCongestionHistoryGraph () {
514
+ Widget _buildCongestionHistoryGraph (String congestionPoint ) {
494
515
return Container (
495
516
height: 150 ,
496
517
color: Colors .blueAccent[100 ],
497
518
child: Center (
498
- child: Text ('Congestion Rating History Graph ' ),
519
+ child: Text ('Congestion Rating History' ),
499
520
),
500
521
);
501
522
}
502
523
503
- Widget _buildTotalCongestionTimeGraph ( ) {
524
+ Widget _buildImageViewer ( String congestionPoint ) {
504
525
return Container (
505
- height: 150 ,
506
- color: Colors .greenAccent [100 ],
526
+ height: 200 ,
527
+ color: Colors .redAccent [100 ],
507
528
child: Center (
508
- child: Text ('Total Congestion Time Graph ' ),
529
+ child: Text ('Congestion History Captures ' ),
509
530
),
510
531
);
511
532
}
533
+
534
+
512
535
}
0 commit comments