-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
289 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Flutter imports: | ||
import 'package:flutter/services.dart'; | ||
|
||
// Package imports: | ||
import 'package:webview_windows/webview_windows.dart'; | ||
|
||
// Project imports: | ||
import 'file_tool.dart'; | ||
import 'log_tool.dart'; | ||
|
||
/// webview 工具 | ||
class SPWebviewTool { | ||
SPWebviewTool._(); | ||
|
||
static final SPWebviewTool _instance = SPWebviewTool._(); | ||
|
||
/// 获取实例 | ||
factory SPWebviewTool() => _instance; | ||
|
||
/// 初始化 | ||
static Future<void> init() async { | ||
var fileTool = SPFileTool(); | ||
var webviewDataDir = await fileTool.getAppDataPath('webview'); | ||
try { | ||
await WebviewController.initializeEnvironment( | ||
userDataPath: webviewDataDir, | ||
); | ||
} on PlatformException catch (e) { | ||
SPLogTool.warn('[Webview] Fail to initialize webview: ${e.message}'); | ||
} | ||
} | ||
} |
Oops, something went wrong.