1. MarketPlace
Game Loom
  • Game Loom
    • 👋 Welcome to Game Loom
  • Getting started
    • Introduction
    • 👤 Authentication
  • User Registration
    • Introduction
    • Get Countries
      GET
    • Get Cities
      GET
    • Single user registration
      POST
    • Bulk Register Users
      POST
  • Notifications
    • Overview
    • Receiving Event Notifications via Webhooks
    • Get All notifications for specific user
      GET
  • Rewards
    • Overview
    • Integrate with you reward system
    • Points
      • Record user point event
      • Get user points
      • Get Specific user point
    • Levels
      • Record user level event
      • Get user levels
      • Get Specific user level
    • Badges
      • Award badge to user
      • Get user badges
      • Get Specific user badge
  • Challenges (Gamification elements)
    • Introduction
    • Leaderboard
      • Get available leaderboards for user
      • Submit score to a leaderboard
      • Get user's leaderboard participation history
      • Get leaderboard details
      • Get leaderboard ranking
      • Get user's record for a leaderboard
      • Get user's entry history for a leaderboard
    • Survey
      • Overview
      • Get available surveys for user
      • Start a new survey participation
      • Get detailed user participation
      • Get user's survey participation history
      • Abandon survey participation
      • Save individual answer to survey question
      • Submit completed survey
      • Submit Survey with answers (One-Step Submission)
    • Quiz
      • Get available quizzes for user
      • Submit complete quiz answers
      • Get comprehensive user quiz history
      • Get comprehensive quiz attempt details
    • Open Challenge
      • Overview
      • Get available open challenges for user
      • Complete an open challenge
      • Get user's open challenge participation history
      • Get user open challenge by ID
    • Streak
      • Create a streak by external Id
      • Get a streak by ExternalId
      • Update own streak
      • Enable or disable own streak
      • Get User Streak Progress.
      • Post Streak Activity
    • Schemas
      • Survey Schame
  • MarketPlace
    • Overview
    • Flutter SDK
    • Marketplace
      • Browse available gifts for user
      • Get gift details
      • Redeem a gift
      • Get user's redemption history
    • Schemas
      • ProblemDetails
      • Pagination
  1. MarketPlace

Flutter SDK

GameLoom Flutter SDK#

A Flutter package for integrating the GameLoom marketplace into your app. Let your users browse gifts, redeem them using earned points, and view their redemption history — all handled by GameLoom.
GameLoom manages stock, point deduction, eligibility filtering, delivery tracking, and localization. You initialize the SDK, log in a user, and drop in the MarketApp widget.

Table of Contents#

Requirements
Installation
Quick Start
Configuration
SDK Reference
Initialization
User Login
Callbacks
State
Displaying the Marketplace
Models
User
Product
Redemption
ProductHistory
Theming
Localization
Error Handling

Requirements#

Flutter >=1.17.0
Dart SDK >=3.11.0

Installation#

Add the dependency to your pubspec.yaml:

Quick Start#

Then place the marketplace anywhere in your widget tree:

Configuration#

GameLoomConfigs is passed to GameLoomSDK().init().
ParameterTypeRequiredDescription
sdkKeyStringYesYour private SDK key
localSupportedLocaleYesUI language: SupportedLocale.en or SupportedLocale.ar
themeModeThemeModeNoThemeMode.light, ThemeMode.dark, or ThemeMode.system (default)

SDK Reference#

Initialization#

Fetches company data (logo, brand colors, corner radius) and prepares the SDK. Must be called before login() or displaying MarketApp.

User Login#

The SDK uses userKey to fetch and filter gifts. Targeting (gender, age, country, city, segments) controls which private gifts the user sees.
Note: if the user does not exist, login will register them with the provided information (name, gender, birthDate, country, city, segments).

Callbacks#

Set these static callbacks before calling init():

Debugging#

Enable network request/response logging for development:
Set this before calling init(). Disable in production.

State#

GameLoomSDK is a BLoC cubit. You can listen to its state stream if you need to react to lifecycle changes:
StateMeaning
GameLoomUninitializedStateSDK not yet initialized
GameLoomInitializingStateinit() in progress
GameLoomInitializedStateinit() succeeded
GameLoomInitializedErrorStateinit() failed
GameLoomLoadedStateUser logged in — state.user available
GameLoomLoadingStateA loading operation is running
GameLoomErrorStateError after initialization
Static getters (available after the respective states are reached):

Displaying the Marketplace#

Drop MarketApp anywhere in your widget tree. It is self-contained and manages its own BLoC providers, theming, and navigation.
The marketplace renders two tabs:
Shop — browseable gift grid with search, category filtering, price range, and sorting
History — the user's redemption history with order and delivery status

Filter & Sort Options#

Users can filter gifts by:
FilterOptions
CategoryFetched from the server
Product typeProduct or Coupon
Points rangeSlider between min/max available
Limited edition onlyToggle
Sort byFeatured, Points (low→high), Points (high→low), Name (A→Z)

Models#

User#

Product#

Returned from the marketplace browse and detail endpoints.
FieldTypeDescription
idStringGift ID
nameStringResolved to the configured language
imageUrlString?Gift image URL
categoryNameStringCategory label
descriptionString?Gift description
pricePointsdouble?Points cost
priceSardouble?SAR cost
priceDisplayProductPriceDisplaypoints, sar, or both
isUnlimitedboolWhether stock is unlimited
remainingStockint?null when unlimited
rankingint?Display order (lower = first)
collectCustomerInfoboolWhether name + phone are required at redemption
deliveryRequiredboolWhether a delivery address is required
expiresAtDateTime?Gift expiry
createdAtDateTimeCreation timestamp

Redemption#

Returned after a successful redemption.
FieldTypeDescription
redemptionMessageString?Message to display to the user
redemptionValueString?Voucher code or delivery confirmation

ProductHistory#

FieldTypeDescription
idStringRedemption ID
giftNameStringName of the redeemed gift
giftImageUrlString?Gift image URL
pointsSpentdoublePoints deducted
orderStatusOrderStatuscompleted, failed, or cancelled
deliveryStatusDeliveryStatus?pending or completed
deliveryRequiredboolWhether delivery info was collected
createdAtDateTimeRedemption timestamp

Theming#

The SDK pulls brand colors and corner radius from your company settings automatically after init(). You can also configure the theme mode via GameLoomConfigs.themeMode.
Default light theme colors:
Primary: #1D8660
Secondary: #F4F4F6
Surface: #FFFFFF
Default dark theme colors:
Primary: #1D8660
Secondary: #232325
Surface: #121212
If your company has configured custom colors in the GameLoom dashboard, those override the defaults.

Localization#

The SDK ships with full English and Arabic support, including RTL layout for Arabic.
Set the locale during initialization:
All gift names, images, redemption messages, and error messages are resolved server-side to the configured language. If a translation does not exist, the default value is returned.

Error Handling#

The SDK surfaces errors through the GameLoomSDK.onFailure callback. Set it before calling init():

Dependency Resolution#

The SDK uses the following packages internally. If you encounter version conflicts with your app's dependencies, use dependency_overrides in your pubspec.yaml to resolve them:
PackageVersion constraint
flutter_bloc>=9.0.0 <10.0.0
dio>=5.0.0 <6.0.0
dio_cache_interceptor>=4.0.0 <5.0.0
dartz^0.10.1
intlbundled via flutter_localizations
Example override:
Modified at 2026-05-22 12:25:13
Previous
Overview
Next
Browse available gifts for user
Built with