Skip to content

Commit

Permalink
- changing icon
Browse files Browse the repository at this point in the history
- adding key to store data
  • Loading branch information
GJJ2019 committed Jul 11, 2022
1 parent cb9774f commit 33d394a
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 2 deletions.
Binary file modified example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified example/android/play_store_512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions example/lib/app/features/main/providers/main_providers.dart
Original file line number Diff line number Diff line change
@@ -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<MainState> {
MainStateNotifier() : super(MainState.initial);
MainStateNotifier(this.ref) : super(MainState.initial);

TransactionDetailModel? transactionDetailModel;

final Ref ref;

/// for starting payment
Future<void> startPayment(EasyUpiPaymentModel model) async {
state = MainState.loading;
try {
savePaymentData(model);
//
final res = await EasyUpiPaymentPlatform.instance.startPayment(model);
if (res != null) {
Expand All @@ -22,11 +27,23 @@ class MainStateNotifier extends StateNotifier<MainState> {
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<MainStateNotifier, MainState>(
(ref) {
return MainStateNotifier();
return MainStateNotifier(ref);
},
);

Expand Down

0 comments on commit 33d394a

Please sign in to comment.