Lab 09
Lab 09
Student Name
CMSID
Semester 5th
Lesson Set Building Applications that Require CRUD Tasks and
Communication with the Internet
9
Purpose 1. Understand the basic concepts of CRUD operations in a Flutter app.
2. Learn how to make HTTP requests using the http package.
3. Handle JSON data to interact with APIs.
4. Implement asynchronous programming concepts for network
communication.
5. Build a simple UI for CRUD operations.
Procedure 6. Students should read the Pre-lab Reading assignment before coming to the
lab.
7. Students should complete the Pre-lab Writing assignment before entering
the lab.
8. In the lab, students should complete Labs 9.1 through 9.4 in sequence.
Your instructor will give further instructions on grading and completing the
lab.
9. Students should complete the set of lab tasks before the next lab and get
them checked by their lab instructor.
Lab 9
2|Page
PRE-LAB READING ASSIGNMENT
HTTP Use the http package to perform HTTP requests (GET, POST, PUT,
Communicatio DELETE).
n in Flutter Handle responses and parse JSON data.
Asynchronous Use Future, async, and await to handle asynchronous API calls
Programming
Self-Study: https://medium.com/@hemant.ramphul/complete-sqlite-crud-
operations-in-flutter-6cbba8582c45
3|Page
PRELAB WRITING ASSIGNMENT
Fill in the 1. CRUD stands for _____, _____, _____, and _____.
blanks
2. A _____ is a common API format for fetching or sending data over the
internet, often structured in key-value pairs.
3. The _____ widget in Flutter is used to build parts of the UI based on the state
of a Future.
4. A REST API communicates using the _____ protocol and employs standard
HTTP methods like GET, POST, PUT, and DELETE.
5. The _____ method in Dart’s http package is used to retrieve data from a
REST API endpoint.
4|Page
Lab 9.2 Lab Tasks
1. Fetch Data: Modify the app to display a list of users instead of posts from JSONPlaceholder.
2. Create Data: Add a form to allow users to create a new post and display it in the list.
3. Update Data: Add an edit button to modify a post's title and body.
4. Delete Data: Add a delete button to remove a post from the list.
Note: Make sure to upload the code for each task to a GitHub repository. Do not update or
change the repository after the due date. Provide the link to your GitHub repository with each
task submission.
5|Page