Skip to content

Commit

Permalink
chore: add heading ids
Browse files Browse the repository at this point in the history
  • Loading branch information
charIeszhao committed Jan 26, 2025
1 parent 49c3698 commit 0c9db1c
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
20 changes: 10 additions & 10 deletions docs/quick-starts/framework/flutter/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,35 @@ This tutorial will show you how to integrate Logto into your Flutter application

<Tip />

## Prerequisites
## Prerequisites \{#prerequisites}

- A [Logto Cloud](https://cloud.logto.io) account or a [self-hosted Logto](/introduction/set-up-logto-oss).
- A Logto native application created.
- A Flutter or Dart development environment.

## Installation
## Installation \{#installation}

<Installation />

## Set up
## Set up \{#set-up}

<Dependency />

## Integration
## Integration \{#integration}

<Integration />

## Get user information
## Get user information \{#get-user-information}

<GetUserInfo />

## API resources and organizations
## API resources and organizations \{#api-resources-and-organizations}

<ApiResources />

<Organization />

## Migration guide
## Migration guide \{#migration-guide}

If you are migration from a previous version of Logto Dart SDK, version < 3.0.0:

Expand All @@ -77,9 +77,9 @@ If you are migration from a previous version of Logto Dart SDK, version < 3.0.0:
await logtoClient.signOut(redirectUri);
```

## Troubleshooting
## Troubleshooting \{#troubleshooting}

### Troubleshooting Android
### Troubleshooting Android \{#troubleshooting-android}

- You will need to update your AndroidManifest.xml to include the `com.linusu.flutter_web_auth_2.CallbackActivity` activity, something like:

Expand Down Expand Up @@ -118,6 +118,6 @@ If you are migration from a previous version of Logto Dart SDK, version < 3.0.0:
/>
```

## Further readings
## Further readings \{#further-readings}

<FurtherReadings />
4 changes: 2 additions & 2 deletions docs/quick-starts/framework/flutter/_api-resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import ConfigResourcesWithSharedScopesCode from './code-snippets/_resource-with-

<ApiResourcesDescription />

### Configure Logto client
### Configure Logto client \{#configure-logto-client}

<ConfigApiResources
configResourcesCode={<ConfigResourcesCode />}
configResourcesWithScopesCode={<ConfigResourcesWithScopesCode />}
configResourcesWithSharedScopesCode={<ConfigResourcesWithSharedScopesCode />}
/>

### Fetch access token for the API resource
### Fetch access token for the API resource \{#fetch-access-token-for-the-api-resource}

<FetchAccessTokenForApiResources
getAccessTokenApi="getAccessToken"
Expand Down
10 changes: 5 additions & 5 deletions docs/quick-starts/framework/flutter/_dependency.mdx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
### SDK version compatibility
### SDK version compatibility \{#sdk-version-compatibility}

| Logto SDK version | Dart SDK version | Dart 3.0 compatible |
| ----------------- | ----------------- | ------------------- |
| < 2.0.0 | >= 2.17.6 < 3.0.0 | false |
| >= 2.0.0 < 3.0.0 | >= 3.0.0 | true |
| >= 3.0.0 | >= 3.6.0 | true |

### flutter_secure_storage set up
### flutter_secure_storage set up \{#flutter_secure_storage-set-up}

Under the hood, this SDK uses [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) to implement the cross-platform persistent secure token storage.

- Keychain is used for iOS
- AES encryption is used for Android.

#### Config Android version
#### Config Android version \{#config-android-version}

Set the android:minSdkVersion to `>= 18` in your project's `android/app/build.gradle` file.

Expand All @@ -29,7 +29,7 @@ Set the android:minSdkVersion to `>= 18` in your project's `android/app/build.gr
}
```

#### Disable auto backup on Android
#### Disable auto backup on Android \{#disable-auto-backup-on-android}

By default Android backups data on Google Drive. It can cause exception `java.security.InvalidKeyException:Failed` to unwrap key. To avoid this,

Expand Down Expand Up @@ -73,7 +73,7 @@ By default Android backups data on Google Drive. It can cause exception `java.se

