import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_alipay/flutter_alipay.dart'; import 'package:flutter_screenutil/screenutil.dart'; import 'package:fluwx/fluwx.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'code/YSTabbar.dart'; import 'tools/YSLocalizationsDelegate.dart'; void main() { try{ WidgetsFlutterBinding.ensureInitialized(); SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.transparent,statusBarIconBrightness: Brightness.dark,),); SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown ]); _initFluwx(); FlutterAlipay.setIosUrlSchema("flutteralipaydemo"); runApp(MyApp()); }catch(e){ print('===============================$e==============================='); } } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( primaryColor: Color(0xFF0088FF), visualDensity: VisualDensity.adaptivePlatformDensity, backgroundColor: Color(0xFFF5F6F8), ), localeListResolutionCallback: (List locales, Iterable supportedLocales) { return Locale('zh'); }, localeResolutionCallback: (Locale locale, Iterable supportedLocales) { return Locale('zh'); }, localizationsDelegates: [ ZhCupertinoLocalizations.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ], supportedLocales: [ const Locale('zh', 'CH'), const Locale('en', 'US'), ], home: MyHomePage() ); } } class MyHomePage extends StatelessWidget { @override Widget build(BuildContext context) { ScreenUtil.init(context,designSize: Size(750, 1624),allowFontScaling: false); return YSTabbar(); } } _initFluwx() async { await registerWxApi( appId: "wxd930ea5d5a258f4f", doOnAndroid: true, doOnIOS: true, universalLink: "https://your.univerallink.com/link/"); var result = await isWeChatInstalled; print("is installed $result"); }