You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.4 KiB
Dart
41 lines
1.4 KiB
Dart
import 'package:flutter/services.dart';
|
|
|
|
class PenguinMethodChannel {
|
|
static const MethodChannel _channel = MethodChannel('launch_penguin_ui');
|
|
|
|
static Future<void> launch(String storyboardName, String languageCode, String username,
|
|
{NavigationClinicDetails? details}) async {
|
|
try {
|
|
await _channel.invokeMethod('launchPenguin', {
|
|
"storyboardName": storyboardName,
|
|
"baseURL": "https://hmg.nav.penguinin.com",
|
|
"dataURL": "https://hmg.nav.penguinin.com",
|
|
"positionURL": "https://hmg.nav.penguinin.com",
|
|
"dataServiceName": "api",
|
|
"positionServiceName": "pe",
|
|
"clientID": "HMG",
|
|
"username": username,
|
|
"isSimulationModeEnabled": false,
|
|
"isShowUserName": false,
|
|
"isUpdateUserLocationSmoothly": true,
|
|
"isEnableReportIssue": true,
|
|
"languageCode": languageCode,
|
|
"clientKey": "UGVuZ3VpbklOX1Blbk5hdl9QSUY=",
|
|
"mapBoxKey": "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg",
|
|
"clinic_id": details?.clinicId ?? "",
|
|
"patient_id": details?.patientId ?? "",
|
|
"project_id": details?.projectId ?? "",
|
|
});
|
|
} on PlatformException catch (e) {
|
|
print("Failed to launch PenguinIn: '${e.message}'.");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class NavigationClinicDetails{
|
|
String? clinicId;
|
|
String? patientId;
|
|
String? projectId;
|
|
}
|