finpong_plus 0.0.7 copy "finpong_plus: ^0.0.7" to clipboard
finpong_plus: ^0.0.7 copied to clipboard

Finpong Plus Widget

example/lib/main.dart

import 'dart:convert';

import 'package:finpong_plus/finpong_plus.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MaterialApp(
    home: MyApp(),
  ));
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String sampleToken = 'oVhMyHYutPW1664VrK3kwYlIlvcQ0QFcW/wwsNmpNZOeTedb0xp3evWclII+mS3+FBPtgf8DCXe5Iv4lnrhnffvw8y/CQDtW+BjTakz8iChL1PiUdCuq1ydWLEhEyhqQ1iG+Kpl46Eol6R33/Bi4XXxwBfyOMiWqA6G43x0Bi3RfRNwRHlUmZxQejv1LcOsVTw8TPPQIrY5tHrVYm9PNFPOqIMSvnyCa3TX+MocffU0ewWAHvChCynyQAx1eGpI8Wezw+4Xcz1NnwVWmnp9FFmNKtXCv3P8uk/lbm8nHhUcLCfXs3KeZAL+8oTZo35o2prydHH96pSVUjyeatJTCNkwCo5xB5mL0dAzLuTWlO2Kw0cEWSwJ9HUPLDP9SzvklDlIgPK2XVvia5M3xj3M88PqX62pwVEx2ecIvbYzPnEB06PXyfoMMMWYJuj2rTZgv5yiBpfgIgHh76OHVMDmfUYugB0IkQDvaEGbh6CLfxNQqT17tfAaKkYb9w8OLeDoSXylLFryHq/7WizWWw+ZG3bCAlKAt8BqG9dA230TJOCiypu4PSMw9yJVyC4Z+KL1tgFgHlM6IkQpafFcWaBkLiBfTDCRawryGevB/gsWqW+5xPTY1NwsMFUHEjzwSBikb';
  FinpongPlusController finpongPlusController = FinpongPlusController();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: Center(
        child: ElevatedButton(
          child: Text('FinpongPlus Start'),
          onPressed: () {
            Navigator.push(
                context,
                MaterialPageRoute(
                    builder: (context) => _finpongPlusWidget(sampleToken)));
          },
        ),
      ),
    );
  }

  Widget _finpongPlusWidget(String token) {
    return SafeArea(
      child: FinpongPlusWidget(
        finpongPlusController: finpongPlusController,
        token: token,
        entry: '1',
        serverMode: ServerMode.dev,
        backgorundColor: Colors.white,
        onUriScheme: (type, scheme) {
          //사설 인증서 호출 (앱스킴 실행)
        },
        onCustomAction: (pageId, params) {
          //사전 정의된 핀퐁플러스의 액션을 앱에서 처리를 위함
        },
        onCloseAction: () {
          //핀퐁플러스 닫기
          Navigator.pop(context);
        },
        onPageLoadStarted: () {
          //핀퐁플러스 페이지 로드 시작
        },
        onPageLoadFinished: () {
          //핀퐁플러스 페이지 로드 종료
        },
      ),
    );
  }
}