패키지, 저장소 및 앱 카테고리 검색

add_to_google_wallet 표지
패키지 상세v0.0.5

add_to_google_wallet

Google 월렛에 추가 버튼을 제공하는 플러터 플러그인입니다.

Android
30일 다운로드
1.5천
좋아요
36
Pub 점수
160

패키지 설치

flutter pub add add_to_google_wallet

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

사용자가 디지털 패스, 티켓 및 레이어리티 카드를 직접 Google 월렛 앱에 쉽게 추가할 수 있도록 해주는 'Google 월렛에 추가' 버튼 통합을 가능하게 하는 플러터 플러그인입니다. 안드로이드 전용으로 설계되어 플러터 애플리케이션 내에서 디지털 월렛 생성 및 관리를 간소화합니다. 플랫폼 채널을 통해 Google의 네이티브 월렛 API를 활용하여 원활한 사용자 경험을 제공합니다.

사용 사례

  • Google Wallet에 이벤트 티켓 추가하기
  • 모바일 앱을 통한 충성도 카드 발행
  • 디지털로 탑승권 배포
  • 디지털 기프트 카드 활성화
  • 회원 카드 접근을 간소화하기

주요 기능

  • Android 전용 플랫폼 지원
  • 네이티브 Google Wallet 통합
  • 간단한 버튼 구현
  • 보안된 패스 데이터 처리
  • 플랫폼 채널 통신

적합한 대상

  • Android 중심의 Flutter 앱
  • 이벤트 티켓팅 플랫폼
  • 충성도 및 보상 프로그램
  • 여행 및 교통 앱
  • 소매 및 전자상거래 앱

고려 사항

  • 안드로이드 기기로 제한
  • 대상 장치에 Google Wallet 앱이 필요합니다
  • Google Play 서비스에 의존합니다
  • 올바른 패스 구성 및 서명이 필요합니다
  • 패스 생성을 위해 추가적인 백엔드 설정이 필요할 수 있습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Add To Google Wallet

A Flutter plugin that provides the Add To Google Wallet Button.

Overview

The goal of this plugin is to simplify the implementation of Add To Google Wallet feature.

Prerequisites

Before plugin can be used, make sure to complete all of the prerequisites listed below.

  1. Sign up for a Google Wallet API Issuer account
  2. Authorize your app
  3. Create a Passes Class
  4. Create a Passes Object

Usage

Installation

To use this plugin, add add_to_google_wallet as a dependency in your pubspec.yaml file.

dependencies:
  add_to_google_wallet: ^0.0.5

or run this command:

flutter pub add add_to_google_wallet 
Example usage
import 'package:add_to_google_wallet/widgets/add_to_google_wallet_button.dart';
import 'package:flutter/material.dart';
import 'package:uuid/uuid.dart';

void main() => runApp(const MaterialApp(home: MyApp()));

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

  @override
  Widget build(BuildContext context) => Scaffold(
        body: Center(
          child: AddToGoogleWalletButton(
            pass: _examplePass,
            onSuccess: () => _showSnackBar(context, 'Success!'),
            onCanceled: () => _showSnackBar(context, 'Action canceled.'),
            onError: (Object error) => _showSnackBar(context, error.toString()),
            locale: const Locale.fromSubtags(
              languageCode: 'fr',
              countryCode: 'FR',
            ),
          ),
        ),
      );

  void _showSnackBar(BuildContext context, String text) =>
      ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(text)));
}

final String _passId = const Uuid().v4();
const String _passClass = 'example';
const String _issuerId = '3333000000000000000';
const String _issuerEmail = 'example@example.com';

final String _examplePass = """ 
    {
      "iss": "$_issuerEmail",
      "aud": "google",
      "typ": "savetowallet",
      "origins": [],
      "payload": {
        "genericObjects": [
          {
            "id": "$_issuerId.$_passId",
            "classId": "$_issuerId.$_passClass",
            "genericType": "GENERIC_TYPE_UNSPECIFIED",
            "hexBackgroundColor": "#4285f4",
            "logo": {
              "sourceUri": {
                "uri": "https://storage.googleapis.com/wallet-lab-tools-codelab-artifacts-public/pass_google_logo.jpg"
              }
            },
            "cardTitle": {
              "defaultValue": {
                "language": "en",
                "value": "Google I/O '22 [DEMO ONLY]"
              }
            },
            "subheader": {
              "defaultValue": {
                "language": "en",
                "value": "Attendee"
              }
            },
            "header": {
              "defaultValue": {
                "language": "en",
                "value": "Alex McJacobs"
              }
            },
            "barcode": {
              "type": "QR_CODE",
              "value": "$_passId"
            },
            "heroImage": {
              "sourceUri": {
                "uri": "https://storage.googleapis.com/wallet-lab-tools-codelab-artifacts-public/google-io-hero-demo-only.jpg"
              }
            },
            "textModulesData": [
              {
                "header": "POINTS",
                "body": "1234",
                "id": "points"
              }
            ]
          }
        ]
      }
    }
""";

See the example app for more examples.

Demo

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.