> ## Documentation Index
> Fetch the complete documentation index at: https://learn.social.plus/llms.txt
> Use this file to discover all available pages before exploring further.

# Flutter

> Get up and running with social.plus Flutter SDK for cross-platform applications in minutes.

Get your Flutter app connected to social.plus in just a few steps. This guide covers everything from installation to your first authenticated session.

## Requirements

* Flutter 3.0.0 - 4.0.0
* Dart 3.0.0+
* iOS 9.0+ / Android 4.4 (API 19)+

## Installation

Add the social.plus SDK to your `pubspec.yaml`:

```yaml theme={null}
dependencies:
  flutter:
    sdk: flutter
  amity_sdk: ^x.y.z  # Check latest version
```

Run the installation command:

```bash theme={null}
flutter pub get
```

<Info>
  `pubspec.yaml` via pub.dev is the only supported installation method for the social.plus Flutter SDK. Find the latest version at [pub.dev/packages/amity\_sdk](https://pub.dev/packages/amity_sdk). If you need to pin to a specific version or git ref, use Dart's standard [git-dependency syntax](https://dart.dev/tools/pub/dependencies#git-packages) in `pubspec.yaml` — no separate alternative install path is required.
</Info>

## Project Configuration

Before you initialize the Flutter SDK, make sure the generated iOS and Android projects meet the native platform requirements.

These native settings usually only need to be configured once per app, but they must be in place before you run the SDK on a device or simulator.

<Note>
  After changing either native project configuration, rerun `flutter pub get` and rebuild the app so the generated platform projects pick up the updated settings.
</Note>

Use the native Flutter project files below as your source of truth for these platform-level settings.

### iOS Configuration

Set the minimum iOS deployment target in `ios/Podfile`. The Flutter SDK example project uses a Podfile with the standard Flutter target setup, and you should set the platform version explicitly before running `pod install`.

```ruby Podfile theme={null}
platform :ios, '12.0'

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
```

<Note>
  The Flutter SDK example Podfile includes the standard Runner target and leaves the `platform` line commented as `12.0`; set it explicitly in your app so CocoaPods resolves the SDK against the correct deployment target.
</Note>

### Android Configuration

Keep your Android minimum SDK at Android 4.4 / API 19 or higher. The Flutter SDK example app inherits Flutter's default through `flutter.minSdkVersion`, so set an explicit value if your project overrides that default.

```groovy build.gradle theme={null}
android {
    defaultConfig {
        applicationId "com.example.example"
        minSdkVersion 19
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
}
```

<Info>
  The Flutter SDK example app uses `minSdkVersion flutter.minSdkVersion` in `example/android/app/build.gradle`; if you override it in your own app, keep the value at 19 or above to match the SDK requirements.
</Info>

## Initialize the SDK

Create the client with your API key so the SDK is ready for authentication.

<CodeGroup>
  ```dart Flutter theme={null}
  Future<void> initializeSDK() async {
    await AmityCoreClient.setup(
      option: AmityCoreClientOption.create(
        apiKey: 'YOUR_API_KEY',
      ),
    );
  }
  ```
</CodeGroup>

<Info>
  This creates the SDK client but does not yet authenticate a user. See [Authentication](/social-plus-sdk/getting-started/authentication) for the next step.
</Info>

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication Guide" icon="shield-check" href="/social-plus-sdk/getting-started/authentication">
    Learn about session management and secure authentication flows
  </Card>

  <Card title="Chat Features" icon="message" href="/social-plus-sdk/chat/overview">
    Start building chat and messaging features
  </Card>

  <Card title="Social Features" icon="users" href="/social-plus-sdk/social/README">
    Add posts, feeds, and social interactions
  </Card>

  <Card title="Video Streaming" icon="video" href="/social-plus-sdk/video-new/broadcasting/overview">
    Implement live video and streaming features
  </Card>
</CardGroup>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Installation Issues" icon="wrench">
    **Package not found**: Make sure you've added the correct package name to pubspec.yaml

    **Version conflicts**: Use `flutter pub deps` to check for dependency conflicts

    **Build errors**: Run `flutter clean` and `flutter pub get` to refresh dependencies
  </Accordion>

  <Accordion title="Runtime Issues" icon="bug">
    **SDK not initialized**: Make sure you call `AmityCoreClient.setup()` before using any SDK features

    **Authentication failures**: Verify your API key and region settings

    **Session state issues**: Ensure you're properly listening to session state changes
  </Accordion>

  <Accordion title="Platform-Specific Issues" icon="mobile">
    **iOS build fails**: Ensure minimum iOS version is set to 9.0+

    **Android build fails**: Check that minimum SDK is set to 19+
  </Accordion>
</AccordionGroup>
