hp_pay_pump_list_project 1.0.0 hp_pay_pump_list_project: ^1.0.0 copied to clipboard
Flutter plugin for integrating a HP PAY into your app
example/lib/main.dart
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:hp_pay_pump_list_project/hp_pay_pump_list_project.dart';
import 'package:hp_pay_pump_list_project/screens/pump_list_screen.dart';
import 'package:hp_pay_pump_list_project_example/app_colors.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
final _hpPayPumpListProjectPlugin = HpPayPumpListProject();
@override
void initState() {
super.initState();
initPlatformState();
}
Future<void> initPlatformState() async {
String platformVersion;
try {
platformVersion =
await _hpPayPumpListProjectPlugin.getPlatformVersion() ??
'Unknown platform version';
} on PlatformException {
platformVersion = 'Failed to get platform version.';
}
if (!mounted) return;
setState(() {
_platformVersion = platformVersion;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primarySwatch:
MaterialColor(AppColors.primaryColor, AppColors.primarySwatch),
useMaterial3: false),
debugShowCheckedModeBanner: false,
home: const Scaffold(
body: PumpListScreen(
pumpImagePath: 'assets/petrol-pump.png',
nozzleImagePath: 'assets/gasoline-pump.png',
strRoCode: "41030952",
strUserId: "41030952"),
),
);
}
}