|
26 | 26 | import OnboardingPlatformCard from './components/OnboardingPlatformCard.svelte';
|
27 | 27 | import { PlatformType } from '@appwrite.io/console';
|
28 | 28 | import { isCloud } from '$lib/system';
|
| 29 | + import { project } from '../../store'; |
29 | 30 |
|
30 | 31 | let showExitModal = false;
|
31 | 32 | let isPlatformCreated = false;
|
|
36 | 37 | const gitCloneCode =
|
37 | 38 | '\ngit clone https://github.com/appwrite/starter-for-flutter\ncd starter-for-flutter\n';
|
38 | 39 |
|
| 40 | + const baseConfig = `class Environment { |
| 41 | + static const String appwriteProjectId = '${projectId}'; |
| 42 | + static const String appwriteProjectName = '${$project.name}';`; |
| 43 | +
|
39 | 44 | const updateConfigCode = isCloud
|
40 |
| - ? `static const String APPWRITE_PROJECT_ID = "${projectId}"` |
41 |
| - : `static const String APPWRITE_PROJECT_ID = "${projectId}" |
42 |
| -static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}" |
43 |
| - `; |
| 45 | + ? `${baseConfig}\n}` |
| 46 | + : `${baseConfig} |
| 47 | + static const String appwriteEndpoint = '${sdk.forProject(page.params.region, page.params.project).client.config.endpoint}'; |
| 48 | +}`; |
44 | 49 |
|
45 | 50 | export let platform: PlatformType = PlatformType.Flutterandroid;
|
46 | 51 |
|
@@ -276,16 +281,18 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg
|
276 | 281 | </div>
|
277 | 282 |
|
278 | 283 | <Typography.Text variant="m-500"
|
279 |
| - >2. Open the file <InlineCode size="s" code="lib/constants/appwrite.dart" /> |
280 |
| - and update the configuration settings.</Typography.Text> |
| 284 | + >2. Replace <InlineCode size="s" code="lib/config/environment.dart" /> |
| 285 | + to reflect the values below:</Typography.Text> |
281 | 286 |
|
282 | 287 | <!-- Temporary fix: Remove this div once Code splitting issue with stack spacing is resolved -->
|
283 | 288 | <div class="pink2-code-margin-fix">
|
284 | 289 | <Code lang="dart" lineNumbers code={updateConfigCode} />
|
285 | 290 | </div>
|
286 | 291 |
|
287 | 292 | <Typography.Text variant="m-500"
|
288 |
| - >3. Run the app on a connected device or simulator, then click the <InlineCode |
| 293 | + >3. Run the app on a connected device or simulator using <InlineCode |
| 294 | + size="s" |
| 295 | + code="flutter run -d [device_name]" />, then click the <InlineCode |
289 | 296 | size="s"
|
290 | 297 | code="Send a ping" /> button to verify the setup.</Typography.Text>
|
291 | 298 | </Layout.Stack>
|
|
0 commit comments