|
|
@ -13,6 +13,7 @@ import 'package:flutter/services.dart'; |
|
|
import 'package:flutter_localizations/flutter_localizations.dart'; |
|
|
import 'package:flutter_localizations/flutter_localizations.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
|
|
|
|
|
import 'package:fluwx/fluwx.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'package:get_storage/get_storage.dart'; |
|
|
import 'package:get_storage/get_storage.dart'; |
|
|
|
|
|
|
|
|
@ -75,14 +76,38 @@ void main() async { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget { |
|
|
|
|
|
|
|
|
class MyApp extends StatefulWidget { |
|
|
const MyApp({super.key}); |
|
|
const MyApp({super.key}); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
State<MyApp> createState() => _MyAppState(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class _MyAppState extends State<MyApp> { |
|
|
|
|
|
|
|
|
|
|
|
Fluwx fluwx = Fluwx(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
void initState() { |
|
|
|
|
|
super.initState(); |
|
|
|
|
|
_initFluwx(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_initFluwx() async { |
|
|
|
|
|
await fluwx.registerApi( |
|
|
|
|
|
appId: 'wx57624b8918fdd95c', |
|
|
|
|
|
doOnAndroid: true, |
|
|
|
|
|
doOnIOS: true, |
|
|
|
|
|
universalLink: 'https://your.univerallink.com/link/', |
|
|
|
|
|
); |
|
|
|
|
|
var result = await fluwx.isWeChatInstalled; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// This widget is the root of your application. |
|
|
// This widget is the root of your application. |
|
|
@override |
|
|
@override |
|
|
Widget build(BuildContext context) { |
|
|
Widget build(BuildContext context) { |
|
|
ScreenUtil.init(context, designSize: const Size(375, 812)); |
|
|
ScreenUtil.init(context, designSize: const Size(375, 812)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断token是否为空 |
|
|
// 判断token是否为空 |
|
|
final storage = GetStorage(); |
|
|
final storage = GetStorage(); |
|
|
final userId = storage.read<String>('userId'); |
|
|
final userId = storage.read<String>('userId'); |
|
|
@ -96,3 +121,5 @@ class MyApp extends StatelessWidget { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|