Skip to content

Commit 0bbc6ea

Browse files
committed
chore: Update README
Include the latest changes from the 0.2.0 release
1 parent ce29a2c commit 0bbc6ea

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,31 @@ The CLI will also create a folder in your project called `celest`, which will in
4747
```shell
4848
flutter_app/
4949
└── celest/
50-
├── config/
51-
│ └── .env # Environment variables
52-
├── functions/ # Celest Functions folder
53-
| └── greeting.dart # Example API file
50+
├── functions/ # Celest Functions folder
51+
| └── greeting.dart # Example API file
5452
├── lib/
55-
│ │── client.dart # Generated client for your Flutter app
56-
│ ├── models.dart # Custom API models
57-
│ └── exceptions.dart # Custom API exceptions
58-
└── test/ # Tests for your backend
53+
│ │── client.dart # Generated client for your Flutter app
54+
│ ├── models/ # Custom API models
55+
| | └── person.dart
56+
│ └── exceptions/ # Custom API exceptions
57+
| └── bad_name_exception.dart
58+
└── test/ # Tests for your backend
5959
```
6060

6161
To get started building your serverless cloud function, navigate to the `<flutter_app>/celest/functions/` folder and create a file named `<api_name>.dart`. You can create as many APIs as you want in this directory. Think of each file as a way to organize and group multiple Celest Functions of similar functionality into a namespace.
6262

6363
Celest Functions are defined as top-level functions as shown below.
6464

6565
```dart
66-
Future<String> sayHello(String name) async {
66+
Future<String> sayHello({
67+
required String name,
68+
}) async {
6769
return 'Hello, $name';
6870
}
6971
70-
Future<String> sayGoodbye(String name) async {
72+
Future<String> sayGoodbye({
73+
required String name,
74+
}) async {
7175
return 'Goodbye, $name';
7276
}
7377
```
@@ -98,7 +102,7 @@ class MyApp extends StatelessWidget {
98102
body: Center(
99103
child: FutureBuilder(
100104
// Call your function using the Celest client
101-
future: celest.functions.greeting.sayHello('Celest'),
105+
future: celest.functions.greeting.sayHello(name: 'Celest'),
102106
builder: (_, snapshot) => switch (snapshot) {
103107
AsyncSnapshot(:final data?) => Text(data),
104108
AsyncSnapshot(:final error?) =>

0 commit comments

Comments
 (0)