esewa 1.0.1 esewa: ^1.0.1 copied to clipboard
A Flutter Package for eSewa Payment Gateway
import 'package:esewa/esewa.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Pay with Esewa',
theme: ThemeData(
useMaterial3: true,
primarySwatch: Colors.green,
),
home: const MyHomePage(title: 'Flutter Pay with Esewa'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
Text(
'Tap on the Floating Action Button to pay with Esewa',
),
],
),
),
floatingActionButton: FloatingActionButton.extended(
onPressed: () {},
isExtended: true,
label: const Text('Pay with Esewa'),
icon: const Icon(Icons.payment),
),
);
}
}
void showSnackBar(BuildContext context, String message) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(message),
duration: const Duration(seconds: 3),
behavior: SnackBarBehavior.floating,
),
);
}