InAppStory

A Flutter plugin to use InAppStory SDK. Supports Android and iOS platforms.

Currently under development & not published

The full documentation for InAppStory SDK can be found on docs.inappstory.com.

Installation

Add dependency in your app pubspec.yaml

dependencies:
  inappstory_plugin: ^0.5.4

Full example

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final initialization = InAppStoryPlugin().initWith('<your api key>', '<user id>');

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme
            .of(context)
            .colorScheme
            .inversePrimary,
        title: Text(widget.title),
      ),
      body: FutureBuilder(
        future: initialization,
        builder: (context, initializationSnapshot) {
          if (initializationSnapshot.connectionState ==
              ConnectionState.done) {
            if (initializationSnapshot.hasError) {
              return const Text('SDK was not initialized');
            } else {
              return FeedStoriesWidget(
                feed: feed,
              );
            }
          }
          return const Center(
            child: CircularProgressIndicator(),
          );
        },
      ),
    );
  }
}