diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index fd16aaa..d5bbd63 100644 Binary files a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png index ae50270..f06a62a 100644 Binary files a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png and b/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png differ diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 544a7d5..bf60de6 100644 Binary files a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png index 679a1e2..4ae67fe 100644 Binary files a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png and b/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png differ diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 46a976b..2aee357 100644 Binary files a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png index e30f3af..f70e56a 100644 Binary files a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png and b/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png differ diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 3d95dbc..fddea6f 100644 Binary files a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png index 81c2bdc..642ecb6 100644 Binary files a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png and b/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png differ diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 958dd94..cf9cfd3 100644 Binary files a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png index cdf684f..3701143 100644 Binary files a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png and b/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png differ diff --git a/example/android/play_store_512.png b/example/android/play_store_512.png index 2182835..ee145dc 100644 Binary files a/example/android/play_store_512.png and b/example/android/play_store_512.png differ diff --git a/example/lib/app/features/main/providers/main_providers.dart b/example/lib/app/features/main/providers/main_providers.dart index 769b2e4..c0b59aa 100644 --- a/example/lib/app/features/main/providers/main_providers.dart +++ b/example/lib/app/features/main/providers/main_providers.dart @@ -1,15 +1,20 @@ import 'package:easy_upi_payment/easy_upi_payment.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; +import '../../../core/local_storage/app_storage.dart'; + class MainStateNotifier extends StateNotifier { - MainStateNotifier() : super(MainState.initial); + MainStateNotifier(this.ref) : super(MainState.initial); TransactionDetailModel? transactionDetailModel; + final Ref ref; + /// for starting payment Future startPayment(EasyUpiPaymentModel model) async { state = MainState.loading; try { + savePaymentData(model); // final res = await EasyUpiPaymentPlatform.instance.startPayment(model); if (res != null) { @@ -22,11 +27,23 @@ class MainStateNotifier extends StateNotifier { state = MainState.error; } } + + /// for saving payment data in hive + void savePaymentData(EasyUpiPaymentModel model) { + ref.read(appStorageProvider) + ..putName(model.payeeName) + ..putUpiId(model.payeeVpa) + ..putAmount(model.amount.toString()); + + if (model.description != null) { + ref.read(appStorageProvider).putDescription(model.description!); + } + } } final mainStateProvider = StateNotifierProvider.autoDispose( (ref) { - return MainStateNotifier(); + return MainStateNotifier(ref); }, );