Creating REST endpoints for the Notes application
Up until this chapter, we have mainly relied on free third-party APIs when building out our Flutter applications. Unfortunately, as developers, we won’t always be able to rely on open APIs or a backend team to build the services we need. Fortunately, the Dart language is just as capable of building APIs as it is for building Flutter applications. In this section, we will wrap up our Notes application by building our own backend API.
To build our API, we will be using dart_frog
, a fast and minimalistic framework that is heavily inspired by Node.js and Next.js and allows developers to build backends in Dart. Start by installing dart_frog
globally using the following command:
dart pub global activate dart_frog_cli
Once the command is finished running, we are ready to create our project. Run the following command at the root of the project, a level above the application:
dart_frog create notes_api
After running this...