You've already forked dart-core-sdk
Latest publish
This commit is contained in:
70
README.md
70
README.md
@@ -0,0 +1,70 @@
|
|||||||
|
# Reflex Platform Dart SDK
|
||||||
|
|
||||||
|
This is the official **Dart SDK** for **Reflex Platform**. It provides client stubs for interacting with Reflex Platform APIs through **gRPC**.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Import the SDK and set up the gRPC client:
|
||||||
|
|
||||||
|
```dart
|
||||||
|
import 'package:dart_core_sdk/proj.pbgrpc.dart';
|
||||||
|
import 'package:grpc/grpc.dart';
|
||||||
|
|
||||||
|
class AuthInterceptor extends ClientInterceptor {
|
||||||
|
final String token;
|
||||||
|
|
||||||
|
AuthInterceptor(this.token);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ResponseFuture<R> interceptUnary<Q, R>(
|
||||||
|
ClientMethod<Q, R> method, Q request, CallOptions options, invoker) {
|
||||||
|
final newOptions = options.mergedWith(CallOptions(metadata: {
|
||||||
|
'Authorization': 'Bearer ',
|
||||||
|
}));
|
||||||
|
return invoker(method, request, newOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
final channel = ClientChannel(
|
||||||
|
'grpc.core.dev.reflex-platform.com',
|
||||||
|
port: 443,
|
||||||
|
options: const ChannelOptions(credentials: ChannelCredentials.secure()),
|
||||||
|
);
|
||||||
|
|
||||||
|
final client = ProjectServiceClient(
|
||||||
|
channel,
|
||||||
|
interceptors: [AuthInterceptor('YOUR_TOKEN')],
|
||||||
|
);
|
||||||
|
|
||||||
|
final request = GetMyUIContextRequest();
|
||||||
|
final response = await client.getMyUIContext(request);
|
||||||
|
|
||||||
|
print("Response: \");
|
||||||
|
|
||||||
|
await channel.shutdown();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## gRPC Endpoint
|
||||||
|
|
||||||
|
The SDK connects to the following gRPC endpoint:
|
||||||
|
|
||||||
|
```
|
||||||
|
grpc.core.dev.reflex-platform.com
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example Flutter Application
|
||||||
|
|
||||||
|
A more complete **Flutter** application that demonstrates how to integrate the **Reflex Platform Dart SDK** is available. This serves as a reference implementation for using the SDK in a mobile application.
|
||||||
|
|
||||||
|
Repository: [Flutter RP Example](https://git.dev.reflex-platform.com/reflex-platform/flutter-rp-example)
|
||||||
|
|
||||||
|
## Additional Resources
|
||||||
|
|
||||||
|
For more information on using the Reflex Platform SDK, please refer to the [documentation](https://docs.viz.dev.reflex-platform.com).
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This SDK is licensed under **MIT License**.
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
name: dart_core_sdk
|
name: dart_core_sdk
|
||||||
description: dart libs from core model proto files
|
description: dart libs from core model proto files
|
||||||
version: 1.13.0-SNAPSHOT-260407085730
|
version: 1.13.0-SNAPSHOT-260407085730
|
||||||
homepage: ''
|
homepage: 'https://git.dev.reflex-platform.com/reflex-platform'
|
||||||
publish_to: ''
|
publish_to: 'https://git.dev.reflex-platform.com/api/packages/reflex-platform/pub'
|
||||||
repository: ''
|
repository: 'https://git.dev.reflex-platform.com/reflex-platform/dart-core-sdk'
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.2.4
|
sdk: ^3.2.4
|
||||||
|
|||||||
Reference in New Issue
Block a user