Please check [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage#configure-android-version) for more details.

### flutter_web_auth_2 set up
### flutter_web_auth_2 set up \{#flutter_web_auth_2-set-up}

Behind the scenes, this SDK uses [flutter_web_auth_2](https://pub.dev/packages/flutter_web_auth_2) to authenticate users with Logto. This package provides a simple way to authenticate users with Logto using the system webview or browser.

Expand Down
6 changes: 3 additions & 3 deletions docs/quick-starts/framework/flutter/_for-tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import FlutterIntegrationTip from './_tip.md';

<FlutterIntegrationTip />

## Installation
## Installation \{#installation}

<Installation />

## Dependency and configurations
## Dependency and configurations \{#dependency-and-configurations}

<Dependency />

## Integration
## Integration \{#integration}

<Integration />
6 changes: 3 additions & 3 deletions docs/quick-starts/framework/flutter/_get-user-info.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import DisplayUserInfo from './code-snippets/_display-userinfo.md';
import FetchUserInfo from './code-snippets/_fetch-userinfo.md';
import ScopesAndClaimsCode from './code-snippets/_scopes-code.mdx';

### Display user information
### Display user information \{#display-user-information}

To display the user's information, you can use the `logtoClient.idTokenClaims` getter. For example, in a Flutter app:

<DisplayUserInfo />

### Request additional claims
### Request additional claims \{#request-additional-claims}

<FindUserInfoMissing method="client.idTokenClaims" />

Expand All @@ -29,6 +29,6 @@ To request additional scopes, you can pass the scopes to the `LogtoConfig` objec
codeSnippet={<FetchUserInfo />}
/>

### Scopes and claims
### Scopes and claims \{#scopes-and-claims}

<ScopesAndClaims />
8 changes: 4 additions & 4 deletions docs/quick-starts/framework/flutter/_integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import ConfigurePostSignOutRedirectUri from '../../fragments/_configure-post-sig
import ConfigureRedirectUri from '../../fragments/_configure-redirect-uri.mdx';
import SignInFlowSummary from '../../fragments/_web-sign-in-flow-summary.mdx';

### Init LogtoClient
### Init LogtoClient \{#init-logtoclient}

Import the `logto_dart_sdk` package and initialize the `LogtoClient` instance at the root of your application.

Expand Down Expand Up @@ -71,7 +71,7 @@ class _MyHomePageState extends State<MyHomePage> {
}
```

### Implement sign-in
### Implement sign-in \{#implement-sign-in}

<SignInFlowSummary />

Expand Down Expand Up @@ -121,7 +121,7 @@ class _MyHomePageState extends State<MyHomePage> {
}
```

### Implement sign-out
### Implement sign-out \{#implement-sign-out}

<ConfigurePostSignOutRedirectUri
figureSrc={postSignOutRedirectUriFigure}
Expand Down Expand Up @@ -169,7 +169,7 @@ class _MyHomePageState extends State<MyHomePage> {
}
```

### Handle authentication status
### Handle authentication status \{#handle-authentication-status}

Logto SDK provides an asynchronous method to check the authentication status. The method is `logtoClient.isAuthenticated`. The method returns a boolean value, `true` if the user is authenticated, otherwise `false`.

Expand Down
2 changes: 1 addition & 1 deletion docs/quick-starts/framework/flutter/_organization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FetchOrganizationTokenForUser from '../../fragments/_fetch-organization-t
import GetOrganizationAccessTokenCode from './code-snippets/_get-organization-access-token.md';
import ConfigOrganizationCode from './code-snippets/_organization-config-code.md';

### Fetch access token for organizations
### Fetch access token for organizations \{#fetch-access-token-for-organizations}

Just like API resources, you may also request for a access token for organizations. This is useful when you need to access resources that are defined using the organization scope instead of the API resource scope.

Expand Down

0 comments on commit 0c9db1c

Please sign in to comment.