Skip to main content

Installation

Requirements

  • Flutter SDK >= 3.41.0
  • Dart >= 3.11.0
  • iOS 14+ / Android API 23+

Add dependency

The SDK is distributed via GitLab as a git dependency. Add it to your pubspec.yaml:

dependencies:
authcentral_sdk:
git:
url: <gitlab-repo-url>
path: authCentralSDK

Then run:

flutter pub get

iOS setup

Google Sign-In

Add the reversed client ID to ios/Runner/Info.plist:

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.YOUR_CLIENT_ID</string>
</array>
</dict>
</array>

Add your app scheme to Info.plist:

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>heroapp</string>
</array>
</dict>
</array>

Android setup

Add intent filters to android/app/src/main/AndroidManifest.xml:

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="heroapp" />
</intent-filter>

Environment variables

Store sensitive tokens in a .env file at the project root:

APP_TOKEN=your_private_token_here

Add .env to .gitignore. Run the app with:

flutter run --dart-define-from-file=.env

Access in code:

const appToken = String.fromEnvironment('APP_TOKEN');