Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 790ce248
authored
2025-11-03 15:55:33 +0800
by
Administrator
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加平台代码的编译判断入口
1 parent
22b6cd9c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
README.md
lib/config/locator.dart
lib/config/wechat.dart
README.md
View file @
790ce24
...
@@ -8,3 +8,5 @@ flutter pub get
...
@@ -8,3 +8,5 @@ flutter pub get
flutter run -d macos
flutter run -d macos
flutter run -d 00008030-001C75810E42402E --release
lib/config/locator.dart
View file @
790ce24
...
@@ -33,6 +33,7 @@ import 'package:appframe/services/dispatcher.dart';
...
@@ -33,6 +33,7 @@ import 'package:appframe/services/dispatcher.dart';
import
'package:fluwx/fluwx.dart'
;
import
'package:fluwx/fluwx.dart'
;
import
'package:get_it/get_it.dart'
;
import
'package:get_it/get_it.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'dart:io'
show
Platform
;
final
getIt
=
GetIt
.
instance
;
final
getIt
=
GetIt
.
instance
;
...
@@ -41,7 +42,9 @@ Future<void> setupLocator() async {
...
@@ -41,7 +42,9 @@ Future<void> setupLocator() async {
getIt
.
registerSingleton
<
Fluwx
>(
getIt
.
registerSingleton
<
Fluwx
>(
await
(()
async
{
await
(()
async
{
Fluwx
fluwx
=
Fluwx
();
Fluwx
fluwx
=
Fluwx
();
await
fluwx
.
registerApi
(
appId:
"wx8c32ea248f0c7765"
,
universalLink:
"https://univerallink.banxe.cn/link/"
);
if
(
Platform
.
isAndroid
||
Platform
.
isIOS
)
{
await
fluwx
.
registerApi
(
appId:
"wx8c32ea248f0c7765"
,
universalLink:
"https://univerallink.banxe.cn/link/"
);
}
return
fluwx
;
return
fluwx
;
})(),
})(),
);
);
...
...
lib/config/wechat.dart
View file @
790ce24
import
'package:fluwx/fluwx.dart'
;
import
'package:fluwx/fluwx.dart'
;
import
'dart:io'
show
Platform
;
final
Fluwx
fluwx
=
Fluwx
();
final
Fluwx
fluwx
=
Fluwx
();
Future
<
void
>
registerWechatApi
()
async
{
Future
<
void
>
registerWechatApi
()
async
{
await
fluwx
.
registerApi
(
appId:
"wx8c32ea248f0c7765"
,
universalLink:
"https://dev.banxiaoer.net/path/to/wechat/"
);
if
(
Platform
.
isAndroid
||
Platform
.
isIOS
)
{
await
fluwx
.
registerApi
(
appId:
"wx8c32ea248f0c7765"
,
universalLink:
"https://dev.banxiaoer.net/path/to/wechat/"
);
}
else
{
print
(
"✅ Fluwx is not supported on this platform (
${Platform.operatingSystem}
). Skip registerApi()."
);
}
}
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment