progamification 1.7.0 copy "progamification: ^1.7.0" to clipboard
progamification: ^1.7.0 copied to clipboard

Pro Gamification - Package.

example/lib/main.dart

import 'package:RewardRally/screen/layout.dart';
import 'package:RewardRally/src/environments/env.dart';
import 'package:flutter/material.dart';
import 'package:progamification/progamification.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  ProgamificationConfig.initialize(clientId, clientSecret, userId, appId);
  await GamificationService.init();

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      debugShowCheckedModeBanner: false,
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);
  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  Future<void> _incrementCounter() async {
    await GamificationService.updateGameAction(userId, gameActionId, '', '');
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Bus Booking',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(primarySwatch: Colors.lightGreen),
      home: Scaffold(body: Layout(title: "")),
    );
  }
}