knotapi_flutter 1.0.1
knotapi_flutter: ^1.0.1 copied to clipboard
Change card on file information, retrieve transactions, and more via Knot.
Setup #
- Requires Android Studio Koala (2024.1) or greater
- For iOS testing you will need Xcode 16.2 or greater
- Observe Flutter local setup instructions requirements
Plugin Development #
The Flutter plugin is developed in Dart and the source can be found in lib/
directory. Please read the Flutter Docs for detailed instructions on Flutter application development.
Android Development & Testing #
The Flutter plugin needs native integrations which can be found in android/src/main/java/com/example/knotapi_flutter
. The build setup for testing can be complicated due to commingling of Android and Dart sources. The following is taken from Flutter's official documentation:
Flutter recommend you edit the Android code using Android Studio.
Before editing the Android platform code in Android Studio, first make sure that the code has been built at least once (in other words, run the example app from your IDE/editor, or in a terminal execute cd knotapi-flutter/example/android; flutter build apk --config-only)
.
Then use the following steps:
Launch Android Studio.
Select Open an existing Android Studio Project in the Welcome to Android Studio dialog, or select File > Open from the menu, and select the knotapi-flutter/example/android/build.gradle
file.
In the Gradle Sync dialog, select OK.
In the Android Gradle Plugin Update dialog, select Don't remind me again for this project.
The Android platform code of your plugin is located in android/src/main/java/com/example/knotapi_flutter/KnotapiFlutterPlugin.java
.
You can run the example app from Android Studio by pressing the run (▶) button.
iOS Development & Testing #
The Flutter plugin needs native integrations which can be found in iOS/Classes/SwiftKnotapiFlutterPlugin.swift
. The following is taken from Flutter's official documentation:
We recommend you edit the iOS code using Xcode.
Before editing the iOS platform code in Xcode, first make sure that the code has been built at least once (in other words, run the example app from your IDE/editor, or in a terminal execute cd knotapi-flutter/example/ios; flutter build ios --no-codesign --config-only).
Then use the following steps:
Launch Xcode. Select File > Open, and select the knotapi-flutter/example/ios/Runner.xcworkspace file. The iOS platform code for your plugin is located in Pods/Development Pods/hello/../../example/ios/.symlinks/plugins/hello/ios/Classes in the Project Navigator. (If you are using sharedDarwinSource, the path will end with hello/darwin/Classes instead.)
You can run the example app by pressing the run (▶) button.
Add CocoaPod dependencies
#
warning Warning Flutter is migrating to Swift Package Manager to manage iOS and macOS native dependencies. Flutter's support of Swift Package Manager is under development. The implementation might change in the future. Swift Package Manager support is only available on Flutter's main channel. Flutter continues to support CocoaPods. Use the following instructions to add HelloPod with the version 0.0.1:
Specify the dependency at the end of ios/hello.podspec:
s.dependency 'HelloPod', '0.0.1'
For private pods, refer to Private CocoaPods to ensure repo access:
s.source = { # For pods hosted on GitHub :git => "https://github.com/path/to/HelloPod.git", # Alternatively, for pods hosted locally # :path => "file:///path/to/private/repo", :tag => s.version.to_s }
Installing the plugin
Add the plugin in the project’s pubspec.yaml dependencies.
Run flutter pub get
.
In the project’s ios/ directory, run pod install.
The pod should appear in the installation summary.