Bug Report: Flutter App Does Not Load Data with New API
Priority: High
Summary
The Flutter application loads normally when using the old API, but displays no data when configured to use the new API:
https://www.djsandmc.net/api/
The backend appears to be operational, but the mobile application does not populate the home screen.
Environment
API Base URL
https://www.djsandmc.net/api/
Backend
- Laravel
- HTTPS enabled with Let's Encrypt
- Apache
- Production database restored
Verified Working
General Settings
Request:
POST /api/general_setting
Response:
status: 200
message: "Get Record Successfully"
Returns application settings successfully.
Section List
Request:
POST /api/get_section_list
Form Data:
section_type=1
user_id=0
page_no=1
Response:
status: 200
Returns multiple sections including:
- Live Radio Stations
- Feature DJs
- DJ KNS Mashups
- DJsandMC Live
Each section includes valid content, images, and stream URLs.
Flutter Configuration
Base URL:
final String baseurl = "https://www.djsandmc.net/api/";
Section request:
Response response = await dio.post(
'$baseurl$get_section_list',
data: FormData.fromMap({
'section_type': sectiontype,
'user_id': (Constant.userID == null) ? 0 : Constant.userID,
'page_no': pageNo,
}),
);
The Flutter application is sending the required POST parameters.
Model Verification
matches the API response structure:
status
message
result
total_rows
total_page
current_page
more_page
No obvious model mismatch was found.
Issue
The backend returns valid JSON with HTTP 200, but the Flutter application still displays no data.
The same application functions correctly when pointed at the previous API.
Requested Investigation
Please investigate:
- Whether the Flutter application is actually receiving the API response.
- Whether SectionListModel.fromJson() throws an exception during parsing.
- Whether any exception occurs immediately after parsing.
- Whether the Provider/GetX/BLoC state is updated after the API response.
- Whether notifyListeners(), update(), or setState() is being called after loading the section list.
- Whether another API call after general_setting is failing and preventing the home screen from rendering.
- Compare the current backend with the previous production backend for any differences in API response format or required fields.
Important Finding
The backend has been verified to return valid data via direct
requests. This suggests the issue is likely within the Flutter application's request handling, parsing, state management, or compatibility with the current backend rather than the API itself.