# a_bridge
## Storyline
The Flutter plugin "a_bridge" was conceived to enhance Appium Flutter automation within iOS simulators. The plugin was build to solve a particular problem statement as part of the discussion defined in the storyline.
Its name, derived from "A Bridge", symbolizes its role in bridging functionalities across flutter runtime and native operating systems.The end outcome or theme would be to leverage these to bring operational
scalability and efficiency in the development environment.
The idea emerged during a conversation between two tech enthusiasts—a QA specialist and an iOS developer—discussing challenges related to reading command line arguments passed to an application processes. The iOS developer highlighted the possibility to read these arguments via Swift APIs. The reasoning exchanged was the fundamental fact that as underneath every process there is a entry-point function(main in case of ios) that act as the starting point of the application.
The initial purpose of the "a_bridge" Flutter plugin centers on extracting command line parameters, crucial for configuring ports in [Appium Flutter Server](https://pub.dev/packages/appium_flutter_server). This functionality serves as a foundational feature, with plans to expand its capabilities over time to add the feature from underlying operating system that which help development.
The plugin leverages Flutter's method channels to bridges to API's exposed native platforms.
## Note
#### Although currently centered on command line argument extraction, the "a_bridge" plugin is designed to evolve. It aims to bridge diverse OS functionalities, fostering operational efficiency and scalability for development operations.
# ABridge Class
The ABridge class provides a Flutter plugin interface for retrieving command line arguments from the native platform using Dart's Foreign Function Interface (FFI). This functionality is particularly useful for configuring ports and facilitating Appium Flutter automation in iOS simulators.
## Usage
To use ABridge in your Flutter project:
### Installation
Add ABridge as a dependency in your pubspec.yaml file:
```
dependencies: a_bridge: ^0.0.1
```
### Import
import the a_bridge package in your Dart file:
```
import 'package:a_bridge/a_bridge.dart';
```
### Retrieve Command Line Arguments
Use the ABridge class to retrieve command line arguments asynchronously:
```
void main() async {
ABridge aBridge = ABridge();
List<String>? arguments = await aBridge.getArgumentList();
if (arguments != null) {
print('Command line arguments: $arguments');
}
else {
print('Failed to retrieve command line arguments.');
}
}
```
### ABridge Class API
#### Public Functions
```
Future<List<String>?> getArgumentList()
```
Returns a Future that resolves to a list of arguments retrieved from the platform interface.
```
Future<Map<String, dynamic>?> getArgumentPair({String separator = "="})
```
Returns a Future that resolves to a map of arguments parsed from the argument list, where each key-value pair represents an argument and its corresponding value. The separator parameter specifies the character used to separate key-value pairs in the arguments.
Usage Example:
```
ABridge aBridge = ABridge();
List<String>? arguments = await aBridge.getArgumentList();
if (arguments != null) {
print('Command line arguments: $arguments');
}
else {
print('Failed to retrieve command line arguments.');
}
Map<String,dynamic>? mapArguments = aBridge.getArgumentPair(separator: '=');
if (mapArguments != null) {
print('Argument Map: $mapArguments');
for (var key in mapArguments.keys) {
var value = mapArguments[key];
print('Key: $key, Value: $value');
}
} else {
print('Failed to retrieve argument map.');
}
```
### Contributing
Contributions to ABridge are welcome! If you encounter issues or have suggestions for improvements, please file an issue on GitHub
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
a_bridge.zip (93个子文件)
a_bridge-main
macos
Classes
ABridgePlugin.swift 600B
a_bridge.podspec 896B
lib
a_bridge_platform_interface.dart 1KB
a_bridge.dart 1KB
a_bridge_method_channel.dart 564B
analysis_options.yaml 154B
LICENSE 1KB
.metadata 1KB
CHANGELOG.md 44B
ios
Assets
.gitkeep 0B
Classes
ABridgePlugin.swift 595B
.gitignore 418B
a_bridge.podspec 987B
.gitignore 531B
example
macos
Runner.xcworkspace
xcshareddata
IDEWorkspaceChecks.plist 238B
contents.xcworkspacedata 152B
Podfile 1KB
RunnerTests
RunnerTests.swift 784B
Flutter
Flutter-Debug.xcconfig 125B
GeneratedPluginRegistrant.swift 242B
Flutter-Release.xcconfig 127B
Runner
MainFlutterWindow.swift 388B
Base.lproj
MainMenu.xib 23KB
DebugProfile.entitlements 348B
Configs
Warnings.xcconfig 580B
Debug.xcconfig 77B
AppInfo.xcconfig 609B
Release.xcconfig 79B
AppDelegate.swift 214B
Info.plist 1KB
Release.entitlements 240B
Assets.xcassets
AppIcon.appiconset
app_icon_32.png 1KB
app_icon_64.png 2KB
app_icon_16.png 520B
Contents.json 1KB
app_icon_1024.png 101KB
app_icon_256.png 14KB
app_icon_512.png 36KB
app_icon_128.png 6KB
Runner.xcodeproj
xcshareddata
xcschemes
Runner.xcscheme 4KB
project.pbxproj 26KB
project.xcworkspace
xcshareddata
IDEWorkspaceChecks.plist 238B
.gitignore 89B
lib
main.dart 3KB
pubspec.lock 8KB
analysis_options.yaml 1KB
integration_test
plugin_integration_test.dart 934B
ios
Runner.xcworkspace
xcshareddata
IDEWorkspaceChecks.plist 238B
WorkspaceSettings.xcsettings 226B
contents.xcworkspacedata 224B
Podfile 1KB
RunnerTests
RunnerTests.swift 734B
Flutter
AppFrameworkInfo.plist 774B
Debug.xcconfig 107B
Release.xcconfig 109B
Runner
Base.lproj
Main.storyboard 2KB
LaunchScreen.storyboard 2KB
Runner-Bridging-Header.h 38B
AppDelegate.swift 404B
Info.plist 2KB
Assets.xcassets
LaunchImage.imageset
Contents.json 391B
LaunchImage@3x.png 68B
LaunchImage@2x.png 68B
LaunchImage.png 68B
README.md 336B
AppIcon.appiconset
Icon-App-1024x1024@1x.png 11KB
Icon-App-60x60@3x.png 2KB
Icon-App-40x40@2x.png 586B
Icon-App-29x29@1x.png 282B
Icon-App-40x40@3x.png 862B
Contents.json 2KB
Icon-App-40x40@1x.png 406B
Icon-App-20x20@2x.png 406B
Icon-App-20x20@1x.png 295B
Icon-App-60x60@2x.png 862B
Icon-App-76x76@1x.png 762B
Icon-App-29x29@3x.png 704B
Icon-App-83.5x83.5@2x.png 1KB
Icon-App-20x20@3x.png 450B
Icon-App-76x76@2x.png 1KB
Icon-App-29x29@2x.png 462B
Runner.xcodeproj
xcshareddata
xcschemes
Runner.xcscheme 4KB
project.pbxproj 30KB
project.xcworkspace
xcshareddata
IDEWorkspaceChecks.plist 238B
WorkspaceSettings.xcsettings 226B
contents.xcworkspacedata 135B
.gitignore 569B
Podfile.lock 711B
.gitignore 691B
README.md 276B
pubspec.yaml 3KB
README.md 4KB
pubspec.yaml 2KB
共 93 条
- 1
资源评论
普通网友
- 粉丝: 3458
- 资源: 505
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 午会分享 全球变暖的危害
- cn-visual-studio-2010-ultimate-x86-dvd-532347.z03
- cn-visual-studio-2010-ultimate-x86-dvd-532347.z02
- 测绘地图制图学-地图投影实验报告ArcGIS
- cn-visual-studio-2010-ultimate-x86-dvd-532347.z01
- Improving DDS signal generation using interpolation
- 电子水准仪15、202、07系列后处理软件数据导入导出教程.wps
- openssl源代码openssl-3.0.1.tar.gz openssl-1.1.1m.tar.gz
- 地图制图学带号转换(附文件有公式)
- 基于深度学习的语音识别+python项目源码+文档说明
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功