Skip to content

Commit

Permalink
fix(Flutter): Added required flags to sandbox command when using Flut…
Browse files Browse the repository at this point in the history
…ter (aws-amplify#7660)

* Added required flags for sandbox command when using Flutter

* Update src/pages/[platform]/start/quickstart/index.mdx

* Apply suggestions from code review

Updated the platform filters.

Co-authored-by: josef <josef.aidt@gmail.com>

---------

Co-authored-by: josef <josef.aidt@gmail.com>
  • Loading branch information
naedx and josefaidt authored May 28, 2024
1 parent bef0e7e commit 3e382bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/pages/[platform]/build-a-backend/auth/set-up-auth/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,15 @@ npx ampx sandbox
<InlineFilter filters={['flutter']}>

```bash title="Terminal" showLineNumbers={false}
npx ampx sandbox --config-format dart --config-out-dir lib
npx ampx sandbox --outputs-format dart --outputs-out-dir lib --outputs-version 0
```

<Callout info>

**Note:** when using Amplify Gen 2 with Flutter, you must downgrade the generated client configuration file (`amplify_outputs.dart`) with [`--outputs-version 0`](/[platform]/reference/cli-commands/#npx-ampx-generate-outputs)

</Callout>

</InlineFilter>
<InlineFilter filters={['android']}>

Expand Down Expand Up @@ -382,12 +388,6 @@ flutter pub get

Next, update your `main.dart` file with the following:

<Callout info>

**Note:** when using Amplify Gen 2 with Flutter, you must downgrade the generated client configuration file (`amplify_outputs.dart`) with [`--outputs-version 0`](/[platform]/reference/cli-commands/#npx-ampx-generate-outputs)

</Callout>

```dart
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
Expand Down
16 changes: 15 additions & 1 deletion src/pages/[platform]/start/quickstart/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1296,10 +1296,24 @@ Running this command will scaffold Amplify backend files in your current project
To deploy your backend use Amplify's per-developer cloud sandbox. This feature provides a separate backend environment for every developer on a team, ideal for local development and testing. To run your application with a sandbox environment, you can run the following command:


<InlineFilter filters={["android", "javascript", "react-native", "angular", "nextjs", "react", "react-native", "vue", "swift"]}>
```bash title="Terminal" showLineNumbers={false}
npx ampx sandbox --outputs-format dart --outputs-out-dir lib
npx ampx sandbox

```
</InlineFilter>
<InlineFilter filters={["flutter"]}>
```bash title="Terminal" showLineNumbers={false}
npx ampx sandbox --outputs-format dart --outputs-out-dir lib --outputs-version 0
```

<Callout info>

**Note:** when using Amplify Gen 2 with Flutter, you must downgrade the generated client configuration file (`amplify_outputs.dart`) with [`--outputs-version 0`](/[platform]/reference/cli-commands/#npx-ampx-generate-outputs)

</Callout>
</InlineFilter>

## Adding Authentication

The initial scaffolding already has a pre-configured auth backend defined in the `amplify/auth/resource`.ts file. We've configured it to support email and password login but you can extend it to support a variety of login mechanisms, including Google, Amazon, Sign In With Apple, and Facebook.
Expand Down

0 comments on commit 3e382bd

Please sign in to comment.