Skip to content

Commit 3e382bd

Browse files
naedxjosefaidt
andauthored
fix(Flutter): Added required flags to sandbox command when using Flutter (#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 <[email protected]> --------- Co-authored-by: josef <[email protected]>
1 parent bef0e7e commit 3e382bd

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

src/pages/[platform]/build-a-backend/auth/set-up-auth/index.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,15 @@ npx ampx sandbox
6969
<InlineFilter filters={['flutter']}>
7070

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

75+
<Callout info>
76+
77+
**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)
78+
79+
</Callout>
80+
7581
</InlineFilter>
7682
<InlineFilter filters={['android']}>
7783

@@ -382,12 +388,6 @@ flutter pub get
382388

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

385-
<Callout info>
386-
387-
**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)
388-
389-
</Callout>
390-
391391
```dart
392392
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
393393
import 'package:amplify_authenticator/amplify_authenticator.dart';

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,10 +1296,24 @@ Running this command will scaffold Amplify backend files in your current project
12961296
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:
12971297

12981298

1299+
<InlineFilter filters={["android", "javascript", "react-native", "angular", "nextjs", "react", "react-native", "vue", "swift"]}>
12991300
```bash title="Terminal" showLineNumbers={false}
1300-
npx ampx sandbox --outputs-format dart --outputs-out-dir lib
1301+
npx ampx sandbox
1302+
1303+
```
1304+
</InlineFilter>
1305+
<InlineFilter filters={["flutter"]}>
1306+
```bash title="Terminal" showLineNumbers={false}
1307+
npx ampx sandbox --outputs-format dart --outputs-out-dir lib --outputs-version 0
13011308
```
13021309

1310+
<Callout info>
1311+
1312+
**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)
1313+
1314+
</Callout>
1315+
</InlineFilter>
1316+
13031317
## Adding Authentication
13041318

13051319
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.

0 commit comments

Comments
 (0)