Flutter SDK (https://pub.dev/packages/simula_ads) for integrating native advertising and mini-game components into AI character apps.

image.png


Quick Start

1. Provider Setup

Wrap your application with SimulaProvider to initialize the SDK:

@override
  Widget build(BuildContext context) {
    return SimulaProvider(
      apiKey: 'SIMULA_xxx', // Your API key
      child: {/* Your application child */}
      primaryUserID: 'xxxxx', // Optional: Hashed publisher provided user ID, highly recommended for better ad targeting,
      hasPrivacyConsent: true, // Optional: Privacy consent flag. When false, suppresses collection of PII 
      devMode: false, // Optional: Determines whether session is in dev mode or not
    );
  }

2. Component Integration

Add components where you want ads or games to appear.


Components

MiniGameMenu

Modal component for displaying and launching sponsored mini-games. Clicking on a sponsored mini game opens an iframe that allows for a playable game.

image.png

Basic Usage

class ChatInterface extends StatefulWidget {
  @override
  _ChatInterfaceState createState() => _ChatInterfaceState();
}

class _ChatInterfaceState extends State<ChatInterface> {
  bool menuOpen = false;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        ElevatedButton(
          onPressed: () => setState(() => menuOpen = true),
          child: Text('Play Games'),
        ),
        MiniGameMenu(
          isOpen: menuOpen,
          onClose: () => setState(() => menuOpen = false),
          charName: 'Luna',
          charID: 'luna-123',
          charImage: '<https://cdn.example.com/avatars/luna.png>',
        ),
      ],
    );
  }
}

Props

Prop Type Required Default Description
isOpen boolean Yes - Controls modal visibility
onClose VoidCallback Yes - Close event handler
charName string Yes - Character name displayed in header
charID string Yes - Character identifier
charImage string Yes - Character avatar URL
messages Message[] No [] Conversation history for context
charDesc string No - Character description
maxGamesToShow 3 6 9 No
theme MiniGameTheme No {} Theme configuration
consentRequiredMessage String? No - Custom message when privacy consent is not granted
delegateChar boolean No False Whether Character displays the messages inside of the Simula provided frame

Note: Minigames require privacy consent. If hasPrivacyConsent ****is false in SimulaProvider, the menu displays a consent required message instead of games.

Theme Configuration