IMGIITRoorkee / IMGIITRoorkee/placement-flutter
Handle string application values without crashing the profile list
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 3
- Forks
- 10
- Avg merge
- 8d 21h
- Merged PRs (30d)
- 4
Description
Problem
The API returns application as an object, or as the string "not_applied", or as the string "exception" when the linked resume row has been deleted. The client stores the raw string and then calls .statusDisplayName or .resume.title on it, which throws NoSuchMethodError and takes down the whole list rather than one row.
The "exception" case is reachable in production: Application.resume is on_delete=SET_NULL, so deleting a resume puts a live application into that state.
Where
lib/models/profilesModel.dart:36-42(theis Stringbranch stores the raw string)lib/viewmodels/ProfilesForMeViewModel.dart:35lib/viewmodels/ProfilesForAllViewModel.dart:44lib/viewmodels/ProfilesAppliedViewModel.dart:27lib/views/ProfilesAppliedView.dart:69(unguardedapplication.resume.title)- Backend source of the string:
omniport-app-placement-and-internship/utils/get_application.py:31-32
Expected
A non-object application degrades to a readable status instead of crashing the list.
Fix sketch
- Type the field as
ApplicationModel?and populate it only when the JSON value is aMap. - Let the existing
?.and??handle the null case. - Fix all four call sites in the same pass, not just the one that was reported.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/models/profilesModel.dart:36-42 and inspect how string versus object application values are stored. Then trace the four listed view-model and view call sites, including ProfilesAppliedView.dart:69, and verify that both "not_applied" and "exception" render a readable status without crashing the profile list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100