Blame view

lib/main.dart 562 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
6
  import 'package:wow_english/app/app.dart';
  
4847e3dc   liangchengyou   feat:添加设备方向处理
7
8
9
10
11
12
13
14
  void main() async{
    ///设置设备默认方向
    WidgetsFlutterBinding.ensureInitialized();
    if (Platform.isIOS) {
      await LimitingDirectionCsx.setScreenDirection(DeviceDirectionMask.Landscape);
    } else {
      SystemChrome.setPreferredOrientations([DeviceOrientation.landscapeLeft,DeviceOrientation.landscapeRight]);
    }
2a29701f   liangchengyou   feat:提交代码
15
16
    runApp(const App());
  }