I am developing an application for android with Flutter, I was able to integrate the embed code provided by HF space into the application. However, I get an error in the image upload section, how can I solve this problem?
Flutter Code:
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
class PageTwo extends StatefulWidget {
const PageTwo({Key? key}) : super(key: key);
@override
State<PageTwo> createState() => _HuggingfaceSpaceViewerState();
}
class _HuggingfaceSpaceViewerState extends State<PageTwo> {
late final WebViewController controller;
@override
void initState() {
super.initState();
controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0xFF000000))
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {
},
onPageStarted: (String url) {
},
onPageFinished: (String url) {
},
onWebResourceError: (WebResourceError error) {
},
onNavigationRequest: (NavigationRequest request) {
return NavigationDecision.navigate;
},
),
)
..loadRequest(Uri.parse('https://huggingfacem4-idefics3.hf.space'));
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Huggingface Space'),
),
body: WebViewWidget(controller: controller),
);
}
}
Error when I try to upload an image: E/FrameEvents(30325): updateAcquireFence: Did not find frame.