Blame view

lib/main.dart 878 Bytes
4847e3dc   liangchengyou   feat:添加设备方向处理
1
  import 'dart:io';
2a29701f   liangchengyou   feat:提交代码
2
  import 'package:flutter/material.dart';
4847e3dc   liangchengyou   feat:添加设备方向处理
3
4
  import 'package:flutter/services.dart';
  import 'package:limiting_direction_csx/limiting_direction_csx.dart';
2a29701f   liangchengyou   feat:提交代码
5
  import 'package:wow_english/app/app.dart';
1dc46cf7   吴启风   feat:绘本ui
6
  import 'package:flutter/services.dart';
2a29701f   liangchengyou   feat:提交代码
7
  
7912b3f7   liangchengyou   feat:更新代码
8
  void main() async {
4847e3dc   liangchengyou   feat:添加设备方向处理
9
10
11
12
13
    ///设置设备默认方向
    WidgetsFlutterBinding.ensureInitialized();
    if (Platform.isIOS) {
      await LimitingDirectionCsx.setScreenDirection(DeviceDirectionMask.Landscape);
    } else {
7912b3f7   liangchengyou   feat:更新代码
14
      await SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft,DeviceOrientation.landscapeRight]);
1dc46cf7   吴启风   feat:绘本ui
15
16
17
18
19
20
21
      // SystemChrome.setEnabledSystemUIMode(
      //   SystemUiMode.manual,
      //   overlays: [SystemUiOverlay.top],
      // );
      SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( //设置状态栏透明
        statusBarColor: Colors.transparent,
      ));
4847e3dc   liangchengyou   feat:添加设备方向处理
22
    }
2a29701f   liangchengyou   feat:提交代码
23
24
    runApp(const App());
  }