Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 7b99572

Browse files
HomelessDinosaurdavemooreuws
authored andcommitted
add frontmatter
1 parent ebd4a90 commit 7b99572

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

docs/guides/dart/flutter.mdx

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
export const description =
2-
'Use the Nitric framework to easily build and deploy a backend for your Flutter application'
3-
4-
export const title_meta = 'Building a Full Stack Flutter Application in Dart'
1+
---
2+
description: Use the Nitric framework to easily build and deploy a backend for your Flutter application
3+
title_seo: Building a Full Stack Flutter Application in Dart
4+
tags:
5+
- Frontend
6+
- Key Value Store
7+
- API
8+
---
59

610
# Building a Full Stack Flutter Application in Dart
711

@@ -125,21 +129,23 @@ import 'dart:convert';
125129
...
126130
127131
api.get("/favorites", (ctx) async {
128-
// Get a list of all the keys in the store
129-
var keys = await favouritesKV.keys();
132+
// Get a list of all the keys in the store
133+
var keys = await favouritesKV.keys();
130134
131-
var favourites = await keys.asyncMap((k) async {
132-
final favourite = await favouritesKV.get(k);
135+
var favourites = await keys.asyncMap((k) async {
136+
final favourite = await favouritesKV.get(k);
133137
134138
return favourite;
135-
}).toList();
136139
137-
// Return the body as a list of favorites
138-
ctx.res.body = jsonEncode(favorites);
139-
ctx.res.headers["Content-Type"] = ["application/json"];
140+
}).toList();
140141
141-
return ctx;
142+
// Return the body as a list of favorites
143+
ctx.res.body = jsonEncode(favorites);
144+
ctx.res.headers["Content-Type"] = ["application/json"];
145+
146+
return ctx;
142147
});
148+
143149
```
144150

145151
We can then define the route for adding favorites. This will toggle a favorite on or off depending on whether the key exists in the key value store. Make sure you import the `favorite` class from `package:word_generator/favorite.dart`
@@ -1006,9 +1012,9 @@ At this point, we can get started on deploying our application. The frontend app
10061012

10071013
For the backend, start by setting up your credentials and any configuration for the cloud you prefer:
10081014

1009-
- [AWS](/reference/providers/pulumi/aws)
1010-
- [Azure](/reference/providers/pulumi/azure)
1011-
- [Google Cloud](/reference/providers/pulumi/gcp)
1015+
- [AWS](/providers/pulumi/aws)
1016+
- [Azure](/providers/pulumi/azure)
1017+
- [Google Cloud](/providers/pulumi/gcp)
10121018

10131019
Next, we'll need to create a `stack`. Stacks represent deployed instances of an application, including the target provider and other details such as the deployment region. You'll usually define separate stacks for each environment such as development, testing and production. For now, let's start by creating a `dev` stack for AWS.
10141020

0 commit comments

Comments
 (0)