Skip to content

Commit

Permalink
- fixing some analyser issues
Browse files Browse the repository at this point in the history
- adding proper links for repository, issue_tracker, homepage.
- adding proper description
  • Loading branch information
GJJ2019 committed Jul 11, 2022
1 parent a83732e commit a391cf8
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.1

- fixing some analyser issues
- adding proper links for repository, issue_tracker, homepage.
- adding proper description
## 0.1.0

- implementing dev.shreyaspatil.EasyUpiPayment:EasyUpiPayment:3.0.3
3 changes: 2 additions & 1 deletion example/lib/app/features/main/providers/main_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class MainStateNotifier extends StateNotifier<MainState> {
}
}

final mainStateProvider = StateNotifierProvider.autoDispose<MainStateNotifier, MainState>(
final mainStateProvider =
StateNotifierProvider.autoDispose<MainStateNotifier, MainState>(
(ref) {
return MainStateNotifier(ref);
},
Expand Down
22 changes: 15 additions & 7 deletions example/lib/app/features/main/view/main_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ class MainView extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final appStorage = ref.read(appStorageProvider);
final payeeVpaController = useTextEditingController(text: appStorage.getUpiId());
final payeeNameController = useTextEditingController(text: appStorage.getName());
final amountController = useTextEditingController(text: appStorage.getAmount());
final descriptionController = useTextEditingController(text: appStorage.getDescription());
final payeeVpaController =
useTextEditingController(text: appStorage.getUpiId());
final payeeNameController =
useTextEditingController(text: appStorage.getName());
final amountController =
useTextEditingController(text: appStorage.getAmount());
final descriptionController =
useTextEditingController(text: appStorage.getDescription());

final formKeyRef = useRef(GlobalKey<FormState>());

Expand All @@ -30,7 +34,8 @@ class MainView extends HookConsumerWidget {
case MainState.loading:
break;
case MainState.success:
final model = ref.read(mainStateProvider.notifier).transactionDetailModel;
final model =
ref.read(mainStateProvider.notifier).transactionDetailModel;
showDialog<void>(
context: context,
builder: (BuildContext context) => AlertDialog(
Expand Down Expand Up @@ -168,7 +173,9 @@ class MainView extends HookConsumerWidget {
),
keyboardType: TextInputType.name,
validator: (value) {
if (value == null || value.isEmpty || !value.contains('@')) {
if (value == null ||
value.isEmpty ||
!value.contains('@')) {
return 'Please enter valid Vpa Id';
}
return null;
Expand Down Expand Up @@ -233,7 +240,8 @@ class MainView extends HookConsumerWidget {
}
},
style: ButtonStyle(
fixedSize: MaterialStateProperty.all(const Size.fromHeight(42)),
fixedSize:
MaterialStateProperty.all(const Size.fromHeight(42)),
),
child: const Text('Pay Now'),
),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.0"
version: "0.1.1"
fake_async:
dependency: transitive
description:
Expand Down
6 changes: 4 additions & 2 deletions lib/src/model/easy_upi_payment_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ class EasyUpiPaymentModel {
'payeeVpa': payeeVpa,
'payeeName': payeeName,
'payeeMerchantCode': payeeMerchantCode ?? '',
'transactionId': transactionId ?? DateTime.now().microsecondsSinceEpoch.toString(),
'transactionRefId': transactionRefId ?? DateTime.now().millisecondsSinceEpoch.toString(),
'transactionId':
transactionId ?? DateTime.now().microsecondsSinceEpoch.toString(),
'transactionRefId':
transactionRefId ?? DateTime.now().millisecondsSinceEpoch.toString(),
'description': description,
'amount': amount.toString(),
};
Expand Down
5 changes: 2 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: easy_upi_payment
description: A new flutter plugin to make upi payment (only on Android).
version: 0.1.0
description: A new flutter plugin to make upi payment with ease currently only supported by Android (only for India).
version: 0.1.1
repository: https://github.com/GJJ2019/easy_upi_payment
issue_tracker: https://github.com/GJJ2019/easy_upi_payment/issues
homepage: https://github.com/GJJ2019/easy_upi_payment


environment:
sdk: ">=2.17.5 <3.0.0"
flutter: ">=2.5.0"
Expand Down
6 changes: 4 additions & 2 deletions test/easy_upi_payment_method_channel_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ void main() {
});

test('startPayment', () async {
expect(await platform.startPayment(fakeEasyUpiPaymentModel), fakeTransactionDetailsModel);
expect(await platform.startPayment(fakeEasyUpiPaymentModel),
fakeTransactionDetailsModel);
});
});

group('startPayment with exception', () {
final platformException = PlatformException(code: EasyUpiPaymentExceptionType.failedException.toString());
final platformException = PlatformException(
code: EasyUpiPaymentExceptionType.failedException.toString());
setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
return platformException;
Expand Down
3 changes: 2 additions & 1 deletion test/easy_upi_payment_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ void main() {
when(mockPlatform.startPayment(fakeEasyUpiPaymentModel)).thenAnswer(
(_) => Future.value(fakeTransactionDetailsModel),
);
expect(await mockPlatform.startPayment(fakeEasyUpiPaymentModel), fakeTransactionDetailsModel);
expect(await mockPlatform.startPayment(fakeEasyUpiPaymentModel),
fakeTransactionDetailsModel);
});

test('startPayment with cancelled Exception', () async {
Expand Down

0 comments on commit a391cf8

Please sign in to comment.