Flutter
Step 1: Set Up the Environment
Step 2: Integrate Flutter plugin
1.Config the pubspec.yaml file as follows
copy
rewards_flutter_widget:
git:
url: http://globaltech-git.alipay.com/aplus-mobile/rewards-widget-flutter-plugins.git
ref: release/1.1.0
2.Init
copy
MaterialApp(
localizationsDelegates: const [
RewardsWidgetLocalizations.delegate,//International registration category provided by Rewards flutter plugin
GlobalMaterialLocalizations.delegate,//Material UI component internationalization registration class
GlobalCupertinoLocalizations.delegate,//Cupertino UI component internationalization registration class
GlobalWidgetsLocalizations.delegate//General international registration class
],
locale: const Locale('en'),// English is supported by default
//locale: const Locale('ko'), // locale: const Locale('ko', 'KR'),
//locale: const Locale('th'), // locale: const Locale('th', 'TH'),
//locale: const Locale('id'), // locale: const Locale('id', 'ID'),
//locale: const Locale('zh', 'HK'),
supportedLocales: [...RewardsWidgetLocalizations.delegate.supportedLocales],// Languages supported by Rewards Widget Plugin
)
Multi-language description
The widget component supports the following languages,English is supported by default
- Korean (South Korea) ko / ko-KR
locale: const Locale('ko'), / locale: const Locale('ko', 'KR'),
- Thai (Thailand) th / th-TH
locale: const Locale('th'), / locale: const Locale('th', 'TH'),
- Bahasa Indonesia (Indonesia) id / id-ID
locale: const Locale('id'), / locale: const Locale('id', 'ID'),
- Chinese (Hong Kong, China) zh-HK
locale: const Locale('zh', 'HK'),
Step 3: Render widget in Flutter
copy
RewardsPromoWidget(positionId: 'XXX')
Validate the integration
After you've finished the previous steps, notify Alipay+ team to configure the delivery content. When all the configuration work is done, you'll see the marketing content rendered in your app page.