123456789101112131415161718192021222324252627 |
- import 'dart:io';
- import 'package:flutter/material.dart';
- import 'package:flutter/services.dart';
- class Config {
- static String cachePath = "";
- static Future<void> init(Function() runApp) async {
- WidgetsFlutterBinding.ensureInitialized();
- // cachePath= await getApplicationDocumentsDirectory().then((value) => value.path);
- // await SpUtil.getInstance();
- runApp();
- SystemChrome.setPreferredOrientations(
- [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
- // 状态栏透明(Android)
- var brightness = Platform.isAndroid ? Brightness.dark : Brightness.light;
- SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
- statusBarColor: Colors.transparent,
- statusBarBrightness: brightness,
- statusBarIconBrightness: brightness,
- ));
- }
- }
|