hi-client/lib/app/modules/kr_chatwoot/views/kr_chatwoot_view.dart

53 lines
1.6 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:kaer_with_panels/app/widgets/hi_base_scaffold.dart';
import 'package:kaer_with_panels/app/widgets/kr_simple_loading.dart';
import '../controllers/kr_chatwoot_controller.dart';
/// 客服2Chatwoot视图页面
class KRChatwootView extends GetView<KRChatwootController> {
const KRChatwootView({super.key});
@override
Widget build(BuildContext context) {
return HIBaseScaffold(
showBack: true,
topContentAreaHeight: 0,
child: Stack(
children: [
InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(controller.kr_chatwootUrl),
),
initialSettings: InAppWebViewSettings(
javaScriptEnabled: true,
domStorageEnabled: true,
allowsInlineMediaPlayback: true,
),
onLoadStart: (controller, url) {
this.controller.kr_setLoading(true);
},
onLoadStop: (controller, url) {
this.controller.kr_setLoading(false);
},
onReceivedError: (controller, request, error) {
this.controller.kr_setLoading(false);
},
),
Obx(() {
if (controller.kr_isLoading.value) {
return const Center(
child: KRSimpleLoading(
size: 40,
),
);
}
return const SizedBox.shrink();
}),
],
),
);
}
}