Search
 
SCRIPT & CODE EXAMPLE
 

DART

how to stop screen rotation in flutter

  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      SystemChrome.setPreferredOrientations([
        DeviceOrientation.portraitUp,
        DeviceOrientation.portraitDown,
      ]);
      return new MaterialApp(...);
    }
  }
Comment

how to disable screen rotation in flutter

void main() {
  // add these lines
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setPreferredOrientations(
      [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);

  ///////////// 
  runApp(MyApp());
}
Comment

how to disable screen rotation in flutter

import 'package:flutter/services.dart';
Comment

PREVIOUS NEXT
Code Example
Dart :: regex numbers only dart 
Dart :: dart timer delay 
Dart :: flutter get device width 
Dart :: flutter showsnackbar 
Dart :: How can I add shadow to the widget in flutter? 
Dart :: flutter types class enum 
Dart :: refresh indicator flutter 
Dart :: How do you add a label (title text) to a Checkbox in Flutter? 
Dart :: not empty string check dart 
Dart :: flutter lock orientation 
Dart :: dart random password generator 
Dart :: MaterialStateProperty<Color? flutter 
Dart :: flutter text button 
Dart :: convert string to float .0 dart 
Dart :: flutter flotingactionbutton extend 
Dart :: set container height flutter 25% of screen 
Dart :: convert object to int flutter 
Dart :: flutter snackbar duration 
Dart :: unable to locate android sdk flutter in windows 
Dart :: listview inside column flutter 
Dart :: Flutter Popup Menu Button Example Tutorial 
Dart :: convert string to double flutter 
Dart :: android studio avd crashing 
Dart :: settimeout dart 
Dart :: dart null aware operators 
Dart :: string to int in dart 
Dart :: for in dart 
Dart :: how to make an empty splash screen in flutter 
Dart :: get the type of an object dart 
Dart :: dart any 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =