altibbi 0.0.0-beta.1
altibbi: ^0.0.0-beta.1 copied to clipboard
Altibbi Sample.
Altibbi Flutter SDK #
This Flutter SDK provides integration for the Altibbi services, including video consultation, text consultation, push notification, and many other features. This guide will walk you through the steps to integrate it into your Flutter project.
Installation #
To use the Altibbi Flutter SDK, add altibbi to your pubspec.yaml file:
dependencies:
flutter:
sdk: flutter
altibbi: ^latest_version
Then, run flutter packages get in your terminal.
Configuration #
Initialize the Altibbi service with your user token and partner endpoint as follows:
AltibbiService.init(
"USER_TOKEN",
"PARTNER_ENDPOINT"
);
Usage #
Here are some common examples of how to use the Altibbi Flutter SDK:
Initializing the Pusher Service: #
import 'package:altibbi/pusher.dart';
Pusher().init(
onEvent: onEvent,
channelName: widget.pusherID,
apiKey: widget.pusherApiKey
);
Initializing the OpenTok Service: #
Future<void> initPlatformState() async {
// ...
_controller = OpenTokController();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
// ...
if (isGranted) {
_controller?.initSession(_config);
// ...
} else {
debugPrint(
"Camera or Microphone permission or both denied by the user!");
}
});
}
Displaying Altibbi Video: #
body: Column(
children: [
Flexible(
child: SizedBox(
height: isFullScreen
? MediaQuery.of(context).size.height
: MediaQuery.of(context).size.height * 0.5,
child: AltibbiVideo(
controller: _controller ?? OpenTokController(),
),
),
)
],
);
Using the API Service: #
The Altibbi SDK comes with a built-in API service for managing users and consultations. Check out the ApiService class in the altibbi package for more information. Here's an example of how to use it:
import 'package:altibbi/altibbi_service.dart';
import 'package:altibbi/enum.dart';
import 'package:altibbi/model/user.dart';
import 'dart:io';
import 'package:http/http.dart' as http;
ApiService apiService = ApiService();
Future<User> createUser() async {
User user = User(/*User details*/);
return await apiService.createUser(user);
}
Note: Be sure to replace placeholders like "USER_TOKEN" or "PARTNER_ENDPOINT" with your actual values.
Example #
An example Flutter application using the Altibbi SDK can be found in the example directory.
Please see the example directory for a complete sample app using Altibbi Flutter SDK.
Documentation #
You can find the latest Altibbi Flutter SDK documentation contact: [email protected]. Please ensure that you are referencing the latest version of our SDK to access all available features and improvements.
License #
The Altibbi Flutter SDK is licensed under the Altibbi License.