This project is a trial implementation of a REST API integration in a Flutter app. The goal was to successfully fetch and display quotes from an external API, demonstrating proficiency in handling HTTP requests and managing JSON data in Flutter.
- Fetches Quotes such as name of author, quote, and along with its id, more from a REST API.
- Parses JSON data into Dart objects for easy manipulation.
- Successfully displays all the retrieved data within the app.
Quotes_app.mp4
- Flutter: Frontend framework for building the mobile app.
- Dart: Programming language used for app development.
- REST API: Source of user data.
-
HTTP Request:
- Used the
httppackage to make a GET request to fetch data. - API Endpoint: Random User API.
- Used the
-
Data Parsing:
- Converted the JSON response into Dart objects using custom data models.
- Managed complex nested JSON structures for fields like name, id, and quote.
-
Error Handling:
- Included exception handling to manage API failures or invalid data formats.
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
-
Clone the Repository:
git clone https://github.com/Siddiqui145/quotes_app.git cd quotes_app -
Install Dependencies:
flutter pub get
-
Run the App:
flutter run
Ensure you have an emulator or a connected device ready.
- 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.
- 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.
This project is for educational purposes and does not include a specific license. Feel free to fork and modify for your own learning.