Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/mac/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-1.0.0/","dependencies":[]},{"name":"webview_flutter","path":"/Users/mac/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.2/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/mac/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-1.0.0/","dependencies":[]},{"name":"webview_flutter","path":"/Users/mac/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.2/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2021-04-07 09:16:56.179599","version":"2.0.2"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info","path":"/Users/mac/development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.2/","dependencies":[]},{"name":"webview_flutter","path":"/Users/mac/development/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.13/","dependencies":[]}],"android":[{"name":"device_info","path":"/Users/mac/development/flutter/.pub-cache/hosted/pub.dartlang.org/device_info-2.0.2/","dependencies":[]},{"name":"webview_flutter","path":"/Users/mac/development/flutter/.pub-cache/hosted/pub.dartlang.org/webview_flutter-2.0.13/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"device_info","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2021-09-12 07:35:37.283533","version":"2.5.0"}
16 changes: 8 additions & 8 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/macbook/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/macbook/Documents/GitHub/okra-flutter/example"
export "FLUTTER_TARGET=/Users/macbook/Documents/GitHub/okra-flutter/example/lib/main.dart"
export "FLUTTER_ROOT=/Users/mac/development/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/mac/Documents/Dev.nosync/Flutter/okra-flutter/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
export "FLUTTER_FRAMEWORK_DIR=/Users/macbook/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "TRACK_WIDGET_CREATION=true"
export "DART_DEFINES=flutter.inspector.structuredErrors=true"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.packages"
50 changes: 21 additions & 29 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:convert';

import 'package:flutter/material.dart';
import 'package:okra_widget/okra_widget.dart';

Expand Down Expand Up @@ -29,7 +27,6 @@ class MyHomePage extends StatefulWidget {
}

class _MyHomePageState extends State<MyHomePage> {

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down Expand Up @@ -70,41 +67,36 @@ class _MyHomePageState extends State<MyHomePage> {
"kuda-bank"
];


var okraOptions = {
"key": "z",
"token": "5da6358130a943486f33dced",
"products": [
"auth",
"balance",
"identity",
"transactions"
],
"products": ["auth", "balance", "identity", "transactions"],
"environment": "production",
"clientName": "Bassey",
"color" : "#9013FE",
"limit" : "3",
"isCorporate" : false,
"connectMessage" : "Which account do you want to connect with?",
"callback_url" : "",
"redirect_url" : "",
"logo" : "https://dash.okra.ng/static/media/okra-logo.514fd943.png",
"widget_success" : "Your account was successfully linked to SwipeNG",
"widget_failed" : "An unknown error occurred, please try again.",
"currency" : "NGN",
"noPeriodic" : true,
"exp" : "",
"success_title" : "null",
"success_message" : "null",
"guarantors" : {
"color": "#9013FE",
"limit": "3",
"isCorporate": false,
"connectMessage":
"Which account do you want to connect with?",
"callback_url": "",
"redirect_url": "",
"logo":
"https://dash.okra.ng/static/media/okra-logo.514fd943.png",
"widget_success":
"Your account was successfully linked to SwipeNG",
"widget_failed":
"An unknown error occurred, please try again.",
"currency": "NGN",
"noPeriodic": true,
"exp": "",
"success_title": "null",
"success_message": "null",
"guarantors": {
"status": false,
"message": "Okra requires you to add guarantors",
"number": 3,
},
"filter" : {
"industry_type": "all",
"banks": banks
}
"filter": {"industry_type": "all", "banks": banks}
};

OkraHandler reply = await Okra.create(context, okraOptions);
Expand Down
24 changes: 12 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.8.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -28,7 +28,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -56,14 +56,14 @@ packages:
name: device_info
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "2.0.2"
device_info_platform_interface:
dependency: transitive
description:
name: device_info_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.1"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -94,14 +94,14 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
okra_widget:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "2.0.2-beta"
version: "2.0.3-beta"
path:
dependency: transitive
description:
Expand All @@ -115,7 +115,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "2.0.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -127,7 +127,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -162,7 +162,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.4.2"
typed_data:
dependency: transitive
description:
Expand All @@ -183,7 +183,7 @@ packages:
name: webview_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.13"
sdks:
dart: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.22.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
10 changes: 5 additions & 5 deletions lib/models/okra_handler.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'dart:core';

class OkraHandler {
String data;
bool isSuccessful;
bool hasError;
bool isDone;
bool onClose;
String? data;
bool? isSuccessful;
bool? hasError;
bool? isDone;
bool? onClose;

OkraHandler(bool isDone, bool isSuccessful, bool hasError, bool onClose, String data){
this.isDone = isDone;
Expand Down
12 changes: 6 additions & 6 deletions lib/okra.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import'dart:io' show Platform;
import 'view/web.dart';

class Okra {
static Future<OkraHandler> create(
static Future<OkraHandler?> create(
BuildContext context, Map<String, dynamic> okraOptions) async {

AndroidDeviceInfo androidDeviceInfo;
IosDeviceInfo iosDeviceInfo;
AndroidDeviceInfo? androidDeviceInfo;
IosDeviceInfo? iosDeviceInfo;

if(Platform.isAndroid) {
androidDeviceInfo = await Helper.getAndroidInfo();
}else {
iosDeviceInfo = await Helper.getIosInfo();
}

okraOptions["uuid"] = Platform.isAndroid ? androidDeviceInfo.androidId : iosDeviceInfo.identifierForVendor;
String deviceName = Platform.isAndroid ? androidDeviceInfo.brand : iosDeviceInfo.name;
String deviceModel = Platform.isAndroid ? androidDeviceInfo.model : iosDeviceInfo.model;
okraOptions["uuid"] = Platform.isAndroid ? androidDeviceInfo!.androidId : iosDeviceInfo!.identifierForVendor;
String deviceName = Platform.isAndroid ? androidDeviceInfo!.brand : iosDeviceInfo!.name;
String deviceModel = Platform.isAndroid ? androidDeviceInfo!.model : iosDeviceInfo!.model;
okraOptions["deviceInfo"] = {
"deviceName" : deviceName,
"deviceModel" : deviceModel,
Expand Down
11 changes: 6 additions & 5 deletions lib/utils/helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:io';

import 'package:device_info/device_info.dart';


class Helper {
static Future<String> getDeviceUUID() async {
String identifier = "";
Expand All @@ -20,27 +19,29 @@ class Helper {
return identifier;
}

static Future<AndroidDeviceInfo> getAndroidInfo() async {
static Future<AndroidDeviceInfo?> getAndroidInfo() async {
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
try {
if (Platform.isAndroid) {
return await deviceInfoPlugin.androidInfo;
} else {
return null;
}
} catch (ex) {
return null;
}
}

static Future<IosDeviceInfo> getIosInfo() async {
static Future<IosDeviceInfo?> getIosInfo() async {
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
try {
if (Platform.isIOS) {
return await deviceInfoPlugin.iosInfo;
} else {
return null;
}
} catch (ex) {
return null;
}
}


}
4 changes: 2 additions & 2 deletions lib/view/web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:webview_flutter/webview_flutter.dart';
class Web extends StatefulWidget {
final Map<String, dynamic> okraOptions;

const Web({Key key, this.okraOptions})
const Web({Key? key, required this.okraOptions})
: assert(okraOptions != null),
super(key: key);

Expand All @@ -18,7 +18,7 @@ class Web extends StatefulWidget {
}

class _WebState extends State<Web> {
WebViewController _controller;
late WebViewController _controller;
bool isLoading = true;
OkraHandler okraHandler = new OkraHandler(false, false, false, true, "");

Expand Down
22 changes: 11 additions & 11 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.8.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -28,7 +28,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand All @@ -49,14 +49,14 @@ packages:
name: device_info
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "2.0.2"
device_info_platform_interface:
dependency: transitive
description:
name: device_info_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.1"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -87,7 +87,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
path:
dependency: transitive
description:
Expand All @@ -101,7 +101,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "2.0.1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -113,7 +113,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -148,7 +148,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.4.2"
typed_data:
dependency: transitive
description:
Expand All @@ -169,7 +169,7 @@ packages:
name: webview_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.13"
sdks:
dart: ">=2.12.0-259.9.beta <3.0.0"
flutter: ">=1.22.0"
dart: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ version: 2.0.3-beta
homepage: https://github.com/okraHQ/okra-flutter

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
sdk: flutter
webview_flutter: ^2.0.2
device_info: ^1.0.0
webview_flutter: ^2.0.13
device_info: ^2.0.2


dev_dependencies:
Expand Down