From c7d851067b7283480762dac8502eef20e48ac428 Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Sat, 9 Mar 2024 13:09:43 -0800 Subject: [PATCH] chore: Update README Include the latest changes from the 0.2.0 release --- README.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7a8193ad..f0964644 100644 --- a/README.md +++ b/README.md @@ -47,15 +47,15 @@ The CLI will also create a folder in your project called `celest`, which will in ```shell flutter_app/ └── celest/ - ├── config/ - │ └── .env # Environment variables - ├── functions/ # Celest Functions folder - | └── greeting.dart # Example API file + ├── functions/ # Celest Functions folder + | └── greeting.dart # Example API file ├── lib/ - │ │── client.dart # Generated client for your Flutter app - │ ├── models.dart # Custom API models - │ └── exceptions.dart # Custom API exceptions - └── test/ # Tests for your backend + │ │── client.dart # Generated client for your Flutter app + │ ├── models/ # Custom API models + | | └── person.dart + │ └── exceptions/ # Custom API exceptions + | └── bad_name_exception.dart + └── test/ # Tests for your backend ``` To get started building your serverless cloud function, navigate to the `/celest/functions/` folder and create a file named `.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. @@ -63,11 +63,15 @@ To get started building your serverless cloud function, navigate to the ` sayHello(String name) async { +Future sayHello({ + required String name, +}) async { return 'Hello, $name'; } -Future sayGoodbye(String name) async { +Future sayGoodbye({ + required String name, +}) async { return 'Goodbye, $name'; } ``` @@ -98,7 +102,7 @@ class MyApp extends StatelessWidget { body: Center( child: FutureBuilder( // Call your function using the Celest client - future: celest.functions.greeting.sayHello('Celest'), + future: celest.functions.greeting.sayHello(name: 'Celest'), builder: (_, snapshot) => switch (snapshot) { AsyncSnapshot(:final data?) => Text(data), AsyncSnapshot(:final error?) =>