https://github.com/siddiqui145/user_api
This project is a REST API designed to fetch and manage detailed information about users. Built to understand and explore REST architecture, this project allows querying data with both simple and complex filters.
https://github.com/siddiqui145/user_api
dart flutter http-requests rest-api
Last synced: 3 months ago
JSON representation
This project is a REST API designed to fetch and manage detailed information about users. Built to understand and explore REST architecture, this project allows querying data with both simple and complex filters.
- Host: GitHub
- URL: https://github.com/siddiqui145/user_api
- Owner: Siddiqui145
- License: mit
- Created: 2024-12-15T06:33:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-15T18:56:58.000Z (over 1 year ago)
- Last Synced: 2025-11-13T08:13:09.658Z (8 months ago)
- Topics: dart, flutter, http-requests, rest-api
- Language: C++
- Homepage:
- Size: 273 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# REST API User Data Fetcher
This project is a trial implementation of a REST API integration in a Flutter app. The goal was to successfully fetch and display user data from an external API, demonstrating proficiency in handling HTTP requests and managing JSON data in Flutter.
## Features
- Fetches user details such as name, email, location, date of birth, and more from a REST API.
- Parses JSON data into Dart objects for easy manipulation.
- Successfully displays all the retrieved data within the app.
## Screenshots


## Tech Stack
- **Flutter**: Frontend framework for building the mobile app.
- **Dart**: Programming language used for app development.
- **REST API**: Source of user data.
## Key Implementation Highlights
1. **HTTP Request**:
- Used the `http` package to make a GET request to fetch data.
- API Endpoint: [Random User API](https://randomuser.me/).
2. **Data Parsing**:
- Converted the JSON response into Dart objects using custom data models.
- Managed complex nested JSON structures for fields like name, address, and picture.
3. **Error Handling**:
- Included exception handling to manage API failures or invalid data formats.
4. **Date Parsing**:
- Converted string dates into `DateTime` objects using `DateTime.parse()`.
## Folder Structure
```
lib/
├── models/ # Contains data model classes
├── screens/ # UI screens displaying fetched data
├── services/ # API-related logic (e.g., HTTP requests)
└── main.dart # App entry point
```
## How to Run
1. **Clone the Repository**:
```bash
git clone https://github.com/Siddiqui145/user_api.git
cd user_api
```
2. **Install Dependencies**:
```bash
flutter pub get
```
3. **Run the App**:
```bash
flutter run
```
Ensure you have an emulator or a connected device ready.
## Lessons Learned
- Gained hands-on experience with REST API integration in Flutter.
- Learned how to parse complex JSON data structures.
- Improved understanding of handling date formats and converting them to Dart `DateTime`.
## Future Improvements
- Enhance UI to make the displayed data more visually appealing.
- Add functionality to filter and search the fetched user data.
- Implement caching for offline access.
## Resources
- [Flutter Documentation](https://flutter.dev/docs)
- [Random User API Documentation](https://randomuser.me/)
- [Dart DateTime Class](https://api.dart.dev/stable/2.19.0/dart-core/DateTime-class.html)
## License
This project is for educational purposes and does not include a specific license. Feel free to fork and modify for your own learning.