gamifyhost_games 1.0.1 copy "gamifyhost_games: ^1.0.1" to clipboard
gamifyhost_games: ^1.0.1 copied to clipboard

Flutter SDK for embedding GamifyHost game widgets. Renders the GamifyHost game experience (Neon Wheel, Cosmic Slots, Enigma Boxes, Leaderboard) inside your Flutter app via WebView.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:gamifyhost_games/gamifyhost_games.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'GamifyHost Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(
          seedColor: const Color(0xFFD125F4),
          brightness: Brightness.dark,
        ),
        useMaterial3: true,
      ),
      home: const GameScreen(),
    );
  }
}

class GameScreen extends StatefulWidget {
  const GameScreen({super.key});

  @override
  State<GameScreen> createState() => _GameScreenState();
}

class _GameScreenState extends State<GameScreen> {
  final _controller = GamifyHostController();

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('GamifyHost Games'),
        actions: [
          IconButton(
            icon: const Icon(Icons.refresh),
            onPressed: () => _controller.reload(),
          ),
        ],
      ),
      body: GamifyHostWidget(
        config: const GamifyHostConfig(
          publicKey: 'pk_test_2a57fe9d2a8c6be83f42b98d30117ece',
          userId: 'user_12345',
          initialBalance: 5000,
        ),
        controller: _controller,
        onReady: () => debugPrint('GamifyHost widget loaded'),
        onError: (error) => debugPrint('GamifyHost error: $error'),
      ),
    );
  }
}
1
likes
160
points
151
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for embedding GamifyHost game widgets. Renders the GamifyHost game experience (Neon Wheel, Cosmic Slots, Enigma Boxes, Leaderboard) inside your Flutter app via WebView.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, webview_flutter

More

Packages that depend on gamifyhost_games