12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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() {
- WidgetsFlutterBinding.ensureInitialized();
- SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.transparent,statusBarIconBrightness: Brightness.dark,),);
- SystemChrome.setPreferredOrientations([
- DeviceOrientation.portraitUp,
- DeviceOrientation.portraitDown
- ]);
- _initFluwx();
- FlutterAlipay.setIosUrlSchema("flutteralipaydemo");
- runApp(MyApp());
- }
- 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<Locale> locales, Iterable<Locale> supportedLocales) {
- return Locale('zh');
- },
- localeResolutionCallback:
- (Locale locale, Iterable<Locale> 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, width: 750, height: 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");
- }
|