limiting_direction_csx 0.0.3 copy "limiting_direction_csx: ^0.0.3" to clipboard
limiting_direction_csx: ^0.0.3 copied to clipboard

outdated

Limit the rotatable orientation of the screen, also known as the orientation Settings that the interface can support. It should be noted that the orientation set here needs to be included in the suppo [...]

example/lib/main.dart

/*
 * @Author: Cao Shixin
 * @Date: 2020-12-28 15:12:15
 * @LastEditors: Cao Shixin
 * @LastEditTime: 2021-01-05 15:35:17
 * @Description: 
 */
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:limiting_direction_csx/limiting_direction_csx.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  if (Platform.isIOS) {
    await LimitingDirectionCsx.setUpScreenDirection(
        DeviceDirectionMask.Landscape);
  } else {
    await SystemChrome.setPreferredOrientations(
        [DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]);
  }
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('ios 屏幕旋转 example'),
        ),
      ),
    );
  }
}
6
likes
0
points
4
downloads

Publisher

unverified uploader

Weekly Downloads

Limit the rotatable orientation of the screen, also known as the orientation Settings that the interface can support. It should be noted that the orientation set here needs to be included in the supported orientation of the project.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on limiting_direction_csx

Packages that implement limiting_direction_csx