Tata Rewards

Tata Rewards package lets you add a widget that supports stuffs to rewards to your Flutter app.

Installation

  1. Add the latest version of package to your pubspec.yaml (and runflutter pub get):
dependencies:
  tata_rewards: ^0.0.47
  1. Import the package and use it in your Flutter App.
    import 'package:tata_rewards/tata_rewards.dart';

Example

There are a number of properties that you can modify:

https://docs.google.com/spreadsheets/d/1XLEHj1LGox_S-whE9bJ5HoMCyNYrhE37eOzf-Ci0qXc/edit?usp=sharing ( but for this need to get verify from ESMAGICO)



import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:tata_rewards/tata_rewards.dart';

import 'firebase_options.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  http.Client httpClient = http.Client();

  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);

  // Initialize the SDK
  await MyRewardsSdk.instance.initialize(
    httpClient: httpClient,
    // tdlBaseUrl: "",
    tdlBaseUrl: "",
    tplBaseUrl: "",
  );

  await MyRewardsSdk.instance.notifyLogin(
      tdlToken:
      "",
      tplToken: "");
  runApp(const MyApp());
}

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Gamification SDK',
      debugShowCheckedModeBanner: false,
      home: HomePage(),
    );
  }
}

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

  @override
  State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("My Rewards Sdk"),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Center(
            child: ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                      builder: (context) => MyRewardsPage(
                        title: "My Rewards",
                        externalCustomerId: "",
                        myRewardsPadding: 16,
                        sectionGap: const SizedBox(
                          height: 24,
                        ),
                      )),
                );
              },
              child: const Text("Gamification Sdk"),
            ),
          )
        ],
      ),
    );
  }
}

Tata Rewards

Next Goals

  • x đŸ•šī¸ Expand Games Portfolio Add new games alongside Scratch Cards, like Spin-the-Wheel, offering diverse gamified experiences.

  • x 🧠 AI-Powered Trivia Introduce engaging trivia games powered by AI to elevate user interaction.

  • x 🔍 Advanced Analytics Coming soon: Gain insights into user engagement and performance metrics with enhanced reporting tools.

Libraries

tata_rewards