Challenge: Serializing JSON Using json_serializable
Challenge yourself to use code generation libraries.
We'll cover the following...
We'll cover the following...
Goal
This challenge aims to help you understand how code generation works using the json_serializable
library to generate JSON serialization boilerplate. You will learn to use the official documentation of the packages.
Specs
When you run your app and navigate to “Realtime Transactions,” a list of transactions streams in, except this time, you are fetching serialized data:
Starter code
Before you begin the challenge, look at the starter code below and run it. Once done, you can dive into the challenges below.
import 'package:flutter/material.dart'; import 'presentation/my_app.dart'; void main() async{ runApp(const MyApp()); }
Serialization app challenge starter
Challenges
Challenge 1: Set up json_serializable
To make use of json_serializable
, you’ll need to include one dependency, ...