The Scrimmage Rewards Widget can be integrated into your Flutter application using the WebView widget provided by the webview_flutter package.

  1. First, you need to add the webview_flutter dependency to your pubspec.yaml file:

    dependencies:
      webview_flutter: latest_version
    
  2. Import the necessary package in your Dart file:

    import 'package:webview_flutter/webview_flutter.dart';
    
  3. Create the WebView widget:

    WebView(
      initialUrl: 'https://<your org id>.apps.scrimmage.co?token=<token>',
      javascriptMode: JavascriptMode.unrestricted,
    )
    
    • Replace <your org id> with your organization ID.
    • Replace <token> with the user token. Check out the Getting Started page for more information.
  4. For Android, ensure you have the internet permission in your AndroidManifest.xml:

    <uses-permission android:name="android.permission.INTERNET" />
    
  5. For iOS, you need to add the following permissions to your Info.plist file:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>