Revert "Фикс сферум он линуксь"

This reverts commit 75fd6d775d.
This commit is contained in:
ivan2282
2025-11-16 09:23:30 +03:00
parent 75fd6d775d
commit a6eeee8331
6 changed files with 16 additions and 79 deletions

View File

@@ -4,8 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:intl/intl.dart';
import 'package:gwid/api_service.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter_linux_webview/flutter_linux_webview.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:gwid/chat_screen.dart';
import 'package:gwid/manage_account_screen.dart';
import 'package:gwid/screens/settings/settings_screen.dart';
@@ -93,10 +92,6 @@ class _ChatsScreenState extends State<ChatsScreen>
@override
void initState() {
super.initState();
LinuxWebViewPlugin.initialize();
if (Platform.isLinux){
WebView.platform = LinuxWebView();
}
_loadMyProfile();
_chatsFuture = (() async {
try {
@@ -3512,33 +3507,37 @@ class _SferumWebViewPanelState extends State<SferumWebViewPanel> {
Expanded(
child: Stack(
children: [
WebView(
initialUrl: widget.url,
javascriptMode: JavascriptMode.unrestricted,
onPageStarted: (url) {
InAppWebView(
initialUrlRequest: URLRequest(url: WebUri(widget.url)),
initialSettings: InAppWebViewSettings(
javaScriptEnabled: true,
transparentBackground: true,
useShouldOverrideUrlLoading: false,
useOnLoadResource: false,
useOnDownloadStart: false,
cacheEnabled: true,
),
onLoadStart: (controller, url) {
print('🌐 WebView начало загрузки: $url');
setState(() {
_isLoading = true;
});
},
onPageFinished: (url) {
onLoadStop: (controller, url) {
print('✅ WebView загрузка завершена: $url');
setState(() {
_isLoading = false;
});
},
onWebResourceError: (error) {
onReceivedError: (controller, request, error) {
print(
'❌ WebView ошибка: ${error.description} (${error.errorCode})',
'❌ WebView ошибка: ${error.description} (${error.type})',
);
},
backgroundColor: Colors.transparent,
gestureNavigationEnabled: true,
),
if (_isLoading)
Container(
color: Colors.grey[100], // Use your theme color instead of colors.surface
color: colors.surface,
child: const Center(child: CircularProgressIndicator()),
),
],