Фикс сферум он линуксь
This commit is contained in:
@@ -4,7 +4,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:gwid/api_service.dart';
|
import 'package:gwid/api_service.dart';
|
||||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
|
import 'package:flutter_linux_webview/flutter_linux_webview.dart';
|
||||||
import 'package:gwid/chat_screen.dart';
|
import 'package:gwid/chat_screen.dart';
|
||||||
import 'package:gwid/manage_account_screen.dart';
|
import 'package:gwid/manage_account_screen.dart';
|
||||||
import 'package:gwid/screens/settings/settings_screen.dart';
|
import 'package:gwid/screens/settings/settings_screen.dart';
|
||||||
@@ -92,6 +93,10 @@ class _ChatsScreenState extends State<ChatsScreen>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
LinuxWebViewPlugin.initialize();
|
||||||
|
if (Platform.isLinux){
|
||||||
|
WebView.platform = LinuxWebView();
|
||||||
|
}
|
||||||
_loadMyProfile();
|
_loadMyProfile();
|
||||||
_chatsFuture = (() async {
|
_chatsFuture = (() async {
|
||||||
try {
|
try {
|
||||||
@@ -3507,37 +3512,33 @@ class _SferumWebViewPanelState extends State<SferumWebViewPanel> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
InAppWebView(
|
WebView(
|
||||||
initialUrlRequest: URLRequest(url: WebUri(widget.url)),
|
|
||||||
initialSettings: InAppWebViewSettings(
|
initialUrl: widget.url,
|
||||||
javaScriptEnabled: true,
|
javascriptMode: JavascriptMode.unrestricted,
|
||||||
transparentBackground: true,
|
onPageStarted: (url) {
|
||||||
useShouldOverrideUrlLoading: false,
|
|
||||||
useOnLoadResource: false,
|
|
||||||
useOnDownloadStart: false,
|
|
||||||
cacheEnabled: true,
|
|
||||||
),
|
|
||||||
onLoadStart: (controller, url) {
|
|
||||||
print('🌐 WebView начало загрузки: $url');
|
print('🌐 WebView начало загрузки: $url');
|
||||||
setState(() {
|
setState(() {
|
||||||
_isLoading = true;
|
_isLoading = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onLoadStop: (controller, url) {
|
onPageFinished: (url) {
|
||||||
print('✅ WebView загрузка завершена: $url');
|
print('✅ WebView загрузка завершена: $url');
|
||||||
setState(() {
|
setState(() {
|
||||||
_isLoading = false;
|
_isLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onReceivedError: (controller, request, error) {
|
onWebResourceError: (error) {
|
||||||
print(
|
print(
|
||||||
'❌ WebView ошибка: ${error.description} (${error.type})',
|
'❌ WebView ошибка: ${error.description} (${error.errorCode})',
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
gestureNavigationEnabled: true,
|
||||||
),
|
),
|
||||||
if (_isLoading)
|
if (_isLoading)
|
||||||
Container(
|
Container(
|
||||||
color: colors.surface,
|
color: Colors.grey[100], // Use your theme color instead of colors.surface
|
||||||
child: const Center(child: CircularProgressIndicator()),
|
child: const Center(child: CircularProgressIndicator()),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -140,3 +140,10 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# This include() command was automatically added by the flutter_linux_webview
|
||||||
|
# plugin when building the app with the plugin. The app executable must be
|
||||||
|
# linked to the CEF library for the WebView plugin to work. This command links
|
||||||
|
# the app executable to the CEF library.
|
||||||
|
include(flutter/ephemeral/.plugin_symlinks/flutter_linux_webview/linux/cmake/link_to_cef_library.cmake)
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <dynamic_color/dynamic_color_plugin.h>
|
#include <dynamic_color/dynamic_color_plugin.h>
|
||||||
#include <file_selector_linux/file_selector_plugin.h>
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
|
#include <flutter_linux_webview/flutter_linux_webview_plugin.h>
|
||||||
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||||
#include <flutter_timezone/flutter_timezone_plugin.h>
|
#include <flutter_timezone/flutter_timezone_plugin.h>
|
||||||
#include <gtk/gtk_plugin.h>
|
#include <gtk/gtk_plugin.h>
|
||||||
@@ -22,6 +23,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||||||
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||||
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||||
|
g_autoptr(FlPluginRegistrar) flutter_linux_webview_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterLinuxWebviewPlugin");
|
||||||
|
flutter_linux_webview_plugin_register_with_registrar(flutter_linux_webview_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin");
|
||||||
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
dynamic_color
|
dynamic_color
|
||||||
file_selector_linux
|
file_selector_linux
|
||||||
|
flutter_linux_webview
|
||||||
flutter_secure_storage_linux
|
flutter_secure_storage_linux
|
||||||
flutter_timezone
|
flutter_timezone
|
||||||
gtk
|
gtk
|
||||||
|
|||||||
48
pubspec.lock
48
pubspec.lock
@@ -470,6 +470,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "5.0.0"
|
||||||
|
flutter_linux_webview:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: flutter_linux_webview
|
||||||
|
sha256: a11fa8fea77a128e3ffbfefa0324e34df289af56f9d0f94e9569e0daa545bb8a
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.3"
|
||||||
flutter_localizations:
|
flutter_localizations:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -741,6 +749,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.1.1"
|
version: "5.1.1"
|
||||||
|
logging:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: logging
|
||||||
|
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.3.0"
|
||||||
markdown:
|
markdown:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1474,6 +1490,38 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.0"
|
version: "2.4.0"
|
||||||
|
webview_flutter:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: webview_flutter
|
||||||
|
sha256: "392c1d83b70fe2495de3ea2c84531268d5b8de2de3f01086a53334d8b6030a88"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.4"
|
||||||
|
webview_flutter_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_android
|
||||||
|
sha256: "8b3b2450e98876c70bfcead876d9390573b34b9418c19e28168b74f6cb252dbd"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.10.4"
|
||||||
|
webview_flutter_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_platform_interface
|
||||||
|
sha256: "812165e4e34ca677bdfbfa58c01e33b27fd03ab5fa75b70832d4b7d4ca1fa8cf"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.9.5"
|
||||||
|
webview_flutter_wkwebview:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: webview_flutter_wkwebview
|
||||||
|
sha256: a5364369c758892aa487cbf59ea41d9edd10f9d9baf06a94e80f1bd1b4c7bbc0
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.9.5"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ dependencies:
|
|||||||
flutter_inappwebview: ^6.1.5
|
flutter_inappwebview: ^6.1.5
|
||||||
|
|
||||||
chewie: ^1.7.5
|
chewie: ^1.7.5
|
||||||
|
webview_flutter: ^3.0.4
|
||||||
|
flutter_linux_webview: ^0.1.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Reference in New Issue
Block a user