Skip to content

Commit

Permalink
refactor: changes for 1.0.5+1
Browse files Browse the repository at this point in the history
  • Loading branch information
wilburx9 committed Apr 8, 2021
1 parent b62bcc7 commit eb26f24
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.5+1
* Updated dependencies
* Updated ReadMe

## 1.0.5 (Breaking change)
* Supported sound null-safety
* Resolved build failure due to unresolved VERSION_NAME and VERSION_CODE
Expand Down
1 change: 0 additions & 1 deletion lib/flutter_paystack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ export 'package:flutter_paystack/src/common/paystack.dart';
export 'package:flutter_paystack/src/models/card.dart';
export 'package:flutter_paystack/src/models/charge.dart';
export 'package:flutter_paystack/src/models/checkout_response.dart';
export 'package:flutter_paystack/src/models/transaction.dart';
1 change: 0 additions & 1 deletion lib/src/common/paystack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class PaystackPlugin {

// Using cascade notation to build the platform specific info
try {

platformInfo = await PlatformInfo.fromMethodChannel(Utils.methodChannel);
_sdkInitialized = true;
} on PlatformException {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/common/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import 'package:flutter/services.dart';
import 'package:intl/intl.dart';

class Utils {
static const MethodChannel methodChannel = const MethodChannel('plugins.wilburt/flutter_paystack');
static const MethodChannel methodChannel =
const MethodChannel('plugins.wilburt/flutter_paystack');

static String getKeyErrorMsg(String keyType) {
return 'Invalid $keyType key. You must use a valid $keyType key. Ensure that you '
Expand Down
12 changes: 6 additions & 6 deletions lib/src/transaction/bank_transaction_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class BankTransactionManager extends BaseTransactionManager {
BankChargeRequestBody? chargeRequestBody;
final BankServiceContract service;

BankTransactionManager({
required this.service,
required Charge charge,
required BuildContext context,
required String publicKey
}) : super(charge: charge, context: context, publicKey: publicKey);
BankTransactionManager(
{required this.service,
required Charge charge,
required BuildContext context,
required String publicKey})
: super(charge: charge, context: context, publicKey: publicKey);

Future<CheckoutResponse> chargeBank() async {
await initiate();
Expand Down
4 changes: 3 additions & 1 deletion lib/src/widgets/buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ class _BaseButton extends StatelessWidget {
)),
)
: iconData == null
? child == null ? textWidget : child!
? child == null
? textWidget
: child!
: new Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expand Down
10 changes: 5 additions & 5 deletions lib/src/widgets/checkout/bank_checkout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ class _BankCheckoutState extends BaseCheckoutMethodState<BankCheckout> {

void _chargeAccount() async {
final response = await BankTransactionManager(
charge: widget.charge,
service: widget.service,
context: context,
publicKey: widget.publicKey
).chargeBank();
charge: widget.charge,
service: widget.service,
context: context,
publicKey: widget.publicKey)
.chargeBank();

if (!mounted) return;

Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/custom_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CustomAlertDialog extends StatelessWidget {
this.expanded = false,
this.fullscreen = false,
required this.content,
}) : super(key: key);
}) : super(key: key);

final Widget? title;
final EdgeInsetsGeometry? titlePadding;
Expand Down
1 change: 0 additions & 1 deletion lib/src/widgets/otp_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class _OtpWidgetState extends BaseState<OtpWidget> {
String? _otp;
var heightBox = const SizedBox(height: 20.0);


@override
Widget buildChild(BuildContext context) {
return new CustomAlertDialog(
Expand Down
7 changes: 3 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: flutter_paystack
description: A Flutter plugin for making payments via Paystack Payment Gateway. Completely supports Android and iOS.
version: 1.0.5
author: Wilberforce Uwadiegwu <[email protected]>
version: 1.0.5+1
homepage: https://github.com/wilburt/flutter_paystack

dependencies:
flutter:
sdk: flutter
http: ^0.13.0
http: ^0.13.1
intl: ^0.17.0
meta: ^1.3.0
async: ^2.5.0
Expand All @@ -16,7 +15,7 @@ dev_dependencies:
flutter_test:
sdk: flutter
matcher: ^0.12.10
mockito: ^5.0.1
mockito: ^5.0.3


flutter:
Expand Down
4 changes: 2 additions & 2 deletions test/src/common/paystack_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'package:flutter_paystack/src/common/paystack.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
const MethodChannel channel = MethodChannel(
'plugins.wilburt/flutter_paystack');
const MethodChannel channel =
MethodChannel('plugins.wilburt/flutter_paystack');

TestWidgetsFlutterBinding.ensureInitialized();

Expand Down
3 changes: 2 additions & 1 deletion test/src/common/utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:matcher/matcher.dart';

void main() {
const MethodChannel channel = MethodChannel('plugins.wilburt/flutter_paystack');
const MethodChannel channel =
MethodChannel('plugins.wilburt/flutter_paystack');

TestWidgetsFlutterBinding.ensureInitialized();

Expand Down

0 comments on commit eb26f24

Please sign in to comment.