ACME API Documentation logo

Flutter

Manage your users' social media accounts from Flutter using the ACME Flutter SDK package

Overview

Flutter is Google's UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

The ACME Flutter SDK package allows you to integrate ACME's social media API with your Flutter apps.

Installing

Install the package as a library in your app.

 $ flutter pub add acme_flutter
ACME Flutter Package

ACME Flutter SDK package

Usage Example of Posting

This sample app creates a button which calls the post function. It posts a random quote and a random image to the linked Twitter and Facebook accounts. It prints the response which includes the URLs for the live posts on the social networks.

import 'package:flutter/material.dart';
import 'acme_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 acme.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'),
          ),
        ));
  }
}

More Information and Documentation