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

# Flutter

> Ayrshare Flutter SDK package का उपयोग करके Flutter से अपने उपयोगकर्ताओं के सोशल मीडिया accounts का प्रबंधन करें

## अवलोकन

[Flutter](https://flutter.dev) एकल codebase से मोबाइल, वेब, और desktop के लिए सुंदर, natively compiled applications बनाने के लिए Google का UI toolkit है।

Ayrshare Flutter SDK package आपको अपने Flutter apps के साथ Ayrshare के सोशल मीडिया API को integrate करने की अनुमति देता है।

## स्थापना

अपने app में एक library के रूप में package स्थापित करें।

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

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

## Posting का उपयोग उदाहरण

यह नमूना app एक button बनाता है जो post function को call करता है। यह linked Twitter और Facebook accounts पर एक random quote और एक random image पोस्ट करता है। यह response प्रिंट करता है जिसमें सोशल नेटवर्क पर live पोस्ट्स के लिए URLs शामिल हैं।

```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'),
          ),
        ));
  }
}
```

## अधिक जानकारी और Documentation

<ul class="custom-bullets">
  <li>
    [iOS with
    Flutter](/apis/profiles/generate-jwt#mobile-jwt-examples) पर linking page (generateJWT) launch करें।
  </li>

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