ezetap_sdk 0.0.3
ezetap_sdk: ^0.0.3 copied to clipboard
Integrating the SDK will allow you to access Ezetap services in your application
example/lib/main.dart
import 'package:ezetap_sdk/ezetap_sdk.dart';
import 'package:flutter/material.dart';
import 'dart:async';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _result = 'Unknown';
@override
void initState() {
super.initState();
initSdk();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initSdk() async {
String result =
await EzetapSdk.initialize("{}");
if (!mounted) return;
setState(() {
_result = result;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Ezetap Sample'),
),
body: Center(
child: Text(_result),
),
),
);
}
}