Skip to content

Commit

Permalink
Merge pull request #180 from 12fahed/main
Browse files Browse the repository at this point in the history
Show collected date if collected
  • Loading branch information
12fahed authored Jul 8, 2024
2 parents c2cf17d + 436f30c commit c50b05b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/new_ui/screens/railway_screen/railway_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import 'package:tsec_app/provider/railway_concession_provider.dart';
import 'package:tsec_app/new_ui/screens/railway_screen/widgets/railway_text_field.dart';
import 'package:tsec_app/utils/railway_enum.dart';
import 'package:tsec_app/utils/station_list.dart';
import 'package:cloud_firestore/cloud_firestore.dart';

class RailwayConcessionScreen extends ConsumerStatefulWidget {
const RailwayConcessionScreen({super.key});
Expand Down Expand Up @@ -62,7 +63,7 @@ class _RailwayConcessionScreenState
DateTime lastPass = lastPassIssued;
int diff = today.difference(lastPass).inDays;

// eg: if lastPassIssued if 6th June, it expires on 5th June then allow user to apply for pass from 2nd,3rd,4th June, 3days prior to pass ends
// eg: if lastPassIssued if 6th June, it expires on 5th July then allow user to apply for pass from 2nd,3rd,4th July, 3days prior to pass ends
bool retVal = (duration == "Monthly" && diff >= 26) ||
(duration == "Quarterly" && diff >= 86);
// debugPrint(retVal.toString());
Expand Down Expand Up @@ -638,6 +639,18 @@ class _RailwayConcessionScreenState
"Class: ${travelClass}",
style: TextStyle(fontSize: 16, color: Colors.white),
),

if (concessionRequestData?.passCollected != null &&
concessionRequestData!.passCollected!['collected'] == "1") ...[
SizedBox(
height: 15,
),
Text(
"Pass collected on ${DateFormat('dd/MM/yyyy').format((concessionRequestData.passCollected!['date'] as Timestamp).toDate())}",
style: TextStyle(fontSize: 13, color: Colors.grey),
),
],

],
),
),
Expand Down

0 comments on commit c50b05b

Please sign in to comment.