> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Flutter

> Verwalten Sie die Social-Media-Konten Ihrer Nutzer aus Flutter mit dem Ayrshare-Flutter-SDK-Paket

## Überblick

[Flutter](https://flutter.dev) ist das UI-Toolkit von Google zum Erstellen schöner, nativ kompilierter Anwendungen für Mobile, Web und Desktop aus einer einzigen Codebasis.

Das Ayrshare-Flutter-SDK-Paket ermöglicht Ihnen die Integration der Ayrshare-Social-Media-API in Ihre Flutter-Apps.

## Installation

Installieren Sie das Paket als Bibliothek in Ihrer App.

```shell theme={"system"}
 $ flutter pub add ayrshare_flutter
```

<Card title="Ayrshare-Flutter-Paket" icon="flutter" href="https://pub.dev/packages/ayrshare_flutter" horizontal>
  Ayrshare-Flutter-SDK-Paket
</Card>

## Verwendungsbeispiel für das Posten

Diese Beispiel-App erstellt eine Schaltfläche, die die Post-Funktion aufruft. Sie postet ein zufälliges Zitat und ein zufälliges Bild an die verknüpften Twitter- und Facebook-Konten. Sie gibt die Antwort aus, die die URLs zu den Live-Beiträgen auf den sozialen Netzwerken enthält.

```dart theme={"system"}
import 'package:flutter/material.dart';
import 'ayrshare_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: PostingPage(),
    );
  }
}

class PostingPage extends StatelessWidget {
  ///TODO get your API key by signing up at ayrshare.com
  final apiKey = '###-###-###-###';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // appBar: null,
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              await post(
                apiKey: apiKey,
                body: {
                  'randomPost': true,
                  'platforms': ['twitter', 'facebook'],
                  'randomMediaUrl': true
                },
              ).then((value) => print(value));
            },
            child: const Text('Post To Social'),
          ),
        ));
  }
}
```

## Weitere Informationen und Dokumentation

<ul class="custom-bullets">
  <li>
    Öffnen Sie die Linking-Seite (generateJWT) unter [iOS mit
    Flutter](/apis/profiles/generate-jwt#mobile-jwt-examples).
  </li>

  <li>[GitHub-Repository](https://github.com/ayrshare/ayrshare_flutter)</li>
  <li>[Changelog](https://pub.dev/packages/ayrshare_flutter/changelog)</li>
</ul>
