Can anyone give some help ? I've been struggling for days :(
What have you tried so far?
Create a custom widget, add this code: (with the url is where my html is), but nothing is showing now, so far i only have "Placeholder for HubspotChatWebView. Please try compiling and previewing it again"
// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/widgets/index.dart'; // Imports other custom widgets
import '/custom_code/actions/index.dart'; // Imports custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom widget code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!
import 'dart:io';
import 'package:webview_flutter/webview_flutter.dart';
class HubspotChatWebView extends StatefulWidget {
const HubspotChatWebView({
Key? key,
this.width,
this.height,
}) : super(key: key);
final double? width;
final double? height;
@override
State<HubspotChatWebView> createState() => _HubspotChatWebViewState();
}
class _HubspotChatWebViewState extends State<HubspotChatWebView> {
@override
void initState() {
super.initState();
if (Platform.isAndroid) {
WebView.platform = SurfaceAndroidWebView();
}
}
@override
Widget build(BuildContext context) {
return SizedBox(
width: widget.width ?? double.infinity,
height: widget.height ?? 400, // hauteur par défaut
child: const WebView(
initialUrl:
'https://harmonious-hotteok-cfd826.netlify.app/', // Remplace par ton URL hébergée
javascriptMode: JavascriptMode.unrestricted,
),
);
}
} voici mon code mais je n'ai rien qui s'affiche
Did you check FlutterFlow's Documentation for this topic?