Skip to content

Commit

Permalink
Merge pull request #116 from SayedZeeshanHyder/main
Browse files Browse the repository at this point in the history
Railway Screen and Calendar Screen Done
  • Loading branch information
SayedZeeshanHyder authored Jun 7, 2024
2 parents 4726fa3 + 7f1e0af commit bb31f35
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
20 changes: 12 additions & 8 deletions lib/new_ui/screens/railway_screen/railway_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ class _RailwayConcessionScreenState
}

void clearValues() {
if (!_formKey.currentState!.validate()) {
/*if (!_formKey.currentState!.validate()) {
print("HELLO");
return;
}
}*/
ConcessionDetailsModel? concessionDetails =
ref.watch(concessionDetailsProvider);
firstNameController.text = concessionDetails?.firstName ?? "";
Expand All @@ -290,11 +291,11 @@ class _RailwayConcessionScreenState
dateOfBirthController.text = concessionDetails?.dob != null
? DateFormat('dd MMM yyyy').format(concessionDetails!.dob!)
: "";
travelLane = concessionDetails?.travelLane ?? "";
gender = concessionDetails?.gender ?? "";
travelClass = concessionDetails?.type ?? "";
duration = concessionDetails?.duration ?? "";
travelLane = concessionDetails?.travelLane ?? "";
travelLane = concessionDetails?.travelLane ?? "Western";
gender = concessionDetails?.gender ?? "Male";
travelClass = concessionDetails?.type ?? "II";
duration = concessionDetails?.duration ?? "Monthly";
travelLane = concessionDetails?.travelLane ?? "Western";
// toStation = concessionDetails?.to ?? "";
homeStation = concessionDetails?.from ?? "";
idCardPhotoTemp = idCardPhoto;
Expand Down Expand Up @@ -326,7 +327,7 @@ class _RailwayConcessionScreenState
address: addressController.text,
dob: _selectedDate ?? DateTime.now(),
phoneNum: int.parse(phoneNumController.text),
travelLane: travelLane ?? "Western",
travelLane: travelLane ?? "Central",
type: travelClass ?? "I",
);

Expand Down Expand Up @@ -768,6 +769,7 @@ class _RailwayConcessionScreenState
children: [
FilledButton(
onPressed: () {
print("Cleared Section");
clearValues();
},
style: FilledButton.styleFrom(
Expand Down Expand Up @@ -825,6 +827,8 @@ class _RailwayConcessionScreenState
),
),
),


SizedBox(height: !editMode ? 20 : 0),
!editMode &&
canIssuePass(concessionDetails, lastPassIssued, duration)
Expand Down
1 change: 1 addition & 0 deletions lib/new_ui/screens/timetable_screen/timetable_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class TimeTable extends ConsumerWidget {
offset: const Offset(0, 1),
);
UserModel? data = ref.watch(userModelProvider);
print(data);

if (data != null) {
NotificationType.makeTopic(ref, data.studentModel);
Expand Down
11 changes: 9 additions & 2 deletions lib/new_ui/screens/timetable_screen/widgets/card_display.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class _CardDisplayState extends ConsumerState<CardDisplay> {
lectureEndTime: timeTableDay[index].lectureEndTime,
lectureName: timeTableDay[index].lectureName,
lectureStartTime: timeTableDay[index].lectureStartTime,
facultyImageurl: getFacultyImagebyName(lectureFacultyname),
facultyName: !checkTimetable(lectureFacultyname) ? "---------" : lectureFacultyname,
facultyImageurl: !checkTimetable(lectureFacultyname) ? getFacultyImagebyName(lectureFacultyname) : "",
lectureBatch: timeTableDay[index].lectureBatch,
);
},
Expand All @@ -124,12 +124,19 @@ class _CardDisplayState extends ConsumerState<CardDisplay> {
}

List<TimetableModel> getTimetablebyDay(Map<String, dynamic> data, String day) {

List<TimetableModel> timeTableDay = [];
final daylist = data[day];
for (final item in daylist) {
StudentModel? studentModel = ref.watch(userModelProvider)?.studentModel;

if (item['lectureBatch'] == studentModel!.batch.toString() || item['lectureBatch'] == 'All') {
timeTableDay.add(TimetableModel.fromJson(item));
if(item['lectureFacultyName'] != null) {
timeTableDay.add(TimetableModel.fromJson(item));
}else{
item['lectureFacultyName'] = " ";
timeTableDay.add(TimetableModel.fromJson(item));
}
}
}
return timeTableDay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class ScheduleCard extends StatelessWidget {
color: Colors.grey,
fontWeight: FontWeight.bold),
),
)
),
],
)
],
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.2+2

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: ">=2.17.0 <=4.0.0"


dependencies:
Expand Down

0 comments on commit bb31f35

Please sign in to comment.