0 purchases
trainman booking sdk
Trainman Booking SDK #
Flutter Integration Steps: #
Add flutter plugin in dependencies:
Use command: flutter pub add trainman_booking_sdk
Manually:
Add plugin in pubspec.yaml within dependencies section dependencies: flutter: sdk: flutter #trainman_booking_sdk: ^0.1.7#
Implement TmBookingInterface
it has functions like
void openLoginPage(String message, String source)
void backPressed(BuildContext context)
void refreshToken(String? pastAuthToken, String source)
Create InitiateTmBookingSdk object.
import package:trainman_booking_sdk/trainman_booking_sdk.dart
class SampleCode extends StatelessWidget {
const SampleCode({Key? key}) : super(key: key)
@override Widget build(BuildContext context) {
//trainman booking sdk
return const InitiateTmBookingSdk( {super.key, required this.tmBookingInterface, this.authToken});
}
}
copied to clipboard
this will automatically invoke Trainman Booking SDK.
Auth token is optional parameter. In case of refresh auth token after successful authentication you can use updateAccessToken(String? accessToken, String? refreshToken)
NOTE: For now we have invoked a intermediate page to login test user for testing. Post Client user login integration, this step will be skipped.
Click on Continue without login button.
For Android, make sure you have added Internet permission
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="[http://schemas.android.com/apk/res/android](http://schemas.android.com/apk/res/android)" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
</manifest>
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